From 4d3b71d94df6666ebf3268feba7337a3d40356ae Mon Sep 17 00:00:00 2001 From: Ioana Ghiban Date: Fri, 9 Feb 2024 16:53:07 +0100 Subject: [PATCH] [doc] Add gaussian_blur() documentation --- intrinsiccv/include/intrinsiccv.h | 57 +++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/intrinsiccv/include/intrinsiccv.h b/intrinsiccv/include/intrinsiccv.h index a2804f1b6..77bcccb83 100644 --- a/intrinsiccv/include/intrinsiccv.h +++ b/intrinsiccv/include/intrinsiccv.h @@ -732,6 +732,17 @@ intrinsiccv_error_t intrinsiccv_canny_u8(const uint8_t *src, size_t src_stride, double low_threshold, double high_threshold); +/// Creates a filter context according to the parameters. +/// +/// Before a gaussian_blur operation, this initialization is needed. +/// After the operation is finished, the context needs to be released +/// using intrinsiccv_filter_release. +/// +/// @param context Pointer where to return the created context's address. +/// @param channels Number of elements for each pixel. +/// @param type_size Element size in bytes. +/// @param image Image dimensions. +/// intrinsiccv_error_t intrinsiccv_filter_create( intrinsiccv_filter_context_t **context, size_t channels, size_t type_size, intrinsiccv_rectangle_t image); @@ -739,6 +750,52 @@ intrinsiccv_error_t intrinsiccv_filter_create( intrinsiccv_error_t intrinsiccv_filter_release( intrinsiccv_filter_context_t *context); +/// Convolves the source image with the specified Gaussian kernel. +/// In-place filtering is not supported. +/// +/// 3x3 Gaussian Blur filter for uint8_t types: +/// ``` +/// [ 1, 2, 1 ] +/// 1/16 * [ 2, 4, 2 ] +/// [ 1, 2, 1 ] +/// ``` +/// 5x5 Gaussian Blur filter for uint8_t types: +/// ``` +/// [ 1, 4, 6, 4, 1 ] +/// [ 4, 16, 24, 16, 4 ] +/// 1/256 * [ 6, 24, 36, 24, 6 ] +/// [ 4, 16, 24, 16, 4 ] +/// [ 1, 4, 6, 4, 1 ] +/// ``` +/// Usage: +/// +/// Before using this function, a context must be created using +/// intrinsiccv_filter_create, and after finished, it has to be released +/// using intrinsiccv_filter_release. Note, from the border types only +/// these are supported: \n +/// ::INTRINSICCV_BORDER_TYPE_REPLICATE \n +/// ::INTRINSICCV_BORDER_TYPE_REFLECT \n +/// ::INTRINSICCV_BORDER_TYPE_WRAP \n +/// ::INTRINSICCV_BORDER_TYPE_REVERSE +/// +/// @param src Pointer to the source data. Must be non-null. +/// @param src_stride Distance in bytes from the start of one row to the +/// start of the next row in the source data. Must not be +/// less than width * sizeof(type) * channels. +/// Must be a multiple of sizeof(type). +/// @param dst Pointer to the destination data. Must be non-null. +/// @param dst_stride Distance in bytes from the start of one row to the +/// start of the next row in the destination data. Must not +/// be less than width * sizeof(type) * channels. +/// Must be a multiple of sizeof(type). +/// @param width Number of columns in the data. (One column consists of +/// 'channels' number of elements.) +/// @param height Number of rows in the data. +/// @param channels Number of channels in the data. +/// @param border_type Way of handling the border. +/// @param context Pointer to filter context created by +/// ::intrinsiccv_filter_create. +/// intrinsiccv_error_t intrinsiccv_gaussian_blur_3x3_u8( const uint8_t *src, size_t src_stride, uint8_t *dst, size_t dst_stride, size_t width, size_t height, size_t channels, -- GitLab