def img_log_rects(img, rcts, text): ''' 1. draw rectangles on image 2. save image ''' if not log.isEnabledFor(DEBUG): return img2 = draw_indexed_rect_list(img, rcts) img_log(img2, text + '_with_rects')
def main(): with SmartDisplay(size=(640, 480), visible=0) as disp: with EasyProcess('gnumeric'): # time.sleep(2) img = disp.waitgrab(timeout=60) rectangles = active_rectangles() print( rectangles ) img = draw_indexed_rect_list(img, rectangles) img = autocrop(img) # display results img.show()
def main(): with Display(): with EasyProcess('zenity --question') as p: p.sleep(1) img = grab() rectangles = discover_buttons() print( rectangles ) img = draw_indexed_rect_list(img, rectangles) img = autocrop(img) # display results img.show()