I’m trying to find a centerline in that image, what should I do?
what’s the meaning of ‘centerline’. If you want to detect straight lines, you can use Hough line transformation. OpenCV: Hough Transform
Start with skeletonization (Skeletonization in Python using OpenCV | by Neeramitra Reddy | Analytics Vidhya | Medium), then simplify the polyline (OpenCV Contour Approximation - PyImageSearch).
be very careful with approxPolyDP. it does not maintain lines, it maintains corners. if the thinning/skeleton “rounds” the corner, you’ll get lines that lie off-center.
I’ve really got to implement something better than DP. commercial packages have some simple approaches that are easy to implement from nothing but looking at freely accessible advertising/sales brochures and docs.
Thank you for your help
Thank you for your help!