Image as a string of binary numbers

2 Ansichten (letzte 30 Tage)
Hunter Thurmond
Hunter Thurmond am 3 Mär. 2014
Kommentiert: Walter Roberson am 5 Mär. 2014
Is there a way to convert a .jpg or .gif into a string of binary numbers?
I want to have a string of binary numbers that could be copied from a word document then read back in MATLab as a picture.
I would also need to know what function could such a string as an image.

Antworten (1)

Walter Roberson
Walter Roberson am 3 Mär. 2014
Converting to text:
dec2bin(TheImage,8)
Converting back:
reshape(uint8(bin2dec(TheStringArray)), size(TheImage))
  4 Kommentare
Walter Roberson
Walter Roberson am 5 Mär. 2014
? I did give the "to text" and "back" code ?
Walter Roberson
Walter Roberson am 5 Mär. 2014
Hunter: use reshape() to change it into a vector. Just be sure to reshape() back the right way!

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Convert Image Type 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