how to convert a binary code to image

I want to convert binary code like 0 1 1 0 1 0 1 0 1 1
to a binary image. Can it be done? please help?

 Risposta accettata

Walter Roberson
Walter Roberson il 16 Giu 2015
Modificato: Walter Roberson il 16 Giu 2015
b = [0 1 1 0 1 0 1 0 1 1];
image(logical(b));
colormap(gray(2))

2 Commenti

Hadiid Anugrah
Hadiid Anugrah il 18 Giu 2015
Modificato: Hadiid Anugrah il 18 Giu 2015
Can it be converted back to binary code? I mean the image to binary code?
Yes.
TheImage = imread('TheFileName.bmp');
ImgBin = im2bw(TheImage, 0.5);
b = ImgBin(1,:);

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Convert Image Type in Centro assistenza e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by