I am experimenting with the mexopencv project that allows using the
OpenCV library from MATLAB .m
files in order to compare the performance
of the native MATLAB functions with the OpenCV functions
I would like to substitute a call to the MATLAB interp2
function:
Vq = interp2(X,Y,V,Xq,Yq)
returns interpolated values of a function of two variables at specific query points using linear interpolation. The results always pass through the original sampling of the function. X and Y contain the coordinates of the sample points. V contains the corresponding function values at each sample point. Xq and Yq contain the coordinates of the query points.
The substitute shall be a call to the cv.remap
function.
Applies a generic geometrical transformation to an image
dst = cv.remap(src, map1, map2) dst = cv.remap(src, map1) dst = cv.remap(..., 'OptionName',optionValue, ...)
The three SO questions Similar OpenCV Api for interp2 in Matlab,
How to do grid interpolation interp2 in OpenCV
and cv::remap (in opencv) and interp2 (matlab)
state that the OpenCV function remap
can be used instead of the native MATLAB
function interp2
, but I have no idea how-to correctly interpret/transform the
arguments (I have no experience regarding MATLAB and computer vision).
How can I use the mexopencv function cv.remap
to get the same effect as if one
would call Vq = interp2(X,Y,V,Xq,Yq)
?