Uncertanity in counting the number of a pixel in a binary image

1 次查看(过去 30 天)
I am trying to find the error in my measurement which is calculating the surface area of different objects.
Using "regionprops" I can count the number of black pixels (or 0) in a binary image. This number (I guess) depends on the threshold of the "im2bw" function. What happens to the pixels at the edge of the objects? Do they convert to 1 or 0? Is there a way to figure out how many edge pixels have not counted (which were supposed to be counted in reality) and how many are counted (which were not supposed to)? In short, I am trying to find the error in counting pixels! How many pixels are in a closed boundary in an image how many I get after I process the image!
Hope I am clear enough!
  2 个评论
Rik
Rik 2017-10-31
regionprops only works on binary data. This means that it indeed depends on the method you use to convert your image to binary. If edge pixels should have been counted, it sounds like you need to adjust the conversion.
Matt J
Matt J 2017-10-31
Is there a way to figure out how many edge pixels have not counted (which were supposed to be counted in reality) and how many are counted (which were not supposed to)?
Only if you have ground truth prior knowledge of which pixels were supposed to be counted.

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2017-11-1
"What happens to the pixels at the edge of the objects? Do they convert to 1 or 0?" That depends on if they were above or below the threshold. The threshold depends on the algorithm chosen and of course if the threshold changes, the number of white and black pixels in the binary image changes. Like Matt said, the only way to know if it's thresholding the image accurately is if you know for certain which way every pixel is supposed to be: 0 or 1. If you don't know that, then who's to say if it's right or wrong? No one.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Segmentation and Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by