imgproc.oprdecl 3.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
decl_opr(
    'WarpPerspective',
    inputs=[
        Doc('src', 'input image, in (batch, channel, row, col), (batch,'
            'row, col, channel) or (batch, channel / 4, row, col, 4) format, '
            'decided by Format(NHWC, NCHW, NCHW4).'),
        Doc('mat', 'batch-wise transforming matrix, in (batch, 3, 3) format. '
            'Note that this matrix maps from output coordinate to input '
            'coordinate'),
        Doc('out_shape', 'output image shape, containing two elements '
            'specifying output height and width')],
    params='WarpPerspective',
    desc='Apply perspective transformation to batched 2D images; '
    'see http://docs.opencv.org/2.4/modules/imgproc/doc/geometric_transformations.html '
    'for details on perspective transformations.')

decl_opr(
    'WarpPerspective',
    pyname='warp_perspective_mat_idx',
    inputs=[
        'src', 'mat', 'mat_idx', 'out_shape'
    ],
    params='WarpPerspective',
    desc='like :func:`warp_perspective`, but the **mat** param does not have '
    'to have the same batch size as **src**; instead, **mat_idx** specifies '
    'the batch number of each matrix in **mat**'
)

decl_opr('Rotate',
    inputs=[
        Doc('src', 'source image, in (batch, row, col, channel) format. '
            'Note the channel size must be 1 or 3')],
    params='Rotate',
    desc='Rotate images 90 degree, clockwise indicate the direction.')

decl_opr('CvtColor',
    inputs=[
        Doc('src', 'source image, in (batch, row, col, channel) format. '
            'Note the channel size must be 1 or 3 or 4')],
    params='CvtColor',
    desc='Converts images from one color space to another. '
    'see http://docs.opencv.org/2.4/modules/imgproc/doc/miscellaneous_transformations.html?highlight=cvtcolor#cv2.cvtColor'
    ' for details.')

decl_opr('GaussianBlur',
    inputs=[
        Doc('src', 'source image, in (batch, row, col, channel) format. '
            'Note the channel size must be 1 or 3')],
    params='GaussianBlur',
         desc='Blurs images using a Gaussian filter. '
         'http://docs.opencv.org/2.4/modules/imgproc/doc/filtering.html?highlight=gaussianblur#gaussianblur'
         ' for details.')

decl_opr('Resize',
    inputs=[
        Doc('src', 'source image, in (batch, row, col, channel), '
            '(batch, channel, row, col), (batch, channel / 4, row, col, 4) '
            'format, decided by specific format NHWC, NCHW or NCHW4'),
        Doc('out_shape', 'output image shape, containing two elements '
            'specifying output height and width')],
    params='Resize',
         desc='Resize an image. '
         'see http://docs.opencv.org/2.4/modules/imgproc/doc/geometric_transformations.html?highlight=resize#cv2.resize'
         ' for details.',
    version=1)

decl_opr(
    'WarpAffine',
    inputs=[
        Doc('src', 'input image, in (batch, row, col, channel) format'),
        Doc('mat', 'batch-wise transforming matrix, in (batch, 2, 3) format. '
            'Note that this matrix maps from output coordinate to input '
            'coordinate'),
        Doc('out_shape', 'output image shape, containing two elements '
            'specifying output height and width')],
    params='WarpAffine',
    desc='Apply affine transformation to batched 2D images; '
    'see http://docs.opencv.org/2.4/modules/imgproc/doc/geometric_transformations.html '
    'for details on affine transformations.',
    version=1)

82 83 84 85 86 87 88 89 90 91 92
decl_opr(
    'Remap',
    inputs=[
        Doc('src', 'input image, in NCHW format or NHWC format'),
        Doc('map_xy', 'map matrix with NHWC format. C must euqal to 2. '
            'dst(x, y) = src(mapX(x, y), mapY(x, y)'
            'col in channel 0, and row in channel 1')],
    params='Remap',
    desc='Remap transformation to batched 2D images; '
    'see https://docs.opencv.org/2.4/modules/imgproc/doc/geometric_transformations.html?highlight=remap'
    'for details on remap transformations.')
93
# vim: ft=python