#include "Vernier.hpp"
using namespace vernier;
using namespace cv;
using namespace std;
int main() {
string filename = "megarenaPatternImage_12bits_9um.jpg";
Mat image = cv::imread(filename);
double physicalPeriod = 9;
int codeSize = 12;
MegarenaPatternDetector detector(physicalPeriod, codeSize);
detector.compute(image);
cout << "Detector: " << detector.toString() << endl;
if (detector.patternFound()) {
cout << "Estimated pose: " << detector.get2DPose().toString() << endl;
detector.draw(image);
} else {
cout <<"Pattern not found..." << endl;
}
detector.showControlImages();
imshow(filename, image);
waitKey(3000);
}