selective bwdist()
8 次查看(过去 30 天)
显示 更早的评论
I have a binary 3D image that consists of a 3D object with "1"-valued pixels and background with "0"-valued pixels. I want to compute the euclidean distance of "some" background pixels to the object.
I found that the MATLAB function bwdist() can compute the distance of "all" of the background pixels to the nearest object pixel for each point.
Is there any MATLAB function or other way to compute the distance of an small subset of background pixels to the nearest non-zero pixel efficiently?
Your help is greatly appreciated.
2 个评论
Sven
2011-12-13
编辑:Image Analyst
2013-10-3
Which version of MATLAB do you have? In 2011b, there was an update which might help you quite a bit:
回答(3 个)
Alex Taylor
2011-12-14
You all have seen Steve's blog post, so you know the answer. But, for anyone who comes to this post with a similar question, we added two new functions to the Image Processing Toolbox for calculating constrained distance problems in R2011b.
These functions solve the geodesic distance and gray-weighted distance transforms.
0 个评论
Image Analyst
2011-12-14
How about just using Pythagorean theorem? If you know the coordinates of all the pixels in your 3D binary object (which you can find out), then just calculate it. If you have one reference point, and say a million other points, it's just a million calculations - shouldn't take too long though I'm not sure whether it will be faster or slower than bwdist.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!