Reputation: 739
I use opencv with cpp.
I have std::vector<std::pair<cv::Point2d, cv::Point2d> >
wich represent a warp.
For each point of an image A, i associate a point of an image B.
I don't know all association between points of image A and points of image B. The points of image A are on a sparse matrix. These data have also probably epsilon error.
So I would like interpolate.
In opencv I don't found a function which do simply an interpolation.
How do this ?
I found the function cv::warpPoint but I don't know the cv::Mat
Camera intrinsic parameters nor cv::Mat
Camera rotation matrix.
How compute these matrix from my data ?
Upvotes: 0
Views: 2724
Reputation: 10850
I think the best way is piecewise affine warper:
https://code.google.com/p/imgwarp-opencv/
I have my own fast implementation, but comments are in russian, you can find it here.
Upvotes: 1
Reputation: 20160
So there are 2 questions:
how to warp the points from one image to the other.
Try cv::remap
to do that, once you have dense (interpolated) description. See http://docs.opencv.org/doc/tutorials/imgproc/imgtrans/remap/remap.html for example.
How to compute non-given point pairs by interpolation. I don't have a solution for this, but some ideas:
But I guess the "real" method to do this would be some kind of spline interpolation.
Upvotes: 0