|
| 1 | +// This file is part of OpenCV project. |
| 2 | +// It is subject to the license terms in the LICENSE file found in the top-level directory |
| 3 | +// of this distribution and at http://opencv.org/license.html. |
| 4 | + |
| 5 | +#ifndef __OPENCV_SPARSE_TABLE_MORPHOLOGY_HPP__ |
| 6 | +#define __OPENCV_SPARSE_TABLE_MORPHOLOGY_HPP__ |
| 7 | + |
| 8 | +#include <opencv2/core.hpp> |
| 9 | + |
| 10 | +namespace cv { |
| 11 | +namespace ximgproc { |
| 12 | +namespace st { |
| 13 | + |
| 14 | +//! @addtogroup ximgproc_sparse_table_morphology |
| 15 | +//! @{ |
| 16 | + |
| 17 | +/** |
| 18 | + * @brief Another implementation of cv::erode with sparse table approach. |
| 19 | + * |
| 20 | + * @param src input image; the number of channels can be arbitrary, but the depth should be one of |
| 21 | + * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. |
| 22 | + * @param dst output image of the same size and type as src. |
| 23 | + * @param kernel structuring element used for erosion; if `element=Mat()`, a `3 x 3` rectangular |
| 24 | + * structuring element is used. Kernel can be created using #getStructuringElement. |
| 25 | + * @param anchor position of the anchor within the element; default value (-1, -1) means that the |
| 26 | + * anchor is at the element center. |
| 27 | + * @param iterations number of times erosion is applied. |
| 28 | + * @param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported. |
| 29 | + * @param borderValue border value in case of a constant border |
| 30 | + * |
| 31 | + * @see cv::erode |
| 32 | + */ |
| 33 | +CV_EXPORTS_W void erode( InputArray src, OutputArray dst, InputArray kernel, |
| 34 | + Point anchor = Point(-1,-1), int iterations = 1, |
| 35 | + int borderType = BORDER_CONSTANT, |
| 36 | + const Scalar& borderValue = morphologyDefaultBorderValue() ); |
| 37 | + |
| 38 | +/** |
| 39 | + * @brief Another implementation of cv::dilate with sparse table approach. |
| 40 | + * |
| 41 | + * @param src input image; the number of channels can be arbitrary, but the depth should be one of |
| 42 | + * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. |
| 43 | + * @param dst output image of the same size and type as src. |
| 44 | + * @param kernel structuring element used for dilation; if element=Mat(), a 3 x 3 rectangular |
| 45 | + * structuring element is used. Kernel can be created using #getStructuringElement |
| 46 | + * @param anchor position of the anchor within the element; default value (-1, -1) means that the |
| 47 | + * anchor is at the element center. |
| 48 | + * @param iterations number of times dilation is applied. |
| 49 | + * @param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not suported. |
| 50 | + * @param borderValue border value in case of a constant border |
| 51 | + * |
| 52 | + * @see cv::dilate |
| 53 | + */ |
| 54 | +CV_EXPORTS_W void dilate( InputArray src, OutputArray dst, InputArray kernel, |
| 55 | + Point anchor = Point(-1,-1), int iterations = 1, |
| 56 | + int borderType = BORDER_CONSTANT, |
| 57 | + const Scalar& borderValue = morphologyDefaultBorderValue() ); |
| 58 | + |
| 59 | +/** |
| 60 | + * @brief Another implementation of cv::morphologyEx with sparse table approach. |
| 61 | +
|
| 62 | + * @param src Source image. The number of channels can be arbitrary. The depth should be one of |
| 63 | + * CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. |
| 64 | + * @param dst Destination image of the same size and type as source image. |
| 65 | + * @param op Type of a morphological operation, see #MorphTypes |
| 66 | + * @param kernel Structuring element. It can be created using #getStructuringElement. |
| 67 | + * @param anchor Anchor position with the kernel. Negative values mean that the anchor is at the |
| 68 | + * kernel center. |
| 69 | + * @param iterations Number of times erosion and dilation are applied. |
| 70 | + * @param borderType Pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported. |
| 71 | + * @param borderValue Border value in case of a constant border. The default value has a special |
| 72 | + * meaning. |
| 73 | + * @note The number of iterations is the number of times erosion or dilatation operation will be applied. |
| 74 | + * For instance, an opening operation (#MORPH_OPEN) with two iterations is equivalent to apply |
| 75 | + * successively: erode -> erode -> dilate -> dilate (and not erode -> dilate -> erode -> dilate). |
| 76 | + * |
| 77 | + * @see cv::morphologyEx |
| 78 | + */ |
| 79 | +CV_EXPORTS_W void morphologyEx( InputArray src, OutputArray dst, |
| 80 | + int op, InputArray kernel, |
| 81 | + Point anchor = Point(-1,-1), int iterations = 1, |
| 82 | + int borderType = BORDER_CONSTANT, |
| 83 | + const Scalar& borderValue = morphologyDefaultBorderValue() ); |
| 84 | + |
| 85 | +//! @} |
| 86 | + |
| 87 | +} // namespace st |
| 88 | +} // namespace ximgproc |
| 89 | +} // namespace cv |
| 90 | + |
| 91 | +#endif |
0 commit comments