필터 지우기
필터 지우기

Thinning 3d object borders to pixel thickness

조회 수: 7 (최근 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 CenterFile Exchange에서 Feature Detection and Extraction에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by