Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
631 views
in Technique[技术] by (71.8m points)

c++ - cv::remap (in opencv) and interp2 (matlab)

I am trying to look for an equivalent opencv function for interp2 and I understand that cv::remap is a good way of doing this.

However, if I have the following:

f2 = interp2( x, y, f, x2, y2, 'bicubic' );

where x, y, x2 and y2 are all (say m x n) matrices, I am not sure how to use cv::remap for this.

How would I use remap for this? I know I have to convert it to a map ... but I'm unable to do so.

And,is there anything else that could do interp2 the way the matlab function does it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In case you didn't find your answer yet, this is how you should use it.

remap(f,f2,x2,y2,CV_INTER_CUBIC);

The function remap supposes that you're working on exactly the grid where f is defined so no need to pass the x,y monotonic coordinates. I'm almost sure that the matrices cannot be CV_64F (double) so, take that into account.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...