类 BarcodeDetector
- java.lang.Object
-
- org.opencv.objdetect.GraphicalCodeDetector
-
- org.opencv.objdetect.BarcodeDetector
-
public class BarcodeDetector extends GraphicalCodeDetector
-
-
字段摘要
-
从类继承的字段 org.opencv.objdetect.GraphicalCodeDetector
nativeObj
-
-
构造函数摘要
构造函数 修饰符 构造函数 描述 BarcodeDetector()初始化 BarcodeDetector。保护BarcodeDetector(long addr)BarcodeDetector(java.lang.String prototxt_path, java.lang.String model_path)初始化 BarcodeDetector。
-
方法摘要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 描述 static BarcodeDetector__fromPtr__(long addr)booleandecodeWithType(Mat img, Mat points, java.util.List<java.lang.String> decoded_info, java.util.List<java.lang.String> decoded_type)一旦通过 detect() 方法找到条形码,就对图像中的条形码进行解码。booleandetectAndDecodeWithType(Mat img, java.util.List<java.lang.String> decoded_info, java.util.List<java.lang.String> decoded_type)检测和解码条形码booleandetectAndDecodeWithType(Mat img, java.util.List<java.lang.String> decoded_info, java.util.List<java.lang.String> decoded_type, Mat points)检测和解码条形码protected voidfinalize()voidgetDetectorScales(MatOfFloat sizes)返回检测器盒式滤波器尺寸。doublegetDownsamplingThreshold()获取检测器下采样阈值。doublegetGradientThreshold()获取检测器梯度幅值阈值。BarcodeDetectorsetDetectorScales(MatOfFloat sizes)设置检测器盒式滤波器尺寸。BarcodeDetectorsetDownsamplingThreshold(double thresh)设置检测器下采样阈值。BarcodeDetectorsetGradientThreshold(double thresh)设置检测器梯度幅值阈值。-
从类继承的方法 org.opencv.objdetect.GraphicalCodeDetector
decode, decode, decodeBytes, decodeBytes, decodeBytesMulti, decodeBytesMulti, decodeMulti, decodeMulti, detect, detectAndDecode, detectAndDecode, detectAndDecode, detectAndDecodeBytes, detectAndDecodeBytes, detectAndDecodeBytes, detectAndDecodeBytesMulti, detectAndDecodeBytesMulti, detectAndDecodeBytesMulti, detectAndDecodeMulti, detectAndDecodeMulti, detectAndDecodeMulti, detectMulti, getNativeObjAddr
-
-
-
-
构造函数详细信息
-
BarcodeDetector
protected BarcodeDetector(long addr)
-
BarcodeDetector
public BarcodeDetector()
初始化 BarcodeDetector。
-
BarcodeDetector
public BarcodeDetector(java.lang.String prototxt_path, java.lang.String model_path)初始化 BarcodeDetector。 参数允许加载 _可选的_ 超分辨率 DNN 模型以获得更好的质量。- 参数
prototxt_path- 超分辨率模型的 prototxt 文件路径model_path- 超分辨率模型的模型文件路径
-
-
方法详细信息
-
__fromPtr__
public static BarcodeDetector __fromPtr__(long addr)
-
decodeWithType
public boolean decodeWithType(Mat img, Mat points, java.util.List<java.lang.String> decoded_info, java.util.List<java.lang.String> decoded_type)
一旦通过 detect() 方法找到条形码,就对图像中的条形码进行解码。- 参数
img- 包含条形码的灰度或彩色 (BGR) 图像。points- detect() 方法(或某些其他算法)找到的旋转矩形顶点的向量。 对于 N 个检测到的条形码,此数组的维度应为 [N][4]。 vector<Point2f> 中四个点的顺序是左下角、左上角、右上角、右下角。decoded_info- UTF8 编码的字符串输出向量,如果无法解码代码,则为空字符串向量。decoded_type- 字符串向量,指定这些条形码的类型- 返回
- 如果至少找到一个有效条形码则为 true
-
detectAndDecodeWithType
public boolean detectAndDecodeWithType(Mat img, java.util.List<java.lang.String> decoded_info, java.util.List<java.lang.String> decoded_type, Mat points)
检测和解码条形码- 参数
img- 包含条形码的灰度或彩色 (BGR) 图像。decoded_info- UTF8 编码的字符串输出向量,如果无法解码代码,则为空字符串向量。decoded_type- 字符串向量,指定这些条形码的类型points- 找到的条形码矩形顶点的可选输出向量。 如果未找到,则为空。- 返回
- 如果至少找到一个有效条形码则为 true
-
detectAndDecodeWithType
public boolean detectAndDecodeWithType(Mat img, java.util.List<java.lang.String> decoded_info, java.util.List<java.lang.String> decoded_type)
检测和解码条形码- 参数
img- 包含条形码的灰度或彩色 (BGR) 图像。decoded_info- UTF8 编码的字符串输出向量,如果无法解码代码,则为空字符串向量。decoded_type- 字符串向量,指定这些条形码的类型- 返回
- 如果至少找到一个有效条形码则为 true
-
getDownsamplingThreshold
public double getDownsamplingThreshold()
获取检测器下采样阈值。- 返回
- 检测器下采样阈值
-
setDownsamplingThreshold
public BarcodeDetector setDownsamplingThreshold(double thresh)
设置检测器降采样阈值。 默认情况下,如果最小图像尺寸大于阈值,detect 方法会将输入图像调整到此限制。 增加此值可以提高检测精度和结果数量,但会牺牲性能。 与检测器比例相关。 将此设置为较大的值将禁用降采样。- 参数
thresh- 应用的降采样限制(默认 512) SEE: setDetectorScales- 返回
- 自动生成
-
getDetectorScales
public void getDetectorScales(MatOfFloat sizes)
返回检测器盒式滤波器尺寸。- 参数
sizes- 用于返回大小的输出参数。
-
setDetectorScales
public BarcodeDetector setDetectorScales(MatOfFloat sizes)
设置检测器框过滤器大小。 调整检测步骤中使用的框过滤器的值和数量。 过滤器大小与条形码的预期线宽直接相关。 对应于预期的条形码距离。 如果降采样限制增加,则需要按反比例调整过滤器大小。- 参数
sizes- 相对于图像最小尺寸的框过滤器大小(默认 [0.01, 0.03, 0.06, 0.08])- 返回
- 自动生成
-
getGradientThreshold
public double getGradientThreshold()
获取检测器梯度幅值阈值。- 返回
- 检测器梯度幅值阈值。
-
setGradientThreshold
public BarcodeDetector setGradientThreshold(double thresh)
设置检测器梯度幅度阈值。 设置检测到的边界框的相干性阈值。 增加此值将生成更紧密拟合的边界框宽度,并可以减少误报。 通常,16 到 1024 之间的值可以工作,而过高的值会删除有效的检测。- 参数
thresh- 梯度幅度阈值(默认 64)。- 返回
- 自动生成
-
finalize
protected void finalize() throws java.lang.Throwable- 重写
finalize在类中GraphicalCodeDetector- 抛出
java.lang.Throwable
-
-