Class SparseHistoCreator

  • All Implemented Interfaces:
    ISTSparseHistoCreator

    public class SparseHistoCreator
    extends Object
    implements ISTSparseHistoCreator
    This class is used to create a histogram of the sparse representation elements. It assumes that the minimum size of an object is 5x5 as this is what objects are automatically sized to if they are smaller than this when using the database connection class in this library. It also assumes that patches are extracted by starting in the upper left corner of the object, then moving down by one step to extract the next patch, until the bottom of the object is reached. Then it moves to the right by one and starts at the top again. This is what is done by the Image Patch Vectorizer in this library when step size is set to one. The weights of each element are determined by how close center of the patch being processed is to the center of the object, using an isotropic gaussian kernel. From Kempton et. al. 2015 and 2018.
    Author:
    Dustin Kempton, Data Mining Lab, Georgia State University
    • Constructor Detail

      • SparseHistoCreator

        public SparseHistoCreator​(int patchSize,
                                  int paramDownSample)
        Constructor
        Parameters:
        patchSize - The size of the patches used in the construction of the input matrix when creating the sparse representation matrix.
        paramDownSample - The down sampling value for the objects that are passed in. The objects are generally in full resolution size but the image parameters are a down sampling of the original image, so we need to shrink the objects using this value.
    • Method Detail

      • createTargetHisto

        public double[] createTargetHisto​(smile.math.matrix.SparseMatrix alpha,
                                          org.locationtech.jts.geom.Envelope bbox)
        Description copied from interface: ISTSparseHistoCreator
        Returns a histogram representing the rows of the sparse input matrix.
        Specified by:
        createTargetHisto in interface ISTSparseHistoCreator
        Parameters:
        alpha - The sparse matrix representing the area of interest to create the histogram from the rows.
        bbox - The area that is represented by alpha.
        Returns:
        The histogram of the input matrix.
      • createCandidateHisto

        public double[] createCandidateHisto​(smile.math.matrix.SparseMatrix alpha,
                                             org.locationtech.jts.geom.Envelope originalBBox,
                                             org.locationtech.jts.geom.Envelope candidateBBox)
        Description copied from interface: ISTSparseHistoCreator
        Returns a histogram representing the rows of the sparse input matrix.
        Specified by:
        createCandidateHisto in interface ISTSparseHistoCreator
        Parameters:
        alpha - The sparse matrix representing the area of interest to create the histogram from the rows.
        originalBBox - The original object area used to adjust weights by how much the candidate needs to scale to match the original.
        candidateBBox - The candidate area that is represented by alpha.
        Returns:
        The histogram of the input matrix.