Creates a histogram of the internal floating point values for the
image that you specify.
Namespace: Cognex.VisionPro.TrevistaAssembly: Cognex.VisionPro.Trevista (in Cognex.VisionPro.Trevista.dll) Version: 93.1.0.0
Syntax
Parameters
- whichImage
- Type: Cognex.VisionPro.Trevista CogTrevistaOutputImageConstants
An enumeration that specifies which image will be histogrammed.
- numElements
- Type: System Int32
The number of elements to create in the returned histogram array.
- minFloat
- Type: System Double
If expandRange is false, this output is the minimum floating point value found in the histogrammed image. If expandRange is true, this output is the smaller of:- The minimum floating point value found in the histogrammed image,
- The BlackLevel for the histogrammed image.
- The WhiteLevel for the histogrammed image.
- maxFloat
- Type: System Double
If expandRange is false, this output is the maximum floating point value found in the histogrammed image. If expandRange is true, this output is the larger of:- The maximum floating point value found in the histogrammed image,
- The BlackLevel for the histogrammed image.
- The WhiteLevel for the histogrammed image.
- expandRange
- Type: System Boolean
If true, the floating point range of the output histogram will be expanded (if necessary) to include both the BlackLevel and WhiteLevel values. If false, the floating point range of the output histogram will exactly match the range of values in the histogrammed image.
Return Value
Type: Int32A one-dimensional Array of integers that contains the requested histogram. Or null, if the histogram cannot be computed.
Exceptions
| Exception | Condition |
|---|---|
| ObjectDisposedException | If the object has been disposed. |
| ArgumentOutOfRangeException | The supplied whichImage argument is not a valid member of the CogTrevistaOutputImageConstants enumeration. |
| ArgumentOutOfRangeException | The supplied numElements argument is less than one. |
Remarks
The returned histogram represents the range of floating point numbers between minFloat and maxFloat, broken into numElements bins. The integer value in each bin is the number of image pixels whose value falls into that bin's portion of the full range. If expandRange is true, there may be zero-valued bins at either end of the returned histogram array.
The returned histogram is computed based on the results of the last call to Execute(ICogVisionData). If the specified image has never been computed, a null histogram will be returned, and minFloat and maxFloat will be set to zero.
See Also