You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

随机背景下划痕缺陷检测难题:固定阈值二值化效果不佳咨询

随机噪声背景下的划痕检测难题

当产品表面存在划痕时,像素值通常会与背景产生差异,但如果背景是随机噪声,就很难区分划痕缺陷和背景。

相关示例图像:
含交叉划痕的源图像
二值化图像

二值化是分离不同灰度值区域的常用方法,但对这类带随机噪声背景的源图像使用固定阈值二值化后,依然无法有效分离出划痕。

使用OpenCV实现固定阈值二值化的代码如下:

Mat img_roi = imread(str_path_read, 0);
/*fix threshold*/
int thresh_b = 170;
Mat img_roi_b;
threshold(img_roi, img_roi_b, thresh_b, 255, THRESH_BINARY_INV);

内容的提问来源于stack exchange,提问作者xtkwfn

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.08 11:08:18