Ejemplo n.º 1
0
bigmodel_intrinsics = np.array(
    [[eon_focal_length / bigmodel_zoom, 0., 0.5 * BIGMODEL_INPUT_SIZE[0]],
     [0., eon_focal_length / bigmodel_zoom, 256 + MEDMODEL_CY], [0., 0., 1.]])

model_frame_from_road_frame = np.dot(
    model_intrinsics, get_view_frame_from_road_frame(0, 0, 0, model_height))

bigmodel_frame_from_road_frame = np.dot(
    bigmodel_intrinsics, get_view_frame_from_road_frame(0, 0, 0, model_height))

medmodel_frame_from_road_frame = np.dot(
    medmodel_intrinsics, get_view_frame_from_road_frame(0, 0, 0, model_height))

medmodel_frame_from_calib_frame = np.dot(
    medmodel_intrinsics,
    get_view_frame_from_calib_frame(0, 0, 0, model_height))

model_frame_from_bigmodel_frame = np.dot(model_intrinsics,
                                         np.linalg.inv(bigmodel_intrinsics))
medmodel_frame_from_bigmodel_frame = np.dot(medmodel_intrinsics,
                                            np.linalg.inv(bigmodel_intrinsics))


# 'camera from model camera'
def get_model_height_transform(camera_frame_from_road_frame, height):
    camera_frame_from_road_ground = np.dot(
        camera_frame_from_road_frame,
        np.array([
            [1, 0, 0],
            [0, 1, 0],
            [0, 0, 0],
Ejemplo n.º 2
0
 def __init__(self, num_px, rpy, intrinsic):
     self.intrinsic = intrinsic
     self.extrinsics_matrix = get_view_frame_from_calib_frame(
         rpy[0], rpy[1], rpy[2], 0.0)[:, :3]
     self.zoom = _BB_TO_FULL_FRAME[num_px][0, 0]
Ejemplo n.º 3
0
SBIGMODEL_YUV_SIZE = (SBIGMODEL_INPUT_SIZE[0],
                      SBIGMODEL_INPUT_SIZE[1] * 3 // 2)

sbigmodel_fl = 455.0
sbigmodel_intrinsics = np.array(
    [[sbigmodel_fl, 0.0, 0.5 * SBIGMODEL_INPUT_SIZE[0]],
     [0.0, sbigmodel_fl, 0.5 * (256 + MEDMODEL_CY)], [0.0, 0.0, 1.0]])

model_frame_from_road_frame = np.dot(
    model_intrinsics, get_view_frame_from_road_frame(0, 0, 0, model_height))

bigmodel_frame_from_road_frame = np.dot(
    bigmodel_intrinsics, get_view_frame_from_road_frame(0, 0, 0, model_height))

bigmodel_frame_from_calib_frame = np.dot(
    bigmodel_intrinsics, get_view_frame_from_calib_frame(0, 0, 0, 0))

sbigmodel_frame_from_road_frame = np.dot(
    sbigmodel_intrinsics,
    get_view_frame_from_road_frame(0, 0, 0, model_height))

sbigmodel_frame_from_calib_frame = np.dot(
    sbigmodel_intrinsics, get_view_frame_from_calib_frame(0, 0, 0, 0))

medmodel_frame_from_road_frame = np.dot(
    medmodel_intrinsics, get_view_frame_from_road_frame(0, 0, 0, model_height))

medmodel_frame_from_calib_frame = np.dot(
    medmodel_intrinsics, get_view_frame_from_calib_frame(0, 0, 0, 0))

model_frame_from_bigmodel_frame = np.dot(model_intrinsics,
Ejemplo n.º 4
0
sbigmodel_intrinsics = np.array([
  [sbigmodel_fl,  0.0,  0.5 * SBIGMODEL_INPUT_SIZE[0]],
  [0.0,  sbigmodel_fl,      0.5 * (256 + MEDMODEL_CY)],
  [0.0,  0.0,                                     1.0]])

model_frame_from_road_frame = np.dot(model_intrinsics,
                                     get_view_frame_from_road_frame(0, 0, 0, model_height))

bigmodel_frame_from_road_frame = np.dot(bigmodel_intrinsics,
                                        get_view_frame_from_road_frame(0, 0, 0, model_height))

medmodel_frame_from_road_frame = np.dot(medmodel_intrinsics,
                                        get_view_frame_from_road_frame(0, 0, 0, model_height))

medmodel_frame_from_calib_frame = np.dot(medmodel_intrinsics,
                                         get_view_frame_from_calib_frame(0, 0, 0, 0))

model_frame_from_bigmodel_frame = np.dot(model_intrinsics, np.linalg.inv(bigmodel_intrinsics))
medmodel_frame_from_bigmodel_frame = np.dot(medmodel_intrinsics, np.linalg.inv(bigmodel_intrinsics))


# 'camera from model camera'
def get_model_height_transform(camera_frame_from_road_frame, height):
  camera_frame_from_road_ground = np.dot(camera_frame_from_road_frame, np.array([
    [1, 0, 0],
    [0, 1, 0],
    [0, 0, 0],
    [0, 0, 1],
  ]))

  camera_frame_from_road_high = np.dot(camera_frame_from_road_frame, np.array([