Skip to content

Commit

Permalink
SCV-1
Browse files Browse the repository at this point in the history
Added masked image extraction function in Blob.py  getMaskedImage()
  • Loading branch information
ryan committed Mar 5, 2014
1 parent cca4884 commit 2b11771
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions SimpleCV/Features/Blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,21 @@ def match(self, otherblob):
otherM = otherSigns * otherLogs

return np.sum(abs((1/ myM - 1/ otherM)))

def getMaskedImage(self):
"""
Get the blob sizde image with the masked blob
"""
retVal = cv.CreateImage((self.width(),self .height()),cv.IPL_DEPTH_8U,3)
cv.Zero(retVal)
bmp = self.image.getBitmap()
mask = self.mMask.getBitmap()
tl = self.topLeftCorner()
cv.SetImageROI(bmp,(tl[0],tl[1], self.width(),self.height()))
cv.Copy(bmp,retVal,mask)
cv.ResetImageROI(bmp)
return Image(retVal)


def getFullMaskedImage(self):
"""
Expand Down

0 comments on commit 2b11771

Please sign in to comment.