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

クラス ScanSegment


  • public class ScanSegment extends Algorithm
    Loke SC らによる F-DBSCAN(並列化された DBSCAN アルゴリズムによる高速化スーパーピクセル画像セグメンテーション)スーパーピクセルアルゴリズムを実装したクラス。原論文は CITE: loke2021accelerated を参照。このアルゴリズムは、ノイズに強く、セグメンテーション品質において競争力があり、既存のスーパーピクセルセグメンテーション手法より高速な、並列化された DBSCAN クラスタ探索を用いる。Berkeley Segmentation Dataset で評価したところ、平均処理速度は 175 フレーム/s で、Boundary Recall は 0.797、Achievable Segmentation Accuracy は 0.944 であった。計算量は二次 O(n2) であり、より小さい画像に適しているが、2MP のカラー画像でも OpenCV の SEEDS アルゴリズムより高速に処理できる。出力は処理スレッド数を固定すれば決定的であり、入力画像が Lab カラーフォーマットであることを必要とする。
    • コンストラクタの詳細

      • ScanSegment

        protected ScanSegment​(long addr)
    • メソッドの詳細

      • __fromPtr__

        public static ScanSegment __fromPtr__​(long addr)
      • getNumberOfSuperpixels

        public int getNumberOfSuperpixels()
        Returns the actual superpixel segmentation from the last image processed using iterate. Returns zero if no image has been processed.
        戻り値:
        自動生成
      • iterate

        public void iterate​(Mat img)
        Calculates the superpixel segmentation on a given image with the initialized parameters in the ScanSegment object. This function can be called again for other images without the need of initializing the algorithm with createScanSegment(). This save the computational cost of allocating memory for all the structures of the algorithm.
        引数:
        img - 入力画像。サポートされるフォーマット: CV_8UC3。画像サイズは createScanSegment() で初期化された画像サイズと一致しなければならない。Lab 色空間でなければならない。
      • getLabels

        public void getLabels​(Mat labels_out)
        Returns the segmentation labeling of the image. Each label represents a superpixel, and each pixel is assigned to one superpixel label.
        引数:
        labels_out - 戻り値: スーパーピクセルセグメンテーションのラベルを格納した CV_32UC1 の整数配列。ラベルは [0, getNumberOfSuperpixels()] の範囲内である。
      • getLabelContourMask

        public void getLabelContourMask​(Mat image,
                                        boolean thick_line)
        Returns the mask of the superpixel segmentation stored in the ScanSegment object. The function return the boundaries of the superpixel segmentation.
        引数:
        image - 戻り値: CV_8UC1 の画像マスク。-1 はそのピクセルがスーパーピクセルの境界であることを示し、それ以外は 0 となる。
        thick_line - false の場合、境界は 1 ピクセル幅のみとなる。そうでない場合、境界上のすべてのピクセルがマスクされる。
      • getLabelContourMask

        public void getLabelContourMask​(Mat image)
        Returns the mask of the superpixel segmentation stored in the ScanSegment object. The function return the boundaries of the superpixel segmentation.
        引数:
        image - 戻り値: CV_8UC1 の画像マスク。-1 はそのピクセルがスーパーピクセルの境界であることを示し、それ以外は 0 となる。