Use all the logic operators discussed previously to darken an image only within a region of interest. Would pixel-by-pixel division be a better way to find the differences between two monochrome images than subtraction, absolute difference, or XOR? Explain.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Use all the logic operators discussed previously to darken an image only within a region of interest.

Would pixel-by-pixel division be a better way to find the differences between two monochrome images than subtraction, absolute difference, or XOR? Explain.

Logic operators are often used for image masking. We will use the roipoly function to create the image mask.
Once we have a mask, we will use it to perform logic operations on the selected image.
* Use the roipoly function to generate a mask for the pout image.
I = imread ('pout.tif');
SWhat class is the variable bw?
bw = roipoly (I);
Convert the mask image to class uint8.
bw2 = im2uint8 (bw) ;
Use the bitand function to compute the logic AND between the original image and the
new mask image.
12 = bitand (I, bw2);
SWhat happens when we logically AND the two images?
imshow (I2);
SUse the bitcmp function to generate a complemented version of the bw2 mask.
bw_cmp
figure
subplot (1,2,1), imshow (bw2), title('Original Mask');
subplot (1,2,2), imshow (bw_cmp), title ('Complemented Mask');
Use bitor to compute the logic OR between the original image and the complemented
mask.
bitcmp (bw2) ;
bitor (I,bw_cmp);
figure, imshow (I3)
13
SWhy did we need to complement the mask? What would have happened if we used the
original mask to perform the OR operation?
*The XOR operation is commonly used for finding differences between two images.
$Close all open figures and clear all workspace variables.
SUse the bitxor function to find the difference between two images.
close all ;clear;clc;
I = imread ('cameraman.tif');
12 =
imread ('rice.png');
I_xor = bitxor (I,12);
figure
subplot (1,3,1), imshow (I), title (' Image 1');
subplot (1,3,2), imshow (12), title ('Image 2');
subplot (1,3,3), imshow (I_xor, []), title ('XOR Image');
Transcribed Image Text:Logic operators are often used for image masking. We will use the roipoly function to create the image mask. Once we have a mask, we will use it to perform logic operations on the selected image. * Use the roipoly function to generate a mask for the pout image. I = imread ('pout.tif'); SWhat class is the variable bw? bw = roipoly (I); Convert the mask image to class uint8. bw2 = im2uint8 (bw) ; Use the bitand function to compute the logic AND between the original image and the new mask image. 12 = bitand (I, bw2); SWhat happens when we logically AND the two images? imshow (I2); SUse the bitcmp function to generate a complemented version of the bw2 mask. bw_cmp figure subplot (1,2,1), imshow (bw2), title('Original Mask'); subplot (1,2,2), imshow (bw_cmp), title ('Complemented Mask'); Use bitor to compute the logic OR between the original image and the complemented mask. bitcmp (bw2) ; bitor (I,bw_cmp); figure, imshow (I3) 13 SWhy did we need to complement the mask? What would have happened if we used the original mask to perform the OR operation? *The XOR operation is commonly used for finding differences between two images. $Close all open figures and clear all workspace variables. SUse the bitxor function to find the difference between two images. close all ;clear;clc; I = imread ('cameraman.tif'); 12 = imread ('rice.png'); I_xor = bitxor (I,12); figure subplot (1,3,1), imshow (I), title (' Image 1'); subplot (1,3,2), imshow (12), title ('Image 2'); subplot (1,3,3), imshow (I_xor, []), title ('XOR Image');
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY