It's very simple. Use numpy slicing.

import cv2
img = cv2.imread("lenna.png")
crop_img = img[y:y+h, x:x+w]
cv2.imshow("cropped", crop_img)
cv2.waitKey(0)

opencv-python · PyPI

https://pypi.org/project/opencv-python/

cv2 (old interface in old OpenCV versions was named as cv ) is the name that OpenCV developers chose when they created the binding generators. This is kept as ...

OpenCV-Python Tutorials - OpenCV

https://docs.opencv.org/4.x/d6/d00/tutorial_py_root.html

Learn how to setup OpenCV-Python on your computer! Gui Features in OpenCV. Here you will learn how to display and save images and videos, control mouse ...

OpenCV: Home

https://opencv.org/

OpenCV provides a real-time optimized Computer Vision library, tools, ... C++, Python and Java interfaces support Linux, MacOS, Windows, iOS, and Android.

OpenCV with Python Intro and loading Images tutorial

https://pythonprogramming.net/loading-images-python-opencv-tutorial/

Python Programming tutorials from beginner to advanced on a massive variety of topics. All video and text tutorials are free.

How to crop an image in OpenCV using Python - Stack Overflow

https://stackoverflow.com/questions/15589517/how-to-crop-an-image-in-opencv-using-python

It's very simple. Use numpy slicing. import cv2 img = cv2.imread("lenna.png") crop_img = img[y:y+h, x:x+w] cv2.imshow("cropped", crop_img) cv2.waitKey(0).

Py之cv2cv2库(OpenCVopencv-python)的简介、安装、使用方法 ...

https://zhuanlan.zhihu.com/p/150124330

2020年6月22日 ... Py之cv2cv2库(OpenCVopencv-python)的简介、安装、使用方法(常见函数、方法等)最强详细攻略目录关于OpenCV简介OpenCV应用领域1、计算机视觉领域 ...

OpenCV - Ask OpenCV Questions, Get OpenCV Answers

https://forum.opencv.org/

OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning (AI) ... Opencv python move mouse cursor rectangles.