clc
close all

% Read Image A that is an image of an ellipse
% Convert Image A to a binary image
mybinaryimageA = im2bw(myimageA);

% Convert Image B to a binary image

% Display the Original Image A

subplot(4,2,1)
imshow(mybinaryimageA),title('Binary Image - Image A ');

% Display the Original Image B

subplot(4,2,2)
imshow(mybinaryimageB),title('Binary Image - Image B');

% Take a complement of Image A and Display it

subplot(4,2,3)
resultor= ~mybinaryimageA ;
imshow(mat2gray(resultor)), title('Complement of Image A');

% Take a Ex-OR of Image A and Image B and Display it

subplot(4,2,4)
resultxor= xor(mybinaryimageA,mybinaryimageB);
imshow(mat2gray(resultxor)), title('Image A XOR Image B');

% Take OR of Image A and Image B and Display it
subplot(4,2,5)
resultor= mybinaryimageA | mybinaryimageB;
imshow(mat2gray(resultor)), title('Image A OR Image B ');

% Take AND of Image A and Image B and Display it
subplot(4,2,6)
resultand= mybinaryimageA & mybinaryimageB;
imshow(mat2gray(resultand)), title('Image A AND Image B ');

% Read a coour image and convert it to 8 bit grey level image

subplot(4,2,7)
mygrayimg = rgb2gray(mycolourimg);
subimage(mygrayimg),title('Original Grey Image');
axis off; axis equal;

% Extract seventh plane and display it
subplot(4,2,8)
planeimg = double(mygrayimg);
k = 128;
mysevengreyimg = mod(floor(planeimg/k),2);
imshow(mysevengreyimg),title('Seventh Plane');

MATLAB CODES - Logical Operations and Bit plane Slicing Reviewed by Suresh Bojja on 9/11/2018 03:08:00 AM Rating: 5

## Subjects & Labs

AC (6) ADS (2) ATMEL (6) AWP (5) C- Language (3) CAO (5) CDAC (1) CMC (6) CN (10) Control Sys (2) CVSM (2) DBMS (1) DC (5) DIP (17) DLD (10) DS (4) DSD&DICA (9) DSP (6) EDC (45) Embedded (7) EMWTL (6) ENERGY AUDIT (1) Engg.Chemistry (11) Faculty Labs (1) Fuzzy (3) II MID (1) LICA (1) Linux OS (1) Materials (1) MATLAB (27) MCU IDE 8051 (1) MEMS (4) MPMC (57) MTECH (6) MWE (2) OC (1) PDC (9) Projects (8) RADAR (1) Research (9) RVSP (3) SC (1) Softwares (1) SS (2) STLD (19) TCSS (1) TSSN (1) TV Engg (1) VHDL (4) VLSI (8) WCN (1) WSN (2)