🤖 AIによる機械翻訳(非公式) — これは OpenCV 5.0.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。
Package org.opencv.objdetect
クラス BarcodeDetector
- java.lang.Object
-
- org.opencv.objdetect.GraphicalCodeDetector
-
- org.opencv.objdetect.BarcodeDetector
-
public class BarcodeDetector extends GraphicalCodeDetector
-
-
フィールドの要約
-
クラス org.opencv.objdetect.GraphicalCodeDetector から継承されたフィールド
nativeObj
-
-
コンストラクタの要約
コンストラクタ Modifier Constructor Description BarcodeDetector()Initialize the BarcodeDetector.protectedBarcodeDetector​(long addr)BarcodeDetector​(java.lang.String super_resolution_model_path)Initialize the BarcodeDetector with a Super Resolution model.
-
メソッドの要約
すべてのメソッド 静的メソッド インスタンスメソッド 具象メソッド Modifier and Type Method Description 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)Decodes barcode in image once it's found by the detect() method.booleandetectAndDecodeWithType​(Mat img, java.util.List<java.lang.String> decoded_info, java.util.List<java.lang.String> decoded_type)Both detects and decodes barcodebooleandetectAndDecodeWithType​(Mat img, java.util.List<java.lang.String> decoded_info, java.util.List<java.lang.String> decoded_type, Mat points)Both detects and decodes barcodevoidgetDetectorScales​(MatOfFloat sizes)Returns detector box filter sizes.doublegetDownsamplingThreshold()Get detector downsampling threshold.doublegetGradientThreshold()Get detector gradient magnitude threshold.BarcodeDetectorsetDetectorScales​(MatOfFloat sizes)Set detector box filter sizes.BarcodeDetectorsetDownsamplingThreshold​(double thresh)Set detector downsampling threshold.BarcodeDetectorsetGradientThreshold​(double thresh)Set detector gradient magnitude threshold.-
クラス 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()
Initialize the BarcodeDetector. Super resolution is disabled.
-
BarcodeDetector
public BarcodeDetector​(java.lang.String super_resolution_model_path)
Initialize the BarcodeDetector with a Super Resolution model. Loads a Super Resolution DNN model in ONNX format, used to upscale small/low-quality barcode crops before decoding for better quality. 覚え書き: Caffe models (sr.prototxt/sr.caffemodel) are no longer supported; convert the model to ONNX (a convertedsr.onnxis available from https://github.com/WeChatCV/opencv_3rdparty/tree/wechat_qrcode).- 引数:
super_resolution_model_path- 単一ファイルの ONNX 超解像モデルへのパス。
-
-
メソッドの詳細
-
__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)
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)。- 戻り値:
- 自動生成
-
-