示例#1
0
def test():
    f = Features(**PARAMS)
    for i in range(300, 400):
        path = 'test/' + str(i) + '.png'
        im = Image(path)
        f.set_image(im)
        f.extract_blobs()
示例#2
0
def test():
    f = Features(**PARAMS)
    for i in range(300,400):
        path = 'test/'+str(i)+'.png'
        im = Image(path)
        f.set_image(im)
        f.extract_blobs()
示例#3
0
def test():
    f = Features(**PARAMS)
    minx,maxx = 0,0
    miny,maxy = 0,0
    while True:
        path = 'test/tmp.png'
        screenshot(path, region=REGION)
        im = Image(path)
        f.set_image(im)
        blobs = f.extract_blobs()
        if not blobs[0]:
            break
        dl = f.small.dl()
        bottom_right_corner = blobs[0].bottomRightCorner()
        dl.circle(bottom_right_corner, 5, Color.RED)
        if blobs[1]:
            top_right = blobs[1].topRightCorner()
            x = bottom_right_corner[0] - top_right[0]
            y = bottom_right_corner[1] - top_right[1]
            if x < minx:
                minx = x
            elif x > maxx:
                maxx = x
            if y < miny:
                miny = y
            elif y > maxy:
                maxy = y
            dl.circle(top_right, 5, Color.RED)
        f.small.show()
    print 'minx, maxx', minx, maxx
    print 'miny, maxy', miny, maxy
示例#4
0
def test():
    f = Features(**PARAMS)
    while True:
        path = 'test/tmp.png'
        screenshot(path, region=REGION)
        im = Image(path)
        f.set_image(im)
        blobs = f.extract_blobs()
        if not blobs[0]:
            break

        blobs = [blob for blob in blobs if blob]

        f.show_blobs_on_image(blobs)
示例#5
0
def test():
    f = Features(**PARAMS)
    while True:
        path = 'test/tmp.png'
        screenshot(path, region=REGION)
        im = Image(path)
        f.set_image(im)
        blobs = f.extract_blobs()
        if not blobs[0]:
            break

        blobs = [blob for blob in blobs if blob]

        f.show_blobs_on_image(blobs)