How to smoothing sharp bends

14 次查看(过去 30 天)
Ilker Cavus
Ilker Cavus 2016-5-27
Hi I'm dealing with path planning, i did it but now need to smooth the curves for make movements suitable. I want to use circumference for smoothing so i can give car's turning radius as an input. What do you suggest for this problem?

回答(2 个)

John D'Errico
John D'Errico 2016-5-27
编辑:John D'Errico 2016-5-27
I'm not sure I see what is the problem. You have two lines that intersect in a known point.
Solve for the equation of a circle (with known radius) that is tangent to both lines. All that is unknown are the coordinates of the center of that circle. In fact, you even can compute a line that must pass through that center point.
As simply, there is a basic formula for the distance to a line from a point . If the radius of the circle is given as r, then the point (x0,y0) must lie at a distance r from the line. Since you have two such lines, this is again a simple problem to solve.
Just sit down with a pencil and paper, and do a little basic algebra. Yeah, I know, you want me to do it for you. But the symbolic toolbox can do it easily enough.

Image Analyst
Image Analyst 2016-5-28
If you can interpolate a bunch more points along the line, then simple take your x and y vectors and filter each of them with a moving smoothing filter such as conv(), sgolayfilt(), lowess(), etc. The output curve will be smoother around the sharp vertices.
See attached demo that uses the Savitzky-Golay filter to smooth an outline in 2-D.

类别

Help CenterFile Exchange 中查找有关 Smoothing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by