Forums - fcvCornerFast9InMaskScoreu8 not using mask [SOLVED]

5 posts / 0 new
Last post
fcvCornerFast9InMaskScoreu8 not using mask [SOLVED]
tdandroid
Join Date: 9 Nov 11
Posts: 11
Posted: Mon, 2011-12-19 15:59

Hi, I've successfully been using fcvCornerFast9Scoreu8 to detect corners; however, I now need to do some masking but fcvCornerFast9InMaskScoreu8 just doesn't seem to work (both v. 1.0.2 and v. 1.0.3).

I'm calling it like this:

		fcvCornerFast9InMaskScoreu8(
			imgBuf,           // Image data        
			img->getWidth(),  // Image width
			img->getHeight(), // Image height
			img->getStride(), // Image stride (bytes per row)
			FAST9_BARRIER,    // FAST9 barrier value
			IMAGE_BORDER,     // Image border
			_corners,         // [out] Packed corner positions (128-bit aligned)
			_scores,          // [out] Corner scores (128-bit aligned)
			MAX_CORNERS,      // Max corners
			& numCorners,     // [out] Number of corners
			mask,             // Image mask (128-bit aligned)
			img->getWidth(),  // Mask width
			img->getHeight()  // Mask height
			);
In the documentation it says that the mask's width over the image's width (and likewise for height) must be a power of two, which I am satisfying (I've also tried doubling the mask's width and height in case the implementation doesn't consider 2^0 to be a power of two). The mask is being allocated via fcvMemAlloc to insure it's 128-bit aligned. Also, I've tried just passing in a completely "black" mask (i.e., std::memset(mask, 0x0, maskSize);) but I still get corners. I'm not sure what I could be doing wrong here. Any ideas? I guess I can just prune the corners after, but it would be nice to get this to work.

Thanks.
  • Up0
  • Down0
tdandroid
Join Date: 9 Nov 11
Posts: 11
Posted: Mon, 2011-12-19 16:07

Also I should note that I do not get any error messages through adb logcat and the image stride is the same as the image width.

  • Up0
  • Down0
grk101
Join Date: 26 Oct 11
Posts: 12
Posted: Tue, 2011-12-20 17:45

Hi, 

The use of the mask here  can be little bit tricky. The mask you are providing is supposed to be a bitmask. In your case, because the masks dimensions match the images dimension, each bit activates one pixel. You should also make sure that in memory the bitmask should have a size of img->getWidth()*img->getHeight()/8 bytes. 

Cheers,

Guy

  • Up0
  • Down0
tdandroid
Join Date: 9 Nov 11
Posts: 11
Posted: Tue, 2011-12-20 19:19

Thanks, got it working.

Although it seems it's 1's that are excluded and 0's that are included, but it works nonetheless!

  • Up0
  • Down0
Shravan_Kumar
Join Date: 1 Mar 12
Posts: 13
Posted: Wed, 2012-03-14 23:26

Hi,

 

Please have a look at this post. Will you Please tell me where I am going wrong. I am a student who is learning fastcv for my project.

Thanks in advance,

Cheers,

Shravan

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