OpenCV Contrib Python

4.13.0.92 · active · verified Thu Apr 09

opencv-contrib-python provides Python bindings for the full OpenCV library, including extra modules not available in the base `opencv-python` package due to licensing or stability reasons (e.g., SIFT, SURF). It enables advanced computer vision functionalities like object detection, image processing, and video analysis. The current version is 4.13.0.92, with frequent updates generally following the main OpenCV library release cycle.

Warnings

Install

Imports

Quickstart

This quickstart creates a simple black image with 'Hello, OpenCV!' text, displays it in a window, waits for a key press, and then closes the window. This demonstrates basic image creation, text overlay, and GUI handling.

import cv2
import numpy as np

# Create a dummy image (black background with white text)
img = np.zeros((300, 500, 3), dtype=np.uint8)
cv2.putText(img, "Hello, OpenCV!", (50, 150), cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255), 2)

# Display the image
cv2.imshow("Dummy Image", img)

# Wait indefinitely until a key is pressed
cv2.waitKey(0)

# Destroy all OpenCV windows
cv2.destroyAllWindows()

view raw JSON →