First time here? Check out the FAQ!

Ask Your Question
2

Scale-rotation-skew invariant template matching

asked Aug 2 '16

nico_lauda gravatar image

updated Aug 4 '16

Hi all,

I need to find the target in an image. The target can assume whichever orientation, and can be scaled. Moreover, the image can be acquired from different camera's angulations.

Do you know if a template matching algorithm that is rotation, scale and skew invariant already exists in OpenCV? In industrial robotics applications, those kinds of algorithms already exist, and they work pretty well. Otherwise, what approach could work?

An example of the images that I would use is attached to the post.

Thanks everybody for the help.

Nicola

C:\fakepath\img13.png C:\fakepath\target.png

P.S.: I'm sorry to have edited this question different times, I know it is a little confusing.

Preview: (hide)

Comments

If pca won't work it means that arrow is symetric. May be you should try somthing like this

LBerger gravatar imageLBerger (Aug 3 '16)edit

Actually, I don't care if the arrow is symmetric, but it is important that the algorithm finds the relative rotation from the template. I've just tried the algorithm that you have suggested, but as it is, it returns -1 without a significative output. Maybe I'm not using it properly.

nico_lauda gravatar imagenico_lauda (Aug 3 '16)edit

use repositorie from github and try with image given. After you can use your own data

LBerger gravatar imageLBerger (Aug 3 '16)edit

2 answers

Sort by » oldest newest most voted
0

answered Aug 4 '16

Guanta gravatar image

I'd just use feature matching in combination w. RANSAC, have a look at the following example: http://docs.opencv.org/2.4/doc/tutorials/features2d/feature_homography/feature_homography.html. Your reference template looks quite small but it should still work out. Try different feature detectors/descriptor combinations.

Preview: (hide)
0

answered Aug 3 '16

Tetragramm gravatar image

This looks like a job for Moments, as described HERE.

You segment or threshold or whatever so that you just have the arrow, then use image moments to find the orientation. As long as there's only rotation, it should be pretty accurate.

Preview: (hide)

Comments

Thank you for your answer! I tried also with moments, but I get bad results. I think this happens because there are slight differences between the template and the target in the image. I can also change the target, but i need to orient the tray always in the same way.

nico_lauda gravatar imagenico_lauda (Aug 3 '16)edit

Question Tools

1 follower

Stats

Asked: Aug 2 '16

Seen: 20,604 times

Last updated: Aug 04 '16