Question

1. Snap a close-up color picture of a person with your phone or download a picture of your preference in JPG format, transfer

USE MATLAB TO SOLVE

0 0
Add a comment Improve this question Transcribed image text
Answer #1

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

+P9e4mBiG+ZN5wAAAABJRU5ErkJggg==

OUTPUT:

Minimum R = 0 Maximum R = 255 Minimum G = 0 Maximum G = 244 Minimum B = 0 Maximum B = 240

160 180 50 100 150 200 250

Add a comment
Know the answer?
Add Answer to:
USE MATLAB TO SOLVE 1. Snap a close-up color picture of a person with your phone...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • the picture above is the one you are supposed to use for the MATlab code please...

    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)...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT