Forums - fcvGeomHomographyEvaluatef32 functuion didn't work

3 posts / 0 new
Last post
fcvGeomHomographyEvaluatef32 functuion didn't work
liqinyun
Join Date: 14 Oct 21
Posts: 2
Posted: Fri, 2021-12-24 00:04

Hi all,

 

I'm working with Fastcv and I need to use fcvGeomHomographyEvaluatef32 function and fcvCorrespondences structure, but I have met a problem that the function didn't work in any ways.

 

I can create a fcvCorrespondences structure as mentioned in the web, and I sucessefully run the similar function of fcvGeomHomographyFitf32, getting the right homography with the Correspondences. But when I use the same Correspondences to run the function of fcvGeomHomographyEvaluatef32, it fails every time with no error shown in the command line (Win10). The result of  numinliers    is 0 all the time even I choose a very high value of maxsqerr and the value of homography is not written. I have set the memory space for inliers and errinliers in advance.

 

 

Can someone help me with this problem? 

Thanks in advance!

Qinyun

 

PS: this is the code I'm using.

 

fcvCorrespondences corrs;

float *fromRe = (float*)malloc((num*3)*sizeof(float));
uint16_t *indicesRe = (uint16_t*)malloc(num*sizeof(uint16_t));
float *__restrict homography = (float*)malloc(9*sizeof(float));

uint16_t *__restrict inliers = (uint16_t*)malloc(num*sizeof(uint16_t));
float *__restrict errinliers = (float*)malloc(num*sizeof(float));
int32_t *numinliers = (int32_t*)malloc(sizeof(int32_t));
float maxsqerr = 20;

 

    fromRe -= num*3;
    xy1 -= num*2;
    indicesRe -= num;


    corrs.from = fromRe;
    corrs.fromStride = 3;
    corrs.to = xy2;
    corrs.toStride = 2;
    corrs.numCorrespondences = (uint32_t)num;
    corrs.indices = indicesRe;
    corrs.numIndices = num;


/*    void (*fcvGeomHomographyFitf32)(fcvCorrespondences*__restrict, float*__restrict);
    fcvGeomHomographyFitf32 = dlsym(obj, "fcvGeomHomographyFitf32");

    fcvGeomHomographyFitf32(&corrs, homography);*/

/*    int (*fcvGeomHomographyEvaluatef32)(fcvCorrespondences*__restrict, float*__restrict, float, uint16_t*__restrict, int32_t*);
    fcvGeomHomographyEvaluatef32 = dlsym(obj, "fcvGeomHomographyEvaluatef32");

    fcvGeomHomographyEvaluatef32(&corrs, homography, maxsqerr, inliers, numinliers);*/

    int (*fcvGeomHomographyEvaluatef32_v2)(fcvCorrespondences*__restrict, float*__restrict, float, uint16_t*__restrict, float*__restrict, int32_t*);
    fcvGeomHomographyEvaluatef32_v2 = dlsym(obj, "fcvGeomHomographyEvaluatef32_v2");

    fcvGeomHomographyEvaluatef32_v2(&corrs, homography, maxsqerr, inliers, errinliers, numinliers);

 

  • Up0
  • Down0
xtang
Join Date: 6 Dec 21
Posts: 12
Posted: Wed, 2022-01-05 18:58

Hi Qinyun,

I will test your code in my device and then back to you.

Thanks,

Xiaofeng

  • Up0
  • Down0
xtang
Join Date: 6 Dec 21
Posts: 12
Posted: Tue, 2022-01-25 22:13

Hi Qinyun,

I got the same result with you, checking with fastcv team to fix it.

will keep update to you.

 

Thanks,

Xiaofeng

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