def _integrateImg(image):
        assert image.__class__ == numpy.ndarray

        row, col = image.shape
        iImg = numpy.zeros((row, col))
        iImg = image.cumsum(axis=1).cumsum(axis=0)
        
        return iImg
Exemple #2
0
    def _integrateImg(image):

        assert image.__class__ == numpy.ndarray

        row, col = image.shape
        #@iImg is integrated image of normalized image @self.stdImg
        iImg = numpy.zeros((row, col))
        """
        for i in xrange(0, row):
            for j in xrange(0, col):
                if j == 0:
                    iImg[i][j] = image[i][j]
                else:
                    iImg[i][j] = iImg[i][j - 1] + image[i][j]
        
        for j in xrange(0, col):
            for i in xrange(1, row):
                iImg[i][j] += iImg[i - 1][j]
        """

        iImg = image.cumsum(axis=1).cumsum(axis=0)
        return iImg
Exemple #3
0
    def _integrateImg(image):

        assert image.__class__ == numpy.ndarray

        row, col = image.shape
        #@iImg is integrated image of normalized image @self.stdImg
        iImg = numpy.zeros((row, col))

        """
        for i in xrange(0, row):
            for j in xrange(0, col):
                if j == 0:
                    iImg[i][j] = image[i][j]
                else:
                    iImg[i][j] = iImg[i][j - 1] + image[i][j]
        
        for j in xrange(0, col):
            for i in xrange(1, row):
                iImg[i][j] += iImg[i - 1][j]
        """

        iImg = image.cumsum(axis=1).cumsum(axis=0)
        return iImg
Exemple #4
0
 def Integralimg(image):
     row, col = image.shape
     img = np.zeros((row, col))
     img = image.cumsum(axis=1).cumsum(axis=0)
     return img