Pipeline for finding hough lines in a binary image

Discussion related to "under the hood" OpenMV topics.
andrey_
Posts: 7
Joined: Wed Jan 08, 2020 10:45 pm

Pipeline for finding hough lines in a binary image

Postby andrey_ » Wed Jan 08, 2020 10:49 pm

Hey guys,
Is it possible to find hough lines after thresholding an image.
After trying it it just shows alot of random lines, im assuming because the sobel filter doesn't really highlight edges on a binary image.
I've tried doing threshold -> canny edge -> find_lines as well, but it has the exact same result.

How can I find lines only around say red objects in an image.

Cheers.
User avatar
kwagyeman
Posts: 4271
Joined: Sun May 24, 2015 2:10 pm

Re: Pipeline for finding hough lines in a binary image

Postby kwagyeman » Thu Jan 09, 2020 1:14 am

Binary images probably have too strong of an edge strength making the Hough lines algorithm go crazy.

I'd recommend running the find_line_segements() method instead. It does a lot of filtering on the output which should help.
Nyamekye,
andrey_
Posts: 7
Joined: Wed Jan 08, 2020 10:45 pm

Re: Pipeline for finding hough lines in a binary image

Postby andrey_ » Thu Jan 09, 2020 2:00 am

Unfortunately segments would be too slow for my purposes.
In opencv I would usually threshold what I need to get the binary -> find contours -> hough transform
There must be some alternative way to do find the edges of a binary image using the openmv libs.
:?
User avatar
kwagyeman
Posts: 4271
Joined: Sun May 24, 2015 2:10 pm

Re: Pipeline for finding hough lines in a binary image

Postby kwagyeman » Fri Jan 10, 2020 1:25 am

Just run find_lines() this method does the sobel filter and then hough transform in one step. We don't really have the memory to due these independently like with OpenCV. So, our methods typically do multiple things per call.

The output will be a list of lines which you can filter by their angle and line strength. You have to write list processing code to do something useful with this output.
Nyamekye,
User avatar
kwagyeman
Posts: 4271
Joined: Sun May 24, 2015 2:10 pm

Re: Pipeline for finding hough lines in a binary image

Postby kwagyeman » Fri Jan 10, 2020 1:30 am

Oh, we have a optimizer that we hired... I may ask him to work on find_line_segments next. He might be able to 2-3x the performance on that code...
Nyamekye,
andrey_
Posts: 7
Joined: Wed Jan 08, 2020 10:45 pm

Re: Pipeline for finding hough lines in a binary image

Postby andrey_ » Wed Feb 12, 2020 3:23 am

I heard!
Already preordered some openmv pluses for work!
Cheers.

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 14 guests