Question: Greyscale The Greyscale function converts the supplied RGB colour image to a greyscale version by apply - ing a ratio of colours for each pixel.

Greyscale
The Greyscale function converts the supplied RGB colour image to a greyscale version by apply-
ing a ratio of colours for each pixel.
Input:
An m-by-n-by-3 uint 8 array representing an RGB colour image.
Output:
An m-by-n-by-1 uint 8 array representing a greyscale image.
Suppose we have a colour image stored in the 3D uint 8 array named picture. Layers 1,2, and
3 represent the red r, green g, and blue b pixel intensities, respectively.
To convert the image from colour to greyscale, we would use the Greyscale function to return a
greyscale image (as the 2D uint 8 array greyscale_picture) as follows:The Greyscale function will need to calculate a grey pixel value p_(g) for each pixel in the colour
image, using the corresponding (r,g,b) value of each pixel and applying the following ratio ?1 :
r:g:b=3:5:1
For example, at pixel position (1,1), we might have (r,g,b)=(200,55,80). Applying our ratio
would result in the value:
pg(1,1)=39200+5955+1980
=106.111dots
So pixel (1,1) has the value 106 in the output greyscale image.
Note: We must round the pixel value to the nearest integer. Make sure you don't round individual
weighted colours prematurely!
Need Matlab code
Greyscale The Greyscale function converts the

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 Programming Questions!