Hi,
I have a black and white image, and I am wanting to apply three different thresholds of 105-168, 170-200, and 120-140 to calculate the surface area coverage of three different sections within the image.
Could you please tell me how I could achieve this, in terms of the code or a link where I cold read up on this?
Thanks in advance
Syed

 채택된 답변

Image Analyst
Image Analyst 2013년 7월 21일

1 개 추천

Try this:
binaryImage1 = grayImage >= 105 & grayImage <= 168;
binaryImage2 = grayImage >= 170 & grayImage <= 200;
binaryImage3 = grayImage >= 120 & grayImage <= 140;
areaFraction1 = sum(binaryImage1(:)) / numel(grayImage);
areaFraction2 = sum(binaryImage2(:)) / numel(grayImage);
areaFraction3 = sum(binaryImage3(:)) / numel(grayImage);

댓글 수: 5

Ahmed
Ahmed 2014년 11월 20일
sir, from the image below, how to create a graph for threshold B&W. Let say i only want to create a graph for the subplot(2,2,4) image. Can u help me sir,
Image Analyst
Image Analyst 2014년 11월 21일
What do you mean by "graph"? Like a line/curve plot? Or a bar chart? Or what?
Ahmed
Ahmed 2014년 11월 21일
like histogram.
Image Analyst
Image Analyst 2014년 11월 21일
The 224 subplot (lower right) looks like a binary image so the histogram will have only bins for 0 and 1. You can use imhist(). Not sure why you want it though.
Ahmed
Ahmed 2014년 11월 21일
oh, gosh. u r right. i'm not sure also. tq!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

질문:

2013년 7월 21일

댓글:

2014년 11월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by