Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In Matlab Task 8 (20 points) Color swap: replace pixels of one color with another color, with some leniency function [ outImg ] color swap
In Matlab
Task 8 (20 points) Color swap: replace pixels of one color with another color, with some leniency function [ outImg ] color swap ( inImg, rl, gl, bl, r2, g2, b2, allowed) This function will create a new image outImg by swapping pixels of one color (defined by rl, g1, b1) with another color (defined by r2, g2, b2). When we did this example in class, we noticed it is hard to find many pixels of purely one exact color. Use the input variable allowed for setting the leniency criteria. For example, for r1-255, g1-0, b1-0 and allowed 10, every pixel with a red value above 245 and green and blue values below 10 should be changed to the RGE values specified by r2, g2, b2) Make sure the values entered by the user for rl, gl, bl, r2, g2, b2, allowed are within the boundaries for image intensities. Also, check that they are positive values. If they are not, display appropriate error messages and request the input of new values Choosing the Color Swap menu button should result in: a. Asking the user to input values for rl, gl, bl, r2, g2, b2, allowed, followed by a call to the color swap function, with the current image and the values of rl, gl, bl, r2, g2, b2, allowed as inputs. b. Displaying the original image and the resulting image, side by side (use subplots) c. Saving the resulting imageStep 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