MATLAB: How can i find number of pixel in irregular road from an image

distance transformimage analysisimage processingImage Processing Toolboximage segmentationroadskeleton

I have a binary image showing the irregular track and I have to find out the number of pixels to measure its width. Anyone have code to apply distance transform and skeleton for this problem? I have tried creating the bwdist and then skeleton and multiplying together Initially it cause error mtimes but after writing the equation as double(Dist) .* double(Skele); gives no error but results in Zero Matrix.

Best Answer

That should work. You'd have to provide your code and binary image so I can investigate why you say it doesn't.