Public Sub processInput(myMat As OCVMat) As OCVMat
' Will work on the cloned frame, since we will draw on it
Dim frame As OCVMat
myMat.copyTo(frame)
mImgProc.cvtColor1(frame, frame, mImgProc.COLOR_RGB2GRAY)
Dim dst, mask As OCVMat
dst.Initialize
mask.Initialize
mImgProc.matchTemplate(frame, mMasks(0), dst, mImgProc.TM_CCOEFF, mask)
Dim result As OCVMinMaxLocResult = mCore.minMaxLoc(dst, mask)
Dim maxPoint As OCVPoint = result.maxLoc
Dim color As OCVScalar = OCV.Scalar.create4(0, 255, 0, 255)
Dim point As OCVPoint = OCV.Point.create(maxPoint.x + mMasks(0).cols, maxPoint.y + mMasks(0).rows)
mImgProc.rectangle(myMat, maxPoint, point, color, 2, mImgProc.LINE_8, 0)
Return myMat
End Sub