'**SUMMARY**
Get the grayscale matrix (cvMat) version of the image, required for some OpenCV algorithms.
**RETURNS**
Returns the OpenCV CvMat version of this image.
**EXAMPLE**
>>> img = Image("lenna")
>>> rawImg  = img.getGrayscaleMatrix()
>>> rawOut  = img.getEmpty()
>>> cv.SomeOpenCVFunc(rawImg,rawOut)
**SEE ALSO**
:py:meth:`getEmpty`
:py:meth:`getBitmap`
:py:meth:`getFPMatrix`
:py:meth:`getPIL`
:py:meth:`getNumpy`
:py:meth:`getGrayNumpy`
:py:meth:`getMatrix`'

def getGrayscaleMatrix(self):

    if self._grayMatrix:
        return self._grayMatrix
    else:
        self._grayMatrix = cv.GetMat(self._getGrayscaleBitmap())
        return self._grayMatrix
