Is there any robust solution to match two images and find the percentage of match between them in MATLAB ?
이전 댓글 표시
Problem description -
->say we already have some no of template(base) images in one folder
Input -
- Image to find its perfect matching image
Output -
-Matched Image (if found)
-Otherwise Message - no matching found
I need robust solution to this ..
I have tried using SURF Features but its not giving me robust output meaning it sometimes gives wrong match - though it its giving quite good result but not 100 %
Here is the rough logic of my current algorithm :
Input_Image_gray = rgb2gray(Input_Image);
Input_keys = detectSURFFeatures(Input_Image_gray);
[Input_features Input_validPts] = extractFeatures(Input_Image_gray, Input_keys);
----iterate for loop for the Template images we have in a Folder
templateImage=templateImagesArray{loopCounter};
ref_img_gray = rgb2gray(templateImage);
ref_keys=detectSURFFeatures(ref_img_gray);
[~, MATCH_METRIC] = matchFeatures(ref_features,Input_features ,'MatchThreshold',3);
-- Calculate percentage for each image on the base of MATCH_MATRIC
if percentage > 50
display the matched Image
otherwise display message - no matching image fond
----end loop
please share if any body has any idea regarding how to achieve this
Thanks in advance..
채택된 답변
추가 답변 (1개)
Image Analyst
2013년 7월 15일
If you're searching for a "perfect matching image" simply subtract the two images:
diffImage = double(image1) - double(image2);
perfectMatch = (sum(diffImage(:)) == 0);
You can use nnz if you want to find the percentage that aren't the very same pixel value. Only use SURF if you want to compare approximate matches, not exact matches.
댓글 수: 4
meghna bhatt
2013년 7월 15일
Image Analyst
2013년 7월 15일
Then it's not perfect, it's approximate like I said. You can use normxcorr2() if you want to find out where and if a smaller template image appears in a larger image. Or you can use SURF, like they use often in CBIR. Or look to other sophisticated cbir methods.
Walter Roberson
2016년 8월 28일
ahmed SHAH comments
i need help sir please
Walter Roberson
2016년 8월 28일
ahmed SHAH, please clarify what you need assistance with.
카테고리
도움말 센터 및 File Exchange에서 Point Cloud Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!