How can I smooth a 2D boundary ?

23 Ansichten (letzte 30 Tage)
Sleh Eddine Brika
Sleh Eddine Brika am 25 Okt. 2016
Kommentiert: Image Analyst am 29 Mai 2019
Hello, I have a N*2 matrix of x,y coordinates. I need to smooth the boundary. I tried with interp2 but I didn't get something nice.

Akzeptierte Antwort

Image Analyst
Image Analyst am 25 Okt. 2016
Lots of ways. One way is to use splines:
Another way is to use a Savitzky-Golay filter.
I'm attaching demos for each of these methods.
  4 Kommentare
Thiago Motta
Thiago Motta am 29 Mai 2019
That would be regionProps
Image Analyst
Image Analyst am 29 Mai 2019
mask = poly2mask(x, y, rows, columns);
props = regionprops(mask, 'Area', 'Perimeter');
props is a structure or structure array where each structure will have an Area field, and a Perimeter field.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by