OpenCV453
型定義 | 関数 | 変数
C API for video I/O

型定義

typedef struct CvCapture CvCapture
 "black box" capture structure [詳解]
 
typedef struct CvVideoWriter CvVideoWriter
 "black box" video file writer structure [詳解]
 

関数

 CVAPI (CvCapture *) cvCreateFileCapture(const char *filename)
 start capturing frames from video file [詳解]
 
 CVAPI (int) cvGrabFrame(CvCapture *capture)
 grab a frame, return 1 on success, 0 on fail. [詳解]
 
 CVAPI (IplImage *) cvRetrieveFrame(CvCapture *capture
 get the frame grabbed with cvGrabFrame(..) [詳解]
 
int streamIdx CV_DEFAULT (0))
 
 CVAPI (void) cvReleaseCapture(CvCapture **capture)
 stop capturing/reading and free resources [詳解]
 
 CVAPI (double) cvGetCaptureProperty(CvCapture *capture
 retrieve capture properties
 
 CVAPI (CvVideoWriter *) cvCreateVideoWriter(const char *filename
 initialize video file writer
 
int double CvSize int is_color CV_DEFAULT (1))
 

変数

int apiPreference
 
int property_id
 
int double value
 
int fourcc
 
int double fps
 
int double CvSize frame_size
 
const IplImageimage
 

Obsolete functions/synonyms

#define cvCaptureFromCAM   cvCreateCameraCapture
 
#define cvCaptureFromFile   cvCreateFileCapture
 
#define cvCaptureFromAVI   cvCaptureFromFile
 
#define cvCreateAVIWriter   cvCreateVideoWriter
 
#define cvWriteToAVI   cvWriteFrame
 

詳解

マクロ定義詳解

◆ cvCaptureFromAVI

#define cvCaptureFromAVI   cvCaptureFromFile
非推奨:
use cvCreateFileCapture() instead

◆ cvCaptureFromCAM

#define cvCaptureFromCAM   cvCreateCameraCapture
非推奨:
use cvCreateCameraCapture() instead

◆ cvCaptureFromFile

#define cvCaptureFromFile   cvCreateFileCapture
非推奨:
use cvCreateFileCapture() instead

◆ cvCreateAVIWriter

#define cvCreateAVIWriter   cvCreateVideoWriter
非推奨:
use cvCreateVideoWriter() instead

◆ cvWriteToAVI

#define cvWriteToAVI   cvWriteFrame
非推奨:
use cvWriteFrame() instead

型定義詳解

◆ CvCapture

typedef struct CvCapture CvCapture

"black box" capture structure

In C++ use cv::VideoCapture

◆ CvVideoWriter

typedef struct CvVideoWriter CvVideoWriter

"black box" video file writer structure

In C++ use cv::VideoWriter

関数詳解

◆ CVAPI() [1/4]

CVAPI ( CvCapture ) const

start capturing frames from video file

start capturing frames from camera: index = camera_index + domain_offset (CV_CAP_*)

start capturing frames from video file. allows specifying a preferred API to use

◆ CVAPI() [2/4]

CVAPI ( int  )

grab a frame, return 1 on success, 0 on fail.

write frame to video file

Return the type of the capturer (eg, ::CV_CAP_VFW, ::CV_CAP_UNICAP)

set capture properties

this function is thought to be fast

It is unknown if created with ::CV_CAP_ANY

◆ CVAPI() [3/4]

CVAPI ( IplImage )

get the frame grabbed with cvGrabFrame(..)

Just a combination of cvGrabFrame and cvRetrieveFrame

This function may apply some frame processing like frame decompression, flipping etc.

警告
!!!DO NOT RELEASE or MODIFY the retrieved frame!!!
!!!DO NOT RELEASE or MODIFY the retrieved frame!!!

◆ CVAPI() [4/4]

CVAPI ( void  )

stop capturing/reading and free resources

close video file writer

stop capturing/reading and free resources

close video file writer

Draws contour outlines or filled interiors on the image

Calculates bounding box of text stroke (useful for alignment)

Renders text stroke with specified font and color at specified location. CvFont should be initialized with cvInitFont

Initializes font structure (OpenCV 1.x API).

Draws one or more polygonal curves

Fills an area bounded by one or more arbitrary polygons

Fills convex or monotonous polygon.

Draws ellipse outline, filled ellipse, elliptic arc or filled elliptic sector

Draws a circle with specified center and radius.

Draws a rectangle specified by a CvRect structure

Draws a rectangle given two opposite corners of the rectangle (pt1 & pt2)

Draws 4-connected, 8-connected or antialiased line segment connecting two points

Fits a line into set of 2d or 3d points in a robust way (M-estimator technique)

Finds a sparse set of points within the selected region that seem to be easy to track

Adjust corner position using some sort of gradient search

Harris corner detector:

Calculates minimal eigenvalue for 2x2 gradient covariation matrix at every image pixel

Calculates eigen values and vectors of 2x2 gradient covariation matrix at every image pixel

Calculates constraint image for corner detection

Runs canny edge detector

Fills the connected component until the color difference gets large enough

Applies adaptive threshold to grayscale image.

Applies distance transform to binary image

equalizes histogram of 8-bit single-channel image

Divides one histogram by another.

Locates a template within an image by using a histogram comparison.

Calculates back project

Calculates array histogram

Calculates bayesian probabilistic histograms (each or src and dst is an array of number histograms

Copies a histogram.

Thresholds the histogram.

Normalizes the histogram.

Finds the minimum and maximum histogram bins.

Clears the histogram.

Releases the histogram.

Sets the bounds of the histogram bins.

Finds coordinates of the box vertices

Initializes Freeman chain reader.

Substitutes the last retrieved contour with the new one

Measures similarity between template and overlapped windows in the source image and fills the resultant image with the measurements

Retrieves quadrangle from the input array.

Retrieves the rectangular image region with specified center from the input array.

Calculates 7 Hu's invariants from precalculated spatial and central moments

Calculates all spatial and central moments up to the 3rd order

Performs complex morphological transformation

dilates input image (applies maximum filter) one or more times.

erodes input image (applies minimum filter) one or more times. If element pointer is NULL, 3x3 rectangular element is used

releases structuring element

Performs forward or inverse log-polar image transform

Converts mapx & mapy from floating-point to integer formats for cvRemap

Performs generic geometric transformation using the specified coordinate maps

Warps image with perspective (projective) transform

Warps image with affine transform

Resizes image (input array is resized to fit the destination array)

Converts input array pixels from one color space to another

Calculates the image Laplacian: (d2/dx + d2/dy)I

Calculates an image derivative using generalized Sobel

Segments image using seed "markers"

Filters image using meanshift algorithm

Releases pyramid

Up-samples image and smoothes the result with gaussian kernel.

Smoothes the input image with gaussian kernel and then down-samples it.

Finds integral image: SUM(X,Y) = sum(x<X,y<Y)I(x,y)

Convolves an image with the kernel.

Smooths the image in one of several ways.

Adds image to accumulator with weights: acc = acc*(1-alpha) + image*alpha

Adds a product of two images to accumulator

Adds squared image to accumulator

Releases an object.

Makes OpenCV use IPL functions for allocating IplImage and IplROI structures.

Calculates the cross product of two 3D vectors.

Fills an array with random numbers and updates the RNG state.

Converts one array to another with optional linear transformation.

Clears the array.

Sets every element of an array to a given value.

Copies one array to another.

Retrieves low-level information about the array.

Assigns user data to the array header.

Releases array data.

Allocates array data

Change a specific array element.

Change the particular array element.

Deallocates sparse array.

Deallocates a matrix.

Resets the image ROI to include the entire image and releases the ROI structure.

Sets an image Region Of Interest (ROI) for a given rectangle.

Sets the channel of interest in an IplImage.

Deallocates the image header and the image data.

free wrapper. Here and further all the memory releasing functions (that all call cvFree) take double pointer in order to to clear pointer to the data after releasing it. Passing pointer to NULL pointer is Ok: nothing happens in this case

This call is an analogue of :

if(image )
{
iplDeallocate(*image, IPL_IMAGE_HEADER | IPL_IMAGE_ROI);
*image = 0;
}

but it does not use IPL functions by default (see the CV_TURN_ON_IPL_COMPATIBILITY macro).

引数
imageDouble pointer to the image header

This call is a shortened form of :

if(*image )
{
cvReleaseData(*image);
cvReleaseImageHeader(image);
}
引数
imageDouble pointer to the image header

If the ROI is set to NULL and the coi is not 0, the ROI is allocated. Most OpenCV functions do not* support the COI setting, so to process an individual image/matrix channel one may copy (via cvCopy or cvSplit) the channel to a separate image/matrix, process it and then copy the result back (via cvCopy or cvMerge) if needed.

引数
imageA pointer to the image header
coiThe channel of interest. 0 - all channels are selected, 1 - first channel is selected, etc. Note that the channel indices become 1-based.

If the original image ROI was NULL and the rect is not the whole image, the ROI structure is allocated.

Most OpenCV functions support the use of ROI and treat the image rectangle as a separate image. For example, all of the pixel coordinates are counted from the top-left (or bottom-left) corner of the ROI, not the original image.

引数
imageA pointer to the image header
rectThe ROI rectangle

This produces a similar result to the following, but in addition it releases the ROI structure. :

cvSetImageROI(image, cvRect(0, 0, image->width, image->height ));
cvSetImageCOI(image, 0);
CV_INLINE CvRect cvRect(int x, int y, int width, int height)
Definition: core/types_c.h:878
引数
imageA pointer to the image header

The function decrements the matrix data reference counter and deallocates matrix header. If the data reference counter is 0, it also deallocates the data. :

if(*mat )
cvDecRefData(*mat);
cvFree((void**)mat);
CV_INLINE void cvDecRefData(CvArr *arr)
Decrements an array data reference counter.
Definition: core_c.h:298
引数
matDouble pointer to the matrix

low-level scalar <-> raw data conversion functions

The function releases the sparse array and clears the array pointer upon exit.

引数
matDouble pointer to the array

The functions assign the new value to a particular array element. In the case of a sparse array the functions create the node if it does not exist yet.

引数
arrInput array
idx0The first zero-based component of the element index
valueThe assigned value

これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。

これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。

引数
arrInput array
idxArray of the element indices
valueThe assigned value

The functions assign a new value to a specific element of a single-channel array. If the array has multiple channels, a runtime error is raised. Note that the Set*D function can be used safely for both single-channel and multiple-channel arrays, though they are a bit slower.

In the case of a sparse array the functions create the node if it does not yet exist.

引数
arrInput array
idx0The first zero-based component of the element index
valueThe assigned value

clears element of ND dense array, in case of sparse arrays it deletes the specified node

Repeats source 2d array several times in both horizontal and vertical direction to fill destination array

The function allocates image, matrix or multi-dimensional dense array data. Note that in the case of matrix types OpenCV allocation functions are used. In the case of IplImage they are used unless CV_TURN_ON_IPL_COMPATIBILITY() has been called before. In the latter case IPL functions are used to allocate the data.

引数
arrArray header

The function releases the array data. In the case of CvMat or CvMatND it simply calls cvDecRefData(), that is the function can not deallocate external data. See also the note to cvCreateData .

引数
arrArray header

The function assigns user data to the array header. Header should be initialized before using cvCreateMatHeader, cvCreateImageHeader, cvCreateMatNDHeader, cvInitMatHeader, cvInitImageHeader or cvInitMatNDHeader.

引数
arrArray header
dataUser data
stepFull row length in bytes

The function fills output variables with low-level information about the array data. All output

parameters are optional, so some of the pointers may be set to NULL. If the array is IplImage with ROI set, the parameters of ROI are returned.

The following example shows how to get access to array elements. It computes absolute values of the array elements :

float* data;
int step;
CvSize size;
cvGetRawData(array, (uchar**)&data, &step, &size);
step /= sizeof(data[0]);
for(int y = 0; y < size.height; y++, data += step )
for(int x = 0; x < size.width; x++ )
data[x] = (float)fabs(data[x]);
Definition: core/types_c.h:1174
引数
arrArray header
dataOutput pointer to the whole image origin or ROI origin if ROI is set
stepOutput full row length in bytes
roi_sizeOutput ROI size

The function copies selected elements from an input array to an output array:

\[\texttt{dst} (I)= \texttt{src} (I) \quad \text{if} \quad \texttt{mask} (I) \ne 0.\]

If any of the passed arrays is of IplImage type, then its ROI and COI fields are used. Both arrays must have the same type, the same number of dimensions, and the same size. The function can also copy sparse arrays (mask is not supported in this case).

引数
srcThe source array
dstThe destination array
maskOperation mask, 8-bit single channel array; specifies elements of the destination array to be changed

The function copies the scalar value to every selected element of the destination array:

\[\texttt{arr} (I)= \texttt{value} \quad \text{if} \quad \texttt{mask} (I) \ne 0\]

If array arr is of IplImage type, then is ROI used, but COI must not be set.

引数
arrThe destination array
valueFill value
maskOperation mask, 8-bit single channel array; specifies elements of the destination array to be changed

The function clears the array. In the case of dense arrays (CvMat, CvMatND or IplImage), cvZero(array) is equivalent to cvSet(array,cvScalarAll(0),0). In the case of sparse arrays all the elements are removed.

引数
arrArray to be cleared

Splits a multi-channel array into the set of single-channel arrays or extracts particular [color] plane

Merges a set of single-channel arrays into the single multi-channel array or inserts one particular [color] plane to the array

Copies several channels from input arrays to certain channels of output arrays

The function has several different purposes, and thus has several different names. It copies one array to another with optional scaling, which is performed first, and/or optional type conversion, performed after:

\[\texttt{dst} (I) = \texttt{scale} \texttt{src} (I) + ( \texttt{shift} _0, \texttt{shift} _1,...)\]

All the channels of multi-channel arrays are processed independently.

The type of conversion is done with rounding and saturation, that is if the result of scaling + conversion can not be represented exactly by a value of the destination array element type, it is set to the nearest representable value on the real axis.

引数
srcSource array
dstDestination array
scaleScale factor
shiftValue added to the scaled source array elements

Performs linear transformation on every source array element, stores absolute value of the result: dst(x,y,c) = abs(scale*src(x,y,c)+shift). destination array must have 8u type. In other cases one may use cvConvertScale + cvAbsDiffS

dst(mask) = src1(mask) + src2(mask)

dst(mask) = src(mask) + value

dst(mask) = src1(mask) - src2(mask)

dst(mask) = value - src(mask)

dst(idx) = src1(idx) * src2(idx) * scale (scaled element-wise multiplication of 2 arrays)

element-wise division/inversion with scaling: dst(idx) = src1(idx) * scale / src2(idx) or dst(idx) = scale / src2(idx) if src1 == 0

dst = src1 * scale + src2

dst = src1 * alpha + src2 * beta + gamma

dst(idx) = src1(idx) & src2(idx)

dst(idx) = src(idx) & value

dst(idx) = src1(idx) | src2(idx)

dst(idx) = src(idx) | value

dst(idx) = src1(idx) ^ src2(idx)

dst(idx) = src(idx) ^ value

dst(idx) = ~src(idx)

dst(idx) = lower(idx) <= src(idx) < upper(idx)

dst(idx) = lower <= src(idx) < upper

The comparison operation support single-channel arrays only. Destination image should be 8uC1 or 8sC1 dst(idx) = src1(idx) cmp_op src2(idx)

dst(idx) = src1(idx) cmp_op value

dst(idx) = min(src1(idx),src2(idx))

dst(idx) = max(src1(idx),src2(idx))

dst(idx) = min(src(idx),value)

dst(idx) = max(src(idx),value)

dst(x,y,c) = abs(src1(x,y,c) - src2(x,y,c))

dst(x,y,c) = abs(src(x,y,c) - value(c))

Does cartesian->polar coordinates conversion. Either of output components (magnitude or angle) is optional

Does polar->cartesian coordinates conversion. Either of output components (magnitude or angle) is optional. If magnitude is missing it is assumed to be all 1's

Does powering: dst(idx) = src(idx)^power

Does exponention: dst(idx) = exp(src(idx)). Overflow is not handled yet. Underflow is handled. Maximal relative error is ~7e-6 for single-precision input

Calculates natural logarithms: dst(idx) = log(abs(src(idx))). Logarithm of 0 gives large negative number(~-700) Maximal relative error is ~3e-7 for single-precision output

The function fills the destination array with uniformly or normally distributed random numbers.

引数
rngCvRNG state initialized by cvRNG
arrThe destination array
dist_typeDistribution type

- CV_RAND_UNI uniform distribution

  • CV_RAND_NORMAL normal or Gaussian distribution
param1The first parameter of the distribution. In the case of a uniform distribution it is the inclusive lower boundary of the random numbers range. In the case of a normal distribution it is the mean value of the random numbers.
param2The second parameter of the distribution. In the case of a uniform distribution it is the exclusive upper boundary of the random numbers range. In the case of a normal distribution it is the standard deviation of the random numbers.
参照
randu, randn, RNG::fill.

Finds all real and complex roots of a polynomial equation

The function calculates the cross product of two 3D vectors:

\[\texttt{dst} = \texttt{src1} \times \texttt{src2}\]

or:

\[\begin{array}{l} \texttt{dst} _1 = \texttt{src1} _2 \texttt{src2} _3 - \texttt{src1} _3 \texttt{src2} _2 \\ \texttt{dst} _2 = \texttt{src1} _3 \texttt{src2} _1 - \texttt{src1} _1 \texttt{src2} _3 \\ \texttt{dst} _3 = \texttt{src1} _1 \texttt{src2} _2 - \texttt{src1} _2 \texttt{src2} _1 \end{array}\]

引数
src1The first source vector
src2The second source vector
dstThe destination vector

Extended matrix transform: dst = alpha*op(A)*op(B) + beta*op(C), where op(X) is X or X^T

Transforms each element of source array and stores resultant vectors in destination array

Does perspective transform on every element of input array

Calculates (A-delta)*(A-delta)^T (order=0) or (A-delta)^T*(A-delta) (order=1)

Transposes matrix. Square matrices can be transposed in-place

Completes the symmetric matrix from the lower (LtoR=0) or from the upper (LtoR!=0) part

Mirror array data around horizontal (flip=0), vertical (flip=1) or both(flip=-1) axises: cvFlip(src) flips images vertically and sequences horizontally (inplace)

Performs Singular Value Decomposition of a matrix

Performs Singular Value Back Substitution (solves A*X = B): flags must be the same as in cvSVD

Finds eigen values and vectors of a symmetric matrix

  • Finds selected eigen values and vectors of a symmetric matrix *‍/ Makes an identity matrix (mat_ij = i == j)

Calculates covariation matrix for a set of vectors

参照
flags

Calculates mean and standard deviation of pixel values

Finds global minimum, maximum and their positions

参照
ref core_c_NormFlags "flags"
flags

Discrete Fourier Transform: complex->complex, real->ccs (forward), ccs->real (inverse)

参照
core_c_DftFlags "flags"

Multiply results of DFTs: DFT(X)*DFT(Y) or DFT(X)*conj(DFT(Y))

参照
core_c_DftFlags "flags"

Discrete Cosine Transform

参照
core_c_DftFlags "flags"

Releases memory storage. All the children of a parent must be released before the parent. A child storage returns all the blocks to parent when it is released

Clears memory storage. This is the only way(!!!) (besides cvRestoreMemStoragePos) to reuse memory allocated for the storage - cvClearSeq,cvClearSet ... do not free any memory. A child storage returns all the blocks to the parent when it is cleared

Remember a storage "free memory" position

Restore a storage "free memory" position

Changes default size (granularity) of sequence blocks. The default size is ~1Kbyte

Removes the last element from sequence and optionally saves it

Removes the first element from sequence and optioanally saves it

Adds several new elements to the end of sequence

Removes several elements from the end of sequence and optionally saves them

Removes specified sequence element

Removes all the elements from the sequence. The freed memory can be reused later only by the same sequence unless cvClearMemStorage or cvRestoreMemStoragePos is called

Initializes sequence writer. The new elements will be added to the end of sequence

Combination of cvCreateSeq and cvStartAppendToSeq

Updates sequence header. May be useful to get access to some of previously written elements via cvGetSeqElem or sequence reader

Initializes sequence reader. The sequence can be read in forward or backward direction

Changes sequence reader position. It may seek to an absolute or to relative to the current position

Removes sequence slice

Inserts a sequence or array into another sequence

Sorts sequence in-place given element comparison function

Reverses order of sequence elements in-place

Removes element from the set by its index

Removes all the elements from the set

Remove edge connecting two vertices

Remove all vertices and edges from the graph

Releases graph scanner.

Does look-up transformation. Elements of the source array (that should be 8uC1 or 8sC1) are used as indexes in lutarr 256-element table

Inserts sequence into tree with specified "parent" sequence. If parent is equal to frame (e.g. the most external contour), then added contour will have null pointer to parent.

Removes contour from tree (together with the contour children).

Normally, the function is not called directly. Instead, a simple macro CV_TURN_ON_IPL_COMPATIBILITY() is used that calls cvSetIPLAllocators and passes there pointers to IPL allocation functions. :

...
CV_TURN_ON_IPL_COMPATIBILITY()
...
引数
create_headerpointer to a function, creating IPL image header.
allocate_datapointer to a function, allocating IPL image data.
deallocatepointer to a function, deallocating IPL image.
create_roipointer to a function, creating IPL image ROI (i.e. Region of Interest).
clone_imagepointer to a function, cloning an IPL image.

The function finds the type of a given object and calls release with the double pointer.

引数
struct_ptrDouble pointer to the object

Sets error status silently

Sets error status and performs some additional actions (displaying message box, writing message to stderr, terminating application etc.) depending on the current error mode

参照
cv::accumulateSquare
cv::accumulateProduct
cv::accumulateWeighted

Copies source 2D array inside of the larger destination array and makes a border of the specified type (IPL_BORDER_*) around the copied area.

引数
srcThe source image
dstThe destination image
smoothtypeType of the smoothing, see SmoothMethod_c
size1The first parameter of the smoothing operation, the aperture width. Must be a positive odd number (1, 3, 5, ...)
size2The second parameter of the smoothing operation, the aperture height. Ignored by CV_MEDIAN and CV_BILATERAL methods. In the case of simple scaled/non-scaled and Gaussian blur if size2 is zero, it is set to size1. Otherwise it must be a positive odd number.
sigma1In the case of a Gaussian parameter this parameter may specify Gaussian $\sigma$ (standard deviation). If it is zero, it is calculated from the kernel size:

\[\sigma = 0.3 (n/2 - 1) + 0.8 \quad \text{where} \quad n= \begin{array}{l l} \mbox{\texttt{size1} for horizontal kernel} \\ \mbox{\texttt{size2} for vertical kernel} \end{array}\]

Using standard sigma for small kernels ( $3\times 3$ to $7\times 7$ ) gives better speed. If sigma1 is not zero, while size1 and size2 are zeros, the kernel size is calculated from the sigma (to provide accurate enough operation).
sigma2additional parameter for bilateral filtering
参照
cv::GaussianBlur, cv::blur, cv::medianBlur, cv::bilateralFilter.
引数
srcinput image.
dstoutput image of the same size and the same number of channels as src.
kernelconvolution kernel (or rather a correlation kernel), a single-channel floating point matrix; if you want to apply different kernels to different channels, split the image into separate color planes using split and process them individually.
anchoranchor of the kernel that indicates the relative position of a filtered point within the kernel; the anchor should lie within the kernel; default value (-1,-1) means that the anchor is at the kernel center.
参照
cv::filter2D
cv::integral

dst_width = floor(src_width/2)[+1], dst_height = floor(src_height/2)[+1]

参照
cv::pyrDown

dst_width = src_width*2, dst_height = src_height*2

参照
cv::pyrUp
cv::pyrMeanShiftFiltering
cv::watershed

(aperture_size = 1,3,5,7) or Scharr (aperture_size = -1) operator. Scharr can be used only for the first dx or dy derivative

参照
cv::Sobel
cv::Laplacian
cv::cvtColor
cv::resize
覚え書き
::cvGetQuadrangleSubPix is similar to ::cvWarpAffine, but the outliers are extrapolated using replication border mode.
参照
cv::warpAffine
cv::warpPerspective
cv::remap
cv::convertMaps
cv::warpPolar

Performs forward or inverse linear-polar image transform

参照
cv::warpPolar
cvCreateStructuringElementEx
cv::erode

If element pointer is NULL, 3x3 rectangular element is used

参照
cv::dilate
cv::morphologyEx
cv::moments
cv::HuMoments

dst(x,y) <- src(x + center.x - dst_width/2, y + center.y - dst_height/2). Values of pixels with fractional coordinates are retrieved using bilinear interpolation

参照
cv::getRectSubPix

matrixarr = ( a11 a12 | b1 ) dst(x,y) <- src(A[x y]' + b) ( a21 a22 | b2 ) (bilinear interpolation is used to retrieve pixels with fractional coordinates)

参照
cvWarpAffine
cv::matchTemplate

(if the substitutor is null, the last retrieved contour is removed from the tree)

参照
cvFindContours

The reader is used to iteratively get coordinates of all the chain points. If the Freeman codes should be read as is, a simple sequence reader should be used

参照
cvApproxChains

This is a standalone function for setting bin ranges in the histogram. For a more detailed description of the parameters ranges and uniform, see the :ocvCalcHist function that can initialize the ranges as well. Ranges for the histogram bins must be set before the histogram is calculated or the backproject of the histogram is calculated.

引数
histHistogram.
rangesArray of bin ranges arrays. See :ocvCreateHist for details.
uniformUniformity flag. See :ocvCreateHist for details.

The function releases the histogram (header and the data). The pointer to the histogram is cleared by the function. If *hist pointer is already NULL, the function does nothing.

引数
histDouble pointer to the released histogram.

The function sets all of the histogram bins to 0 in case of a dense histogram and removes all histogram bins in case of a sparse array.

引数
histHistogram.

The function finds the minimum and maximum histogram bins and their positions. All of output arguments are optional. Among several extremas with the same value the ones with the minimum index (in the lexicographical order) are returned. In case of several maximums or minimums, the earliest in the lexicographical order (extrema locations) is returned.

引数
histHistogram.
min_valuePointer to the minimum value of the histogram.
max_valuePointer to the maximum value of the histogram.
min_idxPointer to the array of coordinates for the minimum.
max_idxPointer to the array of coordinates for the maximum.

The function normalizes the histogram bins by scaling them so that the sum of the bins becomes equal to factor.

引数
histPointer to the histogram.
factorNormalization factor.

The function clears histogram bins that are below the specified threshold.

引数
histPointer to the histogram.
thresholdThreshold level.

The function makes a copy of the histogram. If the second histogram pointer *dst is NULL, a new histogram of the same size as src is created. Otherwise, both histograms must have equal types and sizes. Then the function copies the bin values of the source histogram to the destination histogram and sets the same bin value ranges as in src.

引数
srcSource histogram.
dstPointer to the destination histogram.
参照
cv::calcHist
cvCalcBackProject, cv::calcBackProject

The function calculates the back projection by comparing histograms of the source image patches with the given histogram. The function is similar to matchTemplate, but instead of comparing the raster patch with all its possible positions within the search window, the function CalcBackProjectPatch compares histograms. See the algorithm diagram below:

image

引数
imageSource images (though, you may pass CvMat** as well).
dstDestination image.
range
histHistogram.
methodComparison method passed to cvCompareHist (see the function description).
factorNormalization factor for histograms that affects the normalization scale of the destination image. Pass 1 if not sure.
参照
cvCalcBackProjectPatch

The function calculates the object probability density from two histograms as:

\[\texttt{disthist} (I)= \forkthree{0}{if \‍(\texttt{hist1}(I)=0\‍)}{\texttt{scale}}{if \‍(\texttt{hist1}(I) \ne 0\‍) and \‍(\texttt{hist2}(I) > \texttt{hist1}(I)\‍)}{\frac{\texttt{hist2}(I) \cdot \texttt{scale}}{\texttt{hist1}(I)}}{if \‍(\texttt{hist1}(I) \ne 0\‍) and \‍(\texttt{hist2}(I) \le \texttt{hist1}(I)\‍)}\]

引数
hist1First histogram (the divisor).
hist2Second histogram.
dst_histDestination histogram.
scaleScale factor for the destination histogram.
参照
cv::equalizeHist
cv::distanceTransform

The two parameters for methods CV_ADAPTIVE_THRESH_MEAN_C and CV_ADAPTIVE_THRESH_GAUSSIAN_C are: neighborhood size (3, 5, 7 etc.), and a constant subtracted from mean (...,-3,-2,-1,0,1,2,3,...)

参照
cv::adaptiveThreshold
cv::floodFill
cv::Canny

Dx^2 * Dyy + Dxx * Dy^2 - 2 * Dx * Dy * Dxy. Applying threshold to the result gives coordinates of corners

参照
cv::preCornerDetect
cv::cornerEigenValsAndVecs
cv::cornerMinEigenVal

Calculates det(M) - k*(trace(M)^2), where M is 2x2 gradient covariation matrix for each pixel

参照
cv::cornerHarris
cv::cornerSubPix
cv::goodFeaturesToTrack
cv::fitLine
cv::line

if thickness<0 (e.g. thickness == CV_FILLED), the filled box is drawn

参照
cv::rectangle
cv::rectangle

Thickness works in the same way as with cvRectangle

参照
cv::circle

depending on thickness, start_angle and end_angle parameters. The resultant figure is rotated by angle. All the angles are in degrees

参照
cv::ellipse
cv::fillConvexPoly
cv::fillPoly
cv::polylines

The function initializes the font structure that can be passed to text rendering functions.

引数
fontPointer to the font structure initialized by the function
font_faceFont name identifier. See cv::HersheyFonts and corresponding old CV_* identifiers.
hscaleHorizontal scale. If equal to 1.0f , the characters have the original width depending on the font type. If equal to 0.5f , the characters are of half the original width.
vscaleVertical scale. If equal to 1.0f , the characters have the original height depending on the font type. If equal to 0.5f , the characters are of half the original height.
shearApproximate tangent of the character slope relative to the vertical line. A zero value means a non-italic font, 1.0f means about a 45 degree slope, etc.
thicknessThickness of the text strokes
line_typeType of the strokes, see line description
参照
cvPutText
cvInitFont, cvGetTextSize, cvFont, cv::putText
cv::getTextSize
cv::drawContours