Forums - OpenCV FastCV Point Differences

4 posts / 0 new
Last post
OpenCV FastCV Point Differences
Cyrus
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.png
It 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?
  • Up0
  • Down0
jeff4s Moderator
Join Date: 4 Nov 12
Posts: 106
Posted: Mon, 2016-02-08 10:46

Did you check that the input is greyscale image? It's unclear from the way you set the srcStride parameter. Cheers, -Jeff

 

  • Up0
  • Down0
Cyrus
Join Date: 11 Jan 16
Posts: 6
Posted: Tue, 2016-02-09 08:06

Yes, I convert the image to greyscale in Java using OpenCV before performing any other operations.

  • Up0
  • Down0
Cyrus
Join Date: 11 Jan 16
Posts: 6
Posted: Tue, 2016-02-09 09:58

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.

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