0
votes

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
First you need to be able to sort all points into different groups so that one curve is fitted from each group. You then need to figure out the order of points in each group. Once you have these two information, fitting a cubic Bezier curve to a series of ordered points is easy and you should be able to find many references on internet or on SO.fang

1 Answers

1
votes

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.