Please define this function to do the following:
It extracts a single color out of the RGB values of the color image and returns this layer as
a grayscale image. Input image should not be altered in any way.
Parameters: image (3D list of int) is the color image, color (string) is either 'red' or 'green' or
Return value: A 2D list of int
extract_layer([ [[1,0,4], [8,0,9],[3,1,3]],
[[0,0,6], [2,8,3],[5,4,3]] ], 'red') → [[1,8,3], [7,4,7], [0,2,5]]
You are not allowed to import anything.
You are not allowed to use recursion, classes, exceptions, and list comprehensions
From the built-in functions, you are allowed to use: range(), len(), sorted(), int(), sum()
From list methods, you are allowed to use:
Recently Asked Questions
- Please refer to the attachment to answer this question. This question was created from project2.pdf. Additional comments: "Need help approaching this problem.
- CarClass Design a class namedCarthat has the following fields: yearModel : TheyearModelfield is anIntegerthat holds the car's year model. make : Themakefield
- I need python code for this: Attribute : fuel max capacity is 15 gallons __ init __ takes in a value for fuel; default value would be the max capacity fillOne