Expand description
Image Preprocessing for Computer Vision Applications
This module provides comprehensive image preprocessing utilities for computer vision and machine learning tasks, including normalization, data augmentation, color space transformations, and feature extraction.
§Features
- Image normalization and standardization
- Data augmentation techniques (rotation, scaling, flipping, cropping)
- Color space transformations (RGB, HSV, LAB, grayscale)
- Image resizing and cropping
- Edge detection and feature extraction
- Batch image processing with parallel support
§Examples
ⓘ
use sklears_preprocessing::image_preprocessing::{
ImageNormalizer, ImageAugmenter, ColorSpaceTransformer
};
use scirs2_core::ndarray::Array3;
fn example() -> Result<(), Box<dyn std::error::Error>> {
// Normalize image pixel values to [0, 1] range
let normalizer = ImageNormalizer::new()
.with_range((0.0, 1.0))
.with_channel_wise(true);
let image = Array3::<f64>::zeros((224, 224, 3)); // RGB image
let normalized = normalizer.transform(&image)?;
// Apply data augmentation
let augmenter = ImageAugmenter::new()
.with_rotation_range((-15.0, 15.0))
.with_zoom_range((0.9, 1.1))
.with_horizontal_flip(true);
let augmented = augmenter.transform(&normalized)?;
// Convert color space
let color_transformer = ColorSpaceTransformer::new()
.from_rgb()
.to_hsv();
let hsv_image = color_transformer.transform(&augmented)?;
Ok(())
}Structs§
- Color
Space Transformer - Color space transformer
- Edge
Detector - Edge detector for feature extraction
- Image
Augmenter - Image augmenter for data augmentation
- Image
Augmenter Config - Configuration for image augmentation
- Image
Feature Extractor - Basic feature extractor for images
- Image
Normalizer - Image normalizer for preprocessing image data
- Image
Normalizer Config - Configuration for image normalization
- Image
Normalizer Fitted - Fitted state for image normalizer
- Image
Resizer - Image resizer for changing image dimensions
Enums§
- Color
Space - Color space types for image transformations
- Edge
Detection Method - Edge detection methods
- Image
Normalization Strategy - Image normalization strategies
- Interpolation
Method - Image resizing interpolation methods