Anyone know how to implement the function interp2d in matlab using c++? Or can we link the matlab function into c++?
Asked
Active
Viewed 910 times
-2
-
It would be useful if you described what this function is supposed to do. – Apr 01 '13 at 15:37
-
see this post:http://stackoverflow.com/questions/1576876/matlab-in-c-c-and-c-c-in-matlab. you may need to generate shared libraries from Matlab code such that you can use it in C/C+=. – taocp Apr 01 '13 at 15:42
-
Do you need all the different options that the Matlab function offers (in terms of types of interpolation - bicubic, linear etc)? Did you look at "Numerical Recipes in C" for algorithms? – Floris Apr 01 '13 at 15:46
1 Answers
0
OpenCV (http://www.opencv.org) is a heavy-weight dependency, but it's probably the tool you want if you're planning on doing image processing in c++. remap()
is the OpenCV function that provides the functionality of MATLAB interp2d
.
Or, if you're happy with bilinear interpolation, and you don't care about performance, write it yourself. The simple implementation is easy to write. On the other hand, making it go faster is very hard, so if you care about performance, use OpenCV.

Peter
- 14,559
- 35
- 55