Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion SimpleCV/DrawingLayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def __init__(self, (width, height)):

self.width = width
self.height = height
self._mSurface = pg.Surface((width, height), flags = pg.SRCALPHA)
self._mSurface = pg.Surface((width, height))
self._mSurface.set_colorkey((0, 0, 0))
self._mDefaultAlpha = 255
self._mClearColor = pg.Color(0, 0, 0, 0)

Expand Down
2 changes: 1 addition & 1 deletion SimpleCV/Features/Detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1742,7 +1742,7 @@ def meanColor(self):
"""
if( self._avgColor is None ):
TL = self.topLeftCorner()
raw = self.image.crop(TL[0],TL[0],self.width(),self.height()) # crop the minbouding rect
raw = self.image.crop(TL[0],TL[1],self.width(),self.height()) # crop the minbouding rect
mask = Image((self.width(),self.height()))
mask.dl().polygon(self._minRect,color=Color.WHITE,filled=TRUE)
mask = mask.applyLayers()
Expand Down
4 changes: 2 additions & 2 deletions SimpleCV/ImageClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def _write_gif(self, filename, duration=0.1, loops=0, dither=1):
for img, header_anim in converted:
if not previous:
# gather data
palette = getheader(img)[1]
palette = getheader(img)[0][-1]
data = getdata(img)
imdes, data = data[0], data[1:]
header = header_anim
Expand Down Expand Up @@ -8581,7 +8581,7 @@ def findKeypoints(self,min_quality=300.00,flavor="SURF",highQuality=False ):
else:
kp,d = self._getRawKeypoints(thresh=min_quality,forceReset=True,flavor=flavor,highQuality=0)

if( flavor in ["ORB", "SIFT", "SURF", "BRISK", "FREAK"] and kp!=None and d !=None ):
if( flavor in ["ORB", "SIFT", "SURF", "BRISK", "FREAK"] and kp!=None and d is not None ):
for i in range(0,len(kp)):
fs.append(KeyPoint(self,kp[i],d[i],flavor))
elif(flavor in ["FAST", "STAR", "MSER", "Dense"] and kp!=None ):
Expand Down
8 changes: 4 additions & 4 deletions SimpleCV/tests/test_haar_cascade.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

FACECASCADE = 'face.xml'

testimage = "sampleimages/orson_welles.jpg"
testoutput = "sampleimages/orson_welles_face.jpg"
testimage = "../sampleimages/orson_welles.jpg"
testoutput = "../sampleimages/orson_welles_face.jpg"

testneighbor_in = "sampleimages/04000.jpg"
testneighbor_out = "sampleimages/04000_face.jpg"
testneighbor_in = "../sampleimages/04000.jpg"
testneighbor_out = "../sampleimages/04000_face.jpg"

def test_haarcascade():
img = Image(testimage)
Expand Down