I want to create an image using a matrix.

5 Ansichten (letzte 30 Tage)
Nikhil Chourasia
Nikhil Chourasia am 11 Feb. 2015
Kommentiert: Nikhil Chourasia am 10 Mär. 2015
1) Suppose i have a (8x8) matrix and i want this matrix to be converted into image (as shown in below image).
Note that each row of the matrix correspond to the each row of color in the image.
2) Also if i have R,G,B matrix, then how can i create the image (as shown in below image)
  10 Kommentare
Nikhil Chourasia
Nikhil Chourasia am 8 Mär. 2015
Bearbeitet: Nikhil Chourasia am 8 Mär. 2015
HEMRAJ thanks for your help. I am able to create image. But the image is too small and only a single strip . I want to create strips of color equivalent to my input no. Below is my code which i used.
Matrix1 =[0 0 0]
Matrix2 =[1 1 1]
Matrix3 =[0 0 0]
[m,n]=size(Matrix1);
my_image=[m,n,3];
my_image(:,:,1)=Matrix1;
my_image(:,:,2)=Matrix2;
my_image(:,:,3)=Matrix3;
imshow(my_image);
Please suggest how i can create image like this
Please note color may vary this is only example of image
Nikhil Chourasia
Nikhil Chourasia am 10 Mär. 2015
Thank U all for your help. I am now able to create image using RGB values. But how can i directly give input of R,G,B values in uint8 instead of double.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Eduardo Márquez
Eduardo Márquez am 13 Feb. 2015
Bearbeitet: Eduardo Márquez am 13 Feb. 2015
Using:
imwrite(A,'Image.jpg')
where A is a matrix 3D, A(:,:,1) = Red channel, A(:,:,2) = Green Channel, A(:,:,3) = Blue Channel;
  1 Kommentar
Nikhil Chourasia
Nikhil Chourasia am 10 Mär. 2015
Thank U Eduardo Márquez for your help. I am now able to create image using RGB values. But how can i directly give input of R,G,B values in uint8 instead of double.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

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