% Compute mean in 4-by-4 blocks
kernel = ones(4);meanImage = conv2(double(grayImage), kernel, 'same') / numel(kernel);% Compare actual image to mean image.
bitImage = grayImage >= meanImage;
From the bitImage is it possible to get back grayImage
binary imageImage Processing Toolbox
% Compute mean in 4-by-4 blocks
kernel = ones(4);meanImage = conv2(double(grayImage), kernel, 'same') / numel(kernel);% Compare actual image to mean image.
bitImage = grayImage >= meanImage;
Best Answer