matlab - Convert bitmap to binary values -
i convert bitmap file array consisting of binary values; when use script:
arr=imread('sample.bmp'); arrbin=cell(1140,912,3); i=1:1140 j=1:912 k=1:3 arrbin(i,j,k)=dec2bin(arr(i,j,k)); end; end; end;
the debug info shows this:
conversion cell char not possible. error in imgproc (line 9) arrbin(i,j,k)=dec2bin(arr(i,j,k)); >>
is there anyone? in advance.
your solution going slow on big images. better this:
i=imread('sample.bmp'); a=dec2bin(i,8);%8bit % how index array i=5;j=35;ch=2; pixel=a(sub2ind(size(i),i,j,ch),:)
Comments
Post a Comment