diff --git a/croppers/crop.py b/croppers/crop.py new file mode 100644 index 0000000..43304c7 --- /dev/null +++ b/croppers/crop.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +import cv2 +import matplotlib.pyplot as plt + +#reading image +img = cv2.imread('img3.jpg') +print("Original Image") +cv2.imshow('image',img) +cv2.waitKey(0) + +#Defining boundaries +print(img.shape) +left = 350 +top = 50 +right = img.shape[1] - 100 +bottom = img.shape[0] - 200 + +#cropping image +cropped = img[top:bottom, left:right] +print("Cropped image") +cv2.imshow('image',cropped) +cv2.waitKey(0) diff --git a/croppers/img1.jpg b/croppers/img1.jpg new file mode 100644 index 0000000..84daddb Binary files /dev/null and b/croppers/img1.jpg differ diff --git a/croppers/img3.jpg b/croppers/img3.jpg new file mode 100644 index 0000000..0b3120e Binary files /dev/null and b/croppers/img3.jpg differ