How to calculate intensity value of an image ?

i'm doing project in Image retrieval using Krawtchouk moment .. we are calculating the moment value but to do this.. we need to know the intensity value of an image.. plz help us..

 採用された回答

Image Analyst
Image Analyst 2013 年 3 月 22 日

1 投票

The image is in a variable. This is an array with rows and columns. The value of the array at each row and column is the intensity. So you already have it.

7 件のコメント

julia jemila
julia jemila 2013 年 3 月 23 日
ok, in moment formula it has F(x,y), so x is the row and y is the column .. my question is .. should i have to calculate the total intensity value of an image or the value changes when x and y changes ?
Image Analyst
Image Analyst 2013 年 3 月 23 日
I don't know how you define the "total intensity value of an image". An image has an intensity at each pixel location. Image moments are defined here: http://en.wikipedia.org/wiki/Image_moments. Why do you think that you want them? I've never heard of anyone using Krawtchouk's moment. How is his definition of moment different than the standard ones and why do you need that particular moment?
julia jemila
julia jemila 2013 年 3 月 23 日
we are doing project in image processing using matlab.. our project name is " IMAGE RETRIEVAL USING KRAWTCHOUK MOMENT".. it is the one of the type of discrete Orthogonal Moment.. plz help us..
Image Analyst
Image Analyst 2013 年 3 月 23 日
My questions remain unanswered. What does "plz help us" mean? How can I help you with what you've provided so far? Anyway, I'm not a database or CBIR guy, plus you'll have to narrow down what you're asking. I can't do a whole semester long project for you. Do you have any specific code that you need help on that will take less than 5 minutes?
julia jemila
julia jemila 2013 年 3 月 24 日
we calculated the moment value.. but the way we did is wrong.. coz we don't know how to apply the intensity value of an image..
julia jemila
julia jemila 2013 年 3 月 24 日
編集済み: Image Analyst 2013 年 3 月 24 日
o=imread('car.jpg');
i=rgb2gray(o);
imshow(i)
[r c]=size(i);
s=0;
for p=1:c
for q=1:r
px=impixel(i,c,r);
s=px(1,1)+s;
end
end
s
This is how we calculated the total intensity value. Is it correct or we have to do it for every f(x,y) value?
Image Analyst
Image Analyst 2013 年 3 月 24 日
NO it's not right. you're just summing up the last pixel, (r,c) which is the very lower right pixel, so the value is just the gray level of that pixel times the number of pixels in the image - a totally useless thing. If you just want to sum up the gray level version of your rgb image, you can do this:
rgbImage = imread('car.jpg');
grayImage = rgb2gray(rgbImage);
sumOfAllGrayLevels = sum(grayImage);
But I doubt that is a Krawtchouk moment.

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

その他の回答 (2 件)

Mona
Mona 2013 年 6 月 25 日

0 投票

how can i find : the total number of possible intensity levels in hyper image?
is it the total number of bands?

1 件のコメント

Image Analyst
Image Analyst 2013 年 6 月 25 日
Check out the class of the image. If it's uint8, you can have 256 intensity values. If it's uint16, there are 65536 values. If it's color, there are 256*256*256 possible values for a color uint8 image, and 65536*65536*65536 possible values for a color uint16 image.

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

Poornima Devi
Poornima Devi 2018 年 1 月 23 日

0 投票

Sir I am also doing a project which includes the calculation of intensity of each pixel soo can I get the perfect code for it pleaseeeee sir it's urgent

3 件のコメント

Aatheeswaran M
Aatheeswaran M 2018 年 10 月 10 日
Sir, I am also doing a project which includes the calculation of the intensity of each row soo can I get the perfect code for it please sir it's urgent
YOGITAA YOGITAA
YOGITAA YOGITAA 2022 年 3 月 2 日
could you please share the code?
Image Analyst
Image Analyst 2022 年 3 月 2 日
編集済み: Image Analyst 2022 年 3 月 2 日
@Poornima Devi, @Aatheeswaran M, and @YOGITAA YOGITAA, the image array is already the intensity of each pixel. There is nothing left to do - you have it already. If you want the intensity along one particular row only, you can use indexing:
row = 42; % Whatever row you want
horizontalProfile = grayImage(row, :);
If you want the mean of that row, you can use mean():
meanGrayLevel = mean(horizontalProfile);
If you'd like to see an tutorial on image segmentation, see it on my File Exchange page:

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

カテゴリ

ヘルプ センター および File ExchangeConvert Image Type についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by