Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
633 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...