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.
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