Borrar filtros
Borrar filtros

Thinning 3d object borders to pixel thickness

7 visualizaciones (últimos 30 días)
Carson Purnell
Carson Purnell el 1 de Dic. de 2022
Respondida: Carson Purnell el 7 de Dic. de 2022
I am attempting to perform an operation in 3d similar to skeletonization, but instead of producing pixel-width lines I want to produce pixel-thick curved 'shells' of the entire border. Basic demo attached: i basically want to make spheres from the middle of the much thicker border. The middle is important: a convex hull or perimiter operation isn't going to work.
I initially thought that bwskel would work, but it only produces complete shells when there is a very specific curvature. I actually don't know HOW it does this, as the documentation says it uses 26-conn when these weird shell results look like 8-conn skeletonizations.
Any ideas how to get this done?

Respuesta aceptada

Carson Purnell
Carson Purnell el 7 de Dic. de 2022
I couldn't find any existing implementation of a 3d ridge detector using hessian matrices, but I found a much simpler solution that works for my case. using bwdist and imgradient 3 can find the inflection point of the border, which should be the center.
bw = bwdist(~vol); %calculate distances inside the shape
mask = rescale(imgradient3(bw))>0.5; %generate an inverse mask that approximates the border, minus the mid
skel = (bw.*~mask)>max(bw,[],'all')/2-1; %apply the mask to the distance map and threshold edge noise
skel = bwareaopen(skel,8); %clean any remaining outlier points
probably more efficient/general/precise methods but hopefully this implementation is useful if you come across it.

Más respuestas (0)

Categorías

Más información sobre Feature Detection and Extraction en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by