Skip to content

Examples

The Iris repository includes several complete examples showcasing key capabilities of the library. Browse the Examples Overview for full source code and descriptions.

Running Examples

bash
# Clone the repository
git clone https://github.com/muhammad-fiaz/iris-cv.git
cd iris-cv

# Run any example with the wgpu backend
cargo run --example <name> --features wgpu

TIP

Generate test assets first: cargo run --example generate_assets --features wgpu

Available Examples

Image Processing

ExampleCommandDescription
Image Loadingcargo run --example image_loading --features wgpuLoad, resize, annotate, and save images
Filterscargo run --example filters --features wgpuBox, Gaussian, median, bilateral, and separable filters
Cannycargo run --example canny --features wgpuCanny edge detection on real images
Morphologycargo run --example morphology --features wgpuDilation, erosion, opening, closing
Thresholdcargo run --example threshold --features wgpuBinary, truncation, to-zero, Otsu thresholding
Contourscargo run --example contours --features wgpuContour detection, convex hull, moments
Drawingcargo run --example drawing --features wgpuLines, rectangles, circles, text

Color & Photo

ExampleCommandDescription
Color Processingcargo run --example color_processing --features wgpuColor space conversions, CLAHE, in-range
Photo Processingcargo run --example photo_processing --features wgpuNLM denoising and Mertens exposure fusion

Features & Tracking

ExampleCommandDescription
Optical Flowcargo run --example optical_flow --features wgpuDense (Farneback) and sparse (Lucas-Kanade) flow
Trackingcargo run --example tracking --features wgpuBackground subtraction and CSRT tracking

Video

ExampleCommandDescription
GIF Videocargo run --example gif_video --features wgpuGIF creation, reading, roundtrip
Video Processingcargo run --example video_processing --features wgpuVideo writing and frame iteration
Video Frame Opscargo run --example video_frame_ops --features wgpuFrame differencing, motion, batch, seeking
Video Metadatacargo run --example video_metadata --features wgpuFormat detection, stream info, pixel formats
Image Sequencecargo run --example image_sequence --features wgpuLoad numbered images into frames

Detection & Recognition

ExampleCommandDescription
Barcode Detectioncargo run --example barcode_detection --features wgpuBarcode detection and decoding
QR Detectioncargo run --example qr_detection --features wgpuQR code detection and decoding
ArUco Posecargo run --example aruco_pose --features wgpuArUco marker detection and pose estimation
Face Recognitioncargo run --example face_recognition --features wgpuFace detection and recognition embeddings
Segmentationcargo run --example segmentation --features wgpuSemantic segmentation and connected components

DNN & ML

ExampleCommandDescription
ONNX Inferencecargo run --example onnx_inference --features wgpuONNX model loading and inference
SafeTensors Loadingcargo run --example safetensors_loading --features wgpuWeight loading and NMS
K-Means Clusteringcargo run --example kmeans_clustering --features wgpuK-Means clustering on 2D points
OCRcargo run --example ocr --features wgpuOCR text recognition pipeline

Advanced

ExampleCommandDescription
Stitchingcargo run --example stitching --features wgpuImage panorama stitching
Camera Calibrationcargo run --example camera_calibration --features wgpuCamera calibration, projection, homography
API Showcasecargo run --example api_showcase --features wgpuCore API overview
Image Utilscargo run --example image_utils --features wgpuUtility ops (filter2D, blend, LUT, noise)
GUI Windowscargo run --example gui_windows --features wgpuGUI windows, trackbars, mouse callbacks
Generate Assetscargo run --example generate_assets --features wgpuGenerate test images for examples

Released under the MIT License.