cvw::steps
Namespace containing step factory functions for pipeline composition. More...
Functions
| Name | |
|---|---|
| auto | resize(int width, int height, int interpolation =cv::INTER_LINEAR) Creates a resize step with the given dimensions. |
| auto | flip(int axis) Creates a flip step along the given axis. |
| auto | rotate(double angle, bool expand =false) Creates a rotation step. |
| auto | to_gray() Creates a BGR-to-Gray conversion step. |
| auto | to_gray_rgb() Creates an RGB-to-Gray conversion step. |
| auto | to_bgr() Creates a Gray-to-BGR conversion step. |
| auto | yuyv_to_gray() Creates a YUYV-to-Gray conversion step. |
| auto | gaussian_blur(int kernel_size, double sigma =0.0) Creates a Gaussian blur step. |
| template <is_pixel_format F> auto | median_blur(int kernel_size) Creates a median blur step for single-channel images. |
| auto | canny(double lo, double hi, int aperture =3) Creates a Canny edge detection step. |
| auto | sobel(int dx, int dy, int kernel_size =3) Creates a Sobel derivative step. |
| auto | threshold(double thresh, double max_val, int type =cv::THRESH_BINARY) Creates a global threshold step. |
| auto | adaptive_threshold(int block_size, double C, int method =cv::ADAPTIVE_THRESH_GAUSSIAN_C) Creates an adaptive threshold step. |
| auto | normalize(float min_val =0.0f, float max_val =1.0f) Creates a min-max normalization step. |
| auto | save(std::string path) Creates a save-to-file sink step. |
Detailed Description
Namespace containing step factory functions for pipeline composition.
Each factory returns a callable that accepts an Image or Expected and returns an Expected with automatic error propagation.
Functions Documentation
function resize
inline auto resize(
int width,
int height,
int interpolation =cv::INTER_LINEAR
)Creates a resize step with the given dimensions.
Parameters:
- width Target width in pixels. Must be positive.
- height Target height in pixels. Must be positive.
- interpolation OpenCV interpolation flag. Default: LINEAR.
Return: A callable step that resizes an image.
Since: 1.0.0
function flip
inline auto flip(
int axis
)Creates a flip step along the given axis.
Parameters:
- axis Flip axis (0 = vertical, 1 = horizontal, -1 = both).
Return: A callable step that flips an image.
Since: 1.0.0
function rotate
inline auto rotate(
double angle,
bool expand =false
)Creates a rotation step.
Parameters:
- angle Rotation angle in degrees. Positive = counter-clockwise.
- expand Whether to expand the output to hold the full rotated image. Default: false.
Return: A callable step that rotates an image.
Since: 1.0.0
function to_gray
inline auto to_gray()Creates a BGR-to-Gray conversion step.
Return: A callable step converting Image<BGR> to Image<Gray>.
Since: 1.0.0
function to_gray_rgb
inline auto to_gray_rgb()Creates an RGB-to-Gray conversion step.
Return: A callable step converting Image<RGB> to Image<Gray>.
Since: 1.0.0
function to_bgr
inline auto to_bgr()Creates a Gray-to-BGR conversion step.
Return: A callable step converting Image<Gray> to Image<BGR>.
Since: 1.0.0
function yuyv_to_gray
inline auto yuyv_to_gray()Creates a YUYV-to-Gray conversion step.
Return: A callable step converting ImageView<YUYV> to Image<Gray>.
Since: 1.0.0
function gaussian_blur
inline auto gaussian_blur(
int kernel_size,
double sigma =0.0
)Creates a Gaussian blur step.
Parameters:
- kernel_size Side length of the square kernel. Must be odd and positive. Unit: pixels.
- sigma Standard deviation. 0.0 means computed from kernel size. Default: 0.0.
Return: A callable step that applies Gaussian blur.
Since: 1.0.0
function median_blur
template <is_pixel_format F>
inline auto median_blur(
int kernel_size
)Creates a median blur step for single-channel images.
Parameters:
- kernel_size Side length of the square kernel. Must be odd. Unit: pixels.
Template Parameters:
- F Pixel format with exactly 1 channel.
Return: A callable step that applies median blur.
Since: 1.0.0
function canny
inline auto canny(
double lo,
double hi,
int aperture =3
)Creates a Canny edge detection step.
Parameters:
- lo Lower hysteresis threshold.
- hi Upper hysteresis threshold.
- aperture Aperture size for the Sobel operator. Default: 3.
Return: A callable step that applies Canny edge detection.
Since: 1.0.0
function sobel
inline auto sobel(
int dx,
int dy,
int kernel_size =3
)Creates a Sobel derivative step.
Parameters:
- dx Order of the x-derivative.
- dy Order of the y-derivative.
- kernel_size Aperture size. Default: 3.
Return: A callable step that computes Sobel derivatives.
Since: 1.0.0
function threshold
inline auto threshold(
double thresh,
double max_val,
int type =cv::THRESH_BINARY
)Creates a global threshold step.
Parameters:
- thresh Threshold value.
- max_val Maximum value for THRESH_BINARY. Default: 0.
- type OpenCV threshold type. Default: THRESH_BINARY.
Return: A callable step that applies thresholding.
Since: 1.0.0
function adaptive_threshold
inline auto adaptive_threshold(
int block_size,
double C,
int method =cv::ADAPTIVE_THRESH_GAUSSIAN_C
)Creates an adaptive threshold step.
Parameters:
- block_size Size of the local neighborhood. Must be odd >= 3. Unit: pixels.
- C Constant subtracted from the mean. May be negative.
- method Adaptive method. Default: ADAPTIVE_THRESH_GAUSSIAN_C.
Return: A callable step that applies adaptive thresholding.
Since: 1.0.0
function normalize
inline auto normalize(
float min_val =0.0f,
float max_val =1.0f
)Creates a min-max normalization step.
Parameters:
- min_val Lower bound of the output range. Default: 0.0f.
- max_val Upper bound of the output range. Default: 1.0f.
Return: A callable step normalizing Image<Gray> to Image<Float1>.
Since: 1.0.0
function save
inline auto save(
std::string path
)Creates a save-to-file sink step.
Parameters:
- path Output file path.
Return: A callable step that saves an image and returns expected<void, AlgorithmError>.
Since: 1.0.0
Updated on 2026-05-17 at 13:22:38 +0000