Forums - Optimizing OpenCV code with FastCV - Alignment Issues

4 posts / 0 new
Last post
Optimizing OpenCV code with FastCV - Alignment Issues
Adi_Shavit
Join Date: 8 Feb 12
Posts: 2
Posted: Mon, 2012-04-23 12:11

Hi,

  I have an OpenCV based app that I want to optimize using selected FastCV functions.
How should I allocate my OpenCV image such that they are properly alighned for FastCV (e.g. 128-bit alignment)?

Are there any other tips for selectively replacing OpenCV functions with FastCV calls?

Thanks,

Adi

  • Up0
  • Down0
Estefan_Antelo
Join Date: 16 Feb 12
Posts: 12
Posted: Thu, 2012-05-10 02:20

Hi Adi,

I'm having the same problem, but I think this forum wont help us... It's really frustrating that qualcomm's developers aren't supporting people in the forum. That's the biggest issue on FastCV.

I'll try to figure out how to combine OpenCV and FastCV well. If I get some good results I'll let you know.

 

Kind Regards

Estefan ;)

  • Up0
  • Down0
jeff4s Moderator
Join Date: 14 Mar 12
Posts: 54
Posted: Thu, 2012-05-10 12:44

 

Hi Adi,

Did you try this FastCV function fcvMemAlloc to solve your memory alignment issue?

When you try to replace an OpenCV function call with a corresponding FastCV function call, generally speaking you need to glean FastCV input papameters from your OpenCV function input data structure (such as data pointer, width, height, whatever required by the FastCV function input), and then call the appropriate FastCV function. You want to ensure that the memory alignment requirement is met if you pass pointers, and that you are calling the function of the right input data type.

Regards,

-Jeff

  • Up0
  • Down0
jeff4s Moderator
Join Date: 14 Mar 12
Posts: 54
Posted: Thu, 2012-05-10 13:14

Here is a piece of sample code that illustrates how to mix FastCV and OpenCV:

IplImage* img = cvLoadImage( "/sdcard/testm0h.bmp" );
unsigned int w=img->width, h=img->height;
IplImage* gray8 = cvCreateImage( cvSize(w,h), IPL_DEPTH_8U, 1 );

cvCvtColor( img, gray8, CV_BGR2GRAY );

IplImage* dst = cvCreateImage( cvSize(w,h), IPL_DEPTH_8U, 1 );
IplImage* gradient = cvCreateImage( cvSize(w,h), IPL_DEPTH_8U, 2 );

fcvFilterGaussian5x5u8( img->imageData, w, h, dst->imageData, 0 );
fcvImageGradientInterleaveds16( img->imageData, w, h, img->widthStep,  gradient->imageData );




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