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