Your task is to write a MATLAB code that reads an image and apply a filteration of pixels based on color. Your code should be capable of importing an image called 'colors' and apply a condition at each pixel regarding the level of red color (channel 1): > If red level is higher than 200 then change it to 255, and change green (channel 2) and blue (channel 3) levels to 0. If red level is less than 200 then change it to 0, and change green and blue levels to 0.

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 17RQ
icon
Related questions
Question

https://drive.google.com/drive/folders/1kAkWGHuZFADKBaKoy1eA4OYsxqykLXX7

Task 6
You can process images in MATLAB, the image is just an array with three dimensions. Row and column dimensions define the
location of each pixel. The third dimension (channel) defines the color using the RGB definition (i.e., 3 channels). For a specific
pixel, the combination of numbers in channel dimension will define the color of that pixel.
Here is a general illustration of the array.
row
1 2
1
column
1
channel
Your task is to write a MATLAB code that reads an image and apply a filteration of pixels based on color. Your code should be
capable of importing an image called 'colors' and apply a condition at each pixel regarding the level of red color (channel 1):
If red level is higher than 200 then change it to 255, and change green (channel 2) and blue (channel 3) levels to 0.
If red level is less than 200 then change it to 0, and change green and blue levels to 0.
Hints:
Download the image "colors" from: https://drive.google.com/drive/folders/lkAkWGHuZFADKBaKoyleA40YsxqykLXX7
Read the image into your MATLAB code using the command imread.
Apply two FOR loops to scan pixels, then apply proper IF statements regarding the level of channel 1 (the red layer).
Modify each pixel per the condition described above.
Display the new modified image using the command imshow.
Transcribed Image Text:Task 6 You can process images in MATLAB, the image is just an array with three dimensions. Row and column dimensions define the location of each pixel. The third dimension (channel) defines the color using the RGB definition (i.e., 3 channels). For a specific pixel, the combination of numbers in channel dimension will define the color of that pixel. Here is a general illustration of the array. row 1 2 1 column 1 channel Your task is to write a MATLAB code that reads an image and apply a filteration of pixels based on color. Your code should be capable of importing an image called 'colors' and apply a condition at each pixel regarding the level of red color (channel 1): If red level is higher than 200 then change it to 255, and change green (channel 2) and blue (channel 3) levels to 0. If red level is less than 200 then change it to 0, and change green and blue levels to 0. Hints: Download the image "colors" from: https://drive.google.com/drive/folders/lkAkWGHuZFADKBaKoyleA40YsxqykLXX7 Read the image into your MATLAB code using the command imread. Apply two FOR loops to scan pixels, then apply proper IF statements regarding the level of channel 1 (the red layer). Modify each pixel per the condition described above. Display the new modified image using the command imshow.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Files and Directory
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning