Ejemplo n.º 1
0
 def mHullImg(self):
     tl = self.topLeftCorner()
     retVal = np.zeros((self.height(), self.width(), 3), np.uint8)
     npimg = self.image.getNumpy()[tl[1]:tl[1]+self.height(), tl[0]:tl[0]+self.width()]
     mask = self.mHullMask.getGrayNumpy()
     Image._copyNpwithMask(npimg, retVal, mask)
     return Image(retVal)
Ejemplo n.º 2
0
 def mHullImg(self):
     tl = self.topLeftCorner()
     retVal = np.zeros((self.height(), self.width(), 3), np.uint8)
     npimg = self.image.getNumpy()[tl[1]:tl[1] + self.height(),
                                   tl[0]:tl[0] + self.width()]
     mask = self.mHullMask.getGrayNumpy()
     Image._copyNpwithMask(npimg, retVal, mask)
     return Image(retVal)
Ejemplo n.º 3
0
    def mImg(self):
        #NOTE THAT THIS IS NOT PERFECT - ISLAND WITH A LAKE WITH AN ISLAND WITH A LAKE STUFF
        retVal = np.zeros((self.height(), self.width(), 3), np.uint8)
        tl = self.topLeftCorner()

        npimg = self.image.getNumpy()[tl[1]:tl[1]+self.height(), tl[0]:tl[0]+self.width()]
        mask = self.mMask.getGrayNumpy()
        Image._copyNpwithMask(npimg, retVal, mask)

        return Image(retVal)
Ejemplo n.º 4
0
    def mImg(self):
        #NOTE THAT THIS IS NOT PERFECT - ISLAND WITH A LAKE WITH AN ISLAND WITH A LAKE STUFF
        retVal = np.zeros((self.height(), self.width(), 3), np.uint8)
        tl = self.topLeftCorner()

        npimg = self.image.getNumpy()[tl[1]:tl[1] + self.height(),
                                      tl[0]:tl[0] + self.width()]
        mask = self.mMask.getGrayNumpy()
        Image._copyNpwithMask(npimg, retVal, mask)

        return Image(retVal)
Ejemplo n.º 5
0
    def getFullHullMaskedImage(self):
        """
        Get the full size image with the masked to the blob
        """
        tl = self.topLeftCorner()
        retVal = np.zeros((self.image.height, self.image.width, 3), np.uint8)
        npimgcrop = self.image.getNumpy()[tl[1]:tl[1]+self.height(), tl[0]:tl[0]+self.width()]
        mask = self.mHullMask.getGrayNumpy()
        retValcrop = retVal[tl[1]:tl[1]+self.height(), tl[0]:tl[0]+self.width()]

        Image._copyNpwithMask(npimgcrop, retValcrop, mask)

        retVal[tl[1]:tl[1]+self.height(), tl[0]:tl[0]+self.width()] = retValcrop

        return Image(retVal)
Ejemplo n.º 6
0
    def getFullHullMaskedImage(self):
        """
        Get the full size image with the masked to the blob
        """
        tl = self.topLeftCorner()
        retVal = np.zeros((self.image.height, self.image.width, 3), np.uint8)
        npimgcrop = self.image.getNumpy()[tl[1]:tl[1] + self.height(),
                                          tl[0]:tl[0] + self.width()]
        mask = self.mHullMask.getGrayNumpy()
        retValcrop = retVal[tl[1]:tl[1] + self.height(),
                            tl[0]:tl[0] + self.width()]

        Image._copyNpwithMask(npimgcrop, retValcrop, mask)

        retVal[tl[1]:tl[1] + self.height(),
               tl[0]:tl[0] + self.width()] = retValcrop

        return Image(retVal)