Paddedgray Img B Write Python Function Paddedgray Given Color Image Img Converts Image Gra Q37041720

paddedGray (img, b)

Write the python function paddedGray that, given a color imageimg, converts the image to grayscale, and pads the image with ablack border b pixel wide. It returns this grayscale image. Thetype of each pixel of the grayscale image should be the same as thetype of each pixel of the original color image. The grayscaleconversion of a pixel should use the following luminanceformula:

luminance = 0.2126R + 0.7152G + 0.0722*B

**Notice how green is dominant, an interesting property ofluminance.


Solution


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.