Forums - fcvTrackLKOpticalFlowu8_v2, fcvPyramidCreateu8_v2 can not create pyramid

2 posts / 0 new
Last post
fcvTrackLKOpticalFlowu8_v2, fcvPyramidCreateu8_v2 can not create pyramid
Gradon
Join Date: 19 Sep 13
Posts: 6
Posted: Thu, 2014-01-23 17:20

I am trying to get to run fcvTrackLKOpticalFlowu8_v2 using FastCV 1.3. Prior calling this function pyramids has to be created, here is the code:

pyr2 = new fcvPyramidLevel_v2[pyrLevel];

int i = fcvPyramidAllocate_v2( pyr2, dataBufWidth, dataBufHeight, dataBufWidth, 1, pyrLevel, 1);

DPRINTF( "fcvPyramidAllocate_v2 error code: %d \n", i);

i = fcvPyramidCreateu8_v2( (uint8_t*) dataBuf, dataBufWidth, dataBufHeight, dataBufWidth, pyrLevel, pyr2 );

DPRINTF( "fcvPyramidCreateu8_v2 error code: %d \n", i);

 

Both functions return 0. But fcvPyramidCreateu8_v2 crashes the program with Exception Stack error shown on the hyperterminal.

 

Any thought?

  • Up0
  • Down0
Gradon
Join Date: 19 Sep 13
Posts: 6
Posted: Sun, 2014-01-26 17:52

Problem solved:

 Both fcvPyramidCreateu8_v2 and fcvTrackLKOpticalFlowu8_v2 seem to return 0 regardless.

 pyr2 has pyrLevel number of layers basically, when it is created with "new".

 But during allocation in the fcvPyramidAllocate_v2 the allocateBase was set to 1, which meant an extra layer to be allocated, which created an overflow. So the solution was to give the allocateBase parameter 0 value.

It is interesting that wasn't throwing an exception error if just running fcvPyramidAllocate_v2 (probably it supposed to return that no allocation could make), but the exception was thrown when fcvPyramidCreateu8_v2 was called, when actually the memory space was about to be used.

 

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