Beispiel #1
0
        ]
        ret_val = call(" ".join(command), shell=True)
        if ret_val != 0:
            print "Giving up trying to set camera settings. Retry a few times, fix it or run with --disable-cam-settings"
            sys.exit(1)
    cap = cap_camera(int(args.cam))
elif args.file:
    cap = cap_file(args.file)
else:
    raise ValueError("Must specify either --cam or --file!")

detector_state = DetectorState((640, 480), 128, 5, approx_object_size=15.0)

d = OrderedDict([('h_low', 0), ('h_high', 255), ('s_low', 0), ('s_high', 255),
                 ('v_low', 0), ('v_high', 255)])
white_sample = threshold.Threshold("white_sample", d)

cv.NamedWindow("image", flags=cv.CV_WINDOW_NORMAL)
cv.MoveWindow("image", 20, 20)
cv.ResizeWindow("image", 700, 700)

cv.NamedWindow("original", flags=cv.CV_WINDOW_NORMAL)
cv.MoveWindow("original", 650, 20)
cv.ResizeWindow("original", 640, 480)

cv.NamedWindow("heuristics", flags=cv.CV_WINDOW_NORMAL)
cv.MoveWindow("heuristics", 400, 400)
cv.ResizeWindow("heuristics", 640, 480)

heuristics = HeuristicStack({
    (PhysicalSizeHeuristic(debug=False), 1.0),
Beispiel #2
0
parser = argparse.ArgumentParser(description='local binary patterns test.')
parser.add_argument('--image', required=True, help='image name')
parser.add_argument('--scale',
                    type=float,
                    default=0.4,
                    help='scale image before processing')
args = parser.parse_args()

rgb = cv2.imread(args.image,
                 flags=cv2.IMREAD_ANYCOLOR | cv2.IMREAD_ANYDEPTH
                 | cv2.IMREAD_IGNORE_ORIENTATION)
(h, w) = rgb.shape[:2]

# texture based classifier
model = threshold.Threshold()
model.init_model(rgb, "hsv90")
model.compute_grid(grid_size=128)
cv2.imshow(
    'model',
    cv2.resize(model.image.astype('uint8'),
               (int(w * args.scale), int(h * args.scale))))

# cv2.imshow('index', cv2.resize(model.index, (int(w*args.scale), int(h*args.scale))))
scale_orig = cv2.resize(rgb, (int(w * args.scale), int(h * args.scale)))
scale = scale_orig.copy()
gscale = cv2.cvtColor(scale, cv2.COLOR_BGR2GRAY)


def draw(image, r1, r2, c1, c2, color, width):
    cv2.rectangle(image, (int(c1 * args.scale), int(r1 * args.scale)), (int(
    def __init__(self):
        self.threshold = threshold.Threshold()

        super(IdentifySecondaryObjects, self).__init__()
Beispiel #4
0
    list[2] is LTC account
    list[3] is ETH account'''
usd_stats = account[0]
if 'BTC-USD' in id:
    cryptoBalance = 1
elif 'LTC-USD' in id:
    cryptoBalance = 2
elif 'ETH-USD' in id:
    cryptoBalance = 3

print(usd_stats)
crypto_stats = account[cryptoBalance]

pricing_usd = pricelvl.Pricing()
pricing_usd.set_pid(id)
alert_threshold = threshold.Threshold()
alert_threshold.set_mFactor(mFactor)
trading_usd = trade.Trading()
trading_usd.set_values(id, mFactor)
check_filled = filled.TimeDifference()
firstArrayFill = auth_client.get_fills()[0]

first = 0
postPrice = 0
prePrice = 0
dxLarge = 0
selling = 0
limit = 0
thStatus = 0
ogPrice = 0
thPrice = 0