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

クラス PCTSignatures


  • public class PCTSignatures extends Algorithm
    CITE: KrulisLS16 で説明されている、PCT (position-color-texture) シグネチャ抽出を実装するクラス。アルゴリズムは特徴サンプラとクラスタライザに分かれている。特徴サンプラは与えられた座標集合でサンプルを生成する。次にクラスタライザはk-meansアルゴリズムを用いてこれらのサンプルのクラスタを生成する。得られたクラスタの集合が入力画像のシグネチャとなる。シグネチャはSIGNATURE_DIMENSION次元の点の配列である。使用される次元は、重み、x座標、y位置、lab色、コントラスト、エントロピーである。CITE: KrulisLS16 CITE: BeecksUS10
    • コンストラクタの要約

      コンストラクタ
      Modifier Constructor Description
      protected PCTSignatures​(long addr)  
    • メソッドの要約

      すべてのメソッド 静的メソッド インスタンスメソッド 具象メソッド
      Modifier and Type Method Description
      static PCTSignatures __fromPtr__​(long addr)  
      void computeSignature​(Mat image, Mat signature)
      Computes signature of given image.
      void computeSignatures​(java.util.List<Mat> images, java.util.List<Mat> signatures)
      Computes signatures for multiple images in parallel.
      static PCTSignatures create()
      Creates PCTSignatures algorithm using sample and seed count.
      static PCTSignatures create​(int initSampleCount)
      Creates PCTSignatures algorithm using sample and seed count.
      static PCTSignatures create​(int initSampleCount, int initSeedCount)
      Creates PCTSignatures algorithm using sample and seed count.
      static PCTSignatures create​(int initSampleCount, int initSeedCount, int pointDistribution)
      Creates PCTSignatures algorithm using sample and seed count.
      static PCTSignatures create​(MatOfPoint2f initSamplingPoints, int initSeedCount)
      Creates PCTSignatures algorithm using pre-generated sampling points and number of clusterization seeds.
      static PCTSignatures create​(MatOfPoint2f initSamplingPoints, MatOfInt initClusterSeedIndexes)
      Creates PCTSignatures algorithm using pre-generated sampling points and clusterization seeds indexes.
      static void drawSignature​(Mat source, Mat signature, Mat result)
      Draws signature in the source image and outputs the result.
      static void drawSignature​(Mat source, Mat signature, Mat result, float radiusToShorterSideRatio)
      Draws signature in the source image and outputs the result.
      static void drawSignature​(Mat source, Mat signature, Mat result, float radiusToShorterSideRatio, int borderThickness)
      Draws signature in the source image and outputs the result.
      static void generateInitPoints​(MatOfPoint2f initPoints, int count, int pointDistribution)
      Generates initial sampling points according to selected point distribution.
      int getClusterMinSize()
      This parameter multiplied by the index of iteration gives lower limit for cluster size.
      int getDistanceFunction()
      Distance function selector used for measuring distance between two points in k-means.
      float getDropThreshold()
      Remove centroids in k-means whose weight is lesser or equal to given threshold.
      int getGrayscaleBits()
      Color resolution of the greyscale bitmap represented in allocated bits (i.e., value 4 means that 16 shades of grey are used).
      int getInitSeedCount()
      Number of initial seeds (initial number of clusters) for the k-means algorithm.
      MatOfInt getInitSeedIndexes()
      Initial seeds (initial number of clusters) for the k-means algorithm.
      int getIterationCount()
      Number of iterations of the k-means clustering.
      float getJoiningDistance()
      Threshold euclidean distance between two centroids.
      int getMaxClustersCount()
      Maximal number of generated clusters.
      int getSampleCount()
      Number of initial samples taken from the image.
      MatOfPoint2f getSamplingPoints()
      Initial samples taken from the image.
      float getWeightA()
      Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast.
      float getWeightB()
      Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast.
      float getWeightContrast()
      Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast.
      float getWeightEntropy()
      Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast.
      float getWeightL()
      Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast.
      float getWeightX()
      Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast.
      float getWeightY()
      Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast.
      int getWindowRadius()
      Size of the texture sampling window used to compute contrast and entropy (center of the window is always in the pixel selected by x,y coordinates of the corresponding feature sample).
      void setClusterMinSize​(int clusterMinSize)
      This parameter multiplied by the index of iteration gives lower limit for cluster size.
      void setDistanceFunction​(int distanceFunction)
      Distance function selector used for measuring distance between two points in k-means.
      void setDropThreshold​(float dropThreshold)
      Remove centroids in k-means whose weight is lesser or equal to given threshold.
      void setGrayscaleBits​(int grayscaleBits)
      Color resolution of the greyscale bitmap represented in allocated bits (i.e., value 4 means that 16 shades of grey are used).
      void setInitSeedIndexes​(MatOfInt initSeedIndexes)
      Initial seed indexes for the k-means algorithm.
      void setIterationCount​(int iterationCount)
      Number of iterations of the k-means clustering.
      void setJoiningDistance​(float joiningDistance)
      Threshold euclidean distance between two centroids.
      void setMaxClustersCount​(int maxClustersCount)
      Maximal number of generated clusters.
      void setSamplingPoints​(MatOfPoint2f samplingPoints)
      Sets sampling points used to sample the input image.
      void setTranslation​(int idx, float value)
      Translations of the individual axes of the feature space.
      void setTranslations​(MatOfFloat translations)
      Translations of the individual axes of the feature space.
      void setWeight​(int idx, float value)
      Weights (multiplicative constants) that linearly stretch individual axes of the feature space.
      void setWeightA​(float weight)
      Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast.
      void setWeightB​(float weight)
      Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast.
      void setWeightContrast​(float weight)
      Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast.
      void setWeightEntropy​(float weight)
      Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast.
      void setWeightL​(float weight)
      Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast.
      void setWeights​(MatOfFloat weights)
      Weights (multiplicative constants) that linearly stretch individual axes of the feature space.
      void setWeightX​(float weight)
      Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast.
      void setWeightY​(float weight)
      Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast.
      void setWindowRadius​(int radius)
      Size of the texture sampling window used to compute contrast and entropy (center of the window is always in the pixel selected by x,y coordinates of the corresponding feature sample).
      • クラス java.lang.Object から継承したメソッド

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • コンストラクタの詳細

      • PCTSignatures

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

      • __fromPtr__

        public static PCTSignatures __fromPtr__​(long addr)
      • create

        public static PCTSignatures create​(int initSampleCount,
                                           int initSeedCount,
                                           int pointDistribution)
        Creates PCTSignatures algorithm using sample and seed count. It generates its own sets of sampling points and clusterization seed indexes.
        引数:
        initSampleCount - 画像サンプリングに使用する点の数。
        initSeedCount - 初期クラスタリングのシード数。initSampleCount以下でなければならない。
        pointDistribution - 生成される点の分布。デフォルト: UNIFORM。指定可能: UNIFORM, REGULAR, NORMAL。
        戻り値:
        生成されたアルゴリズム。
      • create

        public static PCTSignatures create​(int initSampleCount,
                                           int initSeedCount)
        Creates PCTSignatures algorithm using sample and seed count. It generates its own sets of sampling points and clusterization seed indexes.
        引数:
        initSampleCount - 画像サンプリングに使用する点の数。
        initSeedCount - 初期クラスタリングのシード数。initSampleCount以下でなければならない。指定可能: UNIFORM, REGULAR, NORMAL。
        戻り値:
        生成されたアルゴリズム。
      • create

        public static PCTSignatures create​(int initSampleCount)
        Creates PCTSignatures algorithm using sample and seed count. It generates its own sets of sampling points and clusterization seed indexes.
        引数:
        initSampleCount - 画像サンプリングに使用する点の数。initSampleCount以下でなければならない。指定可能: UNIFORM, REGULAR, NORMAL。
        戻り値:
        生成されたアルゴリズム。
      • create

        public static PCTSignatures create()
        Creates PCTSignatures algorithm using sample and seed count. It generates its own sets of sampling points and clusterization seed indexes. Must be lower or equal to initSampleCount Available: UNIFORM, REGULAR, NORMAL.
        戻り値:
        生成されたアルゴリズム。
      • create

        public static PCTSignatures create​(MatOfPoint2f initSamplingPoints,
                                           int initSeedCount)
        Creates PCTSignatures algorithm using pre-generated sampling points and number of clusterization seeds. It uses the provided sampling points and generates its own clusterization seed indexes.
        引数:
        initSamplingPoints - 画像サンプリングで使用するサンプリング点。
        initSeedCount - 初期クラスタリングのシード数。initSamplingPoints.size()以下でなければならない。
        戻り値:
        生成されたアルゴリズム。
      • create

        public static PCTSignatures create​(MatOfPoint2f initSamplingPoints,
                                           MatOfInt initClusterSeedIndexes)
        Creates PCTSignatures algorithm using pre-generated sampling points and clusterization seeds indexes.
        引数:
        initSamplingPoints - 画像サンプリングで使用するサンプリング点。
        initClusterSeedIndexes - クラスタリングの初期シードのインデックス。そのサイズは initSamplingPoints.size() 以下でなければならない。
        戻り値:
        生成されたアルゴリズム。
      • computeSignature

        public void computeSignature​(Mat image,
                                     Mat signature)
        Computes signature of given image.
        引数:
        image - CV_8U 型の入力画像。
        signature - 計算されたシグネチャの出力。
      • computeSignatures

        public void computeSignatures​(java.util.List<Mat> images,
                                      java.util.List<Mat> signatures)
        Computes signatures for multiple images in parallel.
        引数:
        images - CV_8U 型の入力画像のベクトル。
        signatures - 計算されたシグネチャのベクトル。
      • drawSignature

        public static void drawSignature​(Mat source,
                                         Mat signature,
                                         Mat result,
                                         float radiusToShorterSideRatio,
                                         int borderThickness)
        Draws signature in the source image and outputs the result. Signatures are visualized as a circle with radius based on signature weight and color based on signature color. Contrast and entropy are not visualized.
        引数:
        source - 元画像。
        signature - 画像のシグネチャ。
        result - 出力結果。
        radiusToShorterSideRatio - 出力画像におけるシグネチャの最大半径を決定する。
        borderThickness - 可視化されたシグネチャの境界の太さ。
      • drawSignature

        public static void drawSignature​(Mat source,
                                         Mat signature,
                                         Mat result,
                                         float radiusToShorterSideRatio)
        Draws signature in the source image and outputs the result. Signatures are visualized as a circle with radius based on signature weight and color based on signature color. Contrast and entropy are not visualized.
        引数:
        source - 元画像。
        signature - 画像のシグネチャ。
        result - 出力結果。
        radiusToShorterSideRatio - 出力画像におけるシグネチャの最大半径を決定する。
      • drawSignature

        public static void drawSignature​(Mat source,
                                         Mat signature,
                                         Mat result)
        Draws signature in the source image and outputs the result. Signatures are visualized as a circle with radius based on signature weight and color based on signature color. Contrast and entropy are not visualized.
        引数:
        source - 元画像。
        signature - 画像のシグネチャ。
        result - 出力結果。
      • generateInitPoints

        public static void generateInitPoints​(MatOfPoint2f initPoints,
                                              int count,
                                              int pointDistribution)
        Generates initial sampling points according to selected point distribution.
        引数:
        initPoints - 生成された点が保存される出力ベクトル。
        count - 生成する点の数。
        pointDistribution - 点の分布セレクタ。利用可能: UNIFORM, REGULAR, NORMAL。覚え書き: 生成される座標は範囲 [0..1) 内である
      • getSampleCount

        public int getSampleCount()
        Number of initial samples taken from the image.
        戻り値:
        自動生成
      • getGrayscaleBits

        public int getGrayscaleBits()
        Color resolution of the greyscale bitmap represented in allocated bits (i.e., value 4 means that 16 shades of grey are used). The greyscale bitmap is used for computing contrast and entropy values.
        戻り値:
        自動生成
      • setGrayscaleBits

        public void setGrayscaleBits​(int grayscaleBits)
        Color resolution of the greyscale bitmap represented in allocated bits (i.e., value 4 means that 16 shades of grey are used). The greyscale bitmap is used for computing contrast and entropy values.
        引数:
        grayscaleBits - 自動生成
      • getWindowRadius

        public int getWindowRadius()
        Size of the texture sampling window used to compute contrast and entropy (center of the window is always in the pixel selected by x,y coordinates of the corresponding feature sample).
        戻り値:
        自動生成
      • setWindowRadius

        public void setWindowRadius​(int radius)
        Size of the texture sampling window used to compute contrast and entropy (center of the window is always in the pixel selected by x,y coordinates of the corresponding feature sample).
        引数:
        radius - 自動生成
      • getWeightX

        public float getWeightX()
        Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast. e = entropy)
        戻り値:
        自動生成
      • setWeightX

        public void setWeightX​(float weight)
        Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast. e = entropy)
        引数:
        weight - 自動生成
      • getWeightY

        public float getWeightY()
        Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast. e = entropy)
        戻り値:
        自動生成
      • setWeightY

        public void setWeightY​(float weight)
        Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast. e = entropy)
        引数:
        weight - 自動生成
      • getWeightL

        public float getWeightL()
        Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast. e = entropy)
        戻り値:
        自動生成
      • setWeightL

        public void setWeightL​(float weight)
        Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast. e = entropy)
        引数:
        weight - 自動生成
      • getWeightA

        public float getWeightA()
        Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast. e = entropy)
        戻り値:
        自動生成
      • setWeightA

        public void setWeightA​(float weight)
        Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast. e = entropy)
        引数:
        weight - 自動生成
      • getWeightB

        public float getWeightB()
        Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast. e = entropy)
        戻り値:
        自動生成
      • setWeightB

        public void setWeightB​(float weight)
        Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast. e = entropy)
        引数:
        weight - 自動生成
      • getWeightContrast

        public float getWeightContrast()
        Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast. e = entropy)
        戻り値:
        自動生成
      • setWeightContrast

        public void setWeightContrast​(float weight)
        Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast. e = entropy)
        引数:
        weight - 自動生成
      • getWeightEntropy

        public float getWeightEntropy()
        Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast. e = entropy)
        戻り値:
        自動生成
      • setWeightEntropy

        public void setWeightEntropy​(float weight)
        Weights (multiplicative constants) that linearly stretch individual axes of the feature space (x,y = position; L,a,b = color in CIE Lab space; c = contrast. e = entropy)
        引数:
        weight - 自動生成
      • getSamplingPoints

        public MatOfPoint2f getSamplingPoints()
        Initial samples taken from the image. These sampled features become the input for clustering.
        戻り値:
        自動生成
      • setWeight

        public void setWeight​(int idx,
                              float value)
        Weights (multiplicative constants) that linearly stretch individual axes of the feature space.
        引数:
        idx - 重みの ID
        value - 重みの値 覚え書き: WEIGHT_IDX = 0; X_IDX = 1; Y_IDX = 2; L_IDX = 3; A_IDX = 4; B_IDX = 5; CONTRAST_IDX = 6; ENTROPY_IDX = 7;
      • setWeights

        public void setWeights​(MatOfFloat weights)
        Weights (multiplicative constants) that linearly stretch individual axes of the feature space.
        引数:
        weights - すべての重みの値。覚え書き: WEIGHT_IDX = 0; X_IDX = 1; Y_IDX = 2; L_IDX = 3; A_IDX = 4; B_IDX = 5; CONTRAST_IDX = 6; ENTROPY_IDX = 7;
      • setTranslation

        public void setTranslation​(int idx,
                                   float value)
        Translations of the individual axes of the feature space.
        引数:
        idx - 平行移動の ID
        value - 平行移動の値 覚え書き: WEIGHT_IDX = 0; X_IDX = 1; Y_IDX = 2; L_IDX = 3; A_IDX = 4; B_IDX = 5; CONTRAST_IDX = 6; ENTROPY_IDX = 7;
      • setTranslations

        public void setTranslations​(MatOfFloat translations)
        Translations of the individual axes of the feature space.
        引数:
        translations - すべての平行移動の値。覚え書き: WEIGHT_IDX = 0; X_IDX = 1; Y_IDX = 2; L_IDX = 3; A_IDX = 4; B_IDX = 5; CONTRAST_IDX = 6; ENTROPY_IDX = 7;
      • setSamplingPoints

        public void setSamplingPoints​(MatOfPoint2f samplingPoints)
        Sets sampling points used to sample the input image.
        引数:
        samplingPoints - 範囲 [0..1) 内のサンプリング点のベクトル 覚え書き: サンプリング点の数はクラスタリングのシード数以上でなければならない。
      • getInitSeedIndexes

        public MatOfInt getInitSeedIndexes()
        Initial seeds (initial number of clusters) for the k-means algorithm.
        戻り値:
        自動生成
      • setInitSeedIndexes

        public void setInitSeedIndexes​(MatOfInt initSeedIndexes)
        Initial seed indexes for the k-means algorithm.
        引数:
        initSeedIndexes - 自動生成
      • getInitSeedCount

        public int getInitSeedCount()
        Number of initial seeds (initial number of clusters) for the k-means algorithm.
        戻り値:
        自動生成
      • getIterationCount

        public int getIterationCount()
        Number of iterations of the k-means clustering. We use fixed number of iterations, since the modified clustering is pruning clusters (not iteratively refining k clusters).
        戻り値:
        自動生成
      • setIterationCount

        public void setIterationCount​(int iterationCount)
        Number of iterations of the k-means clustering. We use fixed number of iterations, since the modified clustering is pruning clusters (not iteratively refining k clusters).
        引数:
        iterationCount - 自動生成
      • getMaxClustersCount

        public int getMaxClustersCount()
        Maximal number of generated clusters. If the number is exceeded, the clusters are sorted by their weights and the smallest clusters are cropped.
        戻り値:
        自動生成
      • setMaxClustersCount

        public void setMaxClustersCount​(int maxClustersCount)
        Maximal number of generated clusters. If the number is exceeded, the clusters are sorted by their weights and the smallest clusters are cropped.
        引数:
        maxClustersCount - 自動生成
      • getClusterMinSize

        public int getClusterMinSize()
        This parameter multiplied by the index of iteration gives lower limit for cluster size. Clusters containing fewer points than specified by the limit have their centroid dismissed and points are reassigned.
        戻り値:
        自動生成
      • setClusterMinSize

        public void setClusterMinSize​(int clusterMinSize)
        This parameter multiplied by the index of iteration gives lower limit for cluster size. Clusters containing fewer points than specified by the limit have their centroid dismissed and points are reassigned.
        引数:
        clusterMinSize - 自動生成
      • getJoiningDistance

        public float getJoiningDistance()
        Threshold euclidean distance between two centroids. If two cluster centers are closer than this distance, one of the centroid is dismissed and points are reassigned.
        戻り値:
        自動生成
      • setJoiningDistance

        public void setJoiningDistance​(float joiningDistance)
        Threshold euclidean distance between two centroids. If two cluster centers are closer than this distance, one of the centroid is dismissed and points are reassigned.
        引数:
        joiningDistance - 自動生成
      • getDropThreshold

        public float getDropThreshold()
        Remove centroids in k-means whose weight is lesser or equal to given threshold.
        戻り値:
        自動生成
      • setDropThreshold

        public void setDropThreshold​(float dropThreshold)
        Remove centroids in k-means whose weight is lesser or equal to given threshold.
        引数:
        dropThreshold - 自動生成
      • getDistanceFunction

        public int getDistanceFunction()
        Distance function selector used for measuring distance between two points in k-means.
        戻り値:
        自動生成
      • setDistanceFunction

        public void setDistanceFunction​(int distanceFunction)
        Distance function selector used for measuring distance between two points in k-means. Available: L0_25, L0_5, L1, L2, L2SQUARED, L5, L_INFINITY.
        引数:
        distanceFunction - 自動生成