Question: Matlab question Do the gradient images look like you expect them too? Why or why not? What is missing from the above question and how
Matlab question
Do the gradient images look like you expect them too? Why or why not?
What is missing from the above question and how would you fix it?
commandwindow;
%imshow(checkerboard(20));
imwrite(checkerboard(20), 'checkerboard.jpg', 'JPEG');
myImage = imread('checkerboard.jpg');
Sx = [1 0 -1; 2 0 -2; 1 0 -1];
Sy = [1 2 1; 0 0 0; -1 -2 -1];
sobelXImage = conv2(double(myImage), Sx, 'same');
sobelYImage = conv2(double(myImage), Sy, 'same');
figure('Name', 'X gradient');
imshow(uint8(sobelXImage));
figure('Name', 'Y gradient');
imshow(uint8(sobelYImage));
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
