Question: Create and Implement a function named rgb26cc() in MATLAB to convert any given RGB color image to corresponding 6-bit color coded image. The function will

Create and Implement a function named rgb26cc() in MATLAB to convert any given RGB color image to corresponding 6-bit color coded image. The function will take an RGB color image as its input. The function should convert RGB values of each pixel in the input to the corresponding 6-bit color code.

Questions

1. Create a MATLAB function named rgb26cc(), which takes one input parameter: (1) imRGB (an RGB color image)

The rgb26cc() function should return a 6-bit color coded image matrix named im6CC with the same height and width of the original RGB color image.

2. Implement RGB to 6-bit color code conversion according to the procedure introduced in the class. Please notice that the procedure converts only one pixel at a time, and thus, you must do one of the following ways for converting the entire image. Create a nested loop to read RGB values for each pixel in imRGB and convert the RGB values to corresponding 6-bit color code. Create a new matrix of the same height and width and write the 6-bit color code to the corresponding location in the new matrix im6CC. The intuitive version is easy to understand but will be extremely slow when processing a large image.

3. In addition, you need to create a MATLAB script named hw10.m to demonstrate the usage of the rgb62cc () function. In particular, in the script you need to

a. Read the color image provided (Hanfu_Libra.jpeg) and store pixel values in a variable (imC)

b. Call rgb26cc() to convert RGB color image stored in imC to corresponding 6-bit color coded image as imG.

c. Display the original color image and 6-bit color coded image side-by-side in a Figure Window where the original color image is shown on the left and the 6-bit color coded image is shown in the right. (Please notice that when display 6-bit color coded image using imshow() you should see a dark image due to the fact that the intensity range of the 6-bit color code is from 0 to 63. To better visualize a 6-bit color coded image, you can look up the imshow() function in MATLAB help file to specify the display range.)

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!