Draw Shapes on Image - Opencv Typing CST Test
Loading…
Draw Shapes on Image — Opencv Code
Draws rectangle, circle, and line on an image.
import cv2
import numpy as np
img = np.zeros((300,300,3), dtype=np.uint8)
cv2.rectangle(img,(50,50),(250,250),(0,255,0),2)
cv2.circle(img,(150,150),50,(255,0,0),2)
cv2.line(img,(0,0),(300,300),(0,0,255),2)
cv2.imshow('Shapes', img)
cv2.waitKey(0)
cv2.destroyAllWindows()Opencv Language Guide
OpenCV (Open Source Computer Vision Library) is an open-source computer vision and machine learning library that provides tools for real-time image and video processing across multiple platforms.
Primary Use Cases
- ▸Image and video processing (filtering, transformations, enhancement)
- ▸Object detection and recognition
- ▸Facial recognition and emotion detection
- ▸Motion tracking and optical flow analysis
- ▸Machine learning integration for vision-based applications
Notable Features
- ▸Cross-platform support (Windows, macOS, Linux, Android, iOS)
- ▸Real-time processing optimized for performance
- ▸Supports CPU and GPU acceleration
- ▸Integration with deep learning frameworks (TensorFlow, PyTorch, ONNX)
- ▸Large collection of pre-trained models and algorithms
Origin & Creator
OpenCV was originally developed by Intel in 1999, led by Gary Bradski, with contributions from Willow Garage and Itseez, and has grown into one of the most widely used computer vision libraries worldwide.
Industrial Note
OpenCV is extensively used in robotics, autonomous vehicles, medical imaging, augmented reality, surveillance, and industrial automation.