首页 > 代码库 > 17.腐蚀
17.腐蚀
//腐蚀 int g_nErodeValue; int g_nErodeType; Mat g_mElement; //这2个消息处理函数可以合并为1个 void on_ChangeErodeValue(int,void*) { if(g_nErodeValue>0) { g_mElement=getStructuringElement(g_nErodeType,Size(g_nErodeValue,g_nErodeValue)); erode(g_srcImage_Contrast,g_dstImage_Contrast,g_mElement); imshow("腐蚀滤波",g_dstImage_Contrast); } } void on_ChangeErodeType(int,void*) { g_mElement=getStructuringElement(g_nErodeType,Size(g_nErodeValue,g_nErodeValue)); erode(g_srcImage_Contrast,g_dstImage_Contrast,g_mElement); imshow("腐蚀滤波",g_dstImage_Contrast); } void Test_ErodeBlur() { namedWindow("腐蚀滤波"); namedWindow("原图"); g_srcImage_Contrast=imread("D:\\OpenCV Projects\\OpenCV_Test_Image\\16.jpg"); g_nErodeValue=http://www.mamicode.com/1;"erode_value","腐蚀滤波",&g_nErodeValue,30,on_ChangeErodeValue); createTrackbar("erode_type","腐蚀滤波",&g_nErodeType,2,on_ChangeErodeType); on_ChangeErodeValue(g_nErodeValue,0); on_ChangeErodeType(g_nErodeValue,0); imshow("原图",g_srcImage_Contrast); }
17.腐蚀
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。