Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Curvature estimation from image

I have images like this ones:

enter image description hereenter image description hereenter image description hereenter image description here

In this images the red line is what I want to get from the image. Original images do not have that red lines, but only that green road.

What I want is to estimate the curve from image in form of a coeffitients of equation: A x^2 + B x + C = 0. In images there can be noise (black holes on edges as you see above).

I have tried to solve this by using least squares method (LSM), but there are two problems with this approach:

  1. The method is too slow even on PC, because the points amount is high.

  2. The road is too wide in the following case:

The curve on the left image is correctly recognized, but on the right side incorrectly. The reason is that the road is too wide and too short, I suppose. enter image

As a solution for both cases I want to make the road narrow. In ideal case it is a red line in images above. Or I want to use LSM for line detection (A x + B = 0) for optimization of processing time.

I have tried eroding image - it is wrong approach. Skeleton also not the right solution.

Any ideas about how to achieve the desired result (make the road narrow)? Or any ideas of another approach for this problem?

like image 758
maximus Avatar asked Sep 04 '12 08:09

maximus


People also ask

What is a curve detection in image processing?

Curve tracing and curve detection in images are important operations in image processing and computer vision. Their applications include road following, object tracking, fracture detection in borehole images and extraction of features from medical images.

What is used to detect curvature?

Related work. Hough Transform (HT) is one of the most widely used algorithms for line detection [1], [2]. General Hough Transform (GHT) represents a modification of HT which is used to detect circles and even arbitrary curves [3].

What is curvature analysis?

The CurvatureAnalysis command visually evaluates surface curvature using false-color analysis. Note. ● These tools can be used to gain information about the type and amount of curvature on a surface. Gaussian and Mean curvature analysis can show if and where there may be anomalies in the curvature of a surface.


1 Answers

If you can rely on always having one axis as the dependent variable in your fit (looks like it should be the x axis in the above "correct" examples, although your bottom right failure seems to be using y), then you could do something like this:

  • for each scanline y, pick the median x of the non-black pixels
  • if there are no non-black pixels (or fewer than some chosen noise threshold), skip the line

You now have a list of (x,y) pairs, at most as many as there are scan lines. These represent guesses as to the midpoint of the road at each level. Fit a low order polynomial x=f(y) (I'd go for linear or cubic, but you could do quadratic if you prefer) to these points by least squares.

For the sorts of images you've shown, the detail is very coarse, so you might be able to manage with just a subset of points. But even without that the processing cost should be reasonable unless you're using very constrained hardware.

If left-right paths occur often then you could fit both ways and then apply some kind of goodness of fit criterion. If paths loop back on themselves often, then this sort of midpoint approach won't give you a good answer, but then you're onto a loser with the fitting anyway.

like image 98
walkytalky Avatar answered Sep 29 '22 15:09

walkytalky