⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cxcore reference manual.mht

📁 比较齐全的OpenCV参考手册
💻 MHT
📖 第 1 页 / 共 5 页
字号:
  <DT>image
  <DD>Original image. </DD></DL>
<P></P>
<P>The function <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvCloneImage">cvCloneImage</A>=20
makes a full copy of the image including header, ROI and data </P>
<HR>

<H3><A name=3Ddecl_cvSetImageCOI>SetImageCOI</A></H3>
<P class=3DBlurb>Sets channel of interest to given value</P><PRE>void =
cvSetImageCOI( IplImage* image, int coi );
</PRE>
<P>
<DL>
  <DT>image
  <DD>Image header.=20
  <DT>coi
  <DD>Channel of interest. </DD></DL>
<P>The function <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvSetImageCOI">cvSetImageCOI</A>=20
sets the channel of interest to a given value. Value 0 means that all =
channels=20
are selected, 1 means that the first channel is selected etc. If ROI is=20
<CODE>NULL</CODE> and <CODE>coi !=3D 0</CODE>, ROI is allocated. Note =
that most of=20
OpenCV functions do not support COI, so to process separate image/matrix =
channel=20
one may copy (via <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvCopy">cvCopy</A>=20
or <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvSplit">cvSplit</A>)=20
the channel to separate image/matrix, process it and copy the result =
back (via=20
<A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvCopy">cvCopy</A>=20
or <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvCvtPlaneToPix">cvCvtPlaneToPix</A>)=20
if need.</P>
<HR>

<H3><A name=3Ddecl_cvGetImageCOI>GetImageCOI</A></H3>
<P class=3DBlurb>Returns index of channel of interest</P><PRE>int =
cvGetImageCOI( const IplImage* image );
</PRE>
<P>
<DL>
  <DT>image
  <DD>Image header. </DD></DL>
<P>The function <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvGetImageCOI">cvGetImageCOI</A>=20
returns channel of interest of the image (it returns 0 if all the =
channels are=20
selected).</P>
<HR>

<H3><A name=3Ddecl_cvSetImageROI>SetImageROI</A></H3>
<P class=3DBlurb>Sets image ROI to given rectangle</P><PRE>void =
cvSetImageROI( IplImage* image, CvRect rect );
</PRE>
<P>
<DL>
  <DT>image
  <DD>Image header.=20
  <DT>rect
  <DD>ROI rectangle. </DD></DL>
<P>The function <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvSetImageROI">cvSetImageROI</A>=20
sets the image ROI to a given rectangle. If ROI is <CODE>NULL</CODE> and =
the=20
value of the parameter <CODE>rect</CODE> is not equal to the whole =
image, ROI is=20
allocated. Unlike COI, most of OpenCV functions do support ROI and treat =
it in a=20
way as it would be a separate image (for example, all the pixel =
coordinates are=20
counted from top-left or bottom-left (depending on the image origin) =
corner of=20
ROI)</P>
<HR>

<H3><A name=3Ddecl_cvResetImageROI>ResetImageROI</A></H3>
<P class=3DBlurb>Releases image ROI</P><PRE>void cvResetImageROI( =
IplImage* image );
</PRE>
<P>
<DL>
  <DT>image
  <DD>Image header. </DD></DL>
<P>The function <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvResetImageROI">cvResetImageROI</A>=20
releases image ROI. After that the whole image is considered selected. =
The=20
similar result can be achieved by</P><PRE>cvSetImageROI( image, cvRect( =
0, 0, image-&gt;width, image-&gt;height ));
cvSetImageCOI( image, 0 );
</PRE>
<P>But the latter variant does not deallocate =
<CODE>image-&gt;roi</CODE>. </P>
<HR>

<H3><A name=3Ddecl_cvGetImageROI>GetImageROI</A></H3>
<P class=3DBlurb>Returns image ROI coordinates</P><PRE>CvRect =
cvGetImageROI( const IplImage* image );
</PRE>
<P>
<DL>
  <DT>image
  <DD>Image header. </DD></DL>
<P>The function <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvGetImageROI">cvGetImageROI</A>=20
returns image ROI coordinates. The rectangle <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvRect">cvRect</A>(0,0,image-&gt;width,im=
age-&gt;height)=20
is returned if there is no ROI</P>
<HR>

<H3><A name=3Ddecl_cvCreateMat>CreateMat</A></H3>
<P class=3DBlurb>Creates new matrix</P><PRE>CvMat* cvCreateMat( int =
rows, int cols, int type );
</PRE>
<P>
<DL>
  <DT>rows
  <DD>Number of rows in the matrix.=20
  <DT>cols
  <DD>Number of columns in the matrix.=20
  <DT>type
  <DD>Type of the matrix elements. Usually it is specified in form=20
  <CODE>CV_&lt;bit_depth&gt;(S|U|F)C&lt;number_of_channels&gt;</CODE>, =
for=20
  example:<BR><CODE>CV_8UC1</CODE> means an 8-bit unsigned =
single-channel=20
  matrix, <CODE>CV_32SC2</CODE> means a 32-bit signed matrix with two =
channels.=20
  </DD></DL>
<P>The function <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvCreateMat">cvCreateMat</A>=20
allocates header for the new matrix and underlying data, and returns a =
pointer=20
to the created matrix. It is a short form for:</P><PRE>    CvMat* mat =
=3D cvCreateMatHeader( rows, cols, type );
    cvCreateData( mat );
</PRE>
<P>Matrices are stored row by row. All the rows are aligned by 4 bytes. =
</P>
<HR>

<H3><A name=3Ddecl_cvCreateMatHeader>CreateMatHeader</A></H3>
<P class=3DBlurb>Creates new matrix header</P><PRE>CvMat* =
cvCreateMatHeader( int rows, int cols, int type );
</PRE>
<P>
<DL>
  <DT>rows
  <DD>Number of rows in the matrix.=20
  <DT>cols
  <DD>Number of columns in the matrix.=20
  <DT>type
  <DD>Type of the matrix elements (see <A=20
  =
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvCreateMat">cvCreateMat</A>).=20
  </DD></DL>
<P>The function <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvCreateMatHeader">cvCreateMatHeader</A> =

allocates new matrix header and returns pointer to it. The matrix data =
can=20
further be allocated using <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvCreateData">cvCreateData</A>=20
or set explicitly to user-allocated data via <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvSetData">cvSetData</A>.=20
</P>
<HR>

<H3><A name=3Ddecl_cvReleaseMat>ReleaseMat</A></H3>
<P class=3DBlurb>Deallocates matrix</P><PRE>void cvReleaseMat( CvMat** =
mat );
</PRE>
<P>
<DL>
  <DT>mat
  <DD>Double pointer to the matrix. </DD></DL>
<P>The function <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvReleaseMat">cvReleaseMat</A>=20
decrements the matrix data reference counter and releases matrix =
header:</P><PRE>    if( *mat )
        cvDecRefData( *mat );
    cvFree( (void**)mat );
</PRE>
<P></P>
<HR>

<H3><A name=3Ddecl_cvInitMatHeader>InitMatHeader</A></H3>
<P class=3DBlurb>Initializes matrix header</P><PRE>CvMat* =
cvInitMatHeader( CvMat* mat, int rows, int cols, int type,
                        void* data=3DNULL, int step=3DCV_AUTOSTEP );
</PRE>
<P>
<DL>
  <DT>mat
  <DD>Pointer to the matrix header to be initialized.=20
  <DT>rows
  <DD>Number of rows in the matrix.=20
  <DT>cols
  <DD>Number of columns in the matrix.=20
  <DT>type
  <DD>Type of the matrix elements.=20
  <DT>data
  <DD>Optional data pointer assigned to the matrix header.=20
  <DT>step
  <DD>Full row width in bytes of the data assigned. By default, the =
minimal=20
  possible step is used, i.e., no gaps is assumed between subsequent =
rows of the=20
  matrix. </DD></DL>
<P>The function <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvInitMatHeader">cvInitMatHeader</A>=20
initializes already allocated <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_CvMat">CvMat</A>=20
structure. It can be used to process raw data with OpenCV matrix =
functions.=20
<P>For example, the following code computes matrix product of two =
matrices,=20
stored as ordinary arrays. </P>
<P></P>
<P><FONT color=3Dblue size=3D4>Calculating Product of Two =
Matrices</FONT></P><PRE>   double a[] =3D { 1, 2, 3, 4
                  5, 6, 7, 8,
                  9, 10, 11, 12 };

   double b[] =3D { 1, 5, 9,
                  2, 6, 10,
                  3, 7, 11,
                  4, 8, 12 };

   double c[9];
   CvMat Ma, Mb, Mc ;

   cvInitMatHeader( &amp;Ma, 3, 4, CV_64FC1, a );
   cvInitMatHeader( &amp;Mb, 4, 3, CV_64FC1, b );
   cvInitMatHeader( &amp;Mc, 3, 3, CV_64FC1, c );

   cvMatMulAdd( &amp;Ma, &amp;Mb, 0, &amp;Mc );
   // c array now contains product of a(3x4) and b(4x3) matrices
</PRE>
<P></P>
<HR>

<H3><A name=3Ddecl_cvMat>Mat</A></H3>
<P class=3DBlurb>Initializes matrix header (light-weight =
variant)</P><PRE>CvMat cvMat( int rows, int cols, int type, void* =
data=3DNULL );
</PRE>
<P>
<DL>
  <DT>rows
  <DD>Number of rows in the matrix.=20
  <DT>cols
  <DD>Number of columns in the matrix.=20
  <DT>type
  <DD>Type of the matrix elements (see CreateMat).=20
  <DT>data
  <DD>Optional data pointer assigned to the matrix header. </DD></DL>
<P>The function <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvMat">cvMat</A>=20
is a fast inline substitution for <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvInitMatHeader">cvInitMatHeader</A>.=20
Namely, it is equivalent to: <PRE>     CvMat mat;
     cvInitMatHeader( &amp;mat, rows, cols, type, data, CV_AUTOSTEP );
</PRE>
<P></P>
<HR>

<H3><A name=3Ddecl_cvCloneMat>CloneMat</A></H3>
<P class=3DBlurb>Creates matrix copy</P><PRE>CvMat* cvCloneMat( const =
CvMat* mat );
</PRE>
<P>
<DL>
  <DT>mat
  <DD>Input matrix. </DD></DL>
<P>The function <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvCloneMat">cvCloneMat</A>=20
creates a copy of input matrix and returns the pointer to it. </P>
<HR>

<H3><A name=3Ddecl_cvCreateMatND>CreateMatND</A></H3>
<P class=3DBlurb>Creates multi-dimensional dense array</P><PRE>CvMatND* =
cvCreateMatND( int dims, const int* sizes, int type );
</PRE>
<P>
<DL>
  <DT>dims
  <DD>Number of array dimensions. It must not exceed CV_MAX_DIM (=3D32 =
by default,=20
  though it may be changed at build time)=20
  <DT>sizes
  <DD>Array of dimension sizes.=20
  <DT>type
  <DD>Type of array elements. The same as for <A=20
  =
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_CvMat">CvMat</A>=20
  </DD></DL>
<P>The function <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvCreateMatND">cvCreateMatND</A>=20
allocates header for multi-dimensional dense array and the underlying =
data, and=20
returns pointer to the created array. It is a short form for:</P><PRE>   =
 CvMatND* mat =3D cvCreateMatNDHeader( dims, sizes, type );
    cvCreateData( mat );
</PRE>
<P>Array data is stored row by row. All the rows are aligned by 4 bytes. =
</P>
<HR>

<H3><A name=3Ddecl_cvCreateMatNDHeader>CreateMatNDHeader</A></H3>
<P class=3DBlurb>Creates new matrix header</P><PRE>CvMatND* =
cvCreateMatNDHeader( int dims, const int* sizes, int type );
</PRE>
<P>
<DL>
  <DT>dims
  <DD>Number of array dimensions.=20
  <DT>sizes
  <DD>Array of dimension sizes.=20
  <DT>type
  <DD>Type of array elements. The same as for CvMat </DD></DL>
<P>The function <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvCreateMatND">cvCreateMatND</A>=20
allocates header for multi-dimensional dense array. The array data can =
further=20
be allocated using <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvCreateData">cvCreateData</A>=20
or set explicitly to user-allocated data via <A=20
href=3D"http://www.assuredigit.com/incoming/sourcecode/opencv/chinese_doc=
s/ref/opencvref_cxcore.htm#decl_cvSetData">cvSetData</A>.=20
</P>
<HR>

<H3><A name=3Ddecl_cvReleaseMatND>ReleaseMatND</A></H3>
<P class=3DBlurb>Deallocates multi-dimensional array</P><PRE>void =
cvReleaseMatND( CvMatND** mat );
</PRE>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -