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.

Python Extension Packages for Windows - Christoph Gohlke

http://rrurl.cn/30cQb4

... opencv; mkl-service; mkl_random; mkl_fft; curses; pyasn; rasterio; btrees; wordcloud; fastrlock; rtmidi-python; sounddevice; pyaudio; indexed_gzip ...

Blob Detection Using OpenCV ( Python, C++ ) |

https://learnopencv.com/blob-detection-using-opencv-python-c/

This beginner tutorial explains simple blob detection using OpenCV. C++ and Python code is available for study and practice.

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

Image Segmentation Using Color Spaces in OpenCV + Python ...

https://realpython.com/python-opencv-color-spaces/

In this introductory tutorial, you'll learn how to simply segment an object from an image based on color in Python using OpenCV. A popular computer vision ...