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

クラス SuperpixelSLIC


  • public class SuperpixelSLIC extends Algorithm
    CITE: Achanta2012 で説明されているSLIC (Simple Linear Iterative Clustering) スーパーピクセルアルゴリズムを実装したクラス。SLIC (Simple Linear Iterative Clustering) は、ピクセルチャンネルと画像平面空間を用いてピクセルをクラスタリングし、コンパクトでほぼ均一なスーパーピクセルを効率的に生成する。手法が単純なため、単一の引数でスーパーピクセル数を指定するだけで極めて簡単に使え、アルゴリズムの効率性により非常に実用的である。SLICクラスにはいくつかの最適化が利用できる。SLICOは「Zero parameter SLIC(引数ゼロのSLIC)」を意味し、CITE: Achanta2012 で説明されているベースラインSLICの最適化版である。MSLICは「Manifold SLIC」を意味し、CITE: Liu_2017_IEEE で説明されているベースラインSLICの最適化版である。
    • フィールドの要約

    • コンストラクタの要約

      コンストラクタ
      Modifier Constructor Description
      protected SuperpixelSLIC​(long addr)  
    • コンストラクタの詳細

      • SuperpixelSLIC

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

      • __fromPtr__

        public static SuperpixelSLIC __fromPtr__​(long addr)
      • getNumberOfSuperpixels

        public int getNumberOfSuperpixels()
        Calculates the actual amount of superpixels on a given segmentation computed and stored in SuperpixelSLIC object.
        戻り値:
        自動生成
      • iterate

        public void iterate​(int num_iterations)
        Calculates the superpixel segmentation on a given image with the initialized parameters in the SuperpixelSLIC object. This function can be called again without the need of initializing the algorithm with createSuperpixelSLIC(). This save the computational cost of allocating memory for all the structures of the algorithm.
        引数:
        num_iterations - 反復回数。数を増やすと結果が改善される。この関数は、createSuperpixelSLIC() 関数で初期化された引数を用いて画像のスーパーピクセルセグメンテーションを計算する。アルゴリズムはスーパーピクセルのグリッドから開始し、エッジ境界の更新を提案して境界を洗練する。
      • iterate

        public void iterate()
        Calculates the superpixel segmentation on a given image with the initialized parameters in the SuperpixelSLIC object. This function can be called again without the need of initializing the algorithm with createSuperpixelSLIC(). This save the computational cost of allocating memory for all the structures of the algorithm. The function computes the superpixels segmentation of an image with the parameters initialized with the function createSuperpixelSLIC(). The algorithms starts from a grid of superpixels and then refines the boundaries by proposing updates of edges boundaries.
      • 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_32SC1整数配列。ラベルは [0, getNumberOfSuperpixels()] の範囲にある。この関数は、スーパーピクセルセグメンテーションのラベルを持つ画像を返す。ラベルは [0, getNumberOfSuperpixels()] の範囲にある。
      • getLabelContourMask

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

        public void getLabelContourMask​(Mat image)
        Returns the mask of the superpixel segmentation stored in SuperpixelSLIC object.
        引数:
        image - 戻り値: CV_8U1の画像マスク。-1はそのピクセルがスーパーピクセルの境界であることを示し、それ以外は0となる。がマスクされる。この関数はスーパーピクセルセグメンテーションの境界を返す。
      • enforceLabelConnectivity

        public void enforceLabelConnectivity​(int min_element_size)
        Enforce label connectivity.
        引数:
        min_element_size - より大きなスーパーピクセルに吸収されるべき最小の要素サイズ(パーセント)。結果として得られる平均スーパーピクセルサイズに対して、有効な値は0〜100の範囲とする。25は4分の1未満のサイズのスーパーピクセルを吸収すべきことを意味し、これがデフォルトである。この関数は小さすぎるコンポーネントを併合し、先に見つかった隣接ラベルをそのコンポーネントに割り当てる。この関数を呼び出すと、最終的なスーパーピクセル数が変わることがある。
      • enforceLabelConnectivity

        public void enforceLabelConnectivity()
        Enforce label connectivity. superpixel. Given resulted average superpixel size valid value should be in 0-100 range, 25 means that less then a quarter sized superpixel should be absorbed, this is default. The function merge component that is too small, assigning the previously found adjacent label to this component. Calling this function may change the final number of superpixels.