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

クラス IntelligentScissorsMB


  • public class IntelligentScissorsMB extends java.lang.Object
    Intelligent Scissors による画像セグメンテーション。このクラスは、画像のセグメンテーションに利用できる2点間のパス(輪郭)を求めるために使用する。使用例: SNIPPET: snippets/photo_segmentation.cpp usage_example_intelligent_scissors 参考文献: <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.138.3811&rep=rep1&type=pdf">"Intelligent Scissors for Image Composition"</a> Eric N. MortensenおよびWilliam A. Barrett(ブリガムヤング大学)によって考案されたアルゴリズム。CITE: Mortensen95intelligentscissors
    • フィールドの要約

      フィールド
      Modifier and Type Field Description
      protected long nativeObj  
    • メソッドの要約

      すべてのメソッド 静的メソッド インスタンスメソッド 具象メソッド
      Modifier and Type Method Description
      static IntelligentScissorsMB __fromPtr__​(long addr)  
      IntelligentScissorsMB applyImage​(Mat image)
      Specify input image and extract image features
      IntelligentScissorsMB applyImageFeatures​(Mat non_edge, Mat gradient_direction, Mat gradient_magnitude)
      Specify custom features of input image Customized advanced variant of applyImage() call.
      IntelligentScissorsMB applyImageFeatures​(Mat non_edge, Mat gradient_direction, Mat gradient_magnitude, Mat image)
      Specify custom features of input image Customized advanced variant of applyImage() call.
      void buildMap​(Point sourcePt)
      Prepares a map of optimal paths for the given source point on the image 覚え書き: applyImage() / applyImageFeatures() must be called before this call
      void getContour​(Point targetPt, Mat contour)
      Extracts optimal contour for the given target point on the image 覚え書き: buildMap() must be called before this call
      void getContour​(Point targetPt, Mat contour, boolean backward)
      Extracts optimal contour for the given target point on the image 覚え書き: buildMap() must be called before this call
      long getNativeObjAddr()  
      IntelligentScissorsMB setEdgeFeatureCannyParameters​(double threshold1, double threshold2)
      Switch edge feature extractor to use Canny edge detector 覚え書き: "Laplacian Zero-Crossing" feature extractor is used by default (following to original article) SEE: Canny
      IntelligentScissorsMB setEdgeFeatureCannyParameters​(double threshold1, double threshold2, int apertureSize)
      Switch edge feature extractor to use Canny edge detector 覚え書き: "Laplacian Zero-Crossing" feature extractor is used by default (following to original article) SEE: Canny
      IntelligentScissorsMB setEdgeFeatureCannyParameters​(double threshold1, double threshold2, int apertureSize, boolean L2gradient)
      Switch edge feature extractor to use Canny edge detector 覚え書き: "Laplacian Zero-Crossing" feature extractor is used by default (following to original article) SEE: Canny
      IntelligentScissorsMB setEdgeFeatureZeroCrossingParameters()
      Switch to "Laplacian Zero-Crossing" edge feature extractor and specify its parameters This feature extractor is used by default according to article.
      IntelligentScissorsMB setEdgeFeatureZeroCrossingParameters​(float gradient_magnitude_min_value)
      Switch to "Laplacian Zero-Crossing" edge feature extractor and specify its parameters This feature extractor is used by default according to article.
      IntelligentScissorsMB setGradientMagnitudeMaxLimit()
      Specify gradient magnitude max value threshold Zero limit value is used to disable gradient magnitude thresholding (default behavior, as described in original article).
      IntelligentScissorsMB setGradientMagnitudeMaxLimit​(float gradient_magnitude_threshold_max)
      Specify gradient magnitude max value threshold Zero limit value is used to disable gradient magnitude thresholding (default behavior, as described in original article).
      IntelligentScissorsMB setWeights​(float weight_non_edge, float weight_gradient_direction, float weight_gradient_magnitude)
      Specify weights of feature functions Consider keeping weights normalized (sum of weights equals to 1.0) Discrete dynamic programming (DP) goal is minimization of costs between pixels.
      • クラス java.lang.Object から継承したメソッド

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • フィールドの詳細

      • nativeObj

        protected final long nativeObj
    • コンストラクタの詳細

      • IntelligentScissorsMB

        protected IntelligentScissorsMB​(long addr)
      • IntelligentScissorsMB

        public IntelligentScissorsMB()
    • メソッドの詳細

      • getNativeObjAddr

        public long getNativeObjAddr()
      • setWeights

        public IntelligentScissorsMB setWeights​(float weight_non_edge,
                                                float weight_gradient_direction,
                                                float weight_gradient_magnitude)
        Specify weights of feature functions Consider keeping weights normalized (sum of weights equals to 1.0) Discrete dynamic programming (DP) goal is minimization of costs between pixels.
        引数:
        weight_non_edge - 非エッジピクセルのコストを指定する(デフォルト: 0.43f)
        weight_gradient_direction - 勾配方向関数のコストを指定する(デフォルト: 0.43f)
        weight_gradient_magnitude - 勾配強度関数のコストを指定する(デフォルト: 0.14f)
        戻り値:
        自動生成
      • setGradientMagnitudeMaxLimit

        public IntelligentScissorsMB setGradientMagnitudeMaxLimit​(float gradient_magnitude_threshold_max)
        Specify gradient magnitude max value threshold Zero limit value is used to disable gradient magnitude thresholding (default behavior, as described in original article). Otherwize pixels with gradient magnitude &gt;= threshold have zero cost. 覚え書き: Thresholding should be used for images with irregular regions (to avoid stuck on parameters from high-contract areas, like embedded logos).
        引数:
        gradient_magnitude_threshold_max - 勾配強度の最大値しきい値を指定する(デフォルト: 0、無効)
        戻り値:
        自動生成
      • setGradientMagnitudeMaxLimit

        public IntelligentScissorsMB setGradientMagnitudeMaxLimit()
        Specify gradient magnitude max value threshold Zero limit value is used to disable gradient magnitude thresholding (default behavior, as described in original article). Otherwize pixels with gradient magnitude &gt;= threshold have zero cost. 覚え書き: Thresholding should be used for images with irregular regions (to avoid stuck on parameters from high-contract areas, like embedded logos).
        戻り値:
        自動生成
      • setEdgeFeatureZeroCrossingParameters

        public IntelligentScissorsMB setEdgeFeatureZeroCrossingParameters​(float gradient_magnitude_min_value)
        Switch to "Laplacian Zero-Crossing" edge feature extractor and specify its parameters This feature extractor is used by default according to article. Implementation has additional filtering for regions with low-amplitude noise. This filtering is enabled through parameter of minimal gradient amplitude (use some small value 4, 8, 16). 覚え書き: Current implementation of this feature extractor is based on processing of grayscale images (color image is converted to grayscale image first). 覚え書き: Canny edge detector is a bit slower, but provides better results (especially on color images): use setEdgeFeatureCannyParameters().
        引数:
        gradient_magnitude_min_value - エッジピクセルの最小勾配強度値(デフォルト: 0、チェックは無効)
        戻り値:
        自動生成
      • setEdgeFeatureZeroCrossingParameters

        public IntelligentScissorsMB setEdgeFeatureZeroCrossingParameters()
        Switch to "Laplacian Zero-Crossing" edge feature extractor and specify its parameters This feature extractor is used by default according to article. Implementation has additional filtering for regions with low-amplitude noise. This filtering is enabled through parameter of minimal gradient amplitude (use some small value 4, 8, 16). 覚え書き: Current implementation of this feature extractor is based on processing of grayscale images (color image is converted to grayscale image first). 覚え書き: Canny edge detector is a bit slower, but provides better results (especially on color images): use setEdgeFeatureCannyParameters().
        戻り値:
        自動生成
      • setEdgeFeatureCannyParameters

        public IntelligentScissorsMB setEdgeFeatureCannyParameters​(double threshold1,
                                                                   double threshold2,
                                                                   int apertureSize,
                                                                   boolean L2gradient)
        Switch edge feature extractor to use Canny edge detector 覚え書き: "Laplacian Zero-Crossing" feature extractor is used by default (following to original article) SEE: Canny
        引数:
        threshold1 - 自動生成
        threshold2 - 自動生成
        apertureSize - 自動生成
        L2gradient - 自動生成
        戻り値:
        自動生成
      • setEdgeFeatureCannyParameters

        public IntelligentScissorsMB setEdgeFeatureCannyParameters​(double threshold1,
                                                                   double threshold2,
                                                                   int apertureSize)
        Switch edge feature extractor to use Canny edge detector 覚え書き: "Laplacian Zero-Crossing" feature extractor is used by default (following to original article) SEE: Canny
        引数:
        threshold1 - 自動生成
        threshold2 - 自動生成
        apertureSize - 自動生成
        戻り値:
        自動生成
      • setEdgeFeatureCannyParameters

        public IntelligentScissorsMB setEdgeFeatureCannyParameters​(double threshold1,
                                                                   double threshold2)
        Switch edge feature extractor to use Canny edge detector 覚え書き: "Laplacian Zero-Crossing" feature extractor is used by default (following to original article) SEE: Canny
        引数:
        threshold1 - 自動生成
        threshold2 - 自動生成
        戻り値:
        自動生成
      • applyImage

        public IntelligentScissorsMB applyImage​(Mat image)
        Specify input image and extract image features
        引数:
        image - 入力画像。型は #CV_8UC1 / #CV_8UC3
        戻り値:
        自動生成
      • applyImageFeatures

        public IntelligentScissorsMB applyImageFeatures​(Mat non_edge,
                                                        Mat gradient_direction,
                                                        Mat gradient_magnitude,
                                                        Mat image)
        Specify custom features of input image Customized advanced variant of applyImage() call.
        引数:
        non_edge - 非エッジピクセルのコストを指定する。型は CV_8UC1。期待される値は {0, 1}。
        gradient_direction - 勾配方向の特徴を指定する。型は CV_32FC2。値は正規化されていることが期待される: x^2 + y^2 == 1
        gradient_magnitude - 勾配強度関数のコストを指定する。型は CV_32FC1。値は [0, 1] の範囲にあるべきである。
        image - 省略可能な引数。特徴のサブセットが指定された場合は指定しなければならない(指定されなかった特徴は内部で計算される)
        戻り値:
        自動生成
      • applyImageFeatures

        public IntelligentScissorsMB applyImageFeatures​(Mat non_edge,
                                                        Mat gradient_direction,
                                                        Mat gradient_magnitude)
        Specify custom features of input image Customized advanced variant of applyImage() call.
        引数:
        non_edge - 非エッジピクセルのコストを指定する。型は CV_8UC1。期待される値は {0, 1}。
        gradient_direction - 勾配方向の特徴を指定する。型は CV_32FC2。値は正規化されていることが期待される: x^2 + y^2 == 1
        gradient_magnitude - 勾配強度関数のコストを指定する。型は CV_32FC1。値は [0, 1] の範囲にあるべきである。
        戻り値:
        自動生成
      • buildMap

        public void buildMap​(Point sourcePt)
        Prepares a map of optimal paths for the given source point on the image 覚え書き: applyImage() / applyImageFeatures() must be called before this call
        引数:
        sourcePt - パスを求めるために使用する始点
      • getContour

        public void getContour​(Point targetPt,
                               Mat contour,
                               boolean backward)
        Extracts optimal contour for the given target point on the image 覚え書き: buildMap() must be called before this call
        引数:
        targetPt - 目標点
        contour - 画像の始点と目標点の間の最適なパスを構成するピクセルのリスト。型は CV_32SC2(std::vector&lt;Point&gt; と互換)
        backward - 取得するピクセルの順序を逆にするかどうかを示すフラグ(目標点から始点に向かって点を取得するには "true" を指定する)
      • getContour

        public void getContour​(Point targetPt,
                               Mat contour)
        Extracts optimal contour for the given target point on the image 覚え書き: buildMap() must be called before this call
        引数:
        targetPt - 目標点
        contour - 画像の始点と目標点の間の最適なパスを構成するピクセルのリスト。型は CV_32SC2(std::vector&lt;Point&gt; と互換)