How can I simulate a Bezier curve out of an image?

1.8k views Asked by At

If I have a set of points from a black-white image I scanned.

It looks like a curve and I want to simulate a smooth curve using cubic Bezier curve from those points.

How can I figure out the start point, 2 control points and the end point?

c

From the image, there are several cubic Bezier curves that can be simulated but I don't know how to figure out the control points.

1

There are 1 answers

2
offchan On BEST ANSWER

I have found the solution for my problems and I want to share it. First, I write a python program to trace the curve and tell me all x,y of the points on the line. Now, I have one curve. I then create a line from start to end point and compare the distance between the perpendicular points on those 2 lines. If the distance is not low enough I will move the control point up, down, left, right and find which direction has the least distance. Do this multiple time and I will get a curve that is similar to the curve I have.