Question: The following MATLAB code increases the brightness of a gray image by adding 50 to each image pixel. Update this code without using the
The following MATLAB code increases the brightness of a gray image by adding 50 to each image pixel. Update this code without using the for-loop (i.e., you can just replace the for-loop with your own codes). You do not need to change a pixel value which is greater than 255 to 255. clear all; img imread ('hsv.jpg'); [rows, cols, dim] = size (img); output zeros (size (img)); for i=1: rows end for j = 1: cols output (i, j,1) output (i, j, 2) output (i, j,3) end = img (i, j,1)+50; = img (i, j, 2)+50; = img (i, j,3)+50; imshow (uint8(output));
Step by Step Solution
3.38 Rating (154 Votes )
There are 3 Steps involved in it
You can achieve the same result without using a forl... View full answer
Get step-by-step solutions from verified subject matter experts
