Reputation: 195
I used OpenCV's "GoodFeatureToTrack" to find features and track them down on the second image.
To speed up the process, I down-sample the image 4 times smaller, let say from 4000x2000 to 1000x500, using bilinear interpolation.
The KLT match the points perfectly on the resized image. BUT I want to have the point positions in the original image size.
I tried multiplying the feature positions I got on the resized image by 4 (to the original-sized image). It seems to me that after multiplying, the corresponding features on the resized image are not longer corresponding in the original image size.
Do I need interpolation (?) or else to project the points in the resized image back to the original image size? so that corresponding features in the resized image still match in the original image size.
Thank you very much.
Please excuse me that my English is not good.
Upvotes: 1
Views: 2766
Reputation: 20056
Downsizing will result in a loss of precision. However, oftentimes this loss is so small that it cannot be detected. If your points are far from their correct position, it may be that the multiplication step is wrong.
The formula you wrote there is correct, namely
pointInBigImage = scale*pointInSmallImage
where scale is 4, in your case.
You should print the points in both images, and display them side by side. Then, compare visually the positions in the two images. This way, you'll see whether it's a bug or a loss of precision.
And finally, to improve precision you can use cornerSubpix - this is a function in OpenCV that extract a corner's position with subpixel precision - so when you'll multiply them back to the original image, the accuracy should be better
Upvotes: 3