How to Crop an Image in OpenCV

Machine Learning courses with 100+ Real-time projects Start Now!!

Program 1

import cv2
img=cv2.imread("D://opencvapp//library-img.jpg")
#print(img)
# img3=img[100:200,100:1000]
# cv2.imwrite("D://opencvapp//crop.jpg",img3)
cv2.imshow('Image Window',img3)
cv2.waitKey(0)
cv2.destroyAllWindows()

 

Did we exceed your expectations?
If Yes, share your valuable feedback on Google

courses

TechVidvan Team

TechVidvan Team provides high-quality content & courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.

Leave a Reply

Your email address will not be published. Required fields are marked *