コード例 #1
0
def main(argv):
    parser = argparse.ArgumentParser()

    parser.add_argument(
        "--report-style", choices=['text', 'color-text', 'html'],
        help='Style of report to use',
        default='color-text')
    parser.add_argument(
        '--positions-only', action="store_true",
        help="Only validate that the letters are in their right positions.  "
             "Don't require that they match")
    parser.add_argument(
        '-o', '--output', type=argparse.FileType('w'),
        help='Filename to write the report to')
    tv_driver.add_argparse_argument(parser)

    parser.add_argument("colour", nargs='*')

    args = parser.parse_args(argv[1:])

    if len(args.colour) == 0:
        args.colour = STANDARD_COLOURS.keys()

    driver = tv_driver.create_from_args(args, videos)
    failures = 0
    for c in args.colour:
        failures += validate(c, driver, validate_match=not args.positions_only)
    return failures
コード例 #2
0
def main(argv):
    parser = argparse.ArgumentParser()

    parser.add_argument(
        "--report-style", choices=["text", "color-text", "html"], help="Style of report to use", default="color-text"
    )
    parser.add_argument(
        "--positions-only",
        action="store_true",
        help="Only validate that the letters are in their right positions.  " "Don't require that they match",
    )
    parser.add_argument("-o", "--output", type=argparse.FileType("w"), help="Filename to write the report to")
    tv_driver.add_argparse_argument(parser)

    parser.add_argument("colour", nargs="*")

    args = parser.parse_args(argv[1:])

    if len(args.colour) == 0:
        args.colour = STANDARD_COLOURS.keys()

    driver = tv_driver.create_from_args(args, videos)
    failures = 0
    for c in args.colour:
        failures += validate(c, driver, validate_match=not args.positions_only)
    return failures
コード例 #3
0
def main(argv):
    args = parse_args(argv)

    device = setup(args.source_pipeline)
    if device is None:
        return 1

    if args.skip_geometric:
        set_config('global', 'geometriccorrection_params', '')

    for k, v in defaults.iteritems():
        set_config('global', k, v)

    # Need to re-parse arguments as the settings above may have affected the
    # values we get out.
    args = parse_args(argv)

    transformation_pipeline = (
        'tee name=raw_undistorted '
        'raw_undistorted. ! queue leaky=upstream ! videoconvert ! '
        '    textoverlay text="Capture from camera" ! %s '
        'raw_undistorted. ! queue ! appsink drop=true sync=false qos=false'
        '    max-buffers=1 caps="video/x-raw,format=BGR"'
        '    name=undistorted_appsink '
        'raw_undistorted. ! queue leaky=upstream max-size-buffers=1 ! %s' %
        (args.sink_pipeline,
         stbt.get_config('global', 'transformation_pipeline')))

    args.sink_pipeline = ('textoverlay text="After correction" ! ' +
                          args.sink_pipeline)
    args.control = 'none'

    with _stbt.core.new_device_under_test_from_config(
            args, transformation_pipeline=transformation_pipeline) as dut:
        tv = tv_driver.create_from_args(args, videos)

        if not args.skip_geometric:
            geometric_calibration(dut,
                                  tv,
                                  device,
                                  interactive=args.interactive)
        if args.interactive:
            adjust_levels(dut, tv, device)
        if not args.skip_illumination:
            calibrate_illumination(dut, tv)

        if args.interactive:
            raw_input("Calibration complete.  Press <ENTER> to exit")
        return 0
コード例 #4
0
def main(argv):
    args = parse_args(argv)

    device = setup(args.source_pipeline)
    if device is None:
        return 1

    if args.skip_geometric:
        set_config('global', 'geometriccorrection_params', '')

    for k, v in defaults.iteritems():
        set_config('global', k, v)

    # Need to re-parse arguments as the settings above may have affected the
    # values we get out.
    args = parse_args(argv)

    transformation_pipeline = (
        'tee name=raw_undistorted '
        'raw_undistorted. ! queue leaky=upstream ! videoconvert ! '
        '    textoverlay text="Capture from camera" ! %s '
        'raw_undistorted. ! queue ! appsink drop=true sync=false qos=false'
        '    max-buffers=1 caps="video/x-raw,format=BGR"'
        '    name=undistorted_appsink '
        'raw_undistorted. ! queue leaky=upstream max-size-buffers=1 ! %s' %
        (args.sink_pipeline,
         stbt.get_config('global', 'transformation_pipeline')))

    sink_pipeline = ('textoverlay text="After correction" ! ' +
                     args.sink_pipeline)

    stbt.init_run(args.source_pipeline, sink_pipeline, 'none', False, False,
                  transformation_pipeline)

    tv = tv_driver.create_from_args(args, videos)

    if not args.skip_geometric:
        geometric_calibration(tv, device, interactive=args.interactive)
    if args.interactive:
        adjust_levels(tv, device)
    if not args.skip_illumination:
        calibrate_illumination(tv)

    if args.interactive:
        raw_input("Calibration complete.  Press <ENTER> to exit")
    return 0