diff --git a/doc/opencv.md b/doc/opencv.md index 42b42374d626a1a36c9601670daa1164f083463a..02b6b553c249aeec1970ad35e808b72dae4c832d 100644 --- a/doc/opencv.md +++ b/doc/opencv.md @@ -107,7 +107,7 @@ In-place filtering is not supported i.e. `src` and `dst` must be different (non- Notes on parameters: * `src.depth()` - only supports `CV_8U` depth. -* `src.cols`,`src.rows` - should be greater than or equal to the size of the kernel in the given direction. +* `src.cols`,`src.rows` - image width and height must be greater than or equal to `ksize - 1` * `ksize` - supported kernel sizes are 3x3, 5x5, 7x7, 15x15 and 21x21. * `sigmaX`, `sigmaY` - optimal performance is achieved if these are set to 0. * `borderType` - supported [OpenCV border types](https://docs.opencv.org/4.11.0/d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5) are: @@ -120,12 +120,16 @@ Notes on parameters: ### [`cv::dilate()`](https://docs.opencv.org/4.10.0/d4/d86/group__imgproc__filter.html#ga4ff0f3318642c4f469d0e11f242f3b6c) Notes on parameters: * `src.depth()`,`dst.depth()`,`kernel.depth()` - only support `CV_8U` depth. +* `src.rows` - image height must be greater than or equal to `kernel.rows - 1` +* `src.cols` - image width must be greater than or equal to `kernel.cols - 1` * `kernel` - only support kernels where all values equal to 1, and having width and height of at least 5. * `borderType` - only supports [`BORDER_CONSTANT`](https://docs.opencv.org/4.10.0/d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5aed2e4346047e265c8c5a6d0276dcd838). ### [`cv::erode()`](https://docs.opencv.org/4.10.0/d4/d86/group__imgproc__filter.html#gaeb1e0c1033e3f6b891a25d0511362aeb) Notes on parameters: * `src.depth()`,`dst.depth()`,`kernel.depth()` - only support `CV_8U` depth. +* `src.rows` - image height must be greater than or equal to `kernel.rows - 1` +* `src.cols` - image width must be greater than or equal to `kernel.cols - 1` * `kernel` - only support kernels where all values equal to 1, and having width and height of at least 5. * `borderType` - only supports [`BORDER_CONSTANT`](https://docs.opencv.org/4.10.0/d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5aed2e4346047e265c8c5a6d0276dcd838). @@ -149,7 +153,7 @@ Applies Sobel gradient filter to a given image. Notes on parameters: * `src.depth()` - only supports `CV_8U` depth. -* `src.cols`,`src.rows` - image width and height should be `>=3`. +* `src.cols`,`src.rows` - image width and height must be greater than or equal to `ksize - 1` * `ddepth` - only supports `CV_16S` depth. * `dx`,`dy` - either vertical `{dx,dy} == {0,1}` or horizontal `{dx,dy} == {1,0}` operation is supported. * `ksize` - only supports 3x3 kernel size. @@ -271,6 +275,7 @@ Blurs and downsamples an image. Notes on parameters: * `src.type()` - only supports `CV_8UC1`. +* `src.cols`,`src.rows` - image width and height must be greater than or equal to `kernel size (== 5) - 1` * if `dstsize` is specified it must be equal to `Size((src.cols + 1) / 2, (src.rows + 1) / 2)` ### [`cv::buildOpticalFlowPyramid()`](https://docs.opencv.org/4.10.0/dc/d6b/group__video__track.html#ga86640c1c470f87b2660c096d2b22b2ce) diff --git a/kleidicv/include/kleidicv/kleidicv.h b/kleidicv/include/kleidicv/kleidicv.h index 82f1c274f40bd0913472bd0fb59f249d0a90265a..988d7433190e32b523714f7e9d383fa2c9116697 100644 --- a/kleidicv/include/kleidicv/kleidicv.h +++ b/kleidicv/include/kleidicv/kleidicv.h @@ -970,8 +970,11 @@ kleidicv_error_t kleidicv_morphology_release( /// start of the next row for the destination data. Must /// not be less than `width * channels * sizeof(uint8)`, /// except for single-row images. -/// @param width Number of pixels in a row. -/// @param height Number of rows in the data. +/// @param width Number of columns in the data. (One column consists of +/// `channels` number of elements.) Must be greater than +/// or equal to `kernel - 1`. +/// @param height Number of rows in the data. Must be greater than +/// or equal to `kernel - 1`. /// @param context Pointer to morphology context. /// KLEIDICV_API_DECLARATION(kleidicv_dilate_u8, const uint8_t *src, @@ -1121,8 +1124,10 @@ kleidicv_error_t kleidicv_resize_linear_f32(const float *src, size_t src_stride, /// sizeof(dst type) * channels`, except for single-row /// images. /// @param width Number of columns in the data. (One column consists of -/// `channels` number of elements.) -/// @param height Number of rows in the data. +/// `channels` number of elements.) Must be greater than or +/// equal to kernel size (== 3) - 1. +/// @param height Number of rows in the data. Must be greater than or +/// equal to kernel size (== 3) - 1. /// @param channels Number of channels in the data. Must be not more than /// @ref KLEIDICV_MAXIMUM_CHANNEL_COUNT. /// @@ -1159,8 +1164,10 @@ kleidicv_error_t kleidicv_sobel_3x3_vertical_s16_u8( /// sizeof(dst type) * channels`, except for single-row /// images. /// @param width Number of columns in the data. (One column consists of -/// `channels` number of elements.) -/// @param height Number of rows in the data. +/// `channels` number of elements.) Must be greater than or +/// equal to kernel size (== 3) - 1. +/// @param height Number of rows in the data. Must be greater than or +/// equal to kernel size (== 3) - 1. /// @param channels Number of channels in the data. Must be not more than /// @ref KLEIDICV_MAXIMUM_CHANNEL_COUNT. /// @@ -1264,8 +1271,10 @@ kleidicv_error_t kleidicv_filter_context_release( /// a multiple of `sizeof(type)` and no less than `width * /// sizeof(type) * channels`, except for single-row images. /// @param width Number of columns in the data. (One column consists of -/// `channels` number of elements.) -/// @param height Number of rows in the data. +/// `channels` number of elements.) Must be greater than +/// or equal to `kernel_width - 1`. +/// @param height Number of rows in the data. Must be greater than +/// or equal to `kernel_height - 1`. /// @param channels Number of channels in the data. Must be not more than /// @ref KLEIDICV_MAXIMUM_CHANNEL_COUNT. /// @param kernel_x Pointer to the horizontal 2D kernel values. @@ -1325,8 +1334,10 @@ kleidicv_error_t kleidicv_separable_filter_2d_s16( /// a multiple of `sizeof(type)` and no less than `width * /// sizeof(type) * channels`, except for single-row images. /// @param width Number of columns in the data. (One column consists of -/// `channels` number of elements.) -/// @param height Number of rows in the data. +/// `channels` number of elements.) Must be greater than +/// or equal to `kernel_width - 1`. +/// @param height Number of rows in the data. Must be greater than +/// or equal to `kernel_height - 1`. /// @param channels Number of channels in the data. Must be not more than /// @ref KLEIDICV_MAXIMUM_CHANNEL_COUNT. /// @param kernel_width Width of the Gaussian kernel. @@ -1385,7 +1396,11 @@ kleidicv_error_t kleidicv_gaussian_blur_u8( /// images. /// @param src_width Number of columns in the source data. (One column /// consists of `channels` number of elements.) +/// Must be greater than or equal to kernel size (== 5) +/// - 1. /// @param src_height Number of rows in the source data. +/// Must be greater than or equal to kernel size (== 5) +/// - 1. /// @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 be