0

Do You have any suggestion for this?

I am following the steps in one research paper to re-implement it for my specific problem. I am not a professional programmer, however, I am struggling a lot, more than one month.When I am reaching to scoring step with generalized Hough transform, I do not get any result and what I am getting is a blank image without finding the object center. What I did includes the following steps:

  • I define a spatially constrained area for a training image and extract SIFT features within the area. The red point in the center represents the object center in template(training) image. enter image description here

    and this the interest point extracted by SIFT in query image: enter image description here

  • Keypoints are matched according to the some conditions: 1)they should be quantized to the same visual word and be spatially consistent. So I get the following points after matching conditions:

enter image description here enter image description here

  • I have 15 and 14 points for template and query images, respectively. I send these points along with template image center of object coordinate to generalized hough transform (the code that I found from github). the code is working properly for it default images. However, according to the few points that I am getting by the algorithm, I do not know what I am doing wrong?!

I thought maybe that is because of theta calculation, so I changed this line to return abs of y and x differences. But it did not help. In line 20 they only consider 90 degrees for binning, Could I ask what is the reason and how can I define a binning according to my problem and range of angles of rotation around the center of an object? - Does binning range affect the center calculation? I really appreciate it of you let me know what I am doing wrong here.

S.EB
  • 1,966
  • 4
  • 29
  • 54
  • The range of angles used depends on the symmetry of the shape you're trying to match. To match a circle, for example, no rotations are necessary. What is the shape you're trying to fit? If you want to match your set of query points to the template points, you probably want to use [iterative closest points](https://en.wikipedia.org/wiki/Iterative_closest_point) or [RANSAC](https://en.wikipedia.org/wiki/Random_sample_consensus). – Cris Luengo Mar 14 '18 at 21:41
  • @CrisLuengo thanks for your comment. The shape has a lot of variation in the training set. I am trying to find similar shapes to the query image from a set of images (training). Each image is considered as a different template and compared to the query image each time. Top 10 templates that give the highest score are retrieved. I did matching based on [FLANN](https://github.com/cvan/FLANN/blob/master/src/python/pyflann/command/compute_nn.py) of SIFT coordinates and then comparing visual words. – S.EB Mar 14 '18 at 21:57
  • @CrisLuengo So, two sets points do not have equal number of points, in which we cannot use ICP. I am not sure how RANSAC is working in python. – S.EB Mar 14 '18 at 21:57
  • The problem is that how to create discrete voting space for this in Hough?!! – S.EB Mar 14 '18 at 21:58
  • The problem is that you have very few points in your model, and they're isolated. Hough won't work well here. Hough expects many points to vote on very similar versions of the model (i.e. the model needs parameters, and the thing you're detecting needs to deviate slowly from that model). Isolated points make for big changes when one of them moves by even one pixel. – Cris Luengo Mar 15 '18 at 00:05
  • @CrisLuengo Thanks for your comment, what do you suggest? – S.EB Mar 15 '18 at 00:08
  • All you need is a cost function (distance from each point in query to nearest point in model), and a way to minimize that cost model. RANSAC is a cheap way to minimize that cost model. I don't think you'll get Hough to work with a point set. – Cris Luengo Mar 15 '18 at 01:12
  • @CrisLuengo thank you very much for your help. Do you think [Coherent Point Drift](https://github.com/siavashk/pycpd) can be used for point matching? – S.EB Mar 19 '18 at 22:25
  • That is an interesting method, I was not familiar with it. Thanks for pointing it out! It seems like a good match for your particular problem, certainly worth trying out. – Cris Luengo Mar 19 '18 at 22:54
  • @CrisLuengo I hope it works, I am struggling with this issue for few weeks and very sick of it – S.EB Mar 22 '18 at 02:10

0 Answers0