How to convert a 128x128 or 256x256 grayscale image into a b

How to convert a 128x128 or 256x256 grayscale image into a binary bitsream in mat lab?

Solution

img = rgb2gray(imread(\'someimage\'));

bin = dec2bin(img); %convert each pixel into binary in column major wise

binaryStream = bin\'(:); %stream the 2d binary array (do not forgetto transpose as I did)

Hopefully, this will help you. In case of any doubt feel free to comment below.

How to convert a 128x128 or 256x256 grayscale image into a binary bitsream in mat lab?Solutionimg = rgb2gray(imread(\'someimage\')); bin = dec2bin(img); %conver

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site