diff --git a/SimpleCV/DrawingLayer.py b/SimpleCV/DrawingLayer.py index a1cd9e60e..72a32c589 100644 --- a/SimpleCV/DrawingLayer.py +++ b/SimpleCV/DrawingLayer.py @@ -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) diff --git a/SimpleCV/Features/Detection.py b/SimpleCV/Features/Detection.py index e9963075f..f8aa8aba4 100644 --- a/SimpleCV/Features/Detection.py +++ b/SimpleCV/Features/Detection.py @@ -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() diff --git a/SimpleCV/ImageClass.py b/SimpleCV/ImageClass.py index 3207a927d..b4fd801f8 100644 --- a/SimpleCV/ImageClass.py +++ b/SimpleCV/ImageClass.py @@ -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 @@ -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 ): diff --git a/SimpleCV/tests/test_haar_cascade.py b/SimpleCV/tests/test_haar_cascade.py index 1942ccf77..a00d7a097 100644 --- a/SimpleCV/tests/test_haar_cascade.py +++ b/SimpleCV/tests/test_haar_cascade.py @@ -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)