Overview
From opencv2/imgproc.hpp:48-52:This module offers a comprehensive suite of image processing functions, enabling tasks such as filtering, geometric transformations, color space conversions, histograms, structural analysis, and feature detection.
Filtering
Linear and non-linear image filtering operations
Transforms
Geometric transformations like resize, rotate, warp
Color Spaces
Conversions between BGR, HSV, Lab, and other formats
Feature Detection
Edge detection, corner detection, and shape analysis
Image Filtering
From imgproc.hpp:54-84, OpenCV provides various filtering operations:Linear Filters
Morphological Operations
From imgproc.hpp:216-241:Derivatives and Gradients
Geometric Transformations
From imgproc.hpp:90-127, geometric transformations deform the pixel grid:Resizing and Interpolation
Affine Transformations
Perspective Transformations
Remapping
Color Space Conversions
From imgproc.hpp:158-172:Thresholding
Edge Detection
Example from samples/cpp/edge.cpp:Histograms
Contours and Shapes
Drawing Functions
From imgproc.hpp:130-156:Distance Transform
Connected Components
Image Moments
Hough Transforms
Watershed Segmentation
Template Matching
Practical Example: Image Enhancement
Best Practices
Border Handling:
Most filtering functions need to extrapolate pixels outside image boundaries. Choose the appropriate border type:
BORDER_REPLICATE- Good for most filteringBORDER_REFLECT_101- Better for derivativesBORDER_CONSTANT- When you need specific padding values
Interpolation:
Choose interpolation based on your needs:
INTER_NEAREST- Fastest, but lowest qualityINTER_LINEAR- Good balance of speed and qualityINTER_AREA- Best for downsamplingINTER_CUBIC- Best quality for upsamplingINTER_LANCZOS4- Highest quality, slowest
Related Modules
- Core Module - Provides Mat and basic operations
- Image I/O - Reading and writing images
- Feature Detection - Advanced feature detection
Source Reference
Key header:~/workspace/source/modules/imgproc/include/opencv2/imgproc.hpp