Houghlines not detecting top line of a simple rectangle

351 Views Asked by At

I'm stumped. It's a simple white rectangle on a black background. Houghlines can't find the top line. It can find all the others, just not the top.

Anyone?

https://www.screencast.com/t/bNu4sptcS3a

1

There are 1 best solutions below

0
On
  1. Make sure that the top edge appears on the result of canny edge detection.

  2. Dilate the image to make the edge fatter, so that it can get more votes

  3. Make sure that the resolution of parameter rho is 1, so that the detector dos not miss the line. See here for a description on parameters.

  4. Decrease the threshold value for voting, just in case. While the top and bottom lines are supposed to get equal number of votes, this might be different in practice.

The value of rho should be lower for the top horizontal line than the bottom horizontal line.