opencv中的图像二值化函数threshold函数
其结构
double cv::threshold( //二值化函数
const CvArr* src, //原始图像
CvArr* dst, //输出图像
double threshold, //阈值
double max_value, //最大值
int threshold_type//阈值类型
);
实例代码
#include "cv.h"
#include "highgui.h"
int main()
{
cv::Mat image= cv::imread("2.jpg",0);
cv::Mat image1= cv::imread("2.jpg");
cv::namedWindow("Image");
cv::imshow("Image",image1);
cv::Mat thresholded;
cv::threshold(image,thresholded,90,255,cv::THRESH_BINARY);
cv::namedWindow("Binary Image");
cv::imshow(