Page 1 of 1

A. (WARMUP] Implement the function empty that takes nrows (the number of cow's of pixels), and cols the number of pixels

Posted: Fri Apr 29, 2022 6:47 am
by answerhappygod
A Warmup Implement The Function Empty That Takes Nrows The Number Of Cow S Of Pixels And Cols The Number Of Pixels 1
A Warmup Implement The Function Empty That Takes Nrows The Number Of Cow S Of Pixels And Cols The Number Of Pixels 1 (71.28 KiB) Viewed 35 times
A. (WARMUP] Implement the function empty that takes nrows (the number of cow's of pixels), and cols the number of pixels in each rows as inputs. It outpuls a lux of size nrows by ncols with all its elements equal to zero 12 marks Acolourell image (RGB image is intensity of every pixel for the three channels, namely real, geen, and blue. Every pixel value is a decimal number between Valid 1. O quantities the channel at its lowest intensity and I quantifies the channel at its highest intensity. Cursinler an example of 3 x 3 coloured image imagel - 11.3, 1, 1). 1a, 9.6, 0.6l. 10, 5, ill. [[0, 1, D], [0, 0.6, 6.3], [0, 0, 0.5]]. [[0, 1, 0.2] (0.3, 0.6, 0], [0, 0, 0]] 1 Here. image1[0] represents the red channel, i nagel[1] represents the green channel and image1[2] represents the blue channel. 1010sPrint provides it feature lo convert an RGB image into a grayscale inage. The value of cuch pixel in a grayscale image is the average of the intensities of rexi, green, and blue chuncls for the same pixel B. [EASY] Implement the function rgb to grayscale that takes an RGR image as the japul and relumns il dew grayscale representation of the image ยป rgb to grayscale inagel) 10.1, 1, 0.4), 10.1, 0.1, 0.3). 10, , 0.5] 14 marks) NOTE: We will only work with grayscale images hereafter. We represents every pixel by a pair (r, c), which denotes and column index of the pixel in the image. 1010sPaint provides a feature to crop an image to a desired shape fruen al specified it, t. C. [EASY] Implement the function crop that takes image, r, c. nrows. ncals as agu- mients. Il slites crupping the innige luer le pixel al ir, c) indreturns the cropped rows by ncols intage Consider a sample execution given below: