how to find the area

조회 수: 3 (최근 30일)
andhavarapu lokesh
andhavarapu lokesh 2016년 12월 30일
댓글: Star Strider 2016년 12월 30일
iam trying to find the area of circular ring which is short axis image of myocardial spect image where i want to find the volume of the white area can any one tell how to find the area what happens if we use bwarea command in matlab

답변 (3개)

Image Analyst
Image Analyst 2016년 12월 30일
bwarea() does NOT give the same area as a simple count of pixels, like sum() and regionprops() give you. It weights the edge pixels according to their neighbors, so like an edge slanted at 45 degrees might give half a pixel instead of a full pixel. There are different weights for different edge orientations. The bwarea documentation explains it all.
bwarea estimates the area of all of the on pixels in an image by summing the areas of each pixel in the image. The area of an individual pixel is determined by looking at its 2-by-2 neighborhood. There are six different patterns, each representing a different area:
  • Patterns with zero on pixels (area = 0)
  • Patterns with one on pixel (area = 1/4)
  • Patterns with two adjacent on pixels (area = 1/2)
  • Patterns with two diagonal on pixels (area = 3/4)
  • Patterns with three on pixels (area = 7/8)
  • Patterns with all four on pixels (area = 1)
Keep in mind that each pixel is part of four different 2-by-2 neighborhoods. This means, for example, that a single on pixel surrounded by off pixels has a total area of 1.
You have to decide if you want that or if you want a simple count of pixels.
  댓글 수: 1
andhavarapu lokesh
andhavarapu lokesh 2016년 12월 30일
i want to find the volume for that i need area means what should i use please tell iam not familiar

댓글을 달려면 로그인하십시오.


John D'Errico
John D'Errico 2016년 12월 30일
편집: John D'Errico 2016년 12월 30일
Why not apply common sense? Count the number of white pixels. If you have some tiny amount of white pixels that are not connected to the main region of interest, then remove them first.
Since this is a black and white image, then 1 is white, 0 is black.
sum(double(im(:)))
Since each pixel has an "area" of 1, then the sum is just the area you want.
  댓글 수: 1
andhavarapu lokesh
andhavarapu lokesh 2016년 12월 30일
sir bwarea means sum of counts both are same or not

댓글을 달려면 로그인하십시오.


Star Strider
Star Strider 2016년 12월 30일
Your ‘.png’ image may be ‘binarised’, but it contains 3 channels. Choose one of them to use with bwarea:
[Img,Map] = imread('andhavarapu lokesh Capture9.png');
MyocardArea = bwarea(Img(:,:,1));
figure(1)
for k1 = 1:3
subplot(1,3,k1)
imshow(Img(:,:,k1))
end
MyocardArea =
20899
  댓글 수: 2
andhavarapu lokesh
andhavarapu lokesh 2016년 12월 30일
will the bwarea give the area of white pixels or total are including black pixels also
Star Strider
Star Strider 2016년 12월 30일
The bwarea function calculates the area of each pixel in a 2-by-2 neighborhood, according to the documentation.
If you just want the numbers of white and black pixels with a threshold of 1 for your image, see if this does what you want:
Imgv = reshape(Img(:,:,1), [], 1);
Black_pxl = sum(Imgv == 0)
White_pxl = numel(Imgv)-Black_pxl
MyocardArea = bwarea(Img(:,:,1))
Black_pxl =
106923
White_pxl =
20871
MyocardArea =
20899
This is a rather simple way of calculating it, but may give you what you want.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Denoising and Compression에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by