Description
19AIE303 – Signal and Image Processing
Assignment 1
Use OpenCV library to do the following:
1. a) Open the given colour image ‘Lenna.png’, convert it to grayscale and save as ‘grayLenna.jpg’.
b) In the code comment: a) How many grayscale shades can be represented in this image? And b) What does it depend on?
c)Change the image to contain four grayscale shades in all. Equally space these four values (white, two equally spaced grays and black). Save this image as gray4Lenna.jpg.
2. Open the image ‘calvinHobbes.jpeg’. The size is 225×225. Scale it up to 450×450 and save the scaled image as ‘chScaled.jpg’.
cv2.cvtColor() cv2.resize()
cv2.imwrite() → to save the output file
What to submit:
1. A single python file containing code and comments for both the questions. Demarcate both questions using comments
2. Output images from both question
Reviews
There are no reviews yet.