Is there any robust solution to match two images and find the percentage of match between them in MATLAB ?
Mostra commenti meno recenti
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..
Risposta accettata
Più risposte (1)
Image Analyst
il 15 Lug 2013
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 Commenti
meghna bhatt
il 15 Lug 2013
Image Analyst
il 15 Lug 2013
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
il 28 Ago 2016
ahmed SHAH comments
i need help sir please
Walter Roberson
il 28 Ago 2016
ahmed SHAH, please clarify what you need assistance with.
Categorie
Scopri di più su Point Cloud Processing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!