Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code in MATLAB Introduction RGB color images in MATLAB are a 3-D arrays, split into 3 layers: Red, Green and Blue corresponding to the first,

Code in MATLAB

image text in transcribed

image text in transcribed

Introduction RGB color images in MATLAB are a 3-D arrays, split into 3 layers: Red, Green and Blue corresponding to the first, second and third array layers, respectively. In this project, an image of Rubic cube is given and you will have to swap colors in this image. Part 1 Load an image of Rubic cube to the workspace from the file "Rubik_cube.png". Images are loaded using the command imread('lmage_name.png). Assign the 3-D array to a variable for further processing. Part 2 Write a function called swap to implement the color swapping process. function out swap(in, c1, c2) %% your work here % ci are layers to swap, the values of which are 'R, 'G' and 'B. % in is the input image, the original Rubic cube. % out is the output color swapping image. end In this function, use two switches to determine which colors need to be swapped assigning numbers 1 to 3 to a variable that describes the layer. Create the output image by exchanging the colors from the input imge. Third, make sure the layer that remains without change is saved into the output image. . Part 3 Consider all the swapping cases and generate the corresponding figures. There are three switching cases: swapping red and green, swapping red and blue, swapping green and blue Use subplot to generate the figures of original cube and three swapping cases. The swapping images should be generated by calling function defined in part 2. Here is an example: figure; subplot(2,2,1) imshow(lmCube); title(Original); subplot(2,2,2) imshow(swap(ImCube,'R,'G')); title(Red/Green Swapped')

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Successful Keyword Searching Initiating Research On Popular Topics Using Electronic Databases

Authors: Randall MacDonald, Susan MacDonald

1st Edition

0313306761, 978-0313306761

More Books

Students also viewed these Databases questions

Question

2. What are the components of IT infrastructure?

Answered: 1 week ago