Examples
Run any example with:
bash
cargo run --example <name> --features wgpu::: note All examples require the wgpu feature. Generate test assets first with cargo run --example generate_assets --features wgpu. :::
Image Processing
| Example | Description |
|---|---|
| image_loading | Load, resize, annotate, and save images |
| filters | Box, Gaussian, median, bilateral, and separable filters |
| canny | Canny edge detection on real images |
| morphology | Dilation, erosion, opening, closing |
| threshold | Binary, truncation, to-zero, and Otsu thresholding |
| contours | Contour detection, convex hull, moments |
| drawing | Draw lines, rectangles, circles, and text |
Color & Histogram
| Example | Description |
|---|---|
| color_processing | Color space conversions, CLAHE, in-range thresholding |
| photo_processing | NLM denoising and Mertens exposure fusion |
Features & Tracking
| Example | Description |
|---|---|
| optical_flow | Dense (Farneback) and sparse (Lucas-Kanade) optical flow |
| tracking | Background subtraction and CSRT object tracking |
Video
| Example | Description |
|---|---|
| gif_video | GIF creation, reading, and roundtrip verification |
| video_processing | Video writing and frame iteration |
| video_frame_ops | Frame differencing, motion, batch, seeking, looping |
| video_metadata | Format detection, stream info, pixel formats |
| image_sequence | Load numbered image sequences into frames |
Detection & Recognition
| Example | Description |
|---|---|
| barcode_detection | Barcode detection and decoding |
| qr_detection | QR code detection and decoding |
| aruco_pose | ArUco marker detection and pose estimation |
| face_recognition | Face detection and recognition embeddings |
| segmentation | Semantic segmentation and connected components |
DNN & ML
| Example | Description |
|---|---|
| onnx_inference | ONNX model loading and inference |
| safetensors_loading | Weight loading and NMS |
| kmeans_clustering | K-Means clustering on 2D points |
| ocr | OCR text recognition pipeline |
Advanced
| Example | Description |
|---|---|
| stitching | Image panorama stitching |
| camera_calibration | Camera calibration, projection, homography |
| api_showcase | Core API overview (color, noise, filters, drawing) |
| image_utils | Utility ops (filter2D, blend, LUT, noise, histogram) |
| gui_windows | GUI windows, trackbars, mouse callbacks |
| generate_assets | Generate test images for examples |