The MATLAB Code is as follows:
clc
clear all
close all
image=imread('D:\images.jpg');
R=image(:,:,1); % extract RED Channel
G=image(:,:,2); % extract GREEN Channel
B=image(:,:,3); % extract BLUE Channel
minR=min(R,[],'all'); % find the minimum pixel value of R
maxR=max(R,[],'all'); % find the maximum pixel value of R
minG=min(G,[],'all'); % find the minimum pixel value of G
maxG=max(G,[],'all'); % find the maximum pixel value of G
minB=min(B,[],'all'); % find the minimum pixel value of B
maxB=max(B,[],'all'); % find the maximum pixel value of B
% display the three color channels in the same horizontal line
using subplots
subplot(1,3,1),imshow(R),title(sprintf('Minimum R = %d\n Maximum R
= %d',minR,maxR));
subplot(1,3,2),imshow(G),title(sprintf('Minimum G = %d\n Maximum G
= %d',minG,maxG));
subplot(1,3,3),imshow(B),title(sprintf('Minimum B = %d\n Maximum B
= %d',minB,maxB));
figure,imagesc(image); % display the color image using
imagesc
[x,y]=ginput(1); %accept using input on coordinates of eye
x=ceil(x); % convert the decimal coordinate to integer value using
ceil function
y=ceil(y);
% draw a square of size 10 x 10 around the center coordinates of
the eye
for i=x-10:x+10 % from x - 10 to x + 10
for j=y-10:y+10 % from y - 10 to y +
10
image(j,i,1)=255;
% make red value 255
image(j,i,2)=0; %
make green value 0
image(j,i,3)=0; %
make blue value 0
end
end
figure,imagesc(image); % display the modified image
OUTPUT:
USE MATLAB TO SOLVE 1. Snap a close-up color picture of a person with your phone...
the picture above is the one you are supposed to use for the MATlab code please help Problems. Grayscale images are composed of a 2D matrix of light intensities from O (Black) to 255 (White). In this lab you will be using grayscale images and do 2D-array operations along with loops and iflelse branches. 1. We can regard 2D grayscale images as 2D arrays. Now load the provided image of scientists at the Solvay Conference in 1927 using the imread)...