🤖 AIによる機械翻訳(非公式) — これは OpenCV 4.13.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。

クラス BarcodeDetector

    • コンストラクタの詳細

      • BarcodeDetector

        protected BarcodeDetector​(long addr)
      • BarcodeDetector

        public BarcodeDetector()
        Initialize the BarcodeDetector.
      • BarcodeDetector

        public BarcodeDetector​(java.lang.String prototxt_path,
                               java.lang.String model_path)
        Initialize the BarcodeDetector. Parameters allow to load _optional_ Super Resolution DNN model for better quality.
        引数:
        prototxt_path - 超解像モデルの prototxt ファイルパス
        model_path - 超解像モデルのモデルファイルパス
    • メソッドの詳細

      • decodeWithType

        public boolean decodeWithType​(Mat img,
                                      Mat points,
                                      java.util.List<java.lang.String> decoded_info,
                                      java.util.List<java.lang.String> decoded_type)
        Decodes barcode in image once it's found by the detect() method.
        引数:
        img - バーコードを含むグレースケールまたはカラー(BGR)画像。
        points - detect()メソッド(または他のアルゴリズム)で検出された回転矩形の頂点のベクトル。N個のバーコードが検出された場合、この配列の次元は[N][4]になる。vector<Point2f>内の4点の順序はbottomLeft、topLeft、topRight、bottomRightである。
        decoded_info - UTF8エンコードされた文字列の出力ベクトル。コードをデコードできない場合は空の文字列ベクトル。
        decoded_type - 文字列ベクトル。これらのバーコードの種類を表す。
        戻り値:
        少なくとも1つの有効なバーコードが見つかった場合に 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)
        Both detects and decodes barcode
        引数:
        img - バーコードを含むグレースケールまたはカラー(BGR)画像。
        decoded_info - UTF8エンコードされた文字列の出力ベクトル。コードをデコードできない場合は空の文字列ベクトル。
        decoded_type - 文字列のベクトル。これらのバーコードの種類を表す。
        points - 検出されたバーコードの矩形の頂点を格納する省略可能な出力ベクトル。見つからなかった場合は空になる。
        戻り値:
        少なくとも1つの有効なバーコードが見つかった場合に true
      • detectAndDecodeWithType

        public boolean detectAndDecodeWithType​(Mat img,
                                               java.util.List<java.lang.String> decoded_info,
                                               java.util.List<java.lang.String> decoded_type)
        Both detects and decodes barcode
        引数:
        img - バーコードを含むグレースケールまたはカラー(BGR)画像。
        decoded_info - UTF8エンコードされた文字列の出力ベクトル。コードをデコードできない場合は空の文字列ベクトル。
        decoded_type - 文字列のベクトル。これらのバーコードの種類を表す。
        戻り値:
        少なくとも1つの有効なバーコードが見つかった場合に true
      • getDownsamplingThreshold

        public double getDownsamplingThreshold()
        Get detector downsampling threshold.
        戻り値:
        検出器のダウンサンプリングしきい値
      • setDownsamplingThreshold

        public BarcodeDetector setDownsamplingThreshold​(double thresh)
        Set detector downsampling threshold. By default, the detect method resizes the input image to this limit if the smallest image size is is greater than the threshold. Increasing this value can improve detection accuracy and the number of results at the expense of performance. Correlates with detector scales. Setting this to a large value will disable downsampling.
        引数:
        thresh - 適用するダウンサンプリングの上限(デフォルト512) 参照: setDetectorScales
        戻り値:
        自動生成
      • getDetectorScales

        public void getDetectorScales​(MatOfFloat sizes)
        Returns detector box filter sizes.
        引数:
        sizes - サイズを返すための出力パラメータ。
      • setDetectorScales

        public BarcodeDetector setDetectorScales​(MatOfFloat sizes)
        Set detector box filter sizes. Adjusts the value and the number of box filters used in the detect step. The filter sizes directly correlate with the expected line widths for a barcode. Corresponds to expected barcode distance. If the downsampling limit is increased, filter sizes need to be adjusted in an inversely proportional way.
        引数:
        sizes - 画像の最小寸法に対する相対的なボックスフィルタのサイズ(デフォルト[0.01, 0.03, 0.06, 0.08])
        戻り値:
        自動生成
      • getGradientThreshold

        public double getGradientThreshold()
        Get detector gradient magnitude threshold.
        戻り値:
        検出器の勾配の大きさのしきい値。
      • setGradientThreshold

        public BarcodeDetector setGradientThreshold​(double thresh)
        Set detector gradient magnitude threshold. Sets the coherence threshold for detected bounding boxes. Increasing this value will generate a closer fitted bounding box width and can reduce false-positives. Values between 16 and 1024 generally work, while too high of a value will remove valid detections.
        引数:
        thresh - 勾配の大きさのしきい値(デフォルト64)。
        戻り値:
        自動生成