Computes the phase planes of a given patternAll the memory allocation and possible pre-calculations are done at the construction of the detector, then the images can be computed without any delays (but all the computed images must have the same size).
#include "Vernier.hpp"
using namespace vernier;
using namespace cv;
using namespace std;
int main() {
Mat image = imread("megarenaPatternImage_12bits_9um.jpg");
PatternPhase patternPhase;
patternPhase.compute(image);
if (patternPhase.peaksFound()) {
cout << "Phase plane 1: " << patternPhase.getPlane1().toString() <<endl;
cout << "Phase plane 2: " << patternPhase.getPlane2().toString() <<endl;
} else {
cout << "Peaks not found..." << endl;
}
patternPhase.showControlImages();
waitKey(3000);
}