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
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 ;)
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
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 );