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