How to smoothing sharp bends

16 ビュー (過去 30 日間)
Ilker Cavus
Ilker Cavus 2016 年 5 月 27 日
回答済み: Image Analyst 2016 年 5 月 28 日
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 Center および File ExchangeSmoothing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by