drow a image only by a matrix

If I have a image's matrix( for example a matrix 300*400) , how do I drow this matrix as a image? Also depends on the type of photo?

 Respuesta aceptada

Thomas
Thomas el 9 de Jul. de 2012

1 voto

Maybe imshow will help
eg:
c=rand(300,400); % generate random matrix data
imshow(c)

7 comentarios

Ryan
Ryan el 9 de Jul. de 2012
to further the demonstration with a "color" image:
c(:,:,1) = rand(300,400); % R
c(:,:,2) = rand(300,400); % G
c(:,:,3) = rand(300,400); % B
figure,imshow(c)
Fatima prv
Fatima prv el 9 de Jul. de 2012
Editada: Fatima prv el 9 de Jul. de 2012
yes, thanks. But Data matrix are only 0 and 1, and when I use this command shows a completely black!!
Thomas
Thomas el 9 de Jul. de 2012
Does the following work
imshow(c,[0 1])
Fatima prv
Fatima prv el 9 de Jul. de 2012
yes, It was clearer. explain about this command please.
Thomas
Thomas el 9 de Jul. de 2012
it gray scales the image in the range 0 and 1.
You can find more about MAtlab commands using the doc command.. so to find help on imshow command use..
doc imshow
Ryan
Ryan el 9 de Jul. de 2012
Editada: Ryan el 9 de Jul. de 2012
What is the result of unique(image_matrix)? Does imshow(image_matrix,[]) work?
Fatima prv
Fatima prv el 9 de Jul. de 2012
no , this command show all of number that used in image matrix as a vector.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 9 de Jul. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by