Write a function that takes three strings as input, redFile, greenFile and blueF
ID: 3572822 • Letter: W
Question
Write a function that takes three strings as input, redFile, greenFile and blueFile, and returns a single output, compImg, an m times n times 3 uint8 as an output. It should do the following: a. Use csvread to import the data from redFile, greenFile and blueFile, and assign that data to three variables. You can assume that each file contains an m times n matrix of numbers. b. Convert the data from each file into the uint8 data type. c. compImg should be color image containing the converted data from redFile as the red component of the image, the converted data from greenFile as the green component of the image, and the converted data from blueFile as the blue component of the image.Explanation / Answer
function compImg = convertimage(redFile, greenFile, blueFile)
red = uint8(csvread(redFile));
green = uint8(csvread(greenFile));
blue = uint8(csvread(blueFile));
compImg = cat(3, red, green, blue);
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.