[][src]Module opencv::imgproc

Image Processing

This module includes image-processing functions.

Image Filtering

Functions and classes described in this section are used to perform various linear or non-linear filtering operations on 2D images (represented as Mat's). It means that for each pixel location inline formula in the source image (normally, rectangular), its neighborhood is considered and used to compute the response. In case of a linear filter, it is a weighted sum of pixel values. In case of morphological operations, it is the minimum or maximum values, and so on. The computed response is stored in the destination image at the same location inline formula. It means that the output image will be of the same size as the input image. Normally, the functions support multi-channel arrays, in which case every channel is processed independently. Therefore, the output image will also have the same number of channels as the input one.

Another common feature of the functions and classes described in this section is that, unlike simple arithmetic functions, they need to extrapolate values of some non-existing pixels. For example, if you want to smooth an image using a Gaussian inline formula filter, then, when processing the left-most pixels in each row, you need pixels to the left of them, that is, outside of the image. You can let these pixels be the same as the left-most image pixels ("replicated border" extrapolation method), or assume that all the non-existing pixels are zeros ("constant border" extrapolation method), and so on. OpenCV enables you to specify the extrapolation method. For details, see #BorderTypes

@anchor filter_depths

Depth combinations

Input depth (src.depth())Output depth (ddepth)
CV_8U-1/CV_16S/CV_32F/CV_64F
CV_16U/CV_16S-1/CV_32F/CV_64F
CV_32F-1/CV_32F/CV_64F
CV_64F-1/CV_64F

Note: when ddepth=-1, the output image will have the same depth as the source.

Geometric Image Transformations

The functions in this section perform various geometrical transformations of 2D images. They do not change the image content but deform the pixel grid and map this deformed grid to the destination image. In fact, to avoid sampling artifacts, the mapping is done in the reverse order, from destination to the source. That is, for each pixel inline formula of the destination image, the functions compute coordinates of the corresponding "donor" pixel in the source image and copy the pixel value:

block formula

In case when you specify the forward mapping inline formula, the OpenCV functions first compute the corresponding inverse mapping inline formula and then use the above formula.

The actual implementations of the geometrical transformations, from the most generic remap and to the simplest and the fastest resize, need to solve two main problems with the above formula:

  • Extrapolation of non-existing pixels. Similarly to the filtering functions described in the previous section, for some inline formula, either one of inline formula, or inline formula, or both of them may fall outside of the image. In this case, an extrapolation method needs to be used. OpenCV provides the same selection of extrapolation methods as in the filtering functions. In addition, it provides the method #BORDER_TRANSPARENT. This means that the corresponding pixels in the destination image will not be modified at all.

  • Interpolation of pixel values. Usually inline formula and inline formula are floating-point numbers. This means that inline formula can be either an affine or perspective transformation, or radial lens distortion correction, and so on. So, a pixel value at fractional coordinates needs to be retrieved. In the simplest case, the coordinates can be just rounded to the nearest integer coordinates and the corresponding pixel can be used. This is called a nearest-neighbor interpolation. However, a better result can be achieved by using more sophisticated interpolation methods , where a polynomial function is fit into some neighborhood of the computed pixel inline formula, and then the value of the polynomial at inline formula is taken as the interpolated pixel value. In OpenCV, you can choose between several interpolation methods. See resize for details.

Note: The geometrical transformations do not work with CV_8S or CV_32S images.

Miscellaneous Image Transformations

Drawing Functions

Drawing functions work with matrices/images of arbitrary depth. The boundaries of the shapes can be rendered with antialiasing (implemented only for 8-bit images for now). All the functions include the parameter color that uses an RGB value (that may be constructed with the Scalar constructor ) for color images and brightness for grayscale images. For color images, the channel ordering is normally Blue, Green, Red. This is what imshow, imread, and imwrite expect. So, if you form a color using the Scalar constructor, it should look like:

block formula

If you are using your own image rendering and I/O functions, you can use any channel ordering. The drawing functions process each channel independently and do not depend on the channel order or even on the used color space. The whole image can be converted from BGR to RGB or to a different color space using cvtColor .

If a drawn figure is partially or completely outside the image, the drawing functions clip it. Also, many drawing functions can handle pixel coordinates specified with sub-pixel accuracy. This means that the coordinates can be passed as fixed-point numbers encoded as integers. The number of fractional bits is specified by the shift parameter and the real point coordinates are calculated as inline formula . This feature is especially effective when rendering antialiased shapes.

Note: The functions do not support alpha-transparency when the target image is 4-channel. In this case, the color[3] is simply copied to the repainted pixels. Thus, if you want to paint semi-transparent shapes, you can paint them in a separate buffer and then blend it with the main image.

Color Space Conversions

ColorMaps in OpenCV

The human perception isn't built for observing fine changes in grayscale images. Human eyes are more sensitive to observing changes between colors, so you often need to recolor your grayscale images to get a clue about them. OpenCV now comes with various colormaps to enhance the visualization in your computer vision application.

In OpenCV you only need applyColorMap to apply a colormap on a given image. The following sample code reads the path to an image from command line, applies a Jet colormap on it and shows the result:

@include snippets/imgproc_applyColorMap.cpp

@see #ColormapTypes

Planar Subdivision

The Subdiv2D class described in this section is used to perform various planar subdivision on a set of 2D points (represented as vector of Point2f). OpenCV subdivides a plane into triangles using the Delaunay's algorithm, which corresponds to the dual graph of the Voronoi diagram. In the figure below, the Delaunay's triangulation is marked with black lines and the Voronoi diagram with red lines.

Delaunay triangulation (black) and Voronoi (red)

The subdivisions can be used for the 3D piece-wise transformation of a plane, morphing, fast location of points on the plane, building special graphs (such as NNG,RNG), and so forth.

Histograms

Structural Analysis and Shape Descriptors

Motion Analysis and Object Tracking

Feature Detection

Object Detection

C API

Hardware Acceleration Layer

Functions

Interface

Structs

LineIterator

Line iterator

Subdiv2D

Enums

InterpolationFlags

interpolation algorithm

UndistortTypes

cv::undistort mode

Constants

ADAPTIVE_THRESH_GAUSSIAN_C
ADAPTIVE_THRESH_MEAN_C
CCL_DEFAULT

BBDT algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity

CCL_GRANA

BBDT algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity

CCL_WU

SAUF algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity

CC_STAT_AREA

The total area (in pixels) of the connected component

CC_STAT_HEIGHT

The vertical size of the bounding box

CC_STAT_LEFT

The leftmost (x) coordinate which is the inclusive start of the bounding

CC_STAT_MAX
CC_STAT_TOP

The topmost (y) coordinate which is the inclusive start of the bounding

CC_STAT_WIDTH

The horizontal size of the bounding box

CHAIN_APPROX_NONE
CHAIN_APPROX_SIMPLE
CHAIN_APPROX_TC89_KCOS
CHAIN_APPROX_TC89_L1
COLORMAP_AUTUMN

autumn

COLORMAP_BONE

bone

COLORMAP_CIVIDIS

cividis

COLORMAP_COOL

cool

COLORMAP_HOT

hot

COLORMAP_HSV

HSV

COLORMAP_INFERNO

inferno

COLORMAP_JET

jet

COLORMAP_MAGMA

magma

COLORMAP_OCEAN

ocean

COLORMAP_PARULA

parula

COLORMAP_PINK

pink

COLORMAP_PLASMA

plasma

COLORMAP_RAINBOW

rainbow

COLORMAP_SPRING

spring

COLORMAP_SUMMER

summer

COLORMAP_TWILIGHT

twilight

COLORMAP_TWILIGHT_SHIFTED

twilight shifted

COLORMAP_VIRIDIS

viridis

COLORMAP_WINTER

winter

COLOR_BGR2BGRA

add alpha channel to RGB or BGR image

COLOR_BGR2GRAY

convert between RGB/BGR and grayscale, @ref color_convert_rgb_gray "color conversions"

COLOR_BGR2HLS

convert RGB/BGR to HLS (hue lightness saturation), @ref color_convert_rgb_hls "color conversions"

COLOR_BGR2HLS_FULL
COLOR_BGR2HSV

convert RGB/BGR to HSV (hue saturation value), @ref color_convert_rgb_hsv "color conversions"

COLOR_BGR2HSV_FULL
COLOR_BGR2Lab

convert RGB/BGR to CIE Lab, @ref color_convert_rgb_lab "color conversions"

COLOR_BGR2Luv

convert RGB/BGR to CIE Luv, @ref color_convert_rgb_luv "color conversions"

COLOR_BGR2RGB
COLOR_BGR2RGBA

convert between RGB and BGR color spaces (with or without alpha channel)

COLOR_BGR2XYZ

convert RGB/BGR to CIE XYZ, @ref color_convert_rgb_xyz "color conversions"

COLOR_BGR2YCrCb

convert RGB/BGR to luma-chroma (aka YCC), @ref color_convert_rgb_ycrcb "color conversions"

COLOR_BGR2YUV

convert between RGB/BGR and YUV

COLOR_BGR2YUV_IYUV
COLOR_BGR5552BGR
COLOR_BGR5552BGRA
COLOR_BGR5552GRAY
COLOR_BGR5552RGB
COLOR_BGR5552RGBA
COLOR_BGR5652BGR
COLOR_BGR5652BGRA
COLOR_BGR5652GRAY
COLOR_BGR5652RGB
COLOR_BGR5652RGBA
COLOR_BGR2BGR555

convert between RGB/BGR and BGR555 (16-bit images)

COLOR_BGR2BGR565

convert between RGB/BGR and BGR565 (16-bit images)

COLOR_BGR2YUV_I420
COLOR_BGR2YUV_YV12
COLOR_BGRA2BGR

remove alpha channel from RGB or BGR image

COLOR_BGRA2GRAY
COLOR_BGRA2RGB
COLOR_BGRA2RGBA
COLOR_BGRA2YUV_IYUV
COLOR_BGRA2BGR555
COLOR_BGRA2BGR565
COLOR_BGRA2YUV_I420
COLOR_BGRA2YUV_YV12
COLOR_BayerBG2BGR
COLOR_BayerBG2BGRA
COLOR_BayerBG2BGR_EA
COLOR_BayerBG2BGR_VNG
COLOR_BayerBG2GRAY
COLOR_BayerBG2RGB
COLOR_BayerBG2RGBA
COLOR_BayerBG2RGB_EA
COLOR_BayerBG2RGB_VNG
COLOR_BayerGB2BGR
COLOR_BayerGB2BGRA
COLOR_BayerGB2BGR_EA
COLOR_BayerGB2BGR_VNG
COLOR_BayerGB2GRAY
COLOR_BayerGB2RGB
COLOR_BayerGB2RGBA
COLOR_BayerGB2RGB_EA
COLOR_BayerGB2RGB_VNG
COLOR_BayerGR2BGR
COLOR_BayerGR2BGRA
COLOR_BayerGR2BGR_EA
COLOR_BayerGR2BGR_VNG
COLOR_BayerGR2GRAY
COLOR_BayerGR2RGB
COLOR_BayerGR2RGBA
COLOR_BayerGR2RGB_EA
COLOR_BayerGR2RGB_VNG
COLOR_BayerRG2BGR
COLOR_BayerRG2BGRA
COLOR_BayerRG2BGR_EA
COLOR_BayerRG2BGR_VNG
COLOR_BayerRG2GRAY
COLOR_BayerRG2RGB
COLOR_BayerRG2RGBA
COLOR_BayerRG2RGB_EA
COLOR_BayerRG2RGB_VNG
COLOR_COLORCVT_MAX
COLOR_GRAY2BGR
COLOR_GRAY2BGRA
COLOR_GRAY2RGB
COLOR_GRAY2RGBA
COLOR_GRAY2BGR555

convert between grayscale and BGR555 (16-bit images)

COLOR_GRAY2BGR565

convert between grayscale to BGR565 (16-bit images)

COLOR_HLS2BGR
COLOR_HLS2BGR_FULL
COLOR_HLS2RGB
COLOR_HLS2RGB_FULL
COLOR_HSV2BGR

backward conversions to RGB/BGR

COLOR_HSV2BGR_FULL
COLOR_HSV2RGB
COLOR_HSV2RGB_FULL
COLOR_LBGR2Lab
COLOR_LBGR2Luv
COLOR_LRGB2Lab
COLOR_LRGB2Luv
COLOR_Lab2BGR
COLOR_Lab2LBGR
COLOR_Lab2LRGB
COLOR_Lab2RGB
COLOR_Luv2BGR
COLOR_Luv2LBGR
COLOR_Luv2LRGB
COLOR_Luv2RGB
COLOR_RGB2BGR
COLOR_RGB2BGRA
COLOR_RGB2GRAY
COLOR_RGB2HLS
COLOR_RGB2HLS_FULL
COLOR_RGB2HSV
COLOR_RGB2HSV_FULL
COLOR_RGB2Lab
COLOR_RGB2Luv
COLOR_RGB2RGBA
COLOR_RGB2XYZ
COLOR_RGB2YCrCb
COLOR_RGB2YUV
COLOR_RGB2YUV_IYUV
COLOR_RGB2BGR555
COLOR_RGB2BGR565
COLOR_RGB2YUV_I420
COLOR_RGB2YUV_YV12
COLOR_RGBA2BGR
COLOR_RGBA2BGRA
COLOR_RGBA2GRAY
COLOR_RGBA2RGB
COLOR_RGBA2YUV_IYUV
COLOR_RGBA2mRGBA
COLOR_RGBA2BGR555
COLOR_RGBA2BGR565
COLOR_RGBA2YUV_I420
COLOR_RGBA2YUV_YV12
COLOR_XYZ2BGR
COLOR_XYZ2RGB
COLOR_YCrCb2BGR
COLOR_YCrCb2RGB
COLOR_YUV2BGR
COLOR_YUV2BGRA_IYUV
COLOR_YUV2BGRA_UYNV
COLOR_YUV2BGRA_UYVY
COLOR_YUV2BGRA_YUNV
COLOR_YUV2BGRA_YUYV
COLOR_YUV2BGRA_YVYU
COLOR_YUV2BGR_IYUV
COLOR_YUV2BGR_UYNV
COLOR_YUV2BGR_UYVY
COLOR_YUV2BGR_YUNV
COLOR_YUV2BGR_YUYV
COLOR_YUV2BGR_YVYU
COLOR_YUV2GRAY_IYUV
COLOR_YUV2GRAY_UYNV
COLOR_YUV2GRAY_UYVY
COLOR_YUV2GRAY_YUNV
COLOR_YUV2GRAY_YUYV
COLOR_YUV2GRAY_YVYU
COLOR_YUV2RGB
COLOR_YUV2RGBA_IYUV
COLOR_YUV2RGBA_UYNV
COLOR_YUV2RGBA_UYVY
COLOR_YUV2RGBA_YUNV
COLOR_YUV2RGBA_YUYV
COLOR_YUV2RGBA_YVYU
COLOR_YUV2RGB_IYUV
COLOR_YUV2RGB_UYNV
COLOR_YUV2RGB_UYVY
COLOR_YUV2RGB_YUNV
COLOR_YUV2RGB_YUYV
COLOR_YUV2RGB_YVYU
COLOR_YUV2BGRA_I420
COLOR_YUV2BGRA_NV12
COLOR_YUV2BGRA_NV21
COLOR_YUV2BGRA_Y422
COLOR_YUV2BGRA_YUY2
COLOR_YUV2BGRA_YV12
COLOR_YUV2BGR_I420
COLOR_YUV2BGR_NV12
COLOR_YUV2BGR_NV21
COLOR_YUV2BGR_Y422
COLOR_YUV2BGR_YUY2
COLOR_YUV2BGR_YV12
COLOR_YUV2GRAY_420
COLOR_YUV2GRAY_I420
COLOR_YUV2GRAY_NV12
COLOR_YUV2GRAY_NV21
COLOR_YUV2GRAY_Y422
COLOR_YUV2GRAY_YUY2
COLOR_YUV2GRAY_YV12
COLOR_YUV2RGBA_I420
COLOR_YUV2RGBA_NV12
COLOR_YUV2RGBA_NV21
COLOR_YUV2RGBA_Y422
COLOR_YUV2RGBA_YUY2
COLOR_YUV2RGBA_YV12
COLOR_YUV2RGB_I420
COLOR_YUV2RGB_NV12
COLOR_YUV2RGB_NV21
COLOR_YUV2RGB_Y422
COLOR_YUV2RGB_YUY2
COLOR_YUV2RGB_YV12
COLOR_YUV420p2BGR
COLOR_YUV420p2BGRA
COLOR_YUV420p2GRAY
COLOR_YUV420p2RGB
COLOR_YUV420p2RGBA
COLOR_YUV420sp2BGR
COLOR_YUV420sp2BGRA
COLOR_YUV420sp2GRAY
COLOR_YUV420sp2RGB
COLOR_YUV420sp2RGBA
COLOR_mRGBA2RGBA
CONTOURS_MATCH_I1

block formula

CONTOURS_MATCH_I2

block formula

CONTOURS_MATCH_I3

block formula

CV_HAL_ADAPTIVE_THRESH_GAUSSIAN_C
CV_HAL_ADAPTIVE_THRESH_MEAN_C
CV_HAL_INTER_AREA
CV_HAL_INTER_CUBIC
CV_HAL_INTER_LANCZOS4
CV_HAL_INTER_LINEAR
CV_HAL_INTER_NEAREST
CV_HAL_MORPH_DILATE
CV_HAL_MORPH_ERODE
CV_HAL_THRESH_BINARY
CV_HAL_THRESH_BINARY_INV
CV_HAL_THRESH_MASK
CV_HAL_THRESH_OTSU
CV_HAL_THRESH_TOZERO
CV_HAL_THRESH_TOZERO_INV
CV_HAL_THRESH_TRIANGLE
CV_HAL_THRESH_TRUNC
DIST_C

distance = max(|x1-x2|,|y1-y2|)

DIST_FAIR

distance = c^2(|x|/c-log(1+|x|/c)), c = 1.3998

DIST_HUBER

distance = |x|<c ? x^2/2 : c(|x|-c/2), c=1.345

DIST_L1

distance = |x1-x2| + |y1-y2|

DIST_L2

the simple euclidean distance

DIST_L12

L1-L2 metric: distance = 2(sqrt(1+x*x/2) - 1))

DIST_LABEL_CCOMP
DIST_LABEL_PIXEL
DIST_MASK_3

mask=3

DIST_MASK_5

mask=5

DIST_MASK_PRECISE
DIST_USER

User defined distance

DIST_WELSCH

distance = c^2/2(1-exp(-(x/c)^2)), c = 2.9846

FLOODFILL_FIXED_RANGE
FLOODFILL_MASK_ONLY
GC_BGD

an obvious background pixels

GC_EVAL
GC_EVAL_FREEZE_MODEL
GC_FGD

an obvious foreground (object) pixel

GC_INIT_WITH_MASK
GC_INIT_WITH_RECT
GC_PR_BGD

a possible background pixel

GC_PR_FGD

a possible foreground pixel

HISTCMP_BHATTACHARYYA
HISTCMP_CHISQR
HISTCMP_CHISQR_ALT
HISTCMP_CORREL
HISTCMP_HELLINGER

Synonym for HISTCMP_BHATTACHARYYA

HISTCMP_INTERSECT
HISTCMP_KL_DIV
HOUGH_GRADIENT

basically 21HT, described in Yuen90

HOUGH_MULTI_SCALE
HOUGH_PROBABILISTIC
HOUGH_STANDARD
INTERSECT_FULL

One of the rectangle is fully enclosed in the other

