Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Solve using MATLAB, using any picture is fine Problem 4 - Color Image Processing A color image is just a composition of 3 separated 2D
Solve using MATLAB, using any picture is fine
Problem 4 - Color Image Processing A color image is just a composition of 3 separated 2D matrices that corresponding to color channels of red, green, and blue. For example, the following color image is a composition of 3 separated images: Original Red Green When we process the colored image, we simply need to process each color image separately. For example, if we want to flip the colored image vertically, we just need to flip each color image vertically. The first step is to load color the image, colorcats.jpg using imread, labeling it as ALLimg. The image should look like this: To access each color image, you can use the following MATLAB indexing: 1. REDimg = ALLimg (:,:,1); 2. GRNimg = ALLimg (:,:,2); 3. BLUimg = ALLimg (:,:,3); Now, it is your job to perform the following image processing tasks: Gray color image This task is to create a gray-scaled color image from the original colored image. The gray-scaled color image is a 2D matrix where each pixel is computed by the following formula: grayimgl,j) = 0.21 REDimg1. j) +0.72 GR Nimei.) -0.01 * BLUimgi. 1) Use imshow to check the result. Negative Image This task is similar to the negative image from the previous problem. You will need to subtract each pixel's color from 255 for all three color images. Since the negative image is a 3D matrix, once you have "negatived" all three color images, you will need to compose them together by using MATLAB code: NEGimg (:,:,1) - redMIG; NEGImg (:,1,2) - greenG; NEGimg (:,:,3) - bluet) ; Sepia The last task is to create Sepia color effect. Here is the sepia color effect for the original cat image. To achieve this effect, you need to perform the following (standard) calculation for each color image: SEP REDime(8.) 0.393. REDimg (1.1) -0.769.GRNimg(1) 0.189.BLUimg(1,1) SEP GRNimg(1.1) 0.349.REDimg (1.1) +0.686.ORNimg (11)-0.16 8. BLUimg(1,1) SEP BLUimg(1.1) -0.272. REDimg (1.1) 0.534. GRNimg (1.)+0.131.BLUimg(1,1) It is possible that some pixels value may exceed 255, you need to use min commands to set the color value back to 255. Use this MATLAB code: SEPimg (1,1,1) - min (SEP REDimg 255); SEPimg (1,1,2) - min (SEP GRNimg 255); SEPimg (t.1.3) - min (SEP BLUimg, 255) Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started