コード例 #1
0
ファイル: LiveDemo.py プロジェクト: mdqyy/pyvision
class RenderSURF:
    def __init__(self):
        self.surf = DetectorSURF(n=1000, min_hessian=500)

    def __call__(self, im):
        tmp = im.asPIL()
        tmp = tmp.resize((160, 120))
        tmp = Image(tmp)
        points = self.surf.detect(tmp)
        for score, pt, radius in points:
            score = score - 500.0
            if score > 500.0:
                score = 500.0
            score = int(255 * score / 500.0)
            color = "#%02x0000" % score
            pt = Point(pt.X() * 4, pt.Y() * 4)
            im.annotateCircle(pt, radius, color=color)
        return im
コード例 #2
0
ファイル: LiveDemo.py プロジェクト: Dfred/concept-robot
class RenderSURF:
    def __init__(self):
        self.surf = DetectorSURF(n=1000,min_hessian=500)
        
    def __call__(self,im):
        tmp = im.asPIL()
        tmp = tmp.resize((160,120))
        tmp = Image(tmp)
        points = self.surf.detect(tmp)
        for score,pt,radius in points:
            score = score - 500.0
            if score > 500.0:
                score = 500.0
            score = int(255*score/500.0)
            color = "#%02x0000"%score
            pt = Point(pt.X()*4,pt.Y()*4)
            im.annotateCircle(pt,radius,color=color)
        return im
コード例 #3
0
ファイル: pyvision_banner.py プロジェクト: svohara/pyvision
 low = mat < 50
 mask = high#+low
 ilog.log(pv.Image(1.0*mask), 'Mask')
 
 #Composite operation using PIL
 e = edges.asPIL().convert('RGB')
 m = pv.Image(1.0*mask).asPIL()
 i = im.asPIL()
 logo = pv.Image(composite(i,e,m))
 ilog.log(logo, 'Composite')    
 #logo.show(window='Composite', pos=(0,300) )
 
 #Keypoint detection using OpenCV's SURF detector
 logo_surf = logo.copy()
 sm = pv.Image(im.asPIL().resize((320,240),LINEAR))
 detector = DetectorSURF()    
 points = detector.detect(sm)
 for score,pt,radius in points:
     logo_surf.annotateCircle(pt*4,radius*4)
 ilog.log(logo_surf, 'Annotated')
 #logo_surf.show(window='Annotated',pos=(360,300))
 
 #Demonstrate use of ImageMontage class to show a few small images in a single window
 print "Have the image montage focused in UI and hit spacebar to continue..."
 imontage = pv.ImageMontage([im,edges,logo,logo_surf], layout=(2,2), tile_size=im.size,
                             gutter=3, by_row=True, labels=None)
 imontage.show(window="Image Montage", delay=0)
 
 #Show the images stored to the image log object
 print "Showing image log."
 print "These images are stored in a tmp directory: %s"%ilog.dir 
コード例 #4
0
ファイル: pyvision_banner.py プロジェクト: mdqyy/pyvision
    low = mat < 50
    mask = high  #+low
    ilog.log(pv.Image(1.0 * mask), 'Mask')

    #Composite operation using PIL
    e = edges.asPIL().convert('RGB')
    m = pv.Image(1.0 * mask).asPIL()
    i = im.asPIL()
    logo = pv.Image(composite(i, e, m))
    ilog.log(logo, 'Composite')
    #logo.show(window='Composite', pos=(0,300) )

    #Keypoint detection using OpenCV's SURF detector
    logo_surf = logo.copy()
    sm = pv.Image(im.asPIL().resize((320, 240), LINEAR))
    detector = DetectorSURF()
    points = detector.detect(sm)
    for score, pt, radius in points:
        logo_surf.annotateCircle(pt * 4, radius * 4)
    ilog.log(logo_surf, 'Annotated')
    #logo_surf.show(window='Annotated',pos=(360,300))

    #Demonstrate use of ImageMontage class to show a few small images in a single window
    print "Have the image montage focused in UI and hit spacebar to continue..."
    imontage = pv.ImageMontage([im, edges, logo, logo_surf],
                               layout=(2, 2),
                               tileSize=im.size,
                               gutter=3,
                               byrow=True,
                               nolabels=True)
    imontage.show(window="Image Montage", delay=0)
コード例 #5
0
ファイル: LiveDemo.py プロジェクト: mdqyy/pyvision
 def __init__(self):
     self.surf = DetectorSURF(n=1000, min_hessian=500)
コード例 #6
0
ファイル: LiveDemo.py プロジェクト: Dfred/concept-robot
 def __init__(self):
     self.surf = DetectorSURF(n=1000,min_hessian=500)