Challenge

Project 1

OBJECTIVE: Perform rotation of the given image by 140 degrees & followed by scaling down the rotated image by 50% & finally crop the original image only to the subject in the image

SOLUTION PROCEDURE:

  • We read the image by imread() from open cv
  • We rotate the image with the inputs of angle as 140 degrees & scale as 1 to the functions warpaffine() & getRotationMatrix2D() , with centre of image as centre of the rotation
  • We scale down the rotated image by 50% with the help of use of resize() from open cv.
  • We crop the original image with the help of the user defined function crop_image() where the input dimensions of the crop window is manually adjusted to focus only on the subject of the image.
  • All these modified images are saved in the same folder by the help of the imwrite() from open cv

CODE & OUTPUT: Jupyter notebook attached

Rotated image:

Scaled image of the rotated image:

Cropped image (focusing on the subject of the image):

Calculations of the scaling down image:

CONCLUSION:

Objective of the project is satisfied by modifying the image & saving the modified files.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.