Forums - How to use fcvTrackBMOpticalFlow16x16u8 ?

2 posts / 0 new
Last post
How to use fcvTrackBMOpticalFlow16x16u8 ?
Join Date: 1 Feb 12
Posts: 2
Posted: Tue, 2012-09-04 01:12

Hi, All, 

I am now trying the new API, fcvTrackBMOpticalFlow16x16u8.

It can runs without errors now, but there is no ouoput, numMv = 0.

Here is my code, 

Mat image1 = imread(fileName1, CV_LOAD_IMAGE_GRAYSCALE);    // opencv image datastructure
Mat image2 = imread(fileName2, CV_LOAD_IMAGE_GRAYSCALE);    // opencv image datastructure

size_t const blockLength = 16;

uint32_t numMv = 100;
uint32_t FASTCV_ALIGN128( locX[numBlocks] );
uint32_t FASTCV_ALIGN128( locY[numBlocks] );
uint32_t FASTCV_ALIGN128( mvX[numBlocks] );
uint32_t FASTCV_ALIGN128( mvY[numBlocks] );

fcvTrackBMOpticalFlow16x16u8(image1.data,	// src1
                             image2.data,	// src2
                             image1.size().width,	// srcWidth
                             image1.size().height,	// srcHeight
                             image1.size().width,	// srcStride
                             0, // roiLeft
                             image1.size().height-1, // roiTop
                             image1.size().width-1,	// roiRight
                             0,	// roiBottom
                             blockLength,	// shiftSize
                             blockLength/2,	// searchWidth
                             blockLength/2,	// searchHeight
                             blockLength/4,		// searchStep
                             false,	// usePrevious
                             &numMv,
                             locX,
                             locY,
                             mvX,
                             mvY);

Does anyone know where is the problem?

Thanks,

Kaku

  • Up0
  • Down0
jeff4s Moderator
Join Date: 14 Mar 12
Posts: 54
Posted: Tue, 2012-09-04 14:48

Please swap roiTop and roiBottom in your call and try again.

 

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