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.

 Réponse acceptée

Image Analyst
Image Analyst le 25 Oct 2016

1 vote

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 commentaires

Sleh Eddine Brika
Sleh Eddine Brika le 25 Oct 2016
Thank you
Bram Mast
Bram Mast le 14 Fév 2019
After you have extracted the boundary and applied a smoothing filter on the coordinates, which command can you use to extract information about de boundary (area, perimeter, ...) ?
Thiago Motta
Thiago Motta le 29 Mai 2019
That would be regionProps
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.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by