Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 1117

opencv keypoint and histogram matching

$
0
0
I'm developing a project in android for image comparison. The images can be in any scale / rotation. I did some tests with my current project, but the results are not good. I thought to do beyond the keypoints matching, a histogram matching. Can anyone help me? Images for comparison (example): Image1: ![image description](https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTcbRdgljrxWhcb-Se6BDsG2WsxzokaEjHVrQ4wvUpDa0CQtbVffg) Image2: ![image description](https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSIsug9PcI3snQLOK8z-VksxdHYRvlxIluG-5Q7tckcVsemW5LUdQ) My Code: FeatureDetector detector = FeatureDetector.create(FeatureDetector.ORB); DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.ORB); DescriptorMatcher matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING); Mat img1 = Imgcodecs.imread(teste,Imgcodecs.CV_LOAD_IMAGE_COLOR); Mat descriptors1 = new Mat(); MatOfKeyPoint keypoints1 = new MatOfKeyPoint(); detector.detect(img1, keypoints1); extractor.compute(img1, keypoints1, descriptors1); Mat img2 = Imgcodecs.imread(file,Imgcodecs.CV_LOAD_IMAGE_COLOR); Mat descriptors2 = new Mat(); MatOfKeyPoint keypoints2 = new MatOfKeyPoint(); detector.detect(img2, keypoints2); extractor.compute(img2, keypoints2, descriptors2); MatOfDMatch matches = new MatOfDMatch(); matcher.match(descriptors1,descriptors2,matches); int distLimit = 80; List matchesList = matches.toList(); List goodMatches= new ArrayList(); for(int i=0; i

Viewing all articles
Browse latest Browse all 1117