Abstract class to define the interface of pattern detectors.
#include "Vernier.hpp"
using namespace vernier;
using namespace cv;
using namespace std;
int main() {
string filename = "stampPatternImage_15um.jpg";
Mat image = cv::imread(filename);
double physicalPeriod = 15;
int snapshotSize = 820;
StampPatternDetector detector(physicalPeriod, "stampPattern.png", snapshotSize);
detector.compute(image);
cout << "Detector: " << detector.toString() << endl;
if (detector.patternFound()) {
cout << "Found " << detector.markers.size() << " markers in " << filename << endl;
for (auto it : detector.markers) {
cout << " Stamp " << it.first << " at " << it.second.toString() << endl;
}
detector.draw(image);
} else {
cout << "Marker not found..." << endl;
}
detector.showControlImages();
imshow(filename, image);
waitKey(3000);
}