Skip to content

Instantly share code, notes, and snippets.

@saurabhpal97
Created March 23, 2019 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saurabhpal97/f00cc406dc9a8feb29d31b5d277ab014 to your computer and use it in GitHub Desktop.
Save saurabhpal97/f00cc406dc9a8feb29d31b5d277ab014 to your computer and use it in GitHub Desktop.
#importing the required libraries
import numpy as np
import cv2
import matplotlib.pyplot as plt
%matplotlib inline
image = cv2.imread('index.png')
rows,cols = image.shape[:2]
#(col/2,rows/2) is the center of rotation for the image
# M is the cordinates of the center
M = cv2.getRotationMatrix2D((cols/2,rows/2),90,1)
dst = cv2.warpAffine(image,M,(cols,rows))
plt.imshow(dst)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment