🤖 AIによる機械翻訳(非公式) — これは OpenCV 4.13.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。
Package org.opencv.imgproc
クラス LineSegmentDetector
- java.lang.Object
-
- org.opencv.core.Algorithm
-
- org.opencv.imgproc.LineSegmentDetector
public class LineSegmentDetector extends Algorithm
CITE: Rafael12 に記載されたアルゴリズムに従う線分検出クラス。注意: 元のコードのライセンス上の問題により、この実装は OpenCV のバージョン 3.4.6 から 3.4.15 まで、およびバージョン 4.1.0 から 4.5.3 まで削除されていた。MIT ライセンスで公開された [NFA の計算](https://github.com/rafael-grompone-von-gioi/binomial_nfa) コードを用いて再度復元された。
-
-
コンストラクタの要約
コンストラクタ Modifier Constructor Description protectedLineSegmentDetector​(long addr)
-
メソッドの要約
すべてのメソッド 静的メソッド インスタンスメソッド 具象メソッド Modifier and Type Method Description static LineSegmentDetector__fromPtr__​(long addr)intcompareSegments​(Size size, Mat lines1, Mat lines2)Draws two groups of lines in blue and red, counting the non overlapping (mismatching) pixels.intcompareSegments​(Size size, Mat lines1, Mat lines2, Mat image)Draws two groups of lines in blue and red, counting the non overlapping (mismatching) pixels.voiddetect​(Mat image, Mat lines)Finds lines in the input image.voiddetect​(Mat image, Mat lines, Mat width)Finds lines in the input image.voiddetect​(Mat image, Mat lines, Mat width, Mat prec)Finds lines in the input image.voiddetect​(Mat image, Mat lines, Mat width, Mat prec, Mat nfa)Finds lines in the input image.voiddrawSegments​(Mat image, Mat lines)Draws the line segments on a given image.-
クラス org.opencv.core.Algorithm から継承されたメソッド
clear, empty, getDefaultName, getNativeObjAddr, save
-
-
-
-
メソッドの詳細
-
__fromPtr__
public static LineSegmentDetector __fromPtr__​(long addr)
-
detect
public void detect​(Mat image, Mat lines, Mat width, Mat prec, Mat nfa)
Finds lines in the input image. This is the output of the default parameters of the algorithm on the above shown image. - 引数:
image- グレースケール(CV_8UC1)の入力画像。ROI のみを選択する必要がある場合は次のように使う:lsd_ptr->detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y);lines- 線の始点と終点を指定する Vec4f 要素のベクトル。Vec4f は (x1, y1, x2, y2) であり、point 1 が始点、point 2 が終点である。返される線は勾配に応じて厳密に向き付けされる。width- 線が見つかった領域の幅のベクトル。例えば線の幅。prec- 線が見つかった精度のベクトル。nfa- Vector containing number of false alarms in the line region, with precision of 10%. The bigger the value, logarithmically better the detection.- -1 は平均10回の誤検出に対応する
- 0 は平均1回の誤検出に対応する
- 1 は 0.1 の平均誤警報数に対応する。このベクトルはオブジェクトの型が #LSD_REFINE_ADV の場合にのみ計算される。
-
detect
public void detect​(Mat image, Mat lines, Mat width, Mat prec)
Finds lines in the input image. This is the output of the default parameters of the algorithm on the above shown image. - 引数:
image- グレースケール(CV_8UC1)の入力画像。ROI のみを選択する必要がある場合は次のように使う:lsd_ptr->detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y);lines- 線の始点と終点を指定する Vec4f 要素のベクトル。Vec4f は (x1, y1, x2, y2) であり、point 1 が始点、point 2 が終点である。返される線は勾配に応じて厳密に向き付けされる。width- 線が見つかった領域の幅のベクトル。例えば線の幅。prec- Vector of precisions with which the lines are found. bigger the value, logarithmically better the detection.- -1 は平均10回の誤検出に対応する
- 0 は平均1回の誤検出に対応する
- 1 は 0.1 の平均誤警報数に対応する。このベクトルはオブジェクトの型が #LSD_REFINE_ADV の場合にのみ計算される。
-
detect
public void detect​(Mat image, Mat lines, Mat width)
Finds lines in the input image. This is the output of the default parameters of the algorithm on the above shown image. - 引数:
image- グレースケール(CV_8UC1)の入力画像。ROI のみを選択する必要がある場合は次のように使う:lsd_ptr->detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y);lines- 線の始点と終点を指定する Vec4f 要素のベクトル。Vec4f は (x1, y1, x2, y2) であり、point 1 が始点、point 2 が終点である。返される線は勾配に応じて厳密に向き付けされる。width- Vector of widths of the regions, where the lines are found. E.g. Width of line. bigger the value, logarithmically better the detection.- -1 は平均10回の誤検出に対応する
- 0 は平均1回の誤検出に対応する
- 1 は 0.1 の平均誤警報数に対応する。このベクトルはオブジェクトの型が #LSD_REFINE_ADV の場合にのみ計算される。
-
detect
public void detect​(Mat image, Mat lines)
Finds lines in the input image. This is the output of the default parameters of the algorithm on the above shown image. - 引数:
image- グレースケール(CV_8UC1)の入力画像。ROI のみを選択する必要がある場合は次のように使う:lsd_ptr->detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y);lines- A vector of Vec4f elements specifying the beginning and ending point of a line. Where Vec4f is (x1, y1, x2, y2), point 1 is the start, point 2 - end. Returned lines are strictly oriented depending on the gradient. bigger the value, logarithmically better the detection.- -1 は平均10回の誤検出に対応する
- 0 は平均1回の誤検出に対応する
- 1 は 0.1 の平均誤警報数に対応する。このベクトルはオブジェクトの型が #LSD_REFINE_ADV の場合にのみ計算される。
-
drawSegments
public void drawSegments​(Mat image, Mat lines)
Draws the line segments on a given image.- 引数:
image- 線が描画される画像。線が見つかった画像以上の大きさである必要がある。lines- 描画する必要のある線のベクトル。
-
compareSegments
public int compareSegments​(Size size, Mat lines1, Mat lines2, Mat image)
Draws two groups of lines in blue and red, counting the non overlapping (mismatching) pixels.- 引数:
size- lines1 と lines2 が見つかった画像のサイズ。lines1- 描画する必要のある線の最初のグループ。青色で可視化される。lines2- 線の2番目のグループ。赤色で可視化される。image- 線が描画される省略可能な画像。lines1 と lines2 を上記の色で描画するには、画像はカラー(3チャンネル)である必要がある。- 戻り値:
- 自動生成
-
compareSegments
public int compareSegments​(Size size, Mat lines1, Mat lines2)
Draws two groups of lines in blue and red, counting the non overlapping (mismatching) pixels.- 引数:
size- lines1 と lines2 が見つかった画像のサイズ。lines1- 描画する必要のある線の最初のグループ。青色で可視化される。lines2- 線の2番目のグループ。赤色で可視化される。lines1 と lines2 を上記の色で描画するため。- 戻り値:
- 自動生成
-
-