Forums - Hough Lines

2 posts / 0 new
Last post
Hough Lines
Clark
Join Date: 26 Jan 15
Posts: 2
Posted: Sun, 2015-09-20 17:37

I used the fastcv demo program and added a Hough Line to the list of filters in filter.cpp. I copied the Canny edge example. I used fcvMemAlloc to allocate maxLines of fcvLines for the returned fcvLine array called pHoughLines.

I called

fcvHoughLineu8(pSrc, filterState.imgWidth, filterState.imgHeight, filterState.imgWidth, 0.25, 20, &filterState.numLines, filterState.pHoughLines);

and then did

memcpy(pDst, pSrc, w*h);

I draw the lines at the bottom of the JNICALL for Filter_update where the ENABLE_CANNY filterType calls its drawEdges.

I can only get diagonal cross hatched lines (both left and right) that don't fit anything in the image. I can manually draw lines in the image, so I think the HoughLine array comes back with incorrect fcvLines, or fcvLines that I am not interpretting correctly.

What about coordinate systems here? the fcvLines are x,y floats. The image coordinates are x,y ints. I think the image is 0,0 is top left, x+ right, y+ down. How does the Hough Line coordinate system lay out?

There have only been a few topics on Hough Lines in the forum over the years. No one seems to have gotten very far.  Der Google doesn't even have many succesful examples.

Any help would be greatly appreciated.

 

 

  • Up0
  • Down0
Clark
Join Date: 26 Jan 15
Posts: 2
Posted: Tue, 2015-10-20 08:03

This has been resolved.

Trying to get started quickly, I jumped into FastCV and got the process flow wrong by making a worng assumption. I backed up and redid Hough LInes using the OpenCV examples and saw my error.

Hough Lines in both OpenCV and FastCV operates on the Canny Edge buffer not the image.  That is, Canny edges are not inside Hough Lines. I know: duh!

It works great!

Clark

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.