code in MATLAB Create two edge-detected images, the first with Sobel operators and the second with a
Laplacian filter. Compare the two images quantitatively. Report on your conclusions.
IMAGE1 – Given an input image (supplied with assignment, and using the two Sobel operators,
horizontal and vertical, create two intermediate images then ‘OR’ them together to create
IMAGE1. Don’t forget (i) derivatives can be both positive and negative so the absolute value of
the response must be taken and (ii) thresholding is needed to create a monochrome edgedetected image.
• IMAGE2 – Start with the same input grayscale image. Convolve with a 3×3 Laplacian kernel to
create IMAGE2. Again, don’t forget (i) second derivatives can be both positive and negative so
the absolute value of the response must be used and (ii) thresholding is needed to create a
monochrome edge-detected image.
For the quantitative analysis, compute the following values:
• TP2 is the number of edge pixels in IMAGE2 that are also edge pixels in IMAGE1
• FP2 is the number of non-edge pixels in IMAGE2 that are edge pixels in IMAGE1
• PRECISION2 = TP2/(TP2+FP2)
Now reverse the roles of IMAGE1 and IMAGE2 and, treating IMAGE2 as the predictor, determine how
well IMAGE1 performs. That is:
• TP1 is the number of edge pixels in IMAGE1 that are also edge pixels in IMAGE2
• FP1 is the number of non-edge pixels in IMAGE1 that are edge pixels in IMAGE2
• PRECISION1 = TP1/(TP1+FP1)
Hand in: (1) The code for the tasks, (2) iMAGE1, (3) IMAGE2, (4) a table of six values with rows labeled
TP, FP, and PRECISION, and columns labeled 1 and 2, and (5) a report described below