function bmp=convert2BMP(img)
%convert an image of 4096 gray levels to an img of 256 gray levels
%input: img is of 4096 gray levels
%output: bmp is of 256 gray levels
img=double(img);
bmp=uint8(floor(img/16));
%imshow(bmp);
%convert an image of 4096 gray levels to an img of 256 gray levels
%input: img is of 4096 gray levels
%output: bmp is of 256 gray levels
img=double(img);
bmp=uint8(floor(img/16));
%imshow(bmp);
本文介绍了一种将4096灰度级别的图像转换为256灰度级别图像的方法。通过将输入图像的数据类型转换为double,并使用floor(img/16)进行下取整操作,实现了灰度级的有效减少。
1168

被折叠的 条评论
为什么被折叠?



