Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 65.1.0.0
Parameters
- inputImage
- Type: Cognex.VisionPro ICogImage
The image to convert.
- x
- Type: System Int32
The X-coordinate in pixels of the origin of the region to convert.
- y
- Type: System Int32
The Y-coordinate in pixels of the origin of the region to convert.
- width
- Type: System Int32
The width in pixels of the region to convert.
- height
- Type: System Int32
The height in pixels of the region to convert.
- redGreyscaleWeight
- Type: System Double
The weighting value by which to multiply the input image red value (default: 0.299).
- greenGreyscaleWeight
- Type: System Double
The weighting value by which to multiply the input image green value (default: 0.587).
- blueGreyscaleWeight
- Type: System Double
The weighting value by which to multiply the input image blue value (default: 0.114).
Return Value
Type: CogImage8GreyThe converted image.
| Exception | Condition |
|---|---|
| CogOperatorNoInputImageException | inputImage is null. |
| CogImageBadTypeException | inputImage does not refer to an image type that can be used to represent a Bayer-format image. |
| CogImageNoPixelsException | inputImage is not allocated. |
| CogImageClippedException | x is less than 0 or greater than or equal to the width of inputImage; y is less than 0 or greater than or equal to the height of inputImage; x plus width is greater than the width of inputImage; or y plus height is greater than the height of inputImage. |
| ArgumentException | width or height is not an even multiple of 2. |
| ArgumentException | redGreyscaleWeight, greenGreyscaleWeight, or BluewGreyscaleWeight is less than 0. |
| ArgumentException | redGreyscaleWeight + greenGreyscaleWeight + BluewGreyscaleWeight does not equal 1.0. |
Produce an intensity image from the supplied Bayer format image.
If x, y, width, and height are all zero, then the entire image is converted. Otherwise, only the specified portion of the image is converted.
The redGreyscaleWeight, greenGreyscaleWeight, and blueGreyscaleWeight parameters must add up to 1.0. These parameters are multiplied by each pixel's red, green, and blue values to compute the intensity value.