简体   繁体   中英

Parabola fitting with two given points and a cost function

Suppose that there is a parabola Y = aX^2 + bX + c , and it might be rotated as follow:

X = x.sin(phi) + y.cos(phi)
Y = x.cos(phi) - y.sin(phi)
phi = rotation angle

We wish to fit it on a border (eg inner border of an eyelid, figure below). The problem is that how we can change the parabola in each iteration such that it minimizes a cost function. We know that the parabola can be in different rotation and its origin may vary in the search region. Note that the there are two given points which the fitted parabola should passes through them (eg the white squares in fig below). So, In each iteration we can compute a , b and c by the two given points and the origin point (three equations and three variables). The question is how we can reach the goal in minimum iteration (not to test all the possibilities, ie all angles and all positions in the search region).

在此处输入图片说明

Any idea will be appreciated.

@woodchips: I think this is a programming problem, and he asked a solution for the implementation.I definitely disagree with you.

A possible solution would be to first search along the vertical line which is orthogonal to the line between the two given points. And also you can vary the angle in this interval. As the nature of your problem (the border of eyelid), you can limit the angle variation between -pi/4 and pi/4. After you find the minimum cost for a position in this vertical line, you can search along the horizontal line and do similar tasks.

Why not use regression to fit a parabola to several points in the target shape? Then you could use which ever algorithm you wanted to get an approximate solution. Newton's method converges pretty fast. The optimization here is on the coefficients in the approximate parabolas.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM