cropping task done

This commit is contained in:
2023-11-06 20:26:39 +02:00
parent 9da0a5987e
commit c816288032
3 changed files with 22 additions and 0 deletions

22
croppers/crop.py Normal file
View File

@@ -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)