How to convert image into matrix

586 views (last 30 days)
Suyash bhardwaj
Suyash bhardwaj on 27 Apr 2012
Commented: Walter Roberson on 9 Dec 2021
Dear readers, i am new to matlab and want to learn how to convert or represent a picture in bmp or jpeg format in matrix form so that manipulations can be carried out on it. your suggestions will be worth for me..
suyash bhardwaj

Answers (5)

Andreas Goser
Andreas Goser on 27 Apr 2012
If you import a picture, it is actually a matrix, so I am not sure what do are looking for. Try:
imdata = imread('ngc6543a.jpg');
  6 Comments
snehal jaipurkar
snehal jaipurkar on 24 Oct 2016
Dis is really helpful. I thanks experts for their support to beginners like usus.

Sign in to comment.


an iy
an iy on 14 Nov 2017
imdata = imread('ngc6543a.jpg');

Omar Omari
Omar Omari on 31 Jan 2019
hi readers
How can I take a picture from a camera my labtop and draw it into matrices and vice versa
Thanks

keerthana reddy
keerthana reddy on 14 Feb 2019
x=dicomread('i2.jpg');
imshow(i2);
  1 Comment
Walter Roberson
Walter Roberson on 9 Dec 2021
dicomread() is only for use with files stored in dicom format. There is no official file extension for dicom files but most people use .dcm or .dicom as the extension. In theory a file named with .jpg could be in dicom format instead of jpeg format, but the attached file is jpeg format not dicom format.

Sign in to comment.


uroog fatima
uroog fatima on 9 Dec 2021
i need a command to convert encrpted image to matrix.can anybody tell me.
  1 Comment
Walter Roberson
Walter Roberson on 9 Dec 2021
No, we cannot help you with that. Due to the laws of the United States, we are not permitted to discuss encryption or decryption algorithms (except under narrow circumstances that are a nuisance to go through, requiring obtaining permission in advance from a government department.)

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!