Chathuranga Dulaj
Chathuranga Dulaj

Reputation: 33

How to use SURF in python?

I am going to work on a image processing project "currency recognition system " in pycharm. I just want to match the input image with the existing images in the database and show the result(database image name). How can I do this with SURF function. I checked it on internet but didn't get any relevant code. Could you please help me to do this?

Thanks Chathu

Upvotes: 2

Views: 13350

Answers (2)

Sohaib Aslam
Sohaib Aslam

Reputation: 1315

enter image description here

SIFT and SURF are examples of algorithms that OpenCV calls “non-free” modules. These algorithms are patented by their respective creators, and while they are free to use in academic and research settings, you should technically be obtaining a license/permission from the creators if you are using them in a commercial (i.e. for-profit) application.

But Good New is ...

It’s also important to note that by using opencv_contrib you will not be interfering with any of the other keypoint detectors and local invariant descriptors included in OpenCV 3. You’ll still be able to access KAZE, AKAZE, BRISK, etc. without an issue:

>>> kaze = cv2.KAZE_create()
>>> (kps, descs) = kaze.detectAndCompute(gray, None)
>>> print("# kps: {}, descriptors: {}".format(len(kps), descs.shape))
# kps: 359, descriptors: (359, 64)
>>> akaze = cv2.AKAZE_create()
>>> (kps, descs) = akaze.detectAndCompute(gray, None)
>>> print("# kps: {}, descriptors: {}".format(len(kps), descs.shape))
# kps: 192, descriptors: (192, 61)
>>> brisk = cv2.BRISK_create()
>>> (kps, descs) = brisk.detectAndCompute(gray, None)
>>> print("# kps: {}, descriptors: {}".format(len(kps), descs.shape))
# kps: 361, descriptors: (361, 64)

More Information Get From That Link: https://www.pyimagesearch.com/2015/07/16/where-did-sift-and-surf-go-in-opencv-3/

Upvotes: 1

Abdul Fatir
Abdul Fatir

Reputation: 6357

You're looking for an implementation of Speed Up Robust Features (SURF). You'll be better off using a library like OpenCV for your use case.

Read the OpenCV docs on how to Install.
Here's how to use SURF in OpenCV once you're done installing.

Upvotes: 2

Related Questions