フィルターのクリア

counting of pixels having same same value

2 ビュー (過去 30 日間)
monika  SINGH
monika SINGH 2019 年 4 月 8 日
編集済み: monika SINGH 2019 年 4 月 11 日
how to count pixels having same value
  4 件のコメント
Manuel Schmidberger
Manuel Schmidberger 2019 年 4 月 8 日
Depending on that you wanna count (one or more values) you can use this:
VALS=[1,2...N] % Array of values 1xN
thermIm= % Matrix of thermal image values
noVals=sum(sum(ismember(thermIm,VALS)))
noVals is the amount of pixels in thermal image containing the values stored in array VALS
If you have just one value you can just use a combination of "length" and "find"
VAL= % Random number 1x1
noVals=length(find(thermIm==VAL))
Image Analyst
Image Analyst 2019 年 4 月 8 日
Please put Answers down in the Answer section.

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

採用された回答

Image Analyst
Image Analyst 2019 年 4 月 8 日
編集済み: Image Analyst 2019 年 4 月 8 日
You can take a histogram:
histObject = histogram(yourImage);
or
[counts, grayLevels] = imhist(grayImage);
  1 件のコメント
monika  SINGH
monika SINGH 2019 年 4 月 11 日
編集済み: monika SINGH 2019 年 4 月 11 日
i am having a gray level image,and i want to set some range for pixel intensity like
if x[i,j]=183 to 215 ; (x[i,j]=pixel intensity )
then it would be of red color
else green
c programming of what i amasking is like this
for (i=0;i<n;i++)
{for(j=0;j<n;j++)
{
ifx[i,j]>=183||x[i,j]=215)
{
red color}
else
{green}
end}}
please give me matlab code for this

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Image Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by