Intoccabil
Intoccabil

Reputation: 313

OpenCV feature detection for recognition of multiple different images

My question is - can I recognize different templates in a source image using feature detection in OpenCV? Let's say my templates are road signs.

I am using ORB, but this is not tracker-specific question.

My basic approach without feature detection is:

But with feature detection I detect keypoints and descriptors for each image in my template set and for my ROI where object might be located, but matcher returns distances for all descriptors I have in my ROI.

I can't tie this to any correlation between ROI and templates, or, in other words, I can't decide whether ROI image and template image are the same objects based on information provided by matcher.

So, to be more specific - is my approach wrong and feature detectors are used to detect one template object in a source image (which is not what I need) or I'm just not grasping the basic concepts of feature detection and thus am in need of help.

Upvotes: 1

Views: 3161

Answers (2)

Armin Mustafa
Armin Mustafa

Reputation: 650

I will refer you to a book called: 'opencv2 computer vision application programming cookbook'

Just browse the relevant chapters.

Upvotes: -1

Jav_Rock
Jav_Rock

Reputation: 22245

You may be missing two aspects. One is to remove outliers in your feature matching using a method like RANSAC+homography. The second point is to project the corners of your template to the scene, to make a "rectangle" of your image. Also you should define a threshold on how many inliers you will consider the minimum for a right detection.

Check this tutorial on finding objects with feature detection.

Upvotes: 3

Related Questions