def convert_to_grayscale(self):
        if self.image_channels >= 3:
            # FIXME: OpenCV does not support grayscale with alpha channel?
            grayscaled = cv.CreateImage((self.image.width, self.image.height), self.image_depth, 1)
            cv.CvtColor(self.image, grayscaled, cv.CV_BGRA2GRAY)
            self.image = grayscaled
dataset/ETHPy150Open thumbor/opencv-engine/opencv_engine/engine.py/Engine.convert_to_grayscale/original