Curve interpolation
Hi,
I want to automatically detect lateral maxima and minima on this image :
Like you can see, I already detect this points. However, the detection precision is about a pixel. I want to make the detection more precise. Thus, I thought to interpolate the curves in order to obtain continuous points and be more precise. Does anyone an idea to make that on OpenCV, in C++ ?
Thanks for any help,
Your research is impressive. Aren't the points on the right a little off? I'd get the maximum and minima by detecting where the dark pixels start on the right and end on the left, but that's just my opinion.
Bézier curves are not too hard to handle, if there is no direct support for curves in OpenCV. Bézier curves are differentiable too (you can calculate their derivative). There is plenty of C++ code, check Google.
In any case, you can draw/approximate the curve as a series of
line
function calls. The smaller the lines the better.