'Add a single image to the segmentation algorithm'

def addImage(self, img):

    if (img is None):
        return
    if (self.mLastImg == None):
        if self.mGrayOnlyMode:
            self.mLastImg = img.toGray()
            self.mDiffImg = Image(self.mLastImg.getEmpty(1))
            self.mCurrImg = None
        else:
            self.mLastImg = img
            self.mDiffImg = Image(self.mLastImg.getEmpty(3))
            self.mCurrImg = None
    else:
        if (self.mCurrImg is not None):
            self.mLastImg = self.mCurrImg
        if self.mGrayOnlyMode:
            self.mColorImg = img
            self.mCurrImg = img.toGray()
        else:
            self.mColorImg = img
            self.mCurrImg = img
        cv.AbsDiff(self.mCurrImg.getBitmap(), self.mLastImg.getBitmap(), self.mDiffImg.getBitmap())
    return
