フィルターのクリア

how to set comparisons between a image matrix and table?

1 回表示 (過去 30 日間)
nida
nida 2014 年 2 月 16 日
コメント済み: Image Analyst 2014 年 2 月 19 日
i have a table with values and matlab files for those values i need my final image color intensities to compare itself to table and if it falls among those ranges(0-200 etc) the corresponding .m files should execute.
  2 件のコメント
Nitin
Nitin 2014 年 2 月 16 日
Please be more specific. What exactly are you trying to achieve?
nida
nida 2014 年 2 月 16 日
ill be having a final image from processing. that image will be of only one color.now i want to compare that image color intensity to range from the table . if range falls within 100-200 iwant my program to execute bar2.m file. need help on this part

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

回答 (1 件)

Image Analyst
Image Analyst 2014 年 2 月 16 日
Try this:
minGL = min(grayImage(:));
maxGL = max(grayImage(:));
% Run appropriate m-file for whatever range the image has.
if minGL > 0 && maxGL <= 100
bar1;
elseif minGL > 100 && maxGL <= 200
bar2;
elsif minGL > 200 && maxGL <= 255
bar3;
else
warningMessage = sprintf('The image range does not fall completely within the 3 ranges specified.\nYour image range = %.1f to %.1f', minGL, maxGL);
uiwait(warndlg(warningMessage));
end
  2 件のコメント
nida
nida 2014 年 2 月 19 日
編集済み: nida 2014 年 2 月 19 日
im having trouble with giving ranges for code above my input image for this is masked image and code directly executes warning message
also how would i know what range/value a particular color pixel has from matrix in an image
Image Analyst
Image Analyst 2014 年 2 月 19 日
Of course, because the min is 0 (where the black mask is), and the max is probably greater than 100, so it doesn't fit into the tight ranges you're checking for. You're requiring BOTH the max and min to fit into the range but what happens is that only one fits in, not both. I really don't know what you're thinking but you'll have to rethink this algorithm. Maybe you want to check that only the mean intensity is in that range, not all the pixels being in that range - I don't know.

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

Community Treasure Hunt

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

Start Hunting!

Translated by