~hedgepigdaniel/dewobble

20eede1e6fa11195461aa90080734084a14e1bde — Daniel Playfair Cal 2 years ago 8796d59
docs: format examples
1 files changed, 20 insertions(+), 37 deletions(-)

M README.md
M README.md => README.md +20 -37
@@ 73,37 73,26 @@ The first test is for the default settings including stabilization, and the seco

dewobble::Camera input_camera(
    PROJECTION_EQUIDISTANT_FISHEYE,
    145.8
    1920,
    145.8 1920,
    1440,
    (1920-1.0)/2,
    (1440-1.0)/2
);
    (1920 - 1.0) / 2,
    (1440 - 1.0) / 2);

dewobble::Camera output_camera(
    PROJECTION_RECTILINEAR,
    145.8
    1920,
    145.8 1920,
    1440,
    (1920-1.0)/2,
    (1440-1.0)/2
);
    (1920 - 1.0) / 2,
    (1440 - 1.0) / 2);

auto stabilizer = make_shared<dewobble::StabilizerSavitzkyGolay>(
    input_camera,
    60,
    30
);
auto stabilizer =
    make_shared<dewobble::StabilizerSavitzkyGolay>(input_camera, 60, 30);

dewobble::FilterConfig config(input_camera, output_camera, stabilizer);
config.set_opencl_context(context);
congif.set_opencl_device(device);

dewobble::FilterThreaded filter(
    input_camera,
    output_camera,
    stabilizer
);
dewobble::FilterThreaded filter(input_camera, output_camera, stabilizer);

while (...) {
    cl_mem input_frame = filter.get_input_frame_buffer();


@@ 140,27 129,20 @@ input_camera = dewobble_camera_create(
    145.8 * PI / 180,
    1920,
    1440,
    (1920-1.0)/2,
    (1440-1.0)/2
);
    (1920 - 1.0) / 2,
    (1440 - 1.0) / 2);

output_camera = dewobble_camera_create(
    DEWOBBLE_PROJECTION_RECTILINEAR,
    145.8 * PI / 180,
    1920,
    1440,
    (1920-1.0)/2,
    (1440-1.0)/2
);
stabilizer = dewobble_stabilizer_create_savitzky_golay(
    input_camera,
    60,
    30
);
config = dewobble_filter_config_create(
    input_camera,
    output_camera,
    stabilizer
);
    (1920 - 1.0) / 2,
    (1440 - 1.0) / 2);

stabilizer = dewobble_stabilizer_create_savitzky_golay(input_camera, 60, 30);

config = dewobble_filter_config_create(input_camera, output_camera, stabilizer);
dewobble_filter_config_set_opencl_context(config, context);
dewobble_filter_config_set_opencl_context(config, device);



@@ 177,7 159,8 @@ dewobble_filter_end_input(filter);

while (dewobble_filter_frame_ready(filter)) {
    cl_mem output_frame = NULL, input_frame;
    frame = dewobble_filter_pull_frame(filter, &output_frame, &input_frame, NULL);
    frame =
        dewobble_filter_pull_frame(filter, &output_frame, &input_frame, NULL);

    // ... retrieve data from output frame