1 | initial version |
I have been able to identify the exact images if they differ based on y co-ordinates. I'm unable to identify the image on the left.(All 3 images are same). Could you let me know the reason for this?
MinMaxLocResult mmr = Core.minMaxLoc(resultMatrix);
Mat bin = new Mat(toFindIn.rows() - toFind.rows() + 1, toFindIn.cols() - toFind.cols() + 1, CvType.CV_8UC1);
double thresh = mmr.minVal * 1.05;
resultMatrix.convertTo(resultMatrix, CvType.CV_8UC1, 255.0);
Imgproc.threshold(resultMatrix, bin, thresh, 255.0, Imgproc.THRESH_BINARY_INV);
MatOfPoint mop = new MatOfPoint();
Mat idx = Mat.zeros(bin.size(), bin.channels());
Core.findNonZero(bin, idx);
mop = new MatOfPoint(idx);
System.out.println(mop.dump());
Template Matching method used is Imgproc.TM_SQDIFF.
P.S: Read about template matching from the c++ tutorial you were mentioning :) @berak
2 | No.2 Revision |
I have been able to identify the exact images if they differ based on y co-ordinates. I'm unable to identify the image on the left.(All 3 images are same). Could you let me know the reason for this?
MinMaxLocResult mmr = Core.minMaxLoc(resultMatrix);
Mat bin = new Mat(toFindIn.rows() - toFind.rows() + 1, toFindIn.cols() - toFind.cols() + 1, CvType.CV_8UC1);
double thresh = mmr.minVal * 1.05;
resultMatrix.convertTo(resultMatrix, CvType.CV_8UC1, 255.0);
Imgproc.threshold(resultMatrix, bin, thresh, 255.0, Imgproc.THRESH_BINARY_INV);
MatOfPoint mop = new MatOfPoint();
Mat idx = Mat.zeros(bin.size(), bin.channels());
Core.findNonZero(bin, idx);
mop = new MatOfPoint(idx);
System.out.println(mop.dump());
Template Matching method used is Imgproc.TM_SQDIFF.
P.S: Read about template matching from the c++ tutorial you were mentioning :) @berak
3 | No.3 Revision |
I have been able to identify the exact images if they differ based only on the y co-ordinates. I'm unable to identify the image on the left.(All 3 images are same). Could you let me know the reason for this?
MinMaxLocResult mmr = Core.minMaxLoc(resultMatrix);
Mat bin = new Mat(toFindIn.rows() - toFind.rows() + 1, toFindIn.cols() - toFind.cols() + 1, CvType.CV_8UC1);
double thresh = mmr.minVal * 1.05;
resultMatrix.convertTo(resultMatrix, CvType.CV_8UC1, 255.0);
Imgproc.threshold(resultMatrix, bin, thresh, 255.0, Imgproc.THRESH_BINARY_INV);
MatOfPoint mop = new MatOfPoint();
Mat idx = Mat.zeros(bin.size(), bin.channels());
Core.findNonZero(bin, idx);
mop = new MatOfPoint(idx);
System.out.println(mop.dump());
Template Matching method used is Imgproc.TM_SQDIFF.
P.S: Read about template matching from the c++ tutorial you were mentioning :) @berak