color = tuple(map(int, Colors.to_rgb(blob.color))) cv2.circle(frame, (int(x), int(y)), 20, color, thickness=-1) # gradx = ndimage.filters.sobel(is_blue, 0) # grady = ndimage.filters.sobel(is_blue, 1) # hyp = np.hypot(gradx, grady) # hyp = hyp / float(np.max(hyp)) # hyp = hyp[...,np.newaxis] debug = res.debug_frame # for x1, y1, x2, y2 in lines: # cv2.line(debug, (x1,y1), (x2,y2), [0, 0, 128], thickness=2) # debug[above_blue,:] = debug[above_blue,:] * 0.125 result_win.show(debug) selector.show(frame) if time.time() - lastCap > 1 and fRec > 0: selector.record(frame) fRec -= 1 print(fRec) lastCap = time.time() c = cv2.waitKey(1) & 0xFF if c == ord('q'): break elif c == ord('r'): selector.clear() fRec = 10 lastCap = time.time()
# gradx = ndimage.filters.sobel(is_blue, 0) # grady = ndimage.filters.sobel(is_blue, 1) # hyp = np.hypot(gradx, grady) # hyp = hyp / float(np.max(hyp)) # hyp = hyp[...,np.newaxis] debug = res.debug_frame # for x1, y1, x2, y2 in lines: # cv2.line(debug, (x1,y1), (x2,y2), [0, 0, 128], thickness=2) # debug[above_blue,:] = debug[above_blue,:] * 0.125 result_win.show(debug) selector.show(frame) if time.time() - lastCap > 1 and fRec > 0: selector.record(frame) fRec -= 1 print(fRec) lastCap = time.time() c = cv2.waitKey(1) & 0xFF if c == ord('q'): break elif c == ord('r'): selector.clear() fRec = 10 lastCap = time.time()