Translated by

このページのコンテンツは英語から自動翻訳されています。自動翻訳をオフにする場合は「<a class="turn_off_mt" href="#">ここ</a>」をクリックしてください。

code for calculation of area of histogram

Yun Su Kim

Yun Su Kim (view profile)

さんによって質問されました 2019 年 1 月 29 日

Rik (view profile)

さんによって コメントされました 2019 年 1 月 29 日
Rik

Rik (view profile)

さんの 回答が採用されました
I want to find the code to calculate for area of histogram of one gray scale image.
after that I want to find the border of area whiche approachs the 11.0%(from the 0~11.0%, this may shows almost black color part in the image) of the whole area of histogram.
and I want to display only corresponding pixel (its brightness will correspond to the mostly darkest part of the image and reaches to 11.0% of a whole part) on the screen as a result.
How can I find out this problem?

Yun Su Kim

Yun Su Kim (view profile)

2019 年 1 月 29 日
Then if I want to make a threshold between 11.0% to 45.0% of intensities, how to express this adding to the code which you have provided me?
and if I make 3images with one this grayscale image can I merge these 3images with different color using matlab code? for example, 0<intense<11.0% in yellow, 11<intense<45.0% in green, and 45<intense<100% in red ?
Rik

Rik (view profile)

2019 年 1 月 29 日
You can find the percentile intensities with the second line. Then you can use those values to scale your images to that range. After using 3 different ranges to rescale, you can use this to contatenate it into the third dimension:
IM_RGB=cat(3,IM_red,IM_green,IM_blue);

サインイン to comment.

1 件の回答

Rik (view profile)

2019 年 1 月 29 日
採用された回答

Assuming you have your image stored as a greyscale image:
intensities=sort(IM(:));
PD11=intensities(ceil(0.11*numel(intensities)))
imshow(IM,[0 PD11])

Yun Su Kim

Yun Su Kim (view profile)

2019 年 1 月 29 日
And can you correct this code?
This code is not for the area of the histogram, if I understand well, but for the just 11% proportion in the range of the 0-255.
I want to know the code for calculating of area corresponding to 11.0% area of histogram.
Rik

Rik (view profile)

2019 年 1 月 29 日
The area of the histogram of an image is just the number of pixels in that image, which you can find with numel(IM). So this code does calculate the 11th percentile value.

サインイン to comment.

Translated by