Method FindTransformECCWithMask
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
FindTransformECCWithMask(InputArray, InputArray, InputArray, InputArray, InputOutputArray, MotionTypes, TermCriteria?, int)
Finds the geometric transform (warp) between two images in terms of the ECC criterion, using validity masks for both the template and the input images. This extends FindTransformECC(InputArray, InputArray, InputOutputArray, MotionTypes, TermCriteria?, InputArray) by adding a mask for the template image. The Enhanced Correlation Coefficient is evaluated only over pixels that are valid in both images: on each iteration inputMask is warped into the template frame and combined with templateMask, and only the intersection of these masks contributes to the objective function.
public static double FindTransformECCWithMask(InputArray templateImage, InputArray inputImage, InputArray templateMask, InputArray inputMask, InputOutputArray warpMatrix, MotionTypes motionType = MotionTypes.Affine, TermCriteria? criteria = null, int gaussFiltSize = 5)
Parameters
templateImageInputArray1 or 3 channel template image; CV_8U, CV_16U, CV_32F, CV_64F type.
inputImageInputArrayinput image which should be warped with the final warpMatrix in order to provide an image similar to templateImage, same type as templateImage.
templateMaskInputArraysingle-channel 8-bit mask for templateImage indicating valid pixels to be used in the alignment. Must have the same size as templateImage.
inputMaskInputArraysingle-channel 8-bit mask for inputImage indicating valid pixels before warping. Must have the same size as inputImage.
warpMatrixInputOutputArrayfloating-point 2x3 or 3x3 mapping matrix (warp).
motionTypeMotionTypesparameter, specifying the type of motion
criteriaTermCriteria?parameter, specifying the termination criteria of the ECC algorithm
gaussFiltSizeintsize of the Gaussian blur filter used for smoothing images and masks before computing the alignment (DEFAULT: 5).