示例#1
0
while (issue_count < 10):

    try:
        subprocess.call(
            'raspistill -n -t 300 -w 640 -h 480 -o {0}'.format(working_image),
            shell=True)
    except:
        print("Issue calling raspistill...retrying")
        issue_count += 1
        time.sleep(1)
        continue

    try:
        img = Image(working_image)
        source_kp = img._getRawKeypoints(500)
    except:
        time.sleep(1)
        continue

    # loop through matching each keypoint set and pull the highest matching set
    for idx, artist in enumerate(config):
        if img.matchKeypoints(source_kp,
                              artist['keypoints'],
                              minDist=0.15,
                              minMatch=0.4):

            # write log that of which album recognised
            print('{1} Recognised {0}'.format(artist['title'],
                                              str(datetime.datetime.now())))