CorrectCalibratedImage Method
Syntax
CWIMAQVision.CorrectCalibratedImage SourceImage, DestImage [, Regions] [, ReplaceValue = 0.0] [, InterpolateMethod = cwimaqInterpolateZeroOrder ]
Return Type
On success, this method returns 0. On failure, this method returns a negative number.
Purpose
Corrects a calibrated image by applying a calibration to create a spatially correct image.
Remarks
Use this method with image types U8, I16, SGL, RGB32, and HSL32.
Parameters
SourceImage As CWIMAQImage
The calibrated image to correct.
DestImage As CWIMAQImage
The corrected image.
Regions As Variant
[Optional] A CWIMAQRegions object representing the portion of the image the method corrects. If you do not supply this parameter, the method corrects the entire image.
ReplaceValue As Variant
[Optional] The pixel replace value for pixel points that cannot be corrected.
This parameter has a default value of 0.0.
InterpolateMethod As Variant
[Optional] A CWIMAQInterpolateMethods constant specifying the method of interpolation. Valid interpolation methods for correction are cwimaqInterpolateZeroOrder and cwimaqInterpolateBiLinear.
This parameter has a default value of cwimaqInterpolateZeroOrder .
Example
Dim i As New CWIMAQImage Dim simpleCalibrationOptions As New CWIMAQSimpleCalibrationOptions ' Calibrate the image in Viewer1 simpleCalibrationOptions.CalibrationAxisInfo.Angle = 45 simpleCalibrationOptions.GridDescriptor.XStep = 10 simpleCalibrationOptions.GridDescriptor.YStep = 10 simpleCalibrationOptions.GridDescriptor.Unit = cwimaqCalUnitMeter CWIMAQVision1.SetSimpleCalibration CWIMAQViewer1.Image, _ simpleCalibrationOptions ' Correct the calibrated image in CWIMAQViewer1 and ' store the result in i. CWIMAQVision1.CorrectCalibratedImage CWIMAQViewer1.Image, i, , , _ cwimaqInterpolateBiLinear