Is there a way to detect lines which are not perfectly straight?
I have objects which represents rectangles but are slightly uneven because of the use of a wide angle camera distortion and bad quality preprocessing. Also I have to do a perspective transformation beforehand which is another factor for the poor line quality.
After detecting the edges with the canny filter, I get for example the following image:
I tried to find the edge lines with the hough lines algorithm. But because of the bad quality of the shape with a lot of bumpiness it is not possible to find the sloping edges.
I tried the normal hough line transform (red lines) and also with the Probabilistic Hough Line Transform (green lines), but the result is quite bad.
Are there any other options to detect something like that? Or is there a way to improve my image, so I get straight lines? The distortion of the lines is variable, so it is really hard to fix.
Here another example:
I'm using python 3.4 with opencv 3.2, numpy 1.12. Any input or hint for a possible new way to solve this would be awesome.