7

Some weeks ago I've implemented a simple block matching stereo algorithm but the results had been bad. So I've searched on the Internet to find better algorithms. There I found the semi global matching (SGM), published by Heiko Hirschmueller. It gets one of the best results in relation to its processing time.

I've implemented the algorithm and got really good results (compared to simple block matching) as you can see here:

disparity and RGB image

I've reprojected the 2D points to 3D by using the calculated disparity values with the following result

point-cloud

At the end of SGM I have an array with aggregated costs for each pixel. The disparity is equivalent to the index with the lowest cost value.

The problem is, that searching for the minimum only returns discrete values. This results in individually layers in the point-cloud. In other words: Round surfaces are cut into many layers (see point cloud).

Heiko mentioned in his paper, that it would be easy to get sub-pixel accuracy by fitting a polynomial function into the cost array and take the lowest point as disparity.

The problem is not bound to stereo vision, so in other words the task is the following:

  • given: An array of values, representing a polynomial function.
  • wanted: The lowest point of the polynomial function.

I don't have any idea how to do this. I need a fast algorithm, because I have to run this code for every pixel in the Image

For example: 500x500 Pixel with 60-200 costs each => Algorithm has to run 15000000-50000000 times!!).

I don't need a real time solution! My current SGM implementation (L2R and R2L matching, no cuda or multi-threading yet) takes about 20 seconds to process an image with 500x500 pixels ;).

I don't ask for libraries! I try to implement my own independent computer vision library :).

Thank you for your help!

With kind regards, Andreas

Spektre
  • 49,595
  • 11
  • 110
  • 380
rottaca
  • 106
  • 1
  • 8
  • 1
    By the way, did u happen to get answer?. Could you please share your thoughts? – Whoami Jan 31 '19 at 08:48
  • Maybe i am missing something, but u just have an array of points right? Just find lowest point, that shouldn't be so hard right? – Gijs Den Hollander Jun 08 '20 at 15:28
  • Or do you really need to find the polynomial first and then the lowest point? – Gijs Den Hollander Jun 08 '20 at 15:30
  • I doubt that problem description is entirely accurate. It's likely not a polynomial function, but a function made up of several polynomials - like a spline; and some splines (like Akima) will make that easy. Alternatively just fit a low order polynomial among closest points. – Hans Olsson Jun 11 '20 at 16:23

1 Answers1

0

Finding the exact lowest point in a general polynomial is a hard problem, since it is equivalent to finding the root of the derivative of the polynomial. In particular, if your polynomial is of degree 6, the derivative is a quintic polynomial, which is known not to be solvable by radical. You therefore need to either: fit the function using restricted families for which computing the roots of the derivatives e.g. the integrals of prod_i(x-ri)p(q) where deg(p)<=4, OR using an iterative method to find an APPROXIMATE minimum, (newton's method, gradient descent).

Juan Carlos Ramirez
  • 2,054
  • 1
  • 7
  • 22