MATLABs interp1 with either pchip or cubic in OpenCV for 1D vector

193 Views Asked by At

I need to implement the same logic and values we get in MATLAB using interp1 with 'pchip' or 'cubic' flags and I'm unable to find a fitting replacement in OpenCV other than implementing by myself the cubic interpolation in Numerical Recipes (as noted by another question, this is based on De Boor's algorithm, which is used by MATLAB).

We need to interpolate values of a 1D doubles vector based on our sample points. Using Linear interpolation did not yield sufficient results as it is not smooth enough and results in non-continuity on the gradient in the joint points.

I came across this on OpenCV's website. But this seems to only be bicubic and work on an image, whilst I need a cubic interpolation.

Does anyone know any other function or simple solution on OpenCV's side for this issue? Any suggestion would help, thanks.

Side note: we are using OpenCV 4.3.0.

0

There are 0 best solutions below