filmov
tv
Coin pattern matching(features matching) using Python and opencv2

Показать описание
Hi
When we match the same features on two images using opencv 2.4.10 and Python 2.7.13, after successfully installed those two and I wrote the Python program using CV .here I am writing the code two ways first time I'm using "drawMatches" this method not supported in Python because that method for only c++ , but here I am using "find_obj" method instead of "drawMatches" finally I got out put successfully.i would like to share my code, anybody want you can see it Bellow
import cv2
from find_obj import filter_matches,explore_match
Import numpy
orb = cv2.ORB()
bf = cv2.BFMatcher(cv2.NORM_HAMMING)
P1,P2,kp_pairs = filter_matches(kp1,kp2,matches)
explore_match('find_obj',img1,img2,kp_pairs)
# note(how to import "find_obj" procedure open opencv folder -sources-samples-python2-find_obj) copy the 'find_obj' then paste into the python27-lib-site-packages(open and paste the 'find_obj' obj here )
Finally go to Python shell import find_obj if you didn't get any errors, it's successfully installed)
When we match the same features on two images using opencv 2.4.10 and Python 2.7.13, after successfully installed those two and I wrote the Python program using CV .here I am writing the code two ways first time I'm using "drawMatches" this method not supported in Python because that method for only c++ , but here I am using "find_obj" method instead of "drawMatches" finally I got out put successfully.i would like to share my code, anybody want you can see it Bellow
import cv2
from find_obj import filter_matches,explore_match
Import numpy
orb = cv2.ORB()
bf = cv2.BFMatcher(cv2.NORM_HAMMING)
P1,P2,kp_pairs = filter_matches(kp1,kp2,matches)
explore_match('find_obj',img1,img2,kp_pairs)
# note(how to import "find_obj" procedure open opencv folder -sources-samples-python2-find_obj) copy the 'find_obj' then paste into the python27-lib-site-packages(open and paste the 'find_obj' obj here )
Finally go to Python shell import find_obj if you didn't get any errors, it's successfully installed)