how to convert a binary code to image

조회 수: 9 (최근 30일)
Hadiid Anugrah
Hadiid Anugrah 2015년 6월 16일
댓글: Walter Roberson 2015년 6월 18일
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?

채택된 답변

Walter Roberson
Walter Roberson 2015년 6월 16일
편집: Walter Roberson 2015년 6월 16일
b = [0 1 1 0 1 0 1 0 1 1];
image(logical(b));
colormap(gray(2))
  댓글 수: 2
Hadiid Anugrah
Hadiid Anugrah 2015년 6월 18일
편집: Hadiid Anugrah 2015년 6월 18일
Can it be converted back to binary code? I mean the image to binary code?
Walter Roberson
Walter Roberson 2015년 6월 18일
Yes.
TheImage = imread('TheFileName.bmp');
ImgBin = im2bw(TheImage, 0.5);
b = ImgBin(1,:);

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by