INTERSECT_NONE

No intersection

INTERSECT_PARTIAL

There is a partial intersection

INTER_AREA
INTER_BITS
INTER_BITS2
INTER_CUBIC
INTER_LANCZOS4
INTER_LINEAR
INTER_LINEAR_EXACT
INTER_MAX
INTER_NEAREST
INTER_TAB_SIZE
INTER_TAB_SIZE2
LSD_REFINE_ADV

Advanced refinement. Number of false alarms is calculated, lines are

LSD_REFINE_NONE

No refinement applied

LSD_REFINE_STD

Standard refinement is applied. E.g. breaking arches into smaller straighter line approximations.

MARKER_CROSS

A crosshair marker shape

MARKER_DIAMOND

A diamond marker shape

MARKER_SQUARE

A square marker shape

MARKER_STAR

A star marker shape, combination of cross and tilted cross

MARKER_TILTED_CROSS

A 45 degree tilted crosshair marker shape

MARKER_TRIANGLE_DOWN

A downwards pointing triangle marker shape

MARKER_TRIANGLE_UP

An upwards pointing triangle marker shape

MORPH_BLACKHAT

"black hat"

MORPH_CLOSE

a closing operation

MORPH_CROSS

a cross-shaped structuring element:

MORPH_DILATE

see #dilate

MORPH_ELLIPSE

an elliptic structuring element, that is, a filled ellipse inscribed

MORPH_ERODE

see #erode

MORPH_GRADIENT

a morphological gradient

MORPH_HITMISS

"hit or miss"

MORPH_OPEN

an opening operation

MORPH_RECT

a rectangular structuring element:

block formula

MORPH_TOPHAT

"top hat"

PROJ_SPHERICAL_EQRECT
PROJ_SPHERICAL_ORTHO
RETR_CCOMP
RETR_EXTERNAL
RETR_FLOODFILL
RETR_LIST
RETR_TREE
Subdiv2D_NEXT_AROUND_DST
Subdiv2D_NEXT_AROUND_LEFT
Subdiv2D_NEXT_AROUND_ORG
Subdiv2D_NEXT_AROUND_RIGHT
Subdiv2D_PREV_AROUND_DST
Subdiv2D_PREV_AROUND_LEFT
Subdiv2D_PREV_AROUND_ORG
Subdiv2D_PREV_AROUND_RIGHT
Subdiv2D_PTLOC_ERROR

Point location error

Subdiv2D_PTLOC_INSIDE

Point inside some facet

Subdiv2D_PTLOC_ON_EDGE

Point on some edge

Subdiv2D_PTLOC_OUTSIDE_RECT

Point outside the subdivision bounding rect

Subdiv2D_PTLOC_VERTEX

Point coincides with one of the subdivision vertices

THRESH_BINARY

block formula

THRESH_BINARY_INV

block formula

THRESH_MASK
THRESH_OTSU

flag, use Otsu algorithm to choose the optimal threshold value

THRESH_TOZERO

block formula

THRESH_TOZERO_INV

block formula

THRESH_TRIANGLE

flag, use Triangle algorithm to choose the optimal threshold value

THRESH_TRUNC

block formula

TM_CCOEFF

block formula

TM_CCOEFF_NORMED

block formula

TM_CCORR

block formula

TM_CCORR_NORMED

block formula

TM_SQDIFF

block formula

TM_SQDIFF_NORMED

block formula

WARP_FILL_OUTLIERS
WARP_INVERSE_MAP
WARP_POLAR_LINEAR
WARP_POLAR_LOG

Traits

CLAHE

Base class for Contrast Limited Adaptive Histogram Equalization.

GeneralizedHough

finds arbitrary template in the grayscale image using Generalized Hough Transform

GeneralizedHoughBallard

finds arbitrary template in the grayscale image using Generalized Hough Transform

GeneralizedHoughGuil

finds arbitrary template in the grayscale image using Generalized Hough Transform

LineSegmentDetector

Line segment detector class

Functions

accumulate

Adds an image to the accumulator image.

accumulate_product

Adds the per-element product of two input images to the accumulator image.

accumulate_square

Adds the square of a source image to the accumulator image.

accumulate_weighted

Updates a running average.

adaptive_threshold

Applies an adaptive threshold to an array.

apply_color_map

Applies a GNU Octave/MATLAB equivalent colormap on a given image.

apply_color_map_user

Applies a user colormap on a given image.

approx_poly_dp

Approximates a polygonal curve(s) with the specified precision.

arc_length

Calculates a contour perimeter or a curve length.

arrowed_line

Draws a arrow segment pointing from the first point to the second one.

bilateral_filter

Applies the bilateral filter to an image.

blend_linear

Performs linear blending of two images:

block formula

blur

Blurs an image using the normalized box filter.

bounding_rect

Calculates the up-right bounding rectangle of a point set or non-zero pixels of gray-scale image.

box_filter

Blurs an image using the box filter.

box_points

Finds the four vertices of a rotated rect. Useful to draw the rotated rectangle.

build_pyramid

Constructs the Gaussian pyramid for an image.

calc_back_project

Calculates the back projection of a histogram.

calc_hist

Calculates a histogram of a set of arrays.

canny

Finds edges in an image using the Canny algorithm Canny86 .

canny_derivative

\overload

circle

Draws a circle.

clip_line

Clips the line against the image rectangle.

clip_line_size

Clips the line against the image rectangle.

clip_line_size_i64

Clips the line against the image rectangle.

compare_hist

Compares two histograms.

connected_components

computes the connected components labeled image of boolean image

connected_components_algo

computes the connected components labeled image of boolean image

connected_components_with_stats

computes the connected components labeled image of boolean image and also produces a statistics output for each label

connected_components_with_stats_algo

computes the connected components labeled image of boolean image and also produces a statistics output for each label

contour_area

Calculates a contour area.

convert_maps

Converts image transformation maps from one representation to another.

convex_hull

Finds the convex hull of a point set.

convexity_defects

Finds the convexity defects of a contour.

corner_eigen_vals_and_vecs

Calculates eigenvalues and eigenvectors of image blocks for corner detection.

corner_harris

Harris corner detector.

corner_min_eigen_val

Calculates the minimal eigenvalue of gradient matrices for corner detection.

corner_sub_pix

Refines the corner locations.

create_clahe

Creates a smart pointer to a cv::CLAHE class and initializes it.

create_generalized_hough_ballard

Creates a smart pointer to a cv::GeneralizedHoughBallard class and initializes it.

create_generalized_hough_guil

Creates a smart pointer to a cv::GeneralizedHoughGuil class and initializes it.

create_hanning_window

This function computes a Hanning window coefficients in two dimensions.

create_line_segment_detector

Creates a smart pointer to a LineSegmentDetector object and initializes it.

cvt_color

Converts an image from one color space to another.

cvt_color_two_plane

Converts an image from one color space to another where the source image is stored in two planes.

demosaicing

main function for all demosaicing processes

dilate

Dilates an image by using a specific structuring element.

distance_transform

Calculates the distance to the closest zero pixel for each pixel of the source image.

distance_transform_labels

Calculates the distance to the closest zero pixel for each pixel of the source image.

draw_contours

Draws contours outlines or filled contours.

draw_marker

Draws a marker on a predefined position in an image.

ellipse

Draws a simple or thick elliptic arc or fills an ellipse sector.

ellipse_2_poly

Approximates an elliptic arc with a polyline.

ellipse_2_poly_f64

Approximates an elliptic arc with a polyline.

ellipse_new_rotated_rect

Draws a simple or thick elliptic arc or fills an ellipse sector.

emd

Computes the "minimal work" distance between two weighted point configurations.

equalize_hist

Equalizes the histogram of a grayscale image.

erode

Erodes an image by using a specific structuring element.

fill_convex_poly

Fills a convex polygon.

fill_poly

Fills the area bounded by one or more polygons.

filter_2d

Convolves an image with the kernel.

find_contours

Finds contours in a binary image.

find_contours_with_hierarchy

Finds contours in a binary image.

fit_ellipse

Fits an ellipse around a set of 2D points.

fit_ellipse_ams

Fits an ellipse around a set of 2D points.

fit_ellipse_direct

Fits an ellipse around a set of 2D points.

fit_line

Fits a line to a 2D or 3D point set.

flood_fill

Fills a connected component with the given color.

flood_fill_mask

Fills a connected component with the given color.

gaussian_blur

Blurs an image using a Gaussian filter.

get_affine_transform
get_affine_transform_slice

Calculates an affine transform from three pairs of the corresponding points.

get_default_new_camera_matrix

Returns the default new camera matrix.

get_deriv_kernels

Returns filter coefficients for computing spatial image derivatives.

get_font_scale_from_height

Calculates the font-specific size to use to achieve a given height in pixels.

get_gabor_kernel

Returns Gabor filter coefficients.

get_gaussian_kernel

Returns Gaussian filter coefficients.

get_perspective_transform

Calculates a perspective transform from four pairs of the corresponding points.

get_perspective_transform_slice

returns 3x3 perspective transformation for the corresponding 4 point pairs.

get_rect_sub_pix

Retrieves a pixel rectangle from an image with sub-pixel accuracy.

get_rotation_matrix_2d

Calculates an affine matrix of 2D rotation.

get_structuring_element

Returns a structuring element of the specified size and shape for morphological operations.

get_text_size

Calculates the width and height of a text string.

good_features_to_track

Determines strong corners on an image.

good_features_to_track_with_gradient

C++ default parameters

grab_cut

Runs the GrabCut algorithm.

hough_circles

Finds circles in a grayscale image using the Hough transform.

hough_lines

Finds lines in a binary image using the standard Hough transform.

hough_lines_p

Finds line segments in a binary image using the probabilistic Hough transform.

hough_lines_point_set

Finds lines in a set of points using the standard Hough transform.

init_undistort_rectify_map

Computes the undistortion and rectification transformation map.

init_wide_angle_proj_map_with_type_i32

initializes maps for #remap for wide-angle

integral

Calculates the integral of an image.

integral_sq_depth

Calculates the integral of an image.

integral_titled_sq

Calculates the integral of an image.

intersect_convex_convex

finds intersection of two convex polygons

invert_affine_transform

Inverts an affine transformation.

is_contour_convex

Tests a contour convexity.

laplacian

Calculates the Laplacian of an image.

line

Draws a line segment connecting two points.

linear_polarDeprecated

Remaps an image to polar coordinates space.

log_polarDeprecated

Remaps an image to semilog-polar coordinates space.

match_shapes

Compares two shapes.

match_template

Compares a template against overlapped image regions.

median_blur

Blurs an image using the median filter.

min_area_rect

Finds a rotated rectangle of the minimum area enclosing the input 2D point set.

min_enclosing_circle

Finds a circle of the minimum area enclosing a 2D point set.

min_enclosing_triangle

Finds a triangle of minimum area enclosing a 2D point set and returns its area.

morphology_default_border_value

returns "magic" border value for erosion and dilation. It is automatically transformed to Scalar::all(-DBL_MAX) for dilation.

morphology_ex

Performs advanced morphological transformations.

phase_correlate

The function is used to detect translational shifts that occur between two images.

point_polygon_test

Performs a point-in-contour test.

polylines

Draws several polygonal curves.

pre_corner_detect

Calculates a feature map for corner detection.

put_text

Draws a text string.

pyr_down

Blurs an image and downsamples it.

pyr_mean_shift_filtering

Performs initial step of meanshift segmentation of an image.

pyr_up

Upsamples an image and then blurs it.

rectangle

Draws a simple, thick, or filled up-right rectangle.

rectangle_points

Draws a simple, thick, or filled up-right rectangle.

remap

Applies a generic geometrical transformation to an image.

resize

Resizes an image.

rotated_rectangle_intersection

Finds out if there is any intersection between two rotated rectangles.

scharr

Calculates the first x- or y- image derivative using Scharr operator.

sep_filter_2d

Applies a separable linear filter to an image.

sobel

Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator.

spatial_gradient

Calculates the first order image derivative in both x and y using a Sobel operator

sqr_box_filter

Calculates the normalized sum of squares of the pixel values overlapping the filter.

threshold

Applies a fixed-level threshold to each array element.

undistort

Transforms an image to compensate for lens distortion.

undistort_points

Computes the ideal point coordinates from the observed point coordinates.

undistort_points_with_criteria

Computes the ideal point coordinates from the observed point coordinates.

warp_affine

Applies an affine transformation to an image.

warp_perspective

Applies a perspective transformation to an image.

warp_polar

\brief Remaps an image to polar or semilog-polar coordinates space

watershed

Performs a marker-based image segmentation using the watershed algorithm.

wrapper_emd

C++ default parameters