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.
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.
Chapter6: Using Arrays
Section: Chapter Questions
Problem 6E
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.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fe7a63be4-45a1-4557-a5fb-4d0b817f24b8%2Feac98b7b-2de2-439e-875b-b9f80c9c4cfe%2Fbfal94v_processed.jpeg&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
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.Recommended textbooks for you
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT