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.