OpenCV FastCV Point Differences
Join Date: 11 Jan 16
Posts: 6
Posted: Sat, 2016-02-06 06:50
I am trying to detect features in FastCV, then use those features in OpenCV for some functionality. However, the grid system for FastCV seems different than the grid system for OpenCV. I detect features with this line:
fcvCornerFast10u8( (uint8_t*)dataBuf,
dataBufWidth,
dataBufHeight,
2 * dataBufWidth,
state.cornerThreshold,
7,
state.corners,
MAX_CORNERS_TO_DETECT,
&state.numCorners );
And I draw features with this function:
void drawCorners_OpenCV( uint32_t* corners, uint32_t numCorners, uint32_t w, uint32_t h, Mat img_mat )
{
uint32_t curcornerx =0;
uint32_t curcornery =0;
// for each of the corner found, insert a green pixel
for( uint32_t k=0; k<numCorners; k++ )
{
curcornerx = *corners++;
curcornery = *corners++;
circle(img_mat, Point(curcornerx, curcornery), 1, Scalar(255,0,0,255));
}
}
Circle is an OpenCV function that draws a circle at the point location. This is what it looks like (zoom in to see the projected red pixels easily):
http://puu.sh/mXXAp/da775cd315.pngIt is most clear by the registered trademark symbol and projected registered trademark symbol that there is an error in translation and scaling. How do I go from FastCV points outputted by fcvCornerFast10u8's array of interleaved x, y positions to OpenCV point positions?
Did you check that the input is greyscale image? It's unclear from the way you set the srcStride parameter. Cheers, -Jeff
Yes, I convert the image to greyscale in Java using OpenCV before performing any other operations.
The issue ended up being how I transferred image data from java to c++. Using an iplimage caused errors for me, and using a mat worked. There are no point differences, so creating an OpenCV point from FastCV feature detection output works.