init = np.array(np.median(init_buffer, axis=0))

# Load horizon-markers
horizont_type = db_start.getMarkerType(name="Horizon")
try:
    horizon_markers = np.array(
        [[m.x, m.y] for m in db_start.getMarkers(type=horizont_type)]).T
except ValueError:
    raise ValueError("No markers with name 'Horizon'!")

# Load penguin-markers
penguin_type = db_start.getMarkerType(name="Penguin_Size")
try:
    penguin_markers = np.array([[m.x1, m.y1, m.x2, m.y2]
                                for m in db_start.getLines(type="Penguin_Size")
                                ]).T
except ValueError:
    raise ValueError("No markers with name 'Horizon'!")

VB = SiAdViBeSegmentation(horizon_markers,
                          14e-3, [17e-3, 9e-3],
                          penguin_markers,
                          penguin_height,
                          500,
                          n=3,
                          init_image=init,
                          n_min=3,
                          r=7,
                          phi=1,
                          subsampling=2)  #, camera_h=44.)
Exemple #2
0
                  dtype=np.int)

# Load horizon-markers
horizont_type = db.getMarkerType(name="Horizon")
try:
    horizon_markers = np.asarray([[m.x, m.y]
                                  for m in db.getMarkers(type=horizont_type)
                                  ]).T
except ValueError:
    raise ValueError("No markers with name 'Horizon'!")

# Load penguin-markers
penguin_type = db.getMarkerType(name="Penguin_Size")
try:
    penguin_markers = np.asarray([[m.x1, m.y1, m.x2, m.y2]
                                  for m in db.getLines(type="Penguin_Size")]).T
except ValueError:
    raise ValueError("No markers with name 'Horizon'!")

# Initialize segmentation with init_image and start updating the first 10 frames.
VB = SiAdViBeSegmentation(horizon_markers,
                          14e-3, [17e-3, 9e-3],
                          penguin_markers,
                          penguin_height,
                          500,
                          n=5,
                          init_image=init,
                          n_min=3,
                          r=10,
                          phi=1)  #, camera_h=44.)
for i in range(1, 10):