Esempio n. 1
0
def get_seat_six():
    """Identifies food orders from seat six and returns to check_bubs()

    This method finds the pixel sum of the order bubble above the customers head.
    The sum is compared to the sushiTypeSix dictionary values to determine the type of food.
    the pixel sum is returned to check_bubs()

    :return:
    """
    box = (x_pad + 663, y_pad + 80, x_pad + 663 + 80, y_pad + 92)
    im = ImageOps.grayscale(ImageGrab.grab(box))
    a = numarray(im.getcolors())
    a = a.sum()
    print a
    im.save(os.getcwd() + '\\seat_six__' + str(int(time.time())) + '.png',
            'PNG')
    if a.sum() == sushiTypeSix['Onigiri']:
        print 'Table 6: Onigiri'
    elif a.sum() == sushiTypeSix['Caliroll']:
        print 'Table 6: Caliroll'
    elif a.sum() == sushiTypeSix['Gunkan']:
        print 'Table 6: Gunkan'
    else:
        print 'Table 6: Error'
    return a
Esempio n. 2
0
def grab():
    """Gets pixel sum of screenGrab()

    This method gets the sum of the pixels of each food bubble to compare to the
    sushitypeOne - sushitypeSix dictionaries to read food orders.

    :return:
    """
    b1 = (x_pad + 1, y_pad + 1, x_pad + 800, y_pad + 600)
    im = ImageOps.grayscale(ImageGrab.grab(b1))
    a = numarray(im.getcolors())
    a = a.sum()
    print a
    return a