How to read an image & convert it into an array and vice versa
6 views (last 30 days)
Show older comments
Hello ,
how to convert an image to 1x2 array & be able to do the inverse ?
0 Comments
Answers (1)
Jon
on 18 Nov 2021
Edited: Jon
on 18 Nov 2021
You can use MATLAB's imread and imwrite functions for this.
On the command line you can type doc imread to get documentation for imread, similarly doc imwrite for imwrite.
By the way I think you meant convert an image to an m x n array, an 1x2 array would only have one row and two columns.
2 Comments
Jon
on 18 Nov 2021
The only image appears to be in the variable that you call original. The variables that you call Original_Data and DecryptedText are just arrays with two elements (1 row by 2 column). There is no image in Original_Data it is just two numbers.
If you want to display the image in the variable you call original, you can use the functions image or imagesc
See Also
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!