ACT-CV - Machine Vision for Cognitive Modeling
MatchTests.h
Go to the documentation of this file.
1 // -*- mode: c++; indent-tabs-mode: nil; c-basic-offset: 4; coding: iso-8859-1; -*-
2 
3 /*
4 ACT-CV - Machine Vision for Cognitive Modeling
5 Copyright (c) 2008 Marc Halbruegge
6 
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11 
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21 
22 
27 #ifndef MATCHTESTS_H_
28 #define MATCHTESTS_H_
29 
30 #include "TestFrameSource.h"
31 
32 #include <string>
33 
34 #include <Matcher.h>
35 
36 namespace tests {
37 
39 class MatchTest : public TestCase {
40  std::string fname;
41 public:
42  MatchTest(const std::string &fn) : fname(fn) {}
43 
44  const char* GetName() const {
45  return "MatchTest";
46  }
47 
48  void Run() {
49  StillImage folder(fname.c_str());
50  MatchImage matcher("MATCH", fname.c_str());
51 
52  AssertFalse(matcher.TargetFound());
53  matcher.Match(folder.GetNextFrame());
54  AssertTrue(matcher.TargetFound());
55  }
56 };
57 
58 
59 }; // end of namespace tests
60 
61 
62 #endif /*MATCHTESTS_H_*/


ACT-CV - Machine Vision for Cognitive Modeling
© 2015 Marc Halbruegge (actcvlibrary@googlemail.com)