Fit a broken, wavy object outline in image processing
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hello everyone, I would like to get the outline of a tennis racket from a top view photograph. The attached picture shows my result so far. The problem is that the outline is broken and is a bit too wavy (for example near the thorat of the racket), so I would like to fit and smooth it, if possible.
I am currently segmenting the image basing on color (the background is supposed to be white), but due to some properties (shadows, light reflections, racket label, etc) the outline is not continuous and there are some isolated dots that do not belong to the racket. I tried to remove the dots/noise with bwareaopen and some of them disappear, but this can increase the probelm that the outline is broken.
However, it looks to me that I am almost there, as I just have to fit the outline in order to connect the broken edges, and smooth the outline. Yet, I haven't been able to figure out a way to solve this problem, so it seems very simple but very difficult at the same time.
Is there a way to fit the red outline following the silhouette of the racket, so that it is continuous and smoother? Or should I act on the segmentation process and avoid these problems in the post-processing?
Thanks a lot for your help,
Luca
2 comentarios
KSSV
el 13 de Ag. de 2020
How about getting the pixel locations of the racket...and using boundary ?
Respuestas (1)
Matt J
el 13 de Ag. de 2020
Editada: Matt J
el 13 de Ag. de 2020
A smoothing spline may work well,
If you convert the points to polar coordinates r, theta, relative to some origin in the interior of the racket, you could use the smoothing spline to fit the polar curve r(theta). You might also try sgolayfilt to do the same,
Ver también
Categorías
Más información sobre Language Support en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!