フィルターのクリア

How to find area of specific region in binary image ?

7 ビュー (過去 30 日間)
Junaid Dar Dar
Junaid Dar Dar 2020 年 11 月 29 日
コメント済み: Image Analyst 2020 年 12 月 1 日
For example, I have image with
  1. region1 white,
  2. region2 black,
  3. region3 white,
  4. region4 black and
  5. region5 white.
How can I know pixel density in region4 and how to convert that specific area mm2/cm2 ?
  2 件のコメント
Image Analyst
Image Analyst 2020 年 11 月 29 日
What do you mean by pixel density? All regions of the image have the same density (pixels per unit area). Or do you mean "optical density", in other words, intensity of a gray scale image in region 4?
Junaid Dar Dar
Junaid Dar Dar 2020 年 11 月 30 日
Yes, If we can know the intensity of specific region as each has different area, we can calculate area in mm2/cm2.

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2020 年 11 月 30 日
編集済み: Image Analyst 2020 年 11 月 30 日
See my Image Segmentation Tutorial in my File Exchange:
In short, segment your image by thresholding or whatever to get a mask, then do
props = regionprops(mask, grayImage, 'Area', 'MeanIntensity');
for k = 1 : numel(props)
fprintf('Blob #%d has an area of %d pixels (%.2f sq. cm), and mean intensity of %.2f\n', ...
k, props(k).Area, props(k).Area * cmPerPixel^2, props(k).MeanIntensity);
end
To see how to determine the number of pixels per cm, see my attached spatial calibration demo.
  6 件のコメント
Junaid Dar Dar
Junaid Dar Dar 2020 年 11 月 30 日
Thank you for your answers.
It partially solve my probelm, like first i was getting area of all regions as a single answer.Now, through this I can get areas of three regions serparately. But I need single output, as area of 3rd blob only. Hope I can get best through this.
Image Analyst
Image Analyst 2020 年 12 月 1 日
areaOfBlob3 = allAreas(3);
I think that's SO obvious that I'm not sure it's what you mean, so try to explain better.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by