I want to extract the least significant bit (LSB) of each pixel in an image. I want to know what is the value of LSB in each pixel, whether it is 1 or 0. How do I do this in MATLAB?
You can use the bitget
function and specify the bit position of 1, denoting the LSB of each pixel. Assuming your image is stored in A
, simply do:
B = bitget(A, 1);
B
will be the same size as A
which tells you the LSB of each pixel in the image.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments