cv :: remap(在opencv中)和interp2(matlab) [英] cv::remap (in opencv) and interp2 (matlab)

查看:1038
本文介绍了cv :: remap(在opencv中)和interp2(matlab)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为interp2寻找一个等效的opencv函数,我理解
cv :: remap 是一个很好的方法。

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.

但是,如果我有以下:

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

其中 x,y,x2 y2 都是(说mxn)矩阵,我不知道如何使用 cv :: remap 为此。

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

如何使用 remap 我知道我必须将其转换为地图...但我不能这样做。

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

还有其他什么可以做 interp2 matlab函数的方式吗?

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

推荐答案

如果你还没有找到答案,这是你应该如何使用它。

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

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

函数remap假设你正在处理的是f定义的网格,传递x,y单调坐标。我几乎肯定矩阵不能是CV_64F(双)所以,考虑到这一点。

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.

这篇关于cv :: remap(在opencv中)和interp2(matlab)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