displaying image

8 Ansichten (letzte 30 Tage)
kash
kash am 9 Mär. 2012
I have 10 images
y1=imread('..') ; ; ; y10=imread('..'),
now i have mean for each image and have stored in
variable
x1,,,,,,,x10
now i want to display the image which has minimum mean value

Antworten (1)

Walter Roberson
Walter Roberson am 9 Mär. 2012
[minval, minidx] = min([x1,x2,x3,x4,x5,x6,x7,x8,x9,x10]);
switch (minidx)
case 1: image(x1);
case 2: image(x2);
case 3: image(x3);
[etc]
end
If that seems a bit clumsy (as it should), then considering storing your images a different way. http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F
  4 Kommentare
Jan
Jan am 9 Mär. 2012
Please follow the link Walter has posted. If you store the images in a cell like x{1}, x{2}, ... the processing is much easier. Hiding an index in the name of a variable is very inconvenient and prone to errors.
Image Analyst
Image Analyst am 9 Mär. 2012
kash, as you step through it with the debugger, which case statement is it going into? Also, you might have the last case be "otherwise" instead of case 10. Also are you sure you didn't make a typo? MATLAB will create new variables dynamically and y4 is different than x4.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by