Hello,
I have a grayscale image that needs to be analysed. You can think of a banana horizontally, banana is brighter, background is almost black. The curvature of the banana should be calculated.
I thresholded it to get binary. Cropped the sides away so that the edges of the image start within the outer parts of the banana. I mulitplied the binary values so that each value in the array represent the row number. So I get a dataset/cloud through which i could do a PolyFit.
The problem is: The dark areas below the threshold are zero, thus a large number of the dataset is interpreted as a line on the x-Axis, which changes the expected result of the polyfit.
What can I do, to only fit through the actual datapoints?