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.
