Practical Exercise 2: Image Colours Learning Outcomes Upon successful completion of this practical task you will be able

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Practical Exercise 2: Image Colours Learning Outcomes Upon successful completion of this practical task you will be able

Post by answerhappygod »

Practical Exercise 2 Image Colours Learning Outcomes Upon Successful Completion Of This Practical Task You Will Be Able 1
Practical Exercise 2 Image Colours Learning Outcomes Upon Successful Completion Of This Practical Task You Will Be Able 1 (62.44 KiB) Viewed 31 times
Practical Exercise 2 Image Colours Learning Outcomes Upon Successful Completion Of This Practical Task You Will Be Able 2
Practical Exercise 2 Image Colours Learning Outcomes Upon Successful Completion Of This Practical Task You Will Be Able 2 (58.79 KiB) Viewed 31 times
Practical Exercise 2 Image Colours Learning Outcomes Upon Successful Completion Of This Practical Task You Will Be Able 3
Practical Exercise 2 Image Colours Learning Outcomes Upon Successful Completion Of This Practical Task You Will Be Able 3 (56.13 KiB) Viewed 31 times
Practical Exercise 2 Image Colours Learning Outcomes Upon Successful Completion Of This Practical Task You Will Be Able 4
Practical Exercise 2 Image Colours Learning Outcomes Upon Successful Completion Of This Practical Task You Will Be Able 4 (56.24 KiB) Viewed 31 times
Practical Exercise 2: Image Colours Learning Outcomes Upon successful completion of this practical task you will be able to: • Apply a problem-solving methodology to create a computer solution that changes the colours in an RGB colour image. Become familiar with the structure and flow of conditional and iterative statements in MATLAB. Introduction to the practical Background of colour replacement: In photography and video applications colour replacement is a useful tool. In photography this technique could be used to change a colour in a photograph to another colour, for example changing the colour of a red chocolate wrapper to blue (below). In video applications similar techniques are used to replace a block of colour in a video stream (such as green or blue) to a completely different background or image, this is called chroma- keying or 'green-screening and is how the weather is often performed on the news; the weather presenter is usually standing in front of a green-screen and the green is replaced with a weather map, which is what you see on your television.
The RGB colour-space: To understand how this is possible we need to understand how colour is represented on a computer (and in MATLAB). The most common way colour is represented is using what's known as the RGB colour-space (R = red, G = green, B = blue). When looking at an image on a computer screen it will be made up of rectangular light elements called pixels (a portmanteau of 'picture elements), the colour of these pixels will be determined by the ratios of red, green and blue light being emitted by the screen. For example, a pure red pixel would be emitting red light only (red turned on), while the green and blue light would be turned off. Cyan (greeny-blue) would have red light turned off with roughly equal parts green and blue light being emitted. Below are the primary and secondary light colours and their RGB values; 255 represents 100% on, 0 represents completely off. Green Yellow White Black R=0 R=255 R=255 R = 0 G-255 G = 255 G - 255 o=0 BO B=0 B-0 B-255 Cyan R-O G=255 B-255 Red R - 255 G - 0 B=0 Blue R = 0 Magenta oo R = 255 B - 255 G-0 B = 255 Figure 1: Primary and secondary colour wheel and RGB values.
On top of this you also have shades, pixels are not just binary 'on' or 'off' elements but can be dimmed or brightened to emit more or less light to create many different colours and shades, this is shown below for pure red pixels. Figure 2: Pure red pixels. R value is increasing from 0 - 255 from left to right, Gand B values are set to zero throughout Part 1: Designing a colour change program For this prac you'll be designing a program that: a. Prompts a user to specify a colour they want to change in an image, b. Iterates through the image and changes all pixels of that colour to black, and c. Displays the resultant image in a new figure window. The image you will be using is shown in figure 3 and is an image of plastic chips called coloredChips.png. This image is an in-built image in MATLAB available through the Image Processing Toolbox Figure 3: 'colored Chips.png' image.
Task 2 - Specify your input and output data Exercise: Using the information given on the previous page determine the input you have/need to solve the problem and what you need to output to accomplish the objective. The image you'll be using for this task is 'coloredChips.png' in the Image Processing Toolbox) so use MATLAB to import this image into your Workspace if you need so you can give details about the data-type, etc of the file. Use Table I in the appendix of this guide for the syntax for importing images. Points to be addressed: - What data type is the matrix in your Workspace? - What are the dimensions of the matrix shown in the Workspace? Explain what each dimension represents, especially the third dimension which will equal 3. Use the data cursor on your figure (Tools -> Data Cursor) to get an idea of the RGB values for all the different coloured chips in the image, explain how that will relate to the task you are to complete. Also think about what you will need to output to fulfil this task, (numbers, words, images, graphical output?). Describe this in detail. What assumptions are you making (if any) to help you solve/simplify
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply