Question: (MATLAB) In this problem, you will create two function files that both perform the same task turning a color image into a black and white

(MATLAB)

In this problem, you will create two function files that both perform the same task turning a color image into a black and white image based on a given threshold value. Every pixel in the original image that is brighter than the threshold value should be set to white. Every pixel in the original image that is darker than the threshold value should be set to black. Assume that pixel brightness is represented by the average of the R, G and B values.

Your ThresholdImage1.m should utilize logical arrays to do the image processing. Your ThresholdImage2 function should use nested for loops to do the image processing. Both functions will have the same inputs and output:

Inputs: (1) RGB image array, (2) scalar threshold value

Output: Modified RGB image array

In a new cell in your HW10.m script:

Read in an image (of your choice, or you can download and use BB-8.jpg from Canvas)

Call your ThresholdImage1 function

Display the original and thresholded images side-by-side in a single figure window

Call your ThresholdImage2 function

Display the original and thresholded images side-by-side in a new figure window

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!