Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to crop image read by opencv

# Import packages
import cv2 as cv
import numpy as np
 
img = cv.imread('test.jpg')
print(img.shape) # Print image shape
cv.imshow("original", img)
 
# Cropping an image
cropped_image = img[80:280, 150:330]
 
PREVIOUS NEXT
Tagged: #crop #image #read #opencv
ADD COMMENT
Topic
Name
7+2 =