displaying image
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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
0 comentarios
Respuestas (1)
Walter Roberson
el 9 de Mzo. de 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 comentarios
Jan
el 9 de Mzo. de 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
el 9 de Mzo. de 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.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!