Thinning 3d object borders to pixel thickness

2 ビュー (過去 30 日間)
Carson Purnell
Carson Purnell 2022 年 12 月 1 日
回答済み: Carson Purnell 2022 年 12 月 7 日
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?

採用された回答

Carson Purnell
Carson Purnell 2022 年 12 月 7 日
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.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeBiological Physics についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by