I want to ask how can i compare intensity values of images with its database? and name them as high intensity and low intensity ? please help me out :)

2 ビュー (過去 30 日間)
.problem i am facing that how can i compare the intensity of images? and name them as high intensity or low intensity

採用された回答

Image Analyst
Image Analyst 2013 年 9 月 23 日
% Read in the image.
grayImage = imread(yourFileName);
[rows. columns, numberOfColorChannels] = size(grayImage)
if numberOfColorChannels > 1
% It's color so convert to grayscale (luminance).
grayImage = rgb2gray(grayImage);
end
% Get it's mean with mean2().
meanValue = mean2(grayImage);
% Compare the image's mean with your definition of what is high or low.
if meanValue < 142 % or whatever...
classification = 'Low Intensity';
else
classification = 'High Intensity';
end
  2 件のコメント
maria ahmed
maria ahmed 2013 年 9 月 23 日
編集済み: maria ahmed 2013 年 9 月 23 日
Thanks...:)) it help me out..sir, but i want to compare it wi th data base of images ? so for this this what should i do in this code more?
Image Analyst
Image Analyst 2013 年 9 月 23 日
Yes of course. You'll have to analyze all your images that you want to be in the database and find their means and store them in the database. Then "compare" a test image to each of the others in the database. You can use save() to create a simple database. You can compare in whatever way you'd like, for example by subtracting the means.

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

その他の回答 (0 件)

カテゴリ

Help Center および 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