How to smoothing sharp bends

16 vues (au cours des 30 derniers jours)
Ilker Cavus
Ilker Cavus le 27 Mai 2016
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?

Réponses (2)

John D'Errico
John D'Errico le 27 Mai 2016
Modifié(e) : John D'Errico le 27 Mai 2016
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 le 28 Mai 2016
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.

Catégories

En savoir plus sur Smoothing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by