opencv::基本阈值操作

图像阈值(threshold)
    阈值 是什么?简单点说是把图像分割的标尺,这个标尺是根据什么产生的,阈值产生算法?阈值类型。(Binary segmentation)

阈值类型一阈值二值化(threshold binary)

阈值类型一阈值反二值化(threshold binary Inverted)

阈值类型一截断 (truncate)

阈值类型一阈值取零 (threshold to zero)

阈值类型一阈值反取零 (threshold to zero inverted)

int main(int argc, char** argv) {

    Mat src, dst;
    src = imread(STRPAHT2);
    if (!src.data) {
        printf("could not load image...
");
        return -1;
    }
    // 0-100  范围
    threshold(src, dst, 0, 100, THRESH_BINARY);
    imshow("output_title", dst);

    waitKey(0);
    return 0;
}
原文地址:https://www.cnblogs.com/osbreak/p/11465993.html