FAsT-Match
FAsT-Match copied to clipboard
issues after removing parallel_for
Hello,
I am working on visual servo research. In order to locate an approximate position of the object, I am looking for approach related to template tracking and found your code.
A few errors came during debug session possibably because of the compiler of visual studio 2013 I am using.
One part is here
```
if (WITHIN(cv::Point2f(affine_corners.at
affines[i] = affine;
insiders[i] = true;
One other is about matrix boundary
if (!photometric_invariance) {
for (int j = 0; j < no_of_points; j++) {
int target_x = int(a11 * xs_ptr_cent[j] + a12 * ys_ptr_cent[j] + tmp_1),
target_y = int(a21 * xs_ptr_cent[j] + a22 * ys_ptr_cent[j] + tmp_2);
int rj, cj;
if (target_y - 1 <=0)
rj = 0;
else if (target_y > padded.size().height)
rj = padded.size().height-1;
else
rj = target_y-1;
if (target_x - 1 <= 0)
cj = 0;
else if (target_x > padded.size().width)
cj = padded.size().width-1;
else
cj = target_x-1;
score += abs(vals_i1[j] - padded.at<float>(rj,cj));
I also replace tbb::parallel_for with standard for simply because failure in using TBB which had also been compiled successfully. After such modifications, the program compiled but does not give me result within a long time.
So, I open this post to tell my question and also want to ask whether the program running takes very long time if the tbb::parallel_for was entirely removed.
Thanks in advance.
It's in essence a parallel for when it was running on a small notebook without GPU. Yes, it'd run slower, however, that was like 7 years ago, so:
- It might be negligible if you own fast computer, not sure if it'd work on single board computers
- Use a GPU or sth