RenderedImage
. A "bin" is a container, where each element stores the total number of pixel samples of an image whose values lie within a given range. A histogram of an image consists of a list of such bins whose range does not overlap with each other (mutually exclusive). For an image that has multiple samples per pixel (multi-banded images), a separate list of bins represents each individual band.
A "low-value" specifies the lowest inclusive pixel value to be checked, and a "high-value" specifies the highest exclusive pixel value to be checked. Therefore, the width of a bin (binWidth
) is determined by (highValue - lowValue) / numberOfBins
. The range of bin i
is defined as from lowValue + i * binWidth
inclusive to lowValue + (i + 1) * binWidth
exclusive.
The image may have any data type. Its histogram may be accumulated over the entire image, or over a specific region-of-interest (ROI) within the image's bounds. Furthermore, the horizontal and vertical subsampling factors specify the rate of sampling in the two directions, so that only every nth pixel will be counted. This allows the accuracy of the histogram to be traded for the speed of the computation. Of course a subsampling rate of 1 means every pixel will be counted.
The "Histogram" operator generates the histogram data of an image and uses this object to store the final pixel counts. The operator returns an instance of this class when a request is made via the getProperty
method for the "histogram" property. The actual bins may be obtained by calling the getBins
method.
@see ROI
@see com.lightcrafts.mediax.jai.operator.HistogramDescriptor
Histogram for tracking the frequency of observations of values below interval upper bounds.
This class is useful for recording timings across a large number of observations when high performance is required.
The interval bounds are used to define the ranges of the histogram buckets. If provided bounds are [10,20,30,40,50] then there will be five buckets, accessible by index 0-4. Any value 0-10 will fall into the first interval bar, values 11-20 will fall into the second bar, and so on.
Histogram
defines the basic Histogram behavior..
@author Vlad Mihalcea
@version %I%, %E%
@since 1.0
RenderedImage
. A "bin" is a container, where each element stores the total number of pixel samples of an image whose values lie within a given range. A histogram of an image consists of a list of such bins whose range does not overlap with each other (mutually exclusive). For an image that has multiple samples per pixel (multi-banded images), a separate list of bins represents each individual band.
A "low-value" specifies the lowest inclusive pixel value to be checked, and a "high-value" specifies the highest exclusive pixel value to be checked. Therefore, the width of a bin (binWidth
) is determined by (highValue - lowValue) / numberOfBins
. The range of bin i
is defined as from lowValue + i * binWidth
inclusive to lowValue + (i + 1) * binWidth
exclusive.
The image may have any data type. Its histogram may be accumulated over the entire image, or over a specific region-of-interest (ROI) within the image's bounds. Furthermore, the horizontal and vertical subsampling factors specify the rate of sampling in the two directions, so that only every nth pixel will be counted. This allows the accuracy of the histogram to be traded for the speed of the computation. Of course a subsampling rate of 1 means every pixel will be counted.
The "Histogram" operator generates the histogram data of an image and uses this object to store the final pixel counts. The operator returns an instance of this class when a request is made via the getProperty
method for the "histogram" property. The actual bins may be obtained by calling the getBins
method.
@see ROI
@see javax.media.jai.operator.HistogramDescriptor
Histogram supports the recording and analyzing sampled data value counts across a configurable integer value range with configurable value precision within the range. Value precision is expressed as the number of significant digits in the value recording, and provides control over value quantization behavior across the value range and the subsequent value resolution at any given level.
For example, a Histogram could be configured to track the counts of observed integer values between 0 and 3,600,000,000 while maintaining a value precision of 3 significant digits across that range. Value quantization within the range will thus be no larger than 1/1,000th (or 0.1%) of any value. This example Histogram could be used to track and analyze the counts of observed response times ranging between 1 microsecond and 1 hour in magnitude, while maintaining a value resolution of 1 microsecond up to 1 millisecond, a resolution of 1 millisecond (or better) up to one second, and a resolution of 1 second (or better) up to 1,000 seconds. At it's maximum tracked value (1 hour), it would still maintain a resolution of 3.6 seconds (or better).
Histogram tracks value counts in long
fields. Smaller field types are available in the {@link org.HdrHistogram_voltpatches.IntHistogram} and {@link org.HdrHistogram_voltpatches.ShortHistogram} implementations of{@link org.HdrHistogram_voltpatches.AbstractHistogram}.
See package description for {@link org.HdrHistogram_voltpatches} for details.
When calling the public methods, in most cases the changes will not be visible until paint() has been called. To request that this be done, call repaint(). One exception is addPoint(), which makes the affect of the new point visible immediately (or nearly immediately) if the plot is visible on the screen.
The ASCII format for the file file contains any number commands, one per line. Unrecognized commands and commands with syntax errors are ignored. Comments are denoted by a line starting with a pound sign "#". The recognized commands include those supported by the base class, plus a few more. The commands are case insensitive, but are usually capitalized. The number of data sets to be plotted does not need to be specified. Data sets are added as needed. Each dataset is identified with a color (see the base class).
The appearance of the histogram can be altered by the following commands:
Bars: width Bars: width, offsetThe width is a real number specifying the width of the bars as a fraction of the bin width. It usually has a value less than or equal to one, and defaults to 0.5. The offset is a real number specifying how much the bar of the i th data set is offset from the previous one. This allows bars to "peek out" from behind the ones in front. It defaults to 0.15. Note that the frontmost data set will be the first one.
The width of each bin of the histogram can be specified using:
BinWidth: widthThis is given in whatever units the data has. By default, each bin is centered at x = nw, where w is the width of the bin and n is an integer. That bin represents values in the range (x - w/2, x + w/2). The alignment of the bins can be changed with the following command:
BinOffset: offsetIf this method is used with argument o, then each bin is centered at x = nw + o, and represents values in the range (x - w/2 + o, x + w/2 + o). So for example, if o = w/2, then each bin represents values from nw to (n + 1)w for some integer n. The default offset is 0.5, half the default bin width.
To specify data to be plotted, start a data set with the following command:
DataSet: stringHere, string is a label that will appear in the legend. It is not necessary to enclose the string in quotation marks. To start a new dataset without giving it a name, use:
DataSet:In this case, no item will appear in the legend. New datasets are plotted behind the previous ones. The data itself is given by a sequence of numbers, one per line. The numbers are specified as strings that can be parsed by the Double parser in Java. It is also possible to specify the numbers using all the formats accepted by the Plot class, so that the same data may be plotted by both classes. The x data is ignored, and only the y data is used to calculate the histogram. @author Edward A. Lee @version $Id: Histogram.java,v 1.50 2007/12/06 18:23:52 cxh Exp $ @since Ptolemy II 0.3 @Pt.ProposedRating Yellow (cxh) @Pt.AcceptedRating Yellow (cxh)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|