

def addImage(self, img):
    '\n        Add a single image to the segmentation algorithm\n        '
    if (self 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

dataset/ETHPy150Open sightmachine/SimpleCV/SimpleCV/Segmentation/DiffSegmentation.py DiffSegmentation.addImage/VarMisuse@16/39 `img`->`self`