Matlab problem Electronic images are composed of three colors, red, green, and b
ID: 3841104 • Letter: M
Question
Matlab problem
Electronic images are composed of three colors, red, green, and blue. The color values are stored in a three dimensional matrix. In this project 7 images of color squares will be examined for the quantity and position of each color square in the image.
A GUI (graphical user interface) will be created to allow for the demonstration that the program reads all of the images.
The GUI must:
The total amount of squares in each image
A graph that displays image number versus quantity of squares
An alert of which color squares are missing in each image
Run the program
The program must:
Read all of the images
Interact with the GUI inputting and outputting pertinent information
Use your own algorithm to find and count the color pieces.(no commands from the image processing toolbox may be used.)
Explanation / Answer
X-imread('Hello.jpg');
R = X(:,:,1);
image(R), colormap([[0:1/255:1]', zeros(256,1), zeros(256,1)]), colorbar;
%Green Component
G = X(:,:,2);
figure;
image(G), colormap([zeros(256,1),[0:1/255:1]', zeros(256,1)]), colorbar;
%Blue segment
B = X(:,:,3);
figure;
image(B), colormap([zeros(256,1), zeros(256,1), [0:1/255:1]']), colorbar