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

Categories

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

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

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...