I'm working with Fastcv and I need to use fcvSumOfSquaredDiffs36xN8
function and fcvCorrespondences structure, but I have some doubts about
each of them.
The first one is about the third parameter (named b) of the
fcvSumOfSquaredDiffs36xNs8 function. This parameter is defined like
const int8_t*const* b. b is a double pointer, isn't it? I defined it
typedef int8_t* pointerDescriptor;
pointerDescritor* b;
b = new pointerDescriptor[numOfPoints];
On the other hand, in the documentation I can read that b must be 128bit
aligned. But, if b is a double pointer, how can I aligned it?
The second doubt is about the fcvCorrespondences structure. In from
to array I have all the points/corners detected in the image capture .
couple of FROM[INDICES[i]]?
Hi Nagore,
Regarding the use of fcvCorrespondences, please take a look this post . It contains information that might help you.
As for aligning b , you could try this.
Cheers,
Guy
Hi,
What values you are setting for fromStride and toStride in fcvCorrespondences data structure? Are you setting both the strides to 2 in case of homography? Also, I think your notion of indices[i] is incorrect. In the fcvCorrespondence data struct, to[indices[i]] should correspond to from[indices[i]].
Let me give you a concrete example: say both 'from' and 'to' arrays have 10 points and indices[i] is an array from 0 to 9 with numindices set to 10. In this case, the evaluate function will loop through all the points and then calculate the inliers, square error, etc. Now, lets say we set numindices to 4 and the indices array to {0, 2, 5, 6}. In this case, the evaluate function will only consider the 0th, 2nd, 5th and 6th points while evaluating the homography function to calculate inliers, square errors, etc. Make sure that numindices is same as the size of the indices array in your implementation.
So, if you have N points (both 'from' and 'to' are of size N) and you want to use all the points for the evaluate function, you should set numindices to N-1 and the indices array should contain {0,1,2,3,4,..., N-1}. Can you try this once and see what output you are getting from the evaluate function?
Hi,
Thanks for your answer again!
I set toStride and fromStride as follows: toStride=2; fromStride= 3;
Now it works ok! And, I understand the structure of fcvCorrespondences.
Thanks!
Best Regards,
Nagore