def draw_screen_boundary(self, cam_img): if self.screen2cam_matrix is None: return cam_img img = cam_img.copy() draw_oriented_polylines(img, self._screen_corners, True, (0,0,255), 3) return img
def draw_screen_boundary(self, cam_img): if self.screen2cam_matrix is None: return cam_img img = cam_img.copy() draw_oriented_polylines(img, self._screen_corners, True, (0, 0, 255), 3) return img
break if k == ord('r'): sf.reset() cam_img = cam.read() on = True while sf.screens is None: on = not on x = on * 255 screen_img = np.full(win_size, (x, x, x), np.uint8) imshow('main', screen_img) imshow('screen finder', cam_img) # wait so that the camera can capture images completely loaded k = waitKey(20) cam_img = cam.read() sf.put_calibrate_images(screen_img, cam_img) # delay again to make sure that the image will not change during the camera taking picture k = waitKey(20) for rect in sf.screens: draw_oriented_polylines(cam_img, rect, 0, (0, 0, 255), 3) imshow('topview', sf.findTopView(cam_img)) imshow('main', black) imshow('screen finder', cam_img)