org.openimaj.image.analysis.algorithm.histogram

Class InterpolatedBinnedWindowedExtractor

    • Constructor Detail

      • InterpolatedBinnedWindowedExtractor

        public InterpolatedBinnedWindowedExtractor(int nbins)
        Construct with the given number of bins. The histogram is not cyclic. The minimum expected value is assumed to be 0 and the maximum 1.
        Parameters:
        nbins - number of bins
      • InterpolatedBinnedWindowedExtractor

        public InterpolatedBinnedWindowedExtractor(int nbins,
                                           boolean wrap)
        Construct with the given number of bins. The histogram is optionally cyclic. The minimum expected value is assumed to be 0 and the maximum 1.
        Parameters:
        nbins - number of bins
        wrap - true if the histogram is cyclic; false otherwise
      • InterpolatedBinnedWindowedExtractor

        public InterpolatedBinnedWindowedExtractor(int nbins,
                                           float min,
                                           float max)
        Construct with the given number of bins, and range. The histogram is not cyclic.
        Parameters:
        nbins - number of bins
        min - minimum expected value
        max - maximum expected value
      • InterpolatedBinnedWindowedExtractor

        public InterpolatedBinnedWindowedExtractor(int nbins,
                                           float min,
                                           float max,
                                           boolean wrap)
        Construct with the given number of bins, and range. The histogram is optionally cyclic.
        Parameters:
        nbins - number of bins
        min - minimum expected value
        max - maximum expected value
        wrap - true if the histogram is cyclic; false otherwise
    • Method Detail

      • computeHistogram

        public Histogram computeHistogram(int x,
                                 int y,
                                 int w,
                                 int h,
                                 FImage extWeights)
        Description copied from class: BinnedWindowedExtractor
        Compute the histogram for the given window. The weight for each bin is taken from the given weights image.
        Overrides:
        computeHistogram in class BinnedWindowedExtractor
        Parameters:
        x - The x-coordinate of the top-left of the window
        y - The y-coordinate of the top-left of the window
        w - The width of the window
        h - The height of the window
        extWeights - the weights image. Must be the same size as the analysed image.
        Returns:
        the histogram in the window of the last analysed image
      • computeHistogram

        public Histogram computeHistogram(int x,
                                 int y,
                                 FImage extWeights,
                                 FImage windowWeights)
        Description copied from class: BinnedWindowedExtractor
        Compute the histogram for the given window. The weight for each bin is taken from the given weights image, and is multiplied by the corresponding weight in the window image before accumulation. The size of the window is taken from the window weights image.

        This method primarily allows you to compute a spatially weighted histogram. For example, the window weights image could be a 2D Gaussian, and thus the histogram would apply more weight on to the centre pixels.

        Overrides:
        computeHistogram in class BinnedWindowedExtractor
        Parameters:
        x - The x-coordinate of the top-left of the window
        y - The y-coordinate of the top-left of the window
        extWeights - The weights image. Must be the same size as the analysed image.
        windowWeights - The weights for each pixel in the window.
        Returns:
        the histogram in the window of the last analysed image
      • getWeightsMap

        public float[][] getWeightsMap()
        Get the weights map
        Returns:
        the weights map