Hello,
I am trying to create an algorithm that converts an image of a black and white tracing into a plot. So far, my code can convert the image into points using the code:
lion = imread('lion.png')
lion_y(count) = -i + 1000;
It can successfully convert the png into plotted points (I have attached the png to this posting as well):
--->![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/721669/image.png)
But, when zooming in, the line is composed of multiple points to make it appear thicker:
How would I create a trace of these points (perhaps some sort of average?) so that the image can be reduced to a single-point width?
so that the final image would look something like this:
This was made by manually outlining the trace using ginput(). This is not the ideal approach because it is not as accurate and it would be time consuming for processing over 100 images. Is there a way to automate this process?
I tried using the boundry function but it did not capture the details inside the image. It also didn't have a high enough resolution to capture the sharp edges (like in the mane).
Thank you for your help!