Click here to Skip to main content
15,886,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
Q1.
i have 3 points and they are connected from 3 lines..Now i want to make those corners rounded...make smooth corners..is there any opencv function to do this ?

Q2.
i have tried the Bezier curve algorithm to draw rounded corners but it draws the curve in another place...not like shown in this image
http://en.wikipedia.org/wiki/File:Bezier_2_big.gif


below is my function...can anyone say where i went wrong ? Thanks in advance :-)

C++
void BezierCurveCalcCurve(CvPoint pt1, CvPoint pt2, CvPoint pt3)
{
     for (int t = 0; t < 101; t++)
    {

    double xt = pow(1-(t/100.0),2.0) * pt1.x + 2*(1-(t/100.0)) * (t/100.0) * pt2.x + (t/100.0)*(t/100.0) * pt3.x;

    double yt =  pow(1-(t/100.0),2.0) * pt1.y + 2*(1-(t/100.0)) * (t/100.0) * pt2.y + (t/100.0)*(t/100.0) * pt3.y;

    cvSet2D(image,xt, yt, cvScalar(255,0,0,0));
    }

}
Posted
Updated 12-Jun-13 0:56am
v3
Comments
The_Inventor 20-Jun-13 6:38am    
Curves require a begin point, end point, center point and a radius. The line interest points will become the middle of the arc. In drafting programs it is called a 'fillet'.
Dilan Shaminda 20-Jun-13 10:39am    
Thank you :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900