OpenCV的BorderTypes

BorderTypes决定在图像发生几何变换或者滤波操作(卷积)时边沿像素的处理方式

在base.hpp中对其有所定义:

enum BorderTypes {
    BORDER_CONSTANT    = 0, //!< `iiiiii|abcdefgh|iiiiiii`  with some specified `i`
    BORDER_REPLICATE   = 1, //!< `aaaaaa|abcdefgh|hhhhhhh`
    BORDER_REFLECT     = 2, //!< `fedcba|abcdefgh|hgfedcb`
    BORDER_WRAP        = 3, //!< `cdefgh|abcdefgh|abcdefg`
    BORDER_REFLECT_101 = 4, //!< `gfedcb|abcdefgh|gfedcba`
    BORDER_TRANSPARENT = 5, //!< `uvwxyz|absdefgh|ijklmno`

    BORDER_REFLECT101  = BORDER_REFLECT_101, //!< same as BORDER_REFLECT_101
    BORDER_DEFAULT     = BORDER_REFLECT_101, //!< same as BORDER_REFLECT_101
    BORDER_ISOLATED    = 16 //!< do not look outside of ROI
};

在函数中会以该参数的形式定义

int borderMode = BORDER_CONSTANT,
const Scalar& borderValue = Scalar()
其中,BORDER_CONSTANT 需要设置borderValue 指定 ' i ' 值

BORDER_CONSTANT就是边沿像素用i替换

BORDER_REPLICATE ,复制边界像素

BORDER_REFLECT  ,反射复制边界像素   

BORDER_REFLECT_101,以边界为对称轴反射复制像素

    



你可能感兴趣的:(OpenCV的BorderTypes)