1. Engineering
  2. Computer Science
  3. matlab this should be the output please provide a good...

Question: matlab this should be the output please provide a good...

Question details

Matlab

. [4 points] Normalize image B to C, whose data type is double and whose values fall in the range of [O, 1]. Display image Con figure 3 with the message Normalized Grayscale Image as the figure title (Note: Image C should appear the same as the image B.) Raise each pixel in the upper quarter rows of image C to the power of 0.5 and raise each pixel in the lower quarter rows of image C to the power of 1.5. Keep the middle two quarter rows of image C unchanged. Store the result as an image (matrix) D. Display images D on figure 4 with the message Processed Grayscale Image as the figure title. Make sure that no loops are used to accomplish the task. On the Matlab console, explain the effects after applying the above two operations Save image D in jpg format to a file called X_D.jpg where X should be your first name. Open it using a standard image viewing program to verify that the image is saved properly Matlab Hint: double, L.J imwrite, display, disp,:

This should be the output:

Run and Run and Figure 3 File Edit View Insert Tools Desktop Window Help Wir Normalized Grayscale Image 但@yQa仚 he na ighter/whiter than the others while the last quarter rows are darker

nce Time Figure 4 File Edit View nset Tools Desktop Windo Help 실 Processed Grayscale Image

Please provide a good code this one does not work:

% Rean an image into A
A = imread('lena.jpg');

% Convert the image A into grayscale image B
B = rgb2gray(A);

% Normalize image B to C
C = im2double(B);

% Calculate the image matrix D
% Copy image matrix C into matrix D
D = C;
% Raise the upper quarte rows of image C to the power of 0.5
D(1:end/4, 1:end/4) = D(1:end/4, 1:end/4).^0.5;
D(end-end/4:end, end-end/4:end) = D(end-end/4:end, end-end/4:end).^1.5;

%Display the images
subplot(2, 2, 1);
imshow(A);
title('Original Image');
subplot(2, 2, 2);
imshow(B);
title('Grascale Image');
subplot(2, 2, 3);
imshow(C);
title('Normalized Image');
subplot(2, 2, 4);
imshow(D);
title('Processed Grayscale Image');

% Write image D to a file
saveas(gcf, 'D.jpg');

Screenshot of Output:

Figure 1 File EditView Insert Tools Desktop Window Help Original Image Grascale Image Normalized Image Processed Grayscale Image Type here to search 0只 ^ ヨ脈 ENG 28-01-2019 무

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution