📄 opencvref_cvaux.htm
字号:
second runs.
</dl></p><p>
The function <code>cvMorphEpilinesMulti</code> morphs two pre-warped images using information
about correspondence between the scanlines of two images.
</p><hr><h3><a name="decl_cvPostWarpImage">PostWarpImage</a></h3>
<p class="Blurb">Warps rectified morphed image back</p>
<pre>
void cvPostWarpImage( int line_count, uchar* src, int* src_nums,
IplImage* img, int* scanlines );
</pre><p><dl>
<dt>line_count<dd>Number of the scanlines.
<dt>src<dd>Pointer to the prewarp image virtual image.
<dt>src_nums<dd>Number of the scanlines in the image.
<dt>img<dd>Resulting unwarp image.
<dt>scanlines<dd>Pointer to the array of scanlines data.
</dl></p><p>
The function <code>cvPostWarpImage</code> warps the resultant image from the virtual camera by
storing its rows across the scanlines whose coordinates are calculated by
<a href="#decl_cvMakeAlphaScanlines">cvMakeAlphaScanlines</a>.
</p><hr><h3><a name="decl_cvDeleteMoire">DeleteMoire</a></h3>
<p class="Blurb">Deletes moire in given image</p>
<pre>
void cvDeleteMoire( IplImage* img );
</pre><p><dl>
<dt>img<dd>Image.
</dl></p><p>
The function <code>cvDeleteMoire</code> deletes moire from the given image. The post-warped
image may have black (un-covered) points because of possible holes between
neighboring scanlines. The function deletes moire (black pixels) from the image
by substituting neighboring pixels for black pixels. If all the scanlines are
horizontal, the function may be omitted.</p>
<hr><h2><a name="aux_3dTracking">3D Tracking Functions</a></h2>
<p>The section discusses functions for tracking objects in 3d space using a stereo camera.
Besides C API, there is DirectShow <a href="../appPage/3dTracker/3dTrackerFilter.htm">3dTracker</a> filter
and the wrapper application <a href="../appPage/3dTracker/3dTracker.htm">3dTracker</a>.
<a href="../appPage/3dTracker/3dTrackerTesting.htm">Here</a> you may find a description how to test the filter on sample data.</p>
<hr><h3><a name="decl_cv3dTrackerCalibrateCameras">3dTrackerCalibrateCameras</a></h3>
<p class="Blurb">Simultaneously determines position and orientation of multiple cameras</p>
<pre>
CvBool cv3dTrackerCalibrateCameras(int num_cameras,
const Cv3dTrackerCameraIntrinsics camera_intrinsics[],
CvSize checkerboard_size,
IplImage *samples[],
Cv3dTrackerCameraInfo camera_info[]);
</pre><p><dl>
<dt>num_cameras<dd>the number of cameras to calibrate. This is the size of each of the
three array parameters.
<dt>camera_intrinsics<dd>camera intrinsics for each camera, such as determined by CalibFilter.
<dt>checkerboard_size<dd>the width and height (in number of squares) of the checkerboard.
<dt>samples<dd>images from each camera, with a view of the checkerboard.
<dt>camera_info<dd>filled in with the results of the camera calibration. This is passed into
<a href="#decl_cv3dTrackerLocateObjects">3dTrackerLocateObjects</a> to do tracking.
</dl></p>
<p>
The function <code>cv3dTrackerCalibrateCameras</code>
searches for a checkerboard of the specified size in each
of the images. For each image in which it finds the checkerboard, it fills
in the corresponding slot in <code>camera_info</code> with the position
and orientation of the camera
relative to the checkerboard and sets the <code>valid</code> flag.
If it finds the checkerboard in all the images, it returns true;
otherwise it returns false.
</p><p>
This function does not change the members of the <code>camera_info</code> array
that correspond to images in which the checkerboard was not found.
This allows you to calibrate each camera independently, instead of
simultaneously.
To accomplish this, do the following:
<ol>
<li>clear all the <code>valid</code> flags before calling this function the first time;</LI>
<li>call this function with each set of images;</LI>
<li> check all the <code>valid</code> flags after each call.
When all the <code>valid</code> flags are set, calibration is complete.
</li>
</ol>
Note that this method works well only if the checkerboard is rigidly mounted;
if it is handheld, all the cameras should be calibrated simultanously
to get an accurate result.
To ensure that all cameras are calibrated simultaneously,
ignore the <code>valid</code> flags and
use the return value to decide when calibration is complete.
</p>
<hr><h3><a name="decl_cv3dTrackerLocateObjects">3dTrackerLocateObjects</a></h3>
<p class="Blurb">Determines 3d location of tracked objects</p>
<pre>
int cv3dTrackerLocateObjects(int num_cameras,
int num_objects,
const Cv3dTrackerCameraInfo camera_info[],
const Cv3dTracker2dTrackedObject tracking_info[],
Cv3dTrackerTrackedObject tracked_objects[]);
</pre><p><dl>
<dt>num_cameras<dd>the number of cameras.
<dt>num_objects<dd>the maximum number of objects found by any camera. (Also the
maximum number of objects returned in <code>tracked_objects</code>.)
<dt>camera_info<dd>camera position and location information for each camera,
as determined by <a href="#decl_cv3dTrackerCalibrateCameras">3dTrackerCalibrateCameras</a>.
<dt>tracking_info<dd>the 2d position of each object as seen by each camera. Although
this is specified as a one-dimensional array, it is actually a
two-dimensional array:
<code>const Cv3dTracker2dTrackedObject tracking_info[num_cameras][num_objects]</code>.
The <code>id</code> field of any unused slots must be -1. Ids need not
be ordered or consecutive.
<dt>tracked_objects<dd>filled in with the results.
</dl></p>
<p>
The function <code>cv3dTrackerLocateObjects</code>
determines the 3d position of tracked objects
based on the 2d tracking information from multiple cameras and
the camera position and orientation information computed by
<a href="#decl_3dTrackerCalibrateCameras">3dTrackerCalibrateCameras</a>.
It locates any objects with the same <code>id</code> that are tracked by more
than one camera.
It fills in the <code>tracked_objects</code> array and
returns the number of objects located. The <code>id</code> fields of
any unused slots in <code>tracked_objects</code> are set to -1.
</p>
<hr><h2><a name="aux_pca">Eigen Objects (PCA) Functions</a></h2>
<p>The functions described in this section do PCA analysis and compression for
a set of 8-bit images that may not fit into memory all together.
If your data fits into memory and the vectors are not 8-bit (or you want a simpler
interface), use
<a href="OpenCVRef_BasicFuncs.htm#decl_cvCalcCovarMatrix">cvCalcCovarMatrix</a>,
<a href="OpenCVRef_BasicFuncs.htm#decl_cvSVD">cvSVD</a> and
<a href="OpenCVRef_BasicFuncs.htm#decl_cvGEMM">cvGEMM</a>
to do PCA</p>
<hr><h3><a name="decl_cvCalcCovarMatrixEx">CalcCovarMatrixEx</a></h3>
<p class="Blurb">Calculates covariance matrix for group of input objects</p>
<pre>
void cvCalcCovarMatrixEx( int object_count, void* input, int io_flags,
int iobuf_size, uchar* buffer, void* userdata,
IplImage* avg, float* covar_matrix );
</pre><p><dl>
<dt>object_count<dd>Number of source objects.
<dt>input<dd>Pointer either to the array of <code>IplImage</code> input objects or to the read
callback function according to the value of the parameter <code>ioFlags</code>.
<dt>io_flags<dd>Input/output flags.
<dt>iobuf_size<dd>Input/output buffer size.
<dt>buffer<dd>Pointer to the input/output buffer.
<dt>userdata<dd>Pointer to the structure that contains all necessary data for the
<dt>callback<dd>functions.
<dt>avg<dd>Averaged object.
<dt>covar_matrix<dd>Covariance matrix. An output parameter; must be allocated before the
call.
</dl><p>
The function <code>cvCalcCovarMatrixEx</code> calculates a covariance matrix of the input
objects group using previously calculated averaged object. Depending on <code>ioFlags</code>
parameter it may be used either in direct access or callback mode. If <code>ioFlags</code> is
not <code>CV_EIGOBJ_NO_CALLBACK</code>, buffer must be allocated before calling the
function.
</p><hr><h3><a name="decl_cvCalcEigenObjects">CalcEigenObjects</a></h3>
<p class="Blurb">Calculates orthonormal eigen basis and averaged object for group of input
objects</p>
<pre>
void cvCalcEigenObjects( int nObjects, void* input, void* output, int ioFlags,
int ioBufSize, void* userData, CvTermCriteria* calcLimit,
IplImage* avg, float* eigVals );
</pre><p><dl>
<dt>nObjects<dd>Number of source objects.
<dt>input<dd>Pointer either to the array of <code>IplImage</code> input objects or to the read
callback function according to the value of the parameter <code>ioFlags</code>.
<dt>output<dd>Pointer either to the array of eigen objects or to the write callback
function according to the value of the parameter ioFlags .
<dt>ioFlags<dd>Input/output flags.
<dt>ioBufSize<dd>Input/output buffer size in bytes. The size is zero, if unknown.
<dt>userData<dd>Pointer to the structure that contains all necessary data for the
callback functions.
<dt>calcLimit<dd>Criteria that determine when to stop calculation of eigen objects.
<dt>avg<dd>Averaged object.
<dt>eigVals<dd>Pointer to the eigenvalues array in the descending order; may be <code>NULL</code> .
</dl><p>
The function <code>cvCalcEigenObjects</code> calculates orthonormal eigen basis and the
averaged object for a group of the input objects. Depending on <code>ioFlags</code> parameter
it may be used either in direct access or callback mode. Depending on the
parameter <code>calcLimit</code>, calculations are finished either after first
<code>calcLimit.max_iter</code> dominating eigen objects are retrieved or if the ratio of the
current eigenvalue to the largest eigenvalue comes down to <code>calcLimit.epsilon</code>
threshold. The value <code>calcLimit -> type</code> must be <code>CV_TERMCRIT_NUMB,
CV_TERMCRIT_EPS</code>, or <code>CV_TERMCRIT_NUMB | CV_TERMCRIT_EPS</code> . The function returns
the real values <code>calcLimit->max_iter</code> and <code>calcLimit->epsilon</code> .
<p>
The function also calculates the averaged object, which must be created
previously. Calculated eigen objects are arranged according to the corresponding
eigenvalues in the descending order.
</p>
The parameter <code>eigVals</code> may be equal to <code>NULL</code>, if eigenvalues are not needed.
<p>
The function <code>cvCalcEigenObjects</code> uses the function
<a href="#decl_cvCalcCovarMatrixEx">cvCalcCovarMatrixEx</a>.
</p>
<hr><h3><a name="decl_cvCalcDecompCoeff">CalcDecompCoeff</a></h3>
<p class="Blurb">Calculates decomposition coefficient of input object</p>
<pre>
double cvCalcDecompCoeff( IplImage* obj, IplImage* eigObj, IplImage* avg );
</pre><p><dl>
<dt>obj<dd>Input object.
<dt>eigObj<dd>Eigen object.
<dt>avg<dd>Averaged object.
</dl><p>
The function <code>cvCalcDecompCoeff</code> calculates one decomposition coefficient of the
input object using the previously calculated eigen object and the averaged
object.
</p>
<hr><h3><a name="decl_cvEigenDecomposite">EigenDecomposite</a></h3>
<p class="Blurb">Calculates all decomposition coefficients for input object</p>
<pre>
void cvEigenDecomposite( IplImage* obj, int eigenvec_count, void* eigInput,
int ioFlags, void* userData, IplImage* avg, float* coeffs );
</pre><p><dl>
<dt>obj<dd>Input object.
<dt>eigenvec_count<dd>Number of eigen objects.
<dt>eigInput<dd>Pointer either to the array of <code>IplImage</code> input objects or to the read
callback function according to the value of the parameter <code>ioFlags</code>.
<dt>ioFlags<dd>Input/output flags.
<dt>userData<dd>Pointer to the structure that contains all necessary data for the
callback functions.
<dt>avg<dd>Averaged object.
<dt>coeffs<dd>Calculated coefficients; an output parameter.
</dl><p>
The function <code>cvEigenDecomposite</code> calculates all decomposition coefficients for the
input object using the previously calculated eigen objects basis and the
averaged object. Depending on <code>ioFlags</code> parameter it may be used either in direct
access or callback mode.
</p>
<hr><h3><a name="decl_cvEigenProjection">EigenProjection</a></h3>
<p class="Blurb">Calculates object projection to the eigen sub-space</p>
<pre>
void cvEigenProjection( void* input_vecs, int eigenvec_count, int io_flags, void* userdata,
float* coeffs, IplImage* avg, IplImage* proj );
</pre><p><dl>
<dt>input_vec<dd>Pointer to either an array of <code>IplImage</code> input objects or to a
callback function, depending on <code>io_flags</code>.
<dt>eigenvec_count<dd>Number of eigenvectors.
<dt>io_flags<dd>Input/output flags; see <a href="#decl_cvCalcEigenObjects">cvCalcEigenObjects</a>.
<dt>userdata<dd>Pointer to the structure that contains all necessary data for the
callback functions.
<dt>coeffs<dd>Previously calculated decomposition coefficients.
<dt>avg<dd>Average vector, calculated by <a href="#decl_cvCalcEigenObjects">cvCalcEigenObjects</a>.
<dt>proj<dd>Projection to the eigen sub-space.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -