Exemplo n.º 1
0
def get_calibration_params() -> Tuple[int, int, str, str]:
    sb.markdown("Params of cameara calibration porcesss")

    path_to_camera_params = sb.text_input("Path to camera params",
                                          "camera_params.json")
    board_height = sb.number_input("Board height", 
                                    min_value=3,
                                    max_value=100,
                                    value=9)
    board_width = sb.number_input("Board width", 
                                   min_value=3,
                                   max_value=100,
                                   value=6)
    path_to_images = sb.text_input("Path to images with board",
                                    "./src/data/calibration")
    return board_height, board_width, path_to_images, path_to_camera_params
Exemplo n.º 2
0
def get_aruco_marker_params() -> Tuple[str, int, float]:
    sb.markdown("Params of marker")
    marker_size = sb.selectbox("Chose aruco marker size",
                               ("7x7", "6x6", "5x5", "4x4"))
    marker_idx = sb.number_input("Select marker index",
                                 min_value=0,
                                 max_value=250,
                                 value=23)
    dictionary = cv2.aruco.Dictionary_get(ARUCO_MARKER_SIZE[marker_size])
    marker_image = cv2.aruco.drawMarker(dictionary, marker_idx, 75, 1)
    sb.image(marker_image)
    marker_world_size = sb.number_input("Lenght of real world marker",
                                        min_value=0.0,
                                        max_value=100.0,
                                        value=0.05)
    return marker_size, marker_idx, marker_world_size
Exemplo n.º 3
0
def get_detector_params() -> Tuple[float, int, int]:
    sb.markdown("Params of detector")
    scale_factor_feat_det = sb.slider('Chose scale factor for feature detector', 1.01, 1.3, 1.01)
    max_num_of_features = sb.slider("Select number of features", 30, 5000, 1000)
    num_of_levels = sb.number_input("Write number of level for feature detector",
                                    min_value=2, max_value=16, value=16)
    return scale_factor_feat_det, max_num_of_features, num_of_levels
Exemplo n.º 4
0
def get_camera_params() -> Tuple[int, int]:
    sb.markdown("Params of camera")
    frame_width = sb.number_input("Width of input frame",
                                  min_value=120,
                                  max_value=1920,
                                  value=640)
    frame_height = int(3 / 4 * frame_width)
    return frame_width, frame_height
Exemplo n.º 5
0
def get_workzone_params() -> Tuple[int, int, int, int]:
    sb.markdown("Params of robot workzone")
    wz_center_x = sb.number_input("X coordinate of workzone center",
                                  min_value=0,
                                  max_value=500,
                                  value=0)
    wz_center_y = sb.number_input("Y coordinate of workzone center",
                                  min_value=0,
                                  max_value=500,
                                  value=0)
    wz_height = sb.number_input("Height of workzone",
                                min_value=1,
                                max_value=100,
                                value=14)
    wz_width = sb.number_input("Width of workzone",
                               min_value=1,
                               max_value=100,
                               value=14)
    return wz_center_x, wz_center_y, wz_height, wz_width
Exemplo n.º 6
0
def get_marker_params(frame_height: int) -> Tuple[int, str, str]:
    sb.markdown("Params of marker")
    marker_size = sb.number_input("Size of marker",
                                  min_value=6,
                                  max_value=frame_height,
                                  value=64)
    path_to_marker = sb.text_input("Write path to custom marker in .jpg or .png formats",
                                   "./src/data/markers/marker23.png")
    full_path_to_marker = os.path.abspath(path_to_marker)
    path_to_obj = sb.text_input("Write path to custom area form",
                                "./src/data/3dmodels/Cylinder.obj")
    full_path_to_obj = os.path.abspath(path_to_obj)
    return marker_size, full_path_to_marker, full_path_to_obj
Exemplo n.º 7
0
def get_model_params() -> float:
    sb.markdown("Params of 3d model")
    return sb.number_input("Write scaled factor for 3d model of workzone",
                           1e-4, 1e4, 10.0)