2015-03-30 23:02:32 +02:00
|
|
|
|
(*
|
|
|
|
|
**************************************************************************************************
|
|
|
|
|
Project Delphi-OpenCV
|
|
|
|
|
**************************************************************************************************
|
|
|
|
|
Contributors:
|
|
|
|
|
Laentir Valetov
|
|
|
|
|
email:laex@bk.ru
|
|
|
|
|
Mikhail Grigorev
|
|
|
|
|
Email: sleuthhound@gmail.com
|
|
|
|
|
**************************************************************************************************
|
|
|
|
|
You may retrieve the latest version of this file at the GitHub,
|
|
|
|
|
located at git://github.com/Laex/Delphi-OpenCV.git
|
|
|
|
|
**************************************************************************************************
|
|
|
|
|
License:
|
|
|
|
|
The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
|
|
|
|
|
you may not use this file except in compliance with the License. You may obtain a copy of the
|
|
|
|
|
License at http://www.mozilla.org/MPL/
|
|
|
|
|
|
|
|
|
|
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
|
|
|
|
|
ANY KIND, either express or implied. See the License for the specific language governing rights
|
|
|
|
|
and limitations under the License.
|
|
|
|
|
|
|
|
|
|
Alternatively, the contents of this file may be used under the terms of the
|
|
|
|
|
GNU Lesser General Public License (the "LGPL License"), in which case the
|
|
|
|
|
provisions of the LGPL License are applicable instead of those above.
|
|
|
|
|
If you wish to allow use of your version of this file only under the terms
|
|
|
|
|
of the LGPL License and not to allow others to use your version of this file
|
|
|
|
|
under the MPL, indicate your decision by deleting the provisions above and
|
|
|
|
|
replace them with the notice and other provisions required by the LGPL
|
|
|
|
|
License. If you do not delete the provisions above, a recipient may use
|
|
|
|
|
your version of this file under either the MPL or the LGPL License.
|
|
|
|
|
|
|
|
|
|
For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html
|
|
|
|
|
**************************************************************************************************
|
|
|
|
|
Warning: Using Delphi XE3 syntax!
|
|
|
|
|
**************************************************************************************************
|
|
|
|
|
The Initial Developer of the Original Code:
|
|
|
|
|
OpenCV: open source computer vision library
|
|
|
|
|
Homepage: http://ocv.org
|
|
|
|
|
Online docs: http://docs.ocv.org
|
|
|
|
|
Q&A forum: http://answers.ocv.org
|
|
|
|
|
Dev zone: http://code.ocv.org
|
|
|
|
|
**************************************************************************************************
|
|
|
|
|
Original file:
|
|
|
|
|
opencv\modules\core\include\opencv2\core\core_c.h
|
|
|
|
|
*************************************************************************************************
|
|
|
|
|
*)
|
2013-04-16 08:40:44 +02:00
|
|
|
|
|
2014-05-22 16:23:41 +02:00
|
|
|
|
unit ocv.core_c;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
|
2015-04-02 21:43:36 +02:00
|
|
|
|
{$I OpenCV.inc}
|
|
|
|
|
|
2013-04-05 13:36:47 +02:00
|
|
|
|
interface
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2013-04-05 13:36:47 +02:00
|
|
|
|
uses
|
2015-04-09 23:15:02 +02:00
|
|
|
|
// {$IFDEF MSWINDOWS}
|
|
|
|
|
// WinApi.Windows,
|
|
|
|
|
// {$ENDIF ~MSWINDOWS}
|
2014-05-22 16:23:41 +02:00
|
|
|
|
ocv.core.types_c;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ ****************************************************************************************
|
2013-04-16 08:40:44 +02:00
|
|
|
|
* cArray allocation, deallocation, initialization and access to elements *
|
2014-07-17 22:27:13 +02:00
|
|
|
|
**************************************************************************************** }
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ <malloc> wrapper.
|
2013-04-15 18:14:12 +02:00
|
|
|
|
If there is no enough memory, the cFunction
|
|
|
|
|
(as well as other OpenCV functions that call cvAlloc)
|
|
|
|
|
raises an error.
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvAlloc}
|
2014-05-23 11:53:54 +02:00
|
|
|
|
function cvAlloc(size: NativeUInt): Pointer; cdecl;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ <free> wrapper.
|
2013-01-01 13:29:34 +01:00
|
|
|
|
Here and further all the memory releasing functions
|
|
|
|
|
(that all call cvFree) take Double cPointer in order to
|
|
|
|
|
to clear cPointer to the data after releasing it.
|
|
|
|
|
Passing cPointer to 0 cPointer is Ok: nothing happens in this
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvFree_}
|
2013-09-25 21:18:23 +02:00
|
|
|
|
procedure cvFree_(ptr: Pointer); cdecl;
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvFree}
|
2017-09-07 12:38:44 +02:00
|
|
|
|
procedure cvFree(var ptr); {$IFDEF USE_INLINE} inline; {$ENDIF}
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Allocates and initializes IplImage header
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(IplImage*) cvCreateImageHeader( CvSize size, int depth, int channels );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvCreateImageHeader}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
function cvCreateImageHeader(size: TCvSize; depth: Integer; channels: Integer): pIplImage; cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Inializes IplImage header
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(IplImage*) cvInitImageHeader( IplImage* image, CvSize size, int depth,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
int channels, int origin CV_DEFAULT(0),
|
|
|
|
|
int align CV_DEFAULT(4));
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvInitImageHeader}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
function cvInitImageHeader(image: pIplImage; size: TCvSize; depth: Integer; channels: Integer; origin: Integer = 0; align: Integer = 4): pIplImage; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Creates IPL image (header and data
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(IplImage*) cvCreateImage( CvSize size, int depth, int channels );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvCreateImage}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
function cvCreateImage(size: TCvSize; depth, channels: Integer): pIplImage; cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Releases (i.e. deallocates) IPL image header
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvReleaseImageHeader( IplImage** image );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvReleaseImageHeader}
|
2013-04-05 13:36:47 +02:00
|
|
|
|
procedure cvReleaseImageHeader(var image: pIplImage); cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Releases IPL image header and data
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvReleaseImage( IplImage** image );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvReleaseImage}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
procedure cvReleaseImage(var image: pIplImage); cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Creates a copy of IPL image (widthStep may differ)
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(IplImage*) cvCloneImage( const IplImage* image );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvCloneImage}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
function cvCloneImage(const image: pIplImage): pIplImage; cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Sets a Channel Of Interest (only a few functions support COI) -
|
2013-04-15 18:14:12 +02:00
|
|
|
|
use cvCopy to extract the selected channel and/or put it back
|
|
|
|
|
CVAPI(void) cvSetImageCOI( IplImage* image, int coi );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvSetImageCOI}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
procedure cvSetImageCOI(image: pIplImage; coi: Integer); cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Retrieves image Channel Of Interest
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(int) cvGetImageCOI( const IplImage* image );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGetImageCOI}
|
2013-04-05 13:36:47 +02:00
|
|
|
|
function cvGetImageCOI(const image: pIplImage): Integer; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Sets image ROI (region of interest) (COI is not changed)
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvSetImageROI( IplImage* image, CvRect rect );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvSetImageROI}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
procedure cvSetImageROI(image: pIplImage; rect: TCvRect); cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Resets image ROI and COI
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvResetImageROI( IplImage* image );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvResetImageROI}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
procedure cvResetImageROI(image: pIplImage); cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Retrieves image ROI
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(CvRect) cvGetImageROI( const IplImage* image );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGetImageROI}
|
2013-04-05 13:36:47 +02:00
|
|
|
|
function cvGetImageROI(const image: pIplImage): TCvRect; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Allocates and initalizes CvMat header
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(CvMat*) cvCreateMatHeader( int rows, int cols, int type );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvCreateMatHeader}
|
2017-09-13 20:31:37 +02:00
|
|
|
|
function cvCreateMatHeader(rows: Integer; cols: Integer; cType: Integer): pCvMat; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
|
|
|
|
const
|
|
|
|
|
CV_AUTOSTEP = $7FFFFFFF;
|
|
|
|
|
{$EXTERNALSYM CV_AUTOSTEP}
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Initializes CvMat header
|
2013-04-16 08:40:44 +02:00
|
|
|
|
CVAPI(CvMat*) cvInitMatHeader( CvMat* mat, int rows, int cols,
|
|
|
|
|
int type, void* data CV_DEFAULT(NULL),
|
|
|
|
|
int step CV_DEFAULT(CV_AUTOSTEP) );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvInitMatHeader}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
function cvInitMatHeader(mat: pCvMat; rows: Integer; cols: Integer; _type: Integer; data: Pointer = nil; step: Integer = CV_AUTOSTEP): pCvMat; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Allocates and initializes CvMat header and allocates data
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(CvMat*) cvCreateMat( int rows, int cols, int type );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvCreateMat}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
function cvCreateMat(rows, cols, cType: Integer): pCvMat; cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Releases CvMat header and deallocates matrix data
|
2013-04-15 18:14:12 +02:00
|
|
|
|
(reference counting is used for data)
|
|
|
|
|
CVAPI(void) cvReleaseMat( CvMat** mat );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvReleaseMat}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvReleaseMat(var mat: pCvMat); cdecl;
|
|
|
|
|
|
2017-09-08 11:02:08 +02:00
|
|
|
|
// * Decrements CvMat data reference counter and deallocates the data if it reaches 0 */
|
|
|
|
|
// CV_INLINE void cvDecRefData( CvArr* arr )
|
2013-04-16 08:40:44 +02:00
|
|
|
|
// {
|
|
|
|
|
// if( CV_IS_MAT( arr ))
|
|
|
|
|
// {
|
|
|
|
|
// CvMat* mat = (CvMat*)arr;
|
|
|
|
|
// mat->data.ptr = NULL;
|
|
|
|
|
// if( mat->refcount != NULL && --*mat->refcount == 0 )
|
|
|
|
|
// cvFree( &mat->refcount );
|
|
|
|
|
// mat->refcount = NULL;
|
|
|
|
|
// }
|
|
|
|
|
// else if( CV_IS_MATND( arr ))
|
|
|
|
|
// {
|
|
|
|
|
// CvMatND* mat = (CvMatND*)arr;
|
|
|
|
|
// mat->data.ptr = NULL;
|
|
|
|
|
// if( mat->refcount != NULL && --*mat->refcount == 0 )
|
|
|
|
|
// cvFree( &mat->refcount );
|
|
|
|
|
// mat->refcount = NULL;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvDecRefData(arr: pCvArr); inline;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
|
|
|
|
// Increments CvMat data reference counter
|
2013-04-16 08:40:44 +02:00
|
|
|
|
// CV_INLINE int cvIncRefData( pCvArr* arr )
|
|
|
|
|
// {
|
|
|
|
|
// int refcount = 0;
|
|
|
|
|
// if( CV_IS_MAT( arr ))
|
|
|
|
|
// {
|
|
|
|
|
// CvMat* mat = (CvMat*)arr;
|
|
|
|
|
// if( mat->refcount != NULL )
|
|
|
|
|
// refcount = ++*mat->refcount;
|
|
|
|
|
// }
|
|
|
|
|
// else if( CV_IS_MATND( arr ))
|
|
|
|
|
// {
|
|
|
|
|
// CvMatND* mat = (CvMatND*)arr;
|
|
|
|
|
// if( mat->refcount != NULL )
|
|
|
|
|
// refcount = ++*mat->refcount;
|
|
|
|
|
// }
|
|
|
|
|
// return refcount;
|
|
|
|
|
// }
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2017-09-10 01:16:52 +02:00
|
|
|
|
function cvIncRefData(arr: pCvArr): Integer; inline;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Creates an exact copy of the input matrix (except, may be, step value)
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(CvMat*) cvCloneMat( const CvMat* mat );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvCloneMat}
|
2013-04-12 21:33:12 +02:00
|
|
|
|
function cvCloneMat(const mat: pCvMat): pCvMat; cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Makes a new matrix from <rect> subrectangle of input array.
|
2013-04-15 18:14:12 +02:00
|
|
|
|
No data is copied
|
|
|
|
|
CVAPI(CvMat*) cvGetSubRect( const pCvArr* arr, CvMat* submat, CvRect rect );
|
|
|
|
|
#define cvGetSubArr cvGetSubRect
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGetSubRect}
|
2013-09-25 21:18:23 +02:00
|
|
|
|
function cvGetSubRect(arr: pCvArr; submat: pCvArr; rect: TCvRect): pCvMat; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Selects row span of the input array: arr(start_row:delta_row:end_row,:)
|
2013-04-15 18:14:12 +02:00
|
|
|
|
(end_row is not included into the span).
|
2013-04-16 08:40:44 +02:00
|
|
|
|
CVAPI(CvMat*) cvGetRows( const pCvArr* arr, CvMat* submat,
|
|
|
|
|
int start_row, int end_row,
|
|
|
|
|
int delta_row CV_DEFAULT(1));
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGetRows}
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvGetRows(const arr: pCvArr; submat: pCvMat; start_row, end_row: Integer; delta_row: Integer = 1): pCvMat; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-10-10 21:08:51 +02:00
|
|
|
|
(*
|
|
|
|
|
CV_INLINE CvMat* cvGetRow( const pCvArr* arr, CvMat* submat, int row )
|
|
|
|
|
{ return cvGetRows( arr, submat, row, row + 1, 1 );}
|
|
|
|
|
*)
|
|
|
|
|
{$EXTERNALSYM cvGetRow}
|
2017-09-07 12:38:44 +02:00
|
|
|
|
function cvGetRow(const arr: pCvArr; submat: pCvMat; row: Integer): pCvMat; {$IFDEF USE_INLINE} inline; {$ENDIF}
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Selects column span of the input array: arr(:,start_col:end_col)
|
2013-04-16 08:40:44 +02:00
|
|
|
|
(end_col is not included into the span)
|
|
|
|
|
CVAPI(CvMat*) cvGetCols( const pCvArr* arr, CvMat* submat,
|
|
|
|
|
int start_col, int end_col );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGetCols}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvGetCols(const arr: pCvArr; submat: pCvMat; start_col, end_col: Integer): pCvMat; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-10-10 21:08:51 +02:00
|
|
|
|
(*
|
|
|
|
|
CV_INLINE CvMat* cvGetCol( const pCvArr* arr, CvMat* submat, int col )
|
|
|
|
|
{return cvGetCols( arr, submat, col, col + 1 );}
|
|
|
|
|
*)
|
|
|
|
|
{$EXTERNALSYM cvGetCol}
|
2017-09-07 12:38:44 +02:00
|
|
|
|
function cvGetCol(const arr: pCvArr; submat: pCvMat; col: Integer): pCvMat; {$IFDEF USE_INLINE} inline; {$ENDIF}
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Select a diagonal of the input array.
|
2013-04-16 08:40:44 +02:00
|
|
|
|
(diag = 0 means the main diagonal, >0 means a diagonal above the main one,
|
|
|
|
|
<0 - below the main one).
|
|
|
|
|
The diagonal will be represented as a column (nx1 matrix).
|
|
|
|
|
CVAPI(CvMat*) cvGetDiag( const pCvArr* arr, CvMat* submat,
|
|
|
|
|
int diag CV_DEFAULT(0));
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGetDiag}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvGetDiag(const arr: pCvArr; submat: pCvMat; diag: Integer = 0): pCvMat; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ low-level scalar <-> raw data conversion functions
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvScalarToRawData( const CvScalar* scalar, void* data, int type,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
int extend_to_12 CV_DEFAULT(0) );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvScalarToRawData}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
procedure cvScalarToRawData(const scalar: pCvScalar; data: pCvArr; cType: Integer; extend_to_12: Integer = 0); cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2013-04-16 08:40:44 +02:00
|
|
|
|
// CVAPI(void) cvRawDataToScalar( const void* data, int type, CvScalar* scalar );
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvRawDataToScalar}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
procedure cvRawDataToScalar(const data: pCvArr; cType: Integer; scalar: pCvScalar); cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Allocates and initializes CvMatND header
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(CvMatND*) cvCreateMatNDHeader( int dims, const int* sizes, int type );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvCreateMatNDHeader}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvCreateMatNDHeader(dims: Integer; const sizes: pInteger; cType: Integer): pCvMatND; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Allocates and initializes CvMatND header and allocates data
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(CvMatND*) cvCreateMatND( int dims, const int* sizes, int type );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvCreateMatND}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvCreateMatND(dims: Integer; const sizes: pInteger; cType: Integer): pCvMatND; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Initializes preallocated CvMatND header */
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(CvMatND*) cvInitMatNDHeader( CvMatND* mat, int dims, const int* sizes,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
int type, void* data CV_DEFAULT(NULL) );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvInitMatNDHeader}
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvInitMatNDHeader(mat: pCvMatND; dims: Integer; const sizes: pInteger; cType: Integer; data: pCvArr = nil): pCvMatND; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-10-10 21:08:51 +02:00
|
|
|
|
(*
|
|
|
|
|
Releases CvMatND
|
|
|
|
|
|
|
|
|
|
CV_INLINE void cvReleaseMatND( CvMatND** mat )
|
|
|
|
|
{cvReleaseMat( (CvMat** )mat ); }
|
|
|
|
|
*)
|
|
|
|
|
{$EXTERNALSYM cvReleaseMatND}
|
2017-09-07 12:38:44 +02:00
|
|
|
|
procedure cvReleaseMatND(var mat: pCvMatND); {$IFDEF USE_INLINE} inline; {$ENDIF}
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Creates a copy of CvMatND (except, may be, steps)
|
2013-04-16 08:40:44 +02:00
|
|
|
|
CVAPI(CvMatND*) cvCloneMatND( const CvMatND* mat );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvCloneMatND}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
function cvCloneMatND(const mat: pCvMatND): pCvMatND; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Allocates and initializes CvSparseMat header and allocates data
|
2013-04-16 08:40:44 +02:00
|
|
|
|
CVAPI(CvSparseMat*) cvCreateSparseMat( int dims, const int* sizes, int type );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvCreateSparseMat}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvCreateSparseMat(dims: Integer; sizes: pInteger; cType: Integer): pCvSparseMat; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Releases CvSparseMat
|
2013-04-16 08:40:44 +02:00
|
|
|
|
CVAPI(void) cvReleaseSparseMat( CvSparseMat** mat );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvReleaseSparseMat}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvReleaseSparseMat(mat: pCvSparseMat); cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Creates a copy of CvSparseMat (except, may be, zero items)
|
2013-04-16 08:40:44 +02:00
|
|
|
|
CVAPI(CvSparseMat*) cvCloneSparseMat( const CvSparseMat* mat );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvCloneSparseMat}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
function cvCloneSparseMat(const mat: pCvSparseMat): pCvSparseMat; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Initializes sparse array iterator
|
2013-04-16 08:40:44 +02:00
|
|
|
|
(returns the first node or NULL if the array is empty)
|
|
|
|
|
CVAPI(CvSparseNode*) cvInitSparseMatIterator( const CvSparseMat* mat,
|
|
|
|
|
CvSparseMatIterator* mat_iterator );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvInitSparseMatIterator}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
function cvInitSparseMatIterator(const mat: pCvSparseMat; mat_iterator: pCvSparseMatIterator): pCvSparseNode; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
// returns next sparse array node (or NULL if there is no more nodes)
|
2014-09-29 09:12:47 +02:00
|
|
|
|
{$IFDEF DELPHIXE_UP}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGetNextSparseNode}
|
2017-09-07 12:38:44 +02:00
|
|
|
|
function cvGetNextSparseNode(mat_iterator: pCvSparseMatIterator): pCvSparseNode; {$IFDEF USE_INLINE} inline; {$ENDIF}
|
2014-09-29 09:12:47 +02:00
|
|
|
|
{$ENDIF}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
// **************** matrix iterator: used for n-ary operations on dense arrays *********
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2017-09-10 01:16:52 +02:00
|
|
|
|
Type
|
|
|
|
|
pCvNArrayIterator = ^TCvNArrayIterator;
|
|
|
|
|
|
|
|
|
|
TCvNArrayIterator = record
|
|
|
|
|
count: Integer; // number of arrays
|
|
|
|
|
dims: Integer; // number of dimensions to iterate
|
|
|
|
|
size: TCvSize; // maximal common linear size: { width = size, height = 1 }
|
|
|
|
|
ptr: Array [0 .. CV_MAX_ARR - 1] of ^uchar; // pointers to the array slices
|
|
|
|
|
stack: Array [0 .. CV_MAX_DIM - 1] of Integer; // for internal use
|
|
|
|
|
hdr: Array [0 .. CV_MAX_ARR - 1] of ^TCvMatND; // pointers to the headers of the
|
|
|
|
|
end;
|
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
const
|
|
|
|
|
CV_NO_DEPTH_CHECK = 1;
|
2013-04-16 08:40:44 +02:00
|
|
|
|
{$EXTERNALSYM CV_NO_DEPTH_CHECK}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CV_NO_CN_CHECK = 2;
|
2013-04-16 08:40:44 +02:00
|
|
|
|
{$EXTERNALSYM CV_NO_CN_CHECK}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CV_NO_SIZE_CHECK = 4;
|
2013-04-16 08:40:44 +02:00
|
|
|
|
{$EXTERNALSYM CV_NO_SIZE_CHECK}
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ initializes iterator that traverses through several arrays simulteneously
|
2013-04-16 08:40:44 +02:00
|
|
|
|
(the function together with cvNextArraySlice is used for
|
2013-04-15 18:14:12 +02:00
|
|
|
|
N-ari element-wise operations)
|
2013-04-16 08:40:44 +02:00
|
|
|
|
CVAPI(int) cvInitNArrayIterator( int count, pCvArr** arrs,
|
|
|
|
|
const pCvArr* mask, CvMatND* stubs,
|
|
|
|
|
CvNArrayIterator* array_iterator,
|
|
|
|
|
int flags CV_DEFAULT(0) );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvInitNArrayIterator}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
function cvInitNArrayIterator(count: Integer; arrs: pCvArr; const mask: pCvArr; stubs: pCvMatND; array_iterator: pCvNArrayIterator; flags: Integer = 0)
|
|
|
|
|
: Integer; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ returns zero value if iteration is finished, non-zero (slice length) otherwise */
|
2013-04-16 08:40:44 +02:00
|
|
|
|
CVAPI(int) cvNextNArraySlice( CvNArrayIterator* array_iterator );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvNextNArraySlice}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvNextNArraySlice(array_iterator: pCvNArrayIterator): Integer; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Returns type of array elements:
|
2013-04-16 08:40:44 +02:00
|
|
|
|
CV_8UC1 ... CV_64FC4 ...
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(int) cvGetElemType( const pCvArr* arr );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGetElemType}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvGetElemType(const arr: pCvArr): Integer; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Retrieves number of an array dimensions and
|
2013-04-16 08:40:44 +02:00
|
|
|
|
optionally sizes of the dimensions */
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(int) cvGetDims( const pCvArr* arr, int* sizes CV_DEFAULT(NULL) );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGetDims}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvGetDims(const arr: pCvArr; sizes: pInteger = nil): Integer; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Retrieves size of a particular array dimension.
|
2013-04-15 18:14:12 +02:00
|
|
|
|
For 2d arrays cvGetDimSize(arr,0) returns number of rows (image height)
|
|
|
|
|
and cvGetDimSize(arr,1) returns number of columns (image width) */
|
|
|
|
|
CVAPI(int) cvGetDimSize( const pCvArr* arr, int index );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGetDimSize}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvGetDimSize(const arr: pCvArr; index: Integer): Integer; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ ptr = &arr(idx0,idx1,...). All indexes are zero-based,
|
2013-04-15 18:14:12 +02:00
|
|
|
|
the major dimensions go first (e.g. (y,x) for 2D, (z,y,x) for 3D
|
|
|
|
|
CVAPI(uchar*) cvPtr1D( const pCvArr* arr, int idx0, int* type CV_DEFAULT(NULL));
|
|
|
|
|
CVAPI(uchar*) cvPtr2D( const pCvArr* arr, int idx0, int idx1, int* type CV_DEFAULT(NULL) );
|
|
|
|
|
CVAPI(uchar*) cvPtr3D( const pCvArr* arr, int idx0, int idx1, int idx2,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
int* type CV_DEFAULT(NULL));
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvPtr1D}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvPtr1D(const arr: pCvArr; idx0: Integer; cType: pInteger = nil): pCvArr; cdecl;
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvPtr2D}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvPtr2D(const arr: pCvArr; idx0, idx1: Integer; cType: pInteger = nil): pCvArr; cdecl;
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvPtr3D}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvPtr3D(const arr: pCvArr; idx0, idx1, idx2: Integer; cType: pInteger = nil): pCvArr; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ For CvMat or IplImage number of indices should be 2
|
2013-04-15 18:14:12 +02:00
|
|
|
|
(row index (y) goes first, column index (x) goes next).
|
|
|
|
|
For CvMatND or CvSparseMat number of infices should match number of <dims> and
|
|
|
|
|
indices order should match the array dimension order. */
|
|
|
|
|
CVAPI(uchar*) cvPtrND( const pCvArr* arr, const int* idx, int* type CV_DEFAULT(NULL),
|
2013-04-16 08:40:44 +02:00
|
|
|
|
int create_node CV_DEFAULT(1),
|
|
|
|
|
unsigned* precalc_hashval CV_DEFAULT(NULL));
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvPtrND}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
function cvPtrND(const arr: pCvArr; idx: pInteger; cType: pInteger = nil; create_node: Integer = 1; precalc_hashval: punsigned = nil): pCvArr; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ value = arr(idx0,idx1,...)
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(CvScalar) cvGet1D( const pCvArr* arr, int idx0 );
|
|
|
|
|
CVAPI(CvScalar) cvGet2D( const pCvArr* arr, int idx0, int idx1 );
|
|
|
|
|
CVAPI(CvScalar) cvGet3D( const pCvArr* arr, int idx0, int idx1, int idx2 );
|
|
|
|
|
CVAPI(CvScalar) cvGetND( const pCvArr* arr, const int* idx );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGet1D}
|
2013-04-10 01:22:08 +02:00
|
|
|
|
function cvGet1D(const arr: pCvArr; idx0: Integer): TCvScalar; cdecl;
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGet2D}
|
2017-09-12 15:30:23 +02:00
|
|
|
|
// function cvGet2D(const arr: pCvMat; idx0, idx1: Integer): TCvScalar; cdecl;
|
|
|
|
|
function cvGet2D(const arr: pCvArr; idx0, idx1: Integer): TCvScalar; cdecl;
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGet3D}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
function cvGet3D(const arr: pCvArr; idx0, idx1, idx2: Integer): TCvScalar; cdecl;
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGetND}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
function cvGetND(const arr: pCvArr; idx: pInteger): TCvScalar; cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ for 1-channel arrays
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(double) cvGetReal1D( const pCvArr* arr, int idx0 );
|
|
|
|
|
CVAPI(double) cvGetReal2D( const pCvArr* arr, int idx0, int idx1 );
|
|
|
|
|
CVAPI(double) cvGetReal3D( const pCvArr* arr, int idx0, int idx1, int idx2 );
|
|
|
|
|
CVAPI(double) cvGetRealND( const pCvArr* arr, const int* idx );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGetReal1D}
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// function cvGetReal1D(const arr: pIplImage; idx0: Integer): double; cdecl; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
function cvGetReal1D(const arr: pCvArr; idx0: Integer): double; cdecl; overload;
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGetReal2D}
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// function cvGetReal2D(const arr: pCvMat; idx0, idx1: Integer): double; cdecl; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
function cvGetReal2D(const arr: pCvArr; idx0, idx1: Integer): double; cdecl; overload;
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGetReal3D}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
function cvGetReal3D(const arr: pCvArr; idx0, idx1, idx2: Integer): double; cdecl;
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGetRealND}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
function cvGetRealND(const arr: pCvArr; idx: pInteger): double; cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ arr(idx0,idx1,...) = value
|
2019-08-14 12:21:31 +02:00
|
|
|
|
CVAPI(void) cvSet1D( CvArr* arr, int idx0, CvScalar value );
|
|
|
|
|
CVAPI(void) cvSet2D( CvArr* arr, int idx0, int idx1, CvScalar value );
|
|
|
|
|
CVAPI(void) cvSet3D( CvArr* arr, int idx0, int idx1, int idx2, CvScalar value );
|
|
|
|
|
CVAPI(void) cvSetND( CvArr* arr, const int* idx, CvScalar value );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvSet1D}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvSet1D(arr: pCvArr; idx0: Integer; value: TCvScalar); cdecl;
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvSet2D}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvSet2D(arr: pCvArr; idx0, idx1: Integer; value: TCvScalar); cdecl;
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvSet3D}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvSet3D(arr: pCvArr; idx0, idx1, idx2: Integer; value: TCvScalar); cdecl;
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvSetND}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvSetND(arr: pCvArr; idx: pInteger; value: TCvScalar); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2019-08-14 12:21:31 +02:00
|
|
|
|
{ /* for 1-channel arrays */
|
|
|
|
|
CVAPI(void) cvSetReal1D( CvArr* arr, int idx0, double value );
|
|
|
|
|
CVAPI(void) cvSetReal2D( CvArr* arr, int idx0, int idx1, double value );
|
|
|
|
|
CVAPI(void) cvSetReal3D( CvArr* arr, int idx0, int idx1, int idx2, double value );
|
|
|
|
|
CVAPI(void) cvSetRealND( CvArr* arr, const int* idx, double value );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvSetReal1D}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvSetReal1D(arr: pCvArr; idx0: Integer; value: double); cdecl;
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvSetReal2D}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvSetReal2D(arr: pCvArr; idx0, idx1: Integer; value: double); cdecl;
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvSetReal3D}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvSetReal3D(arr: pCvArr; idx0, idx1, idx2: Integer; value: double); cdecl;
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvSetRealND}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvSetRealND(arr: pCvArr; idx: pInteger; value: double); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2019-08-14 12:21:31 +02:00
|
|
|
|
{
|
|
|
|
|
/* clears element of ND dense array,
|
2013-04-15 18:14:12 +02:00
|
|
|
|
in case of sparse arrays it deletes the specified node */
|
2019-08-14 12:21:31 +02:00
|
|
|
|
CVAPI(void) cvClearND( CvArr* arr, const int* idx );
|
2013-04-05 13:36:47 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvClearND}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvClearND(arr: pCvArr; idx: pInteger); cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Converts pCvArr (IplImage or CvMat,...) to CvMat.
|
2013-04-15 18:14:12 +02:00
|
|
|
|
If the last parameter is non-zero, function can
|
|
|
|
|
convert multi(>2)-dimensional array to CvMat as long as
|
|
|
|
|
the last array's dimension is continous. The resultant
|
|
|
|
|
matrix will be have appropriate (a huge) number of rows */
|
|
|
|
|
CVAPI(CvMat*) cvGetMat( const pCvArr* arr, CvMat* header,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
int* coi CV_DEFAULT(NULL),
|
|
|
|
|
int allowND CV_DEFAULT(0));
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGetMat}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvGetMat(const arr: pCvArr; header: pCvMat; coi: pInteger = nil; allowND: Integer = 0): pCvMat; cdecl;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Converts pCvArr (IplImage or CvMat) to IplImage
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(IplImage*) cvGetImage( const pCvArr* arr, IplImage* image_header );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvGetImage}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
function cvGetImage(const arr: pCvArr; image_header: pIplImage): pIplImage; cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Changes a shape of multi-dimensional array.
|
2013-04-15 18:14:12 +02:00
|
|
|
|
new_cn == 0 means that number of channels remains unchanged.
|
|
|
|
|
new_dims == 0 means that number and sizes of dimensions remain the same
|
|
|
|
|
(unless they need to be changed to set the new number of channels)
|
|
|
|
|
if new_dims == 1, there is no need to specify new dimension sizes
|
|
|
|
|
The resultant configuration should be achievable w/o data copying.
|
|
|
|
|
If the resultant array is sparse, CvSparseMat header should be passed
|
|
|
|
|
to the function else if the result is 1 or 2 dimensional,
|
|
|
|
|
CvMat header should be passed to the function
|
|
|
|
|
else CvMatND header should be passed */
|
|
|
|
|
CVAPI(pCvArr*) cvReshapeMatND( const pCvArr* arr,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
int sizeof_header, pCvArr* header,
|
|
|
|
|
int new_cn, int new_dims, int* new_sizes );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
#define cvReshapeND( arr, header, new_cn, new_dims, new_sizes ) \
|
2013-04-16 08:40:44 +02:00
|
|
|
|
cvReshapeMatND( (arr), sizeof(*(header)), (header), \
|
|
|
|
|
(new_cn), (new_dims), (new_sizes))
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvReshapeMatND}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
function cvReshapeMatND(const arr: pCvArr; sizeof_header: Integer; header: pCvArr; new_cn, new_dims: Integer; new_sizes: pInteger): pCvArr; cdecl;
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvReshapeND}
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvReshapeND(const arr: pCvArr; sizeof_header: Integer; header: pCvArr; new_cn, new_dims: Integer; new_sizes: pInteger): pCvArr;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
{$IFDEF USE_INLINE} inline; {$ENDIF}
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ CVAPI(CvMat*) cvReshape( const pCvArr* arr, CvMat* header,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
int new_cn, int new_rows CV_DEFAULT(0) );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvReshape}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvReshape(const arr: pCvArr; header: pCvMat; new_cn: Integer; new_rows: Integer = 0): pCvMat; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Repeats source 2d array several times in both horizontal and
|
2013-04-15 18:14:12 +02:00
|
|
|
|
vertical direction to fill destination array
|
|
|
|
|
CVAPI(void) cvRepeat( const pCvArr* src, pCvArr* dst );
|
|
|
|
|
}
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{$EXTERNALSYM cvRepeat}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvRepeat(src, dst: pCvArr); cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Allocates array data
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvCreateData( pCvArr* arr );
|
|
|
|
|
}
|
|
|
|
|
procedure cvCreateData(arr: pCvArr); cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Releases array data
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvReleaseData( pCvArr* arr );
|
|
|
|
|
}
|
|
|
|
|
procedure cvReleaseData(arr: pCvArr); cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Attaches user data to the array header. The step is reffered to
|
2013-04-15 18:14:12 +02:00
|
|
|
|
the pre-last dimension. That is, all the planes of the array
|
|
|
|
|
must be joint (w/o gaps) */
|
|
|
|
|
CVAPI(void) cvSetData( pCvArr* arr, void* data, int step );
|
|
|
|
|
}
|
2013-09-25 21:18:23 +02:00
|
|
|
|
procedure cvSetData(arr: pCvArr; data: Pointer; step: Integer); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Retrieves raw data of CvMat, IplImage or CvMatND.
|
2013-04-15 18:14:12 +02:00
|
|
|
|
In the latter case the function raises an error if
|
|
|
|
|
the array can not be represented as a matrix */
|
|
|
|
|
CVAPI(void) cvGetRawData( const pCvArr* arr, uchar** data,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
int* step CV_DEFAULT(NULL),
|
|
|
|
|
CvSize* roi_size CV_DEFAULT(NULL));
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2015-03-30 23:02:32 +02:00
|
|
|
|
procedure cvGetRawData(arr: pCvArr; data: pByte; step: pInteger = nil; roi_size: pCvSize = nil); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Returns width and height of array in elements
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(CvSize) cvGetSize( const pCvArr* arr );
|
|
|
|
|
}
|
2017-10-23 01:37:17 +02:00
|
|
|
|
function cvGetSize(const arr: pCvArr): TCvSize; {$IFDEF DelphiOCVVersion_30} cdecl; {$ENDIF}
|
2015-04-07 01:39:39 +02:00
|
|
|
|
// procedure _cvGetSize(const arr: pCvArr; Var size: TCvSize); cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Copies source array to destination array */
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvCopy( const pCvArr* src, pCvArr* dst,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
const pCvArr* mask CV_DEFAULT(NULL) );
|
2013-01-01 13:29:34 +01:00
|
|
|
|
}
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvCopy(const src: pCvArr; dst: pCvArr; const mask: pCvArr = nil); cdecl; overload;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvCopy(const src: pIplImage; dst: pIplImage; const mask: pIplImage = nil); cdecl; overload;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Sets all or "masked" elements of input array
|
2013-04-15 18:14:12 +02:00
|
|
|
|
to the same value
|
|
|
|
|
CVAPI(void) cvSet( pCvArr* arr, CvScalar value,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
const pCvArr* mask CV_DEFAULT(NULL) );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
|
|
|
|
procedure cvSet(arr: pCvArr; value: TCvScalar; const mask: pCvArr = nil); cdecl; overload;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
|
|
|
|
procedure cvSet(mat: pCvMat; i, j: Integer; val: Single); {$IFDEF USE_INLINE} inline; {$ENDIF} overload;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Clears all the array elements (sets them to 0)
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvSetZero( pCvArr* arr );
|
|
|
|
|
#define cvZero cvSetZero
|
|
|
|
|
}
|
|
|
|
|
procedure cvSetZero(arr: pCvArr); cdecl;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2013-04-07 12:41:15 +02:00
|
|
|
|
procedure cvZero(arr: pCvArr); cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Splits a multi-channel array into the set of single-channel arrays or
|
2013-01-01 22:36:38 +01:00
|
|
|
|
extracts particular [color] plane */
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvSplit( const pCvArr* src, pCvArr* dst0, pCvArr* dst1,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
pCvArr* dst2, pCvArr* dst3 );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2017-09-10 01:16:52 +02:00
|
|
|
|
procedure cvSplit(const src: pCvArr; dst0: pCvArr; dst1: pCvArr; dst2: pCvArr = nil; dst3: pCvArr = nil); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Merges a set of single-channel arrays into the single multi-channel array
|
2013-01-01 22:36:38 +01:00
|
|
|
|
or inserts one particular [color] plane to the array */
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvMerge( const pCvArr* src0, const pCvArr* src1,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
const pCvArr* src2, const pCvArr* src3,
|
|
|
|
|
pCvArr* dst );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvMerge(const src0: pIplImage; const src1: pIplImage; const src2: pIplImage; const src3: pIplImage; dst: pIplImage);
|
|
|
|
|
// cdecl; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvMerge(const src0: pCvArr; const src1: pCvArr; const src2: pCvArr; const src3: pCvArr; dst: pCvArr); cdecl; overload;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Copies several channels from input arrays to
|
2013-04-15 18:14:12 +02:00
|
|
|
|
certain channels of output arrays */
|
|
|
|
|
CVAPI(void) cvMixChannels( const pCvArr** src, int src_count,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
pCvArr** dst, int dst_count,
|
|
|
|
|
const int* from_to, int pair_count );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2017-09-07 12:38:44 +02:00
|
|
|
|
procedure cvMixChannels(src: array of pCvArr; src_count: Integer; dst: array of pCvArr; dst_count: Integer; const from_to: pInteger;
|
2015-03-30 23:02:32 +02:00
|
|
|
|
pair_count: Integer); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Performs linear transformation on every source array element:
|
2013-01-07 15:02:10 +01:00
|
|
|
|
dst(x,y,c) = scale*src(x,y,c)+shift.
|
|
|
|
|
Arbitrary combination of input and output array depths are allowed
|
|
|
|
|
(number of channels must be the same), thus the function can be used
|
2013-04-15 18:14:12 +02:00
|
|
|
|
for type conversion
|
|
|
|
|
CVAPI(void) cvConvertScale( const pCvArr* src, pCvArr* dst,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
double scale CV_DEFAULT(1),
|
|
|
|
|
double shift CV_DEFAULT(0) );
|
2013-01-07 15:02:10 +01:00
|
|
|
|
#define cvCvtScale cvConvertScale
|
|
|
|
|
#define cvConvert( src, dst ) cvConvertScale( (src), (dst), 1, 0 )
|
|
|
|
|
}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvConvertScale(const src: pCvArr; dst: pCvArr; scale: double = 1; shift: double = 0); cdecl;
|
2013-09-25 21:18:23 +02:00
|
|
|
|
// #define cvScale cvConvertScale
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2013-09-25 21:18:23 +02:00
|
|
|
|
procedure cvScale(const src: pCvArr; dst: pCvArr; scale: double = 1; shift: double = 0); cdecl;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2013-04-16 08:40:44 +02:00
|
|
|
|
procedure cvCvtScale(const src: pCvArr; dst: pCvArr; scale: double = 1; shift: double = 0); cdecl;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
|
|
|
|
procedure cvConvert(const src: pCvArr; dst: pCvArr); {$IFDEF USE_INLINE} inline; {$ENDIF}
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Performs linear transformation on every source array element,
|
2013-04-15 18:14:12 +02:00
|
|
|
|
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 */
|
|
|
|
|
CVAPI(void) cvConvertScaleAbs( const pCvArr* src, pCvArr* dst,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
double scale CV_DEFAULT(1),
|
|
|
|
|
double shift CV_DEFAULT(0) );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
#define cvCvtScaleAbs cvConvertScaleAbs
|
|
|
|
|
}
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvConvertScaleAbs(const src: pCvArr; dst: pCvArr; scale: double = 1; shift: double = 0); cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ checks termination criteria validity and
|
2013-04-15 18:14:12 +02:00
|
|
|
|
sets eps to default_eps (if it is not set),
|
|
|
|
|
max_iter to default_max_iters (if it is not set)
|
|
|
|
|
CVAPI(CvTermCriteria) cvCheckTermCriteria( CvTermCriteria criteria,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
double default_eps,
|
|
|
|
|
int default_max_iters );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvCheckTermCriteria(criteria: TCvTermCriteria; default_eps: double; default_max_iters: Integer): TCvTermCriteria; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{ ***************************************************************************************
|
|
|
|
|
* Arithmetic, logic and comparison operations *
|
|
|
|
|
*************************************************************************************** }
|
2013-01-07 15:02:10 +01:00
|
|
|
|
|
2014-06-16 23:38:35 +02:00
|
|
|
|
{
|
|
|
|
|
dst(mask) = src1(mask) + src2(mask)
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvAdd( const pCvArr* src1, const pCvArr* src2, pCvArr* dst,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
const pCvArr* mask CV_DEFAULT(NULL));
|
2013-01-01 13:29:34 +01:00
|
|
|
|
}
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvAdd(const src1, src2: pIplImage; dst: pIplImage; const mask: pIplImage = nil); cdecl; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvAdd(const src1, src2: pCvArr; dst: pCvArr; const mask: pCvArr = nil); cdecl; overload;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-06-16 23:38:35 +02:00
|
|
|
|
{
|
|
|
|
|
dst(mask) = src(mask) + value
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvAddS( const pCvArr* src, CvScalar value, pCvArr* dst,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
const pCvArr* mask CV_DEFAULT(NULL));
|
2013-01-07 15:02:10 +01:00
|
|
|
|
}
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvAddS(const src: pIplImage; value: TCvScalar; dst: pIplImage; const mask: pIplImage = nil); cdecl; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvAddS(const src: pCvArr; value: TCvScalar; dst: pCvArr; const mask: pCvArr = nil); cdecl; overload;
|
2013-01-07 15:02:10 +01:00
|
|
|
|
|
2014-06-16 23:38:35 +02:00
|
|
|
|
{
|
|
|
|
|
dst(mask) = src1(mask) - src2(mask)
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvSub( const pCvArr* src1, const pCvArr* src2, pCvArr* dst,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
const pCvArr* mask CV_DEFAULT(NULL));
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvSub(const src1, src2: pIplImage; dst: pIplImage; const mask: pIplImage = nil); cdecl; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvSub(const src1, src2: pCvArr; dst: pCvArr; const mask: pCvArr = nil); cdecl; overload;
|
2013-01-07 15:02:10 +01:00
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
// dst(mask) = src(mask) - value = src(mask) + (-value)
|
2013-04-16 08:40:44 +02:00
|
|
|
|
// CV_INLINE void cvSubS( const pCvArr* src, CvScalar value, pCvArr* dst,
|
|
|
|
|
// const pCvArr* mask CV_DEFAULT(NULL))
|
|
|
|
|
// {
|
|
|
|
|
// cvAddS( src, cvScalar( -value.val[0], -value.val[1], -value.val[2], -value.val[3]),
|
|
|
|
|
// dst, mask );
|
|
|
|
|
// }
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvSubS(const src: pIplImage; value: TCvScalar; dst: pIplImage; const mask: pIplImage = nil);
|
|
|
|
|
// {$IFDEF USE_INLINE} inline; {$ENDIF} overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvSubS(const src: pCvArr; value: TCvScalar; dst: pCvArr; const mask: pCvArr = nil);
|
|
|
|
|
{$IFDEF USE_INLINE} inline; {$ENDIF} overload;
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ dst(mask) = value - src(mask)
|
2013-04-16 08:40:44 +02:00
|
|
|
|
CVAPI(void) cvSubRS( const pCvArr* src, CvScalar value, pCvArr* dst,
|
|
|
|
|
const pCvArr* mask CV_DEFAULT(NULL));
|
2013-04-05 13:36:47 +02:00
|
|
|
|
}
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvSubRS(const src: pIplImage; value: TCvScalar; dst: pIplImage; const mask: pIplImage = nil); cdecl; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvSubRS(const src: pCvArr; value: TCvScalar; dst: pCvArr; const mask: pCvArr = nil); cdecl; overload;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ dst(idx) = src1(idx) * src2(idx) * scale
|
2013-04-15 18:14:12 +02:00
|
|
|
|
(scaled element-wise multiplication of 2 arrays) */
|
|
|
|
|
CVAPI(void) cvMul( const pCvArr* src1, const pCvArr* src2,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
pCvArr* dst, double scale CV_DEFAULT(1) );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvMul(const src1, src2: pIplImage; dst: pIplImage; scale: double = 1); cdecl; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvMul(const src1, src2: pCvArr; dst: pCvArr; scale: double = 1); cdecl; overload;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ element-wise division/inversion with scaling:
|
2013-04-15 18:14:12 +02:00
|
|
|
|
dst(idx) = src1(idx) * scale / src2(idx)
|
|
|
|
|
or dst(idx) = scale / src2(idx) if src1 == 0 */
|
|
|
|
|
CVAPI(void) cvDiv( const pCvArr* src1, const pCvArr* src2,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
pCvArr* dst, double scale CV_DEFAULT(1));
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvDiv(const src1, src2: pIplImage; dst: pIplImage; scale: double = 1); cdecl; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvDiv(const src1, src2: pCvArr; dst: pCvArr; scale: double = 1); cdecl; overload;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ dst = src1 * scale + src2
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvScaleAdd( const pCvArr* src1, CvScalar scale,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
const pCvArr* src2, pCvArr* dst );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
#define cvAXPY( A, real_scalar, B, C ) cvScaleAdd(A, cvRealScalar(real_scalar), B, C)
|
|
|
|
|
}
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvScaleAdd(const src1: pIplImage; scale: TCvScalar; const src2: pIplImage; dst: pIplImage); cdecl; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvScaleAdd(const src1: pCvArr; scale: TCvScalar; const src2: pCvArr; dst: pCvArr); cdecl; overload;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvAXPY(A: pIplImage; real_scalar: double; B, C: pIplImage); {$IFDEF USE_INLINE} inline; {$ENDIF} overload;
|
|
|
|
|
procedure cvAXPY(A: pCvArr; real_scalar: double; B, C: pCvArr); {$IFDEF USE_INLINE} inline; {$ENDIF} overload;
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ dst = src1 * alpha + src2 * beta + gamma
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvAddWeighted( const pCvArr* src1, double alpha,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
const pCvArr* src2, double beta,
|
|
|
|
|
double gamma, pCvArr* dst );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvAddWeighted(const src1: pIplImage; alpha: double; const src2: pIplImage; beta: double; gamma: double; dst: pIplImage);
|
|
|
|
|
// cdecl; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvAddWeighted(const src1: pCvArr; alpha: double; const src2: pCvArr; beta: double; gamma: double; dst: pCvArr); cdecl; overload;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ result = sum_i(src1(i) * src2(i)) (results for all channels are accumulated together)
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(double) cvDotProduct( const pCvArr* src1, const pCvArr* src2 );
|
|
|
|
|
}
|
|
|
|
|
function cvDotProduct(const src1, src2: pCvArr): double; cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ dst(idx) = src1(idx) & src2(idx)
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvAnd( const pCvArr* src1, const pCvArr* src2,
|
2013-04-16 08:40:44 +02:00
|
|
|
|
pCvArr* dst, const pCvArr* mask CV_DEFAULT(NULL));
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvAnd(const src1: pIplImage; const src2: pIplImage; dst: pIplImage; masl: pIplImage = nil); cdecl; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvAnd(const src1: pCvArr; const src2: pCvArr; dst: pCvArr; masl: pCvArr = nil); cdecl; overload;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2016-06-03 17:59:24 +02:00
|
|
|
|
(* dst(idx) = src(idx) & value *)
|
|
|
|
|
{
|
2017-09-07 12:38:44 +02:00
|
|
|
|
CVAPI(void) cvAndS( const CvArr* src, CvScalar value,
|
|
|
|
|
CvArr* dst, const CvArr* mask CV_DEFAULT(NULL));
|
2016-06-03 17:59:24 +02:00
|
|
|
|
}
|
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
procedure cvAndS(const src: pCvArr; value: TCvScalar; dst: pCvArr; const mask: pCvArr = nil); cdecl;
|
2016-06-03 17:59:24 +02:00
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
// dst(x,y,c) = abs(src1(x,y,c) - src2(x,y,c))
|
|
|
|
|
// CVAPI(void) cvAbsDiff( const pCvArr* src1, const pCvArr* src2, pCvArr* dst );
|
2013-04-13 16:59:47 +02:00
|
|
|
|
procedure cvAbsDiff(const src1: pCvArr; const src2: pCvArr; dst: pCvArr); cdecl;
|
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
function cvGet(const mat: pCvMat; i, j: Integer): Single; {$IFDEF USE_INLINE} inline; {$ENDIF}
|
2017-09-08 11:02:08 +02:00
|
|
|
|
// procedure cvCopyImage(const src: pIplImage; dst: pIplImage; const mask: pIplImage = nil); cdecl; overload;
|
|
|
|
|
// procedure cvCopyImage(const src: pCvArr; dst: pCvArr; const mask: pCvArr = nil); cdecl; overload;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ dst(idx) = src1(idx) | src2(idx) */
|
2013-05-27 13:11:45 +02:00
|
|
|
|
CVAPI(void) cvOr( const CvArr* src1, const CvArr* src2,
|
2013-09-12 11:49:13 +02:00
|
|
|
|
CvArr* dst, const CvArr* mask CV_DEFAULT(NULL));
|
2013-05-27 13:11:45 +02:00
|
|
|
|
}
|
|
|
|
|
procedure cvOr(const src1, src2: pCvArr; dst: pCvArr; const mask: pCvArr = nil); cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ dst(idx) = src1(idx) ^ src2(idx) */
|
2013-05-27 13:11:45 +02:00
|
|
|
|
CVAPI(void) cvXor( const CvArr* src1, const CvArr* src2,
|
2013-09-12 11:49:13 +02:00
|
|
|
|
CvArr* dst, const CvArr* mask CV_DEFAULT(NULL));
|
2013-05-27 13:11:45 +02:00
|
|
|
|
}
|
|
|
|
|
procedure cvXor(const src1, src2: pCvArr; dst: pCvArr; const mask: pCvArr = nil); cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ dst(idx) = src(idx) ^ value
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvXorS( const pCvArr* src, CvScalar value, pCvArr* dst, const pCvArr* mask CV_DEFAULT(NULL));
|
|
|
|
|
}
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvXorS(const src: pIplImage; value: TCvScalar; dst: pIplImage; const mask: pCvArr = nil); cdecl; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvXorS(const src: pCvArr; value: TCvScalar; dst: pCvArr; const mask: pCvArr = nil); cdecl; overload;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ dst(idx) = ~src(idx) */
|
2013-05-27 13:11:45 +02:00
|
|
|
|
CVAPI(void) cvNot( const CvArr* src, CvArr* dst );
|
|
|
|
|
}
|
|
|
|
|
procedure cvNot(const src: pCvArr; dst: pCvArr); cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ dst(idx) = lower(idx) <= src(idx) < upper(idx)
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvInRange( const pCvArr* src, const pCvArr* lower, const pCvArr* upper, pCvArr* dst );
|
|
|
|
|
}
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvInRange(const src: pIplImage; const lower: pIplImage; const upper: pIplImage; dst: pIplImage); cdecl; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvInRange(const src: pCvArr; const lower: pCvArr; const upper: pCvArr; dst: pCvArr); cdecl; overload;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ dst(idx) = lower <= src(idx) < upper
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvInRangeS( const pCvArr* src, CvScalar lower, CvScalar upper, pCvArr* dst );
|
|
|
|
|
}
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvInRangeS(const src: pIplImage; lower: TCvScalar; upper: TCvScalar; dst: pIplImage); cdecl; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvInRangeS(const src: pCvArr; lower: TCvScalar; upper: TCvScalar; dst: pCvArr); cdecl; overload;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2013-09-15 14:02:26 +02:00
|
|
|
|
const
|
2019-08-14 12:21:31 +02:00
|
|
|
|
CV_RAND_UNI = 0;
|
2013-09-15 14:02:26 +02:00
|
|
|
|
CV_RAND_NORMAL = 1;
|
|
|
|
|
|
|
|
|
|
// CVAPI(void)cvRandArr(CvRNG * rng, CvArr * arr, int dist_type, CvScalar param1, CvScalar param2);
|
|
|
|
|
procedure cvRandArr(rng: pCvRNG; arr: pCvArr; dist_type: Integer; param1: TCvScalar; param2: TCvScalar); cdecl;
|
|
|
|
|
|
|
|
|
|
// CVAPI(void)cvRandShuffle(CvArr * mat, CvRNG * rng, double iter_factor CV_DEFAULT(1. ));
|
|
|
|
|
procedure cvRandShuffle(mat: pCvArr; rng: pCvRNG; iter_factor: double = 1); cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
CVAPI(void) cvSort( const CvArr* src, CvArr* dst CV_DEFAULT(NULL),
|
|
|
|
|
CvArr* idxmat CV_DEFAULT(NULL),
|
|
|
|
|
int flags CV_DEFAULT(0));
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSort(const src: pCvArr; dst: pCvArr = nil; idxmat: pCvArr = nil; flags: Integer = 0); cdecl;
|
|
|
|
|
(*
|
|
|
|
|
Finds real roots of a cubic equation
|
|
|
|
|
*)
|
|
|
|
|
(*
|
|
|
|
|
CVAPI(int) cvSolveCubic( const CvMat* coeffs, CvMat* roots );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvSolveCubic(const coeffs: pCvMat; roots: pCvMat): Integer; cdecl;
|
|
|
|
|
(*
|
|
|
|
|
Finds all real and complex roots of a polynomial equation
|
|
|
|
|
*)
|
|
|
|
|
(*
|
|
|
|
|
CVAPI(void) cvSolvePoly(const CvMat* coeffs, CvMat *roots2,
|
|
|
|
|
int maxiter CV_DEFAULT(20), int fig CV_DEFAULT(100));
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSolvePoly(const coeffs: pCvMat; roots2: pCvMat; maxiter: Integer = 20; fig: Integer = 100); cdecl;
|
2013-09-15 14:02:26 +02:00
|
|
|
|
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{ ****************************************************************************************
|
|
|
|
|
* Math operations *
|
|
|
|
|
**************************************************************************************** }
|
2013-04-05 13:36:47 +02:00
|
|
|
|
|
2013-09-25 21:18:23 +02:00
|
|
|
|
// * Does cartesian->polar coordinates conversion.
|
|
|
|
|
// Either of output components (magnitude or angle) is optional */
|
|
|
|
|
// CVAPI(void) cvCartToPolar( const CvArr* x, const CvArr* y,
|
|
|
|
|
// CvArr* magnitude, CvArr* angle CV_DEFAULT(NULL),
|
|
|
|
|
// int angle_in_degrees CV_DEFAULT(0));
|
2015-03-30 23:02:32 +02:00
|
|
|
|
procedure cvCartToPolar(const x: pCvArr; const y: pCvArr; magnitude: pCvArr; angle: pCvArr = nil; angle_in_degrees: Integer = 0); cdecl;
|
2013-09-25 21:18:23 +02:00
|
|
|
|
|
|
|
|
|
// * 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 */
|
|
|
|
|
// CVAPI(void) cvPolarToCart( const CvArr* magnitude, const CvArr* angle,
|
|
|
|
|
// CvArr* x, CvArr* y,
|
|
|
|
|
// int angle_in_degrees CV_DEFAULT(0));
|
2015-03-30 23:02:32 +02:00
|
|
|
|
procedure cvPolarToCart(const magnitude: pCvArr; const angle: pCvArr; x: pCvArr; y: pCvArr; angle_in_degrees: Integer = 0); cdecl;
|
2013-09-25 21:18:23 +02:00
|
|
|
|
|
|
|
|
|
// * Does powering: dst(idx) = src(idx)^power */
|
|
|
|
|
// CVAPI(void) cvPow( const CvArr* src, CvArr* dst, double power );
|
|
|
|
|
procedure cvPow(const src: pCvArr; dst: pCvArr; power: double); cdecl;
|
|
|
|
|
|
|
|
|
|
// * 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 */
|
|
|
|
|
// CVAPI(void) cvExp( const CvArr* src, CvArr* dst );
|
|
|
|
|
procedure cvExp(const src: pCvArr; dst: pCvArr); cdecl;
|
|
|
|
|
|
|
|
|
|
// * 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
|
|
|
|
|
// CVAPI(void) cvLog( const CvArr* src, CvArr* dst );
|
|
|
|
|
procedure cvLog(const src: pCvArr; dst: pCvArr); cdecl;
|
|
|
|
|
|
|
|
|
|
// * Fast arctangent calculation */
|
|
|
|
|
// CVAPI(float) cvFastArctan( float y, float x );
|
|
|
|
|
function cvFastArctan(y, x: Float): Float; cdecl;
|
|
|
|
|
|
|
|
|
|
// * Fast cubic root calculation */
|
|
|
|
|
// CVAPI(float) cvCbrt( float value );
|
|
|
|
|
function cvCbrt(value: Float): Float; cdecl;
|
|
|
|
|
|
|
|
|
|
// * Checks array values for NaNs, Infs or simply for too large numbers
|
|
|
|
|
// (if CV_CHECK_RANGE is set). If CV_CHECK_QUIET is set,
|
|
|
|
|
// no runtime errors is raised (function returns zero value in case of "bad" values).
|
|
|
|
|
// Otherwise cvError is called */
|
|
|
|
|
const
|
|
|
|
|
CV_CHECK_RANGE = 1;
|
|
|
|
|
CV_CHECK_QUIET = 2;
|
|
|
|
|
|
|
|
|
|
// CVAPI(int) cvCheckArr( const CvArr* arr, int flags CV_DEFAULT(0),
|
|
|
|
|
// double min_val CV_DEFAULT(0), double max_val CV_DEFAULT(0));
|
|
|
|
|
function cvCheckArr(const arr: pCvArr; flags: Integer = 0; min_val: double = 0; max_val: double = 0): Integer; cdecl;
|
|
|
|
|
// #define cvCheckArray cvCheckArr
|
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
// (* Mirror array data around horizontal (flip=0),
|
|
|
|
|
// vertical (flip=1) or both(flip=-1) axises:
|
|
|
|
|
// cvFlip(src) flips images vertically and sequences horizontally (inplace) *)
|
|
|
|
|
// procedure cvFlip(v1: 0); var Performs Singular value Decomposition of A Matrix * )
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvFlip(const src: pCvArr; dst: pCvArr = nil; flip_mode: Integer = 0); cdecl;
|
2017-09-22 22:11:32 +02:00
|
|
|
|
// #define cvMirror cvFlip
|
|
|
|
|
procedure cvMirror(const src: pCvArr; dst: pCvArr = nil; flip_mode: Integer = 0); cdecl;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
const
|
2013-04-13 16:59:47 +02:00
|
|
|
|
// * types of array norm */
|
2019-08-14 12:21:31 +02:00
|
|
|
|
CV_C = 1;
|
|
|
|
|
CV_L1 = 2;
|
|
|
|
|
CV_L2 = 4;
|
|
|
|
|
CV_NORM_MASK = 7;
|
|
|
|
|
CV_RELATIVE = 8;
|
|
|
|
|
CV_DIFF = 16;
|
|
|
|
|
CV_MINMAX = 32;
|
|
|
|
|
CV_DIFF_C = (CV_DIFF or CV_C);
|
|
|
|
|
CV_DIFF_L1 = (CV_DIFF or CV_L1);
|
|
|
|
|
CV_DIFF_L2 = (CV_DIFF or CV_L2);
|
|
|
|
|
CV_RELATIVE_C = (CV_RELATIVE or CV_C);
|
2013-04-13 16:59:47 +02:00
|
|
|
|
CV_RELATIVE_L1 = (CV_RELATIVE or CV_L1);
|
|
|
|
|
CV_RELATIVE_L2 = (CV_RELATIVE or CV_L2);
|
|
|
|
|
|
|
|
|
|
// * Finds norm, difference norm or relative difference norm for an array (or two arrays) */
|
2013-04-15 18:14:12 +02:00
|
|
|
|
// CVAPI(double) cvNorm( const pCvArr* arr1, const pCvArr* arr2 CV_DEFAULT(NULL),
|
2013-04-13 16:59:47 +02:00
|
|
|
|
// int norm_type CV_DEFAULT(CV_L2),
|
2013-04-15 18:14:12 +02:00
|
|
|
|
// const pCvArr* mask CV_DEFAULT(NULL) );
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvNorm(const arr1: pCvArr; const arr2: pCvArr = nil; norm_type: Integer = CV_L2; const mask: pCvArr = nil): double; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-12-01 22:46:13 +01:00
|
|
|
|
(*
|
|
|
|
|
|
|
|
|
|
CVAPI(void) cvNormalize( const CvArr* src, CvArr* dst,
|
|
|
|
|
double a CV_DEFAULT(1.), double b CV_DEFAULT(0.),
|
|
|
|
|
int norm_type CV_DEFAULT(CV_L2),
|
|
|
|
|
const CvArr* mask CV_DEFAULT(NULL) );
|
|
|
|
|
|
|
|
|
|
*)
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvNormalize(const src: pCvArr; dst: pCvArr; A: double { = CV_DEFAULT(1) }; B: double { =CV_DEFAULT(0.) }; norm_type: Integer { =CV_DEFAULT(CV_L2) };
|
|
|
|
|
const mask: pCvArr = nil); cdecl;
|
2014-12-01 22:46:13 +01:00
|
|
|
|
|
|
|
|
|
|
2013-09-25 21:18:23 +02:00
|
|
|
|
// ****************************************************************************************
|
|
|
|
|
// * Matrix operations
|
|
|
|
|
// ****************************************************************************************
|
|
|
|
|
|
|
|
|
|
// * Calculates cross product of two 3d vectors */
|
|
|
|
|
// CVAPI(void) cvCrossProduct( const CvArr* src1, const CvArr* src2, CvArr* dst );
|
|
|
|
|
procedure cvCrossProduct(const src1: pCvArr; const src2: pCvArr; dst: pCvArr); cdecl;
|
|
|
|
|
|
|
|
|
|
// * Matrix transform: dst = A*B + C, C is optional */
|
|
|
|
|
// #define cvMatMulAdd( src1, src2, src3, dst ) cvGEMM( (src1), (src2), 1., (src3), 1., (dst), 0 )
|
2015-04-23 00:23:04 +02:00
|
|
|
|
procedure cvMatMulAdd(const src1, src2, src3: pCvArr; dst: pCvArr);
|
2013-09-25 21:18:23 +02:00
|
|
|
|
// #define cvMatMul( src1, src2, dst ) cvMatMulAdd( (src1), (src2), NULL, (dst))
|
|
|
|
|
|
|
|
|
|
const
|
|
|
|
|
CV_GEMM_A_T = 1;
|
|
|
|
|
CV_GEMM_B_T = 2;
|
|
|
|
|
CV_GEMM_C_T = 4;
|
|
|
|
|
|
|
|
|
|
// * Extended matrix transform:
|
|
|
|
|
// dst = alpha*op(A)*op(B) + beta*op(C), where op(X) is X or X^T */
|
|
|
|
|
// CVAPI(void) cvGEMM( const CvArr* src1, const CvArr* src2, double alpha,
|
|
|
|
|
// const CvArr* src3, double beta, CvArr* dst,
|
|
|
|
|
// int tABC CV_DEFAULT(0));
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvGEMM(const src1: pCvArr; const src2: pCvArr; alpha: double; const src3: pCvArr; beta: double; dst: pCvArr; tABC: Integer = 0); cdecl;
|
2013-09-25 21:18:23 +02:00
|
|
|
|
// #define cvMatMulAddEx cvGEMM
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvMatMulAddEx(const src1: pCvArr; const src2: pCvArr; alpha: double; const src3: pCvArr; beta: double; dst: pCvArr; tABC: Integer = 0); cdecl;
|
2013-09-25 21:18:23 +02:00
|
|
|
|
|
2017-09-22 22:11:32 +02:00
|
|
|
|
/// * Transforms each element of source array and stores
|
|
|
|
|
// resultant vectors in destination array */
|
|
|
|
|
// CVAPI(void) cvTransform( const CvArr* src, CvArr* dst,
|
|
|
|
|
// const CvMat* transmat,
|
|
|
|
|
// const CvMat* shiftvec CV_DEFAULT(NULL));
|
|
|
|
|
procedure cvTransform(const src: pCvArr; dst: pCvArr; const transmat: pCvMat; const shiftvec: pCvMat = nil); cdecl;
|
|
|
|
|
// #define cvMatMulAddS cvTransform
|
|
|
|
|
procedure cvMatMulAddS(const src: pCvArr; dst: pCvArr; const transmat: pCvMat; const shiftvec: pCvMat = nil); cdecl;
|
|
|
|
|
|
|
|
|
|
/// * Does perspective transform on every element of input array */
|
|
|
|
|
// CVAPI(void) cvPerspectiveTransform( const CvArr* src, CvArr* dst,
|
|
|
|
|
// const CvMat* mat );
|
|
|
|
|
procedure cvPerspectiveTransform(const src: pCvArr; dst: pCvArr; const mat: pCvMat); cdecl;
|
|
|
|
|
|
|
|
|
|
/// * Calculates (A-delta)*(A-delta)^T (order=0) or (A-delta)^T*(A-delta) (order=1) */
|
|
|
|
|
// CVAPI(void) cvMulTransposed( const CvArr* src, CvArr* dst, int order,
|
|
|
|
|
// const CvArr* delta CV_DEFAULT(NULL),
|
|
|
|
|
// double scale CV_DEFAULT(1.) );
|
|
|
|
|
procedure cvMulTransposed(const src: pCvArr; dst: pCvArr; order: Integer; const delta: pCvArr = nil; scale: double = 1); cdecl;
|
|
|
|
|
|
|
|
|
|
/// * Tranposes matrix. Square matrices can be transposed in-place */
|
|
|
|
|
// CVAPI(void) cvTranspose( const CvArr* src, CvArr* dst );
|
|
|
|
|
procedure cvTranspose(const src: pCvArr; dst: pCvArr); cdecl;
|
|
|
|
|
// #define cvT cvTranspose
|
|
|
|
|
procedure cvT(const src: pCvArr; dst: pCvArr); cdecl;
|
|
|
|
|
|
|
|
|
|
/// * Completes the symmetric matrix from the lower (LtoR=0) or from the upper (LtoR!=0) part */
|
|
|
|
|
// CVAPI(void) cvCompleteSymm( CvMat* matrix, int LtoR CV_DEFAULT(0) );
|
|
|
|
|
procedure cvCompleteSymm(matrix: pCvMat; LtoR: Integer = 0); cdecl;
|
|
|
|
|
|
|
|
|
|
const
|
|
|
|
|
CV_SVD_MODIFY_A = 1;
|
2019-08-14 12:21:31 +02:00
|
|
|
|
CV_SVD_U_T = 2;
|
|
|
|
|
CV_SVD_V_T = 4;
|
2017-09-22 22:11:32 +02:00
|
|
|
|
|
|
|
|
|
/// * Performs Singular Value Decomposition of a matrix */
|
|
|
|
|
// CVAPI(void) cvSVD( CvArr* A, CvArr* W, CvArr* U CV_DEFAULT(NULL),
|
|
|
|
|
// CvArr* V CV_DEFAULT(NULL), int flags CV_DEFAULT(0));
|
|
|
|
|
procedure cvSVD(A: pCvArr; W: pCvArr; U: pCvArr = nil; V: pCvArr = nil; flags: Integer = 0); cdecl;
|
|
|
|
|
|
|
|
|
|
/// * Performs Singular Value Back Substitution (solves A*X = B):
|
|
|
|
|
// flags must be the same as in cvSVD */
|
|
|
|
|
// CVAPI(void) cvSVBkSb( const CvArr* W, const CvArr* U,
|
|
|
|
|
// const CvArr* V, const CvArr* B,
|
|
|
|
|
// CvArr* X, int flags );
|
|
|
|
|
procedure cvSVBkSb(const W: pCvArr; const U: pCvArr; const V: pCvArr; const B: pCvArr; x: pCvArr; flags: Integer); cdecl;
|
|
|
|
|
|
2013-09-25 21:18:23 +02:00
|
|
|
|
const
|
2019-08-14 12:21:31 +02:00
|
|
|
|
CV_LU = 0;
|
|
|
|
|
CV_SVD = 1;
|
|
|
|
|
CV_SVD_SYM = 2;
|
2013-09-25 21:18:23 +02:00
|
|
|
|
CV_CHOLESKY = 3;
|
2019-08-14 12:21:31 +02:00
|
|
|
|
CV_QR = 4;
|
|
|
|
|
CV_NORMAL = 16;
|
2013-09-25 21:18:23 +02:00
|
|
|
|
|
|
|
|
|
// * Inverts matrix */
|
|
|
|
|
// CVAPI(double) cvInvert( const CvArr* src, CvArr* dst,
|
|
|
|
|
// int method CV_DEFAULT(CV_LU));
|
|
|
|
|
function cvInvert(const src: pCvArr; dst: pCvArr; method: Integer = CV_LU): double; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
Solves linear system (src1)*(dst) = (src2)
|
|
|
|
|
(returns 0 if src1 is a singular and CV_LU method is used)
|
|
|
|
|
|
|
|
|
|
CVAPI(int) cvSolve( const CvArr* src1, const CvArr* src2, CvArr* dst,
|
|
|
|
|
int method CV_DEFAULT(CV_LU));
|
|
|
|
|
*)
|
|
|
|
|
function cvSolve(const src1: pCvArr; const src2: pCvArr; dst: pCvArr; method: Integer = CV_LU): Integer; cdecl;
|
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Calculates determinant of input matrix
|
|
|
|
|
CVAPI(double) cvDet( const CvArr* mat );
|
|
|
|
|
*)
|
|
|
|
|
function cvDet(const mat: pCvArr): double; cdecl;
|
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Calculates trace of the matrix (sum of elements on the main diagonal)
|
|
|
|
|
CVAPI(CvScalar) cvTrace( const CvArr* mat );
|
|
|
|
|
*)
|
|
|
|
|
function cvTrace(const mat: pCvArr): TCvScalar; cdecl;
|
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Finds eigen values and vectors of a symmetric matrix
|
2017-09-10 01:16:52 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
CVAPI(void) cvEigenVV( CvArr* mat, CvArr* evects, CvArr* evals,
|
|
|
|
|
double eps CV_DEFAULT(0),
|
|
|
|
|
int lowindex CV_DEFAULT(-1),
|
|
|
|
|
int highindex CV_DEFAULT(-1));
|
|
|
|
|
*)
|
2015-03-30 23:02:32 +02:00
|
|
|
|
procedure cvEigenVV(mat: pCvArr; evects: pCvArr; evals: pCvArr; eps: double = 0; lowindex: Integer = -1; highindex: Integer = -1); cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
/// * Finds selected eigen values and vectors of a symmetric matrix */
|
|
|
|
|
// CVAPI(void) cvSelectedEigenVV( CvArr* mat, CvArr* evects, CvArr* evals,
|
|
|
|
|
// int lowindex, int highindex );
|
|
|
|
|
(*
|
|
|
|
|
Makes an identity matrix (mat_ij = i == j)
|
2017-09-10 01:16:52 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
CVAPI(void) cvSetIdentity( CvArr* mat, CvScalar value CV_DEFAULT(cvRealScalar(1)) );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSetIdentity(mat: pCvArr; value: TCvScalar { =cvRealScalar(1) } ); cdecl;
|
|
|
|
|
(*
|
|
|
|
|
Fills matrix with given range of numbers
|
|
|
|
|
|
|
|
|
|
CVAPI(CvArr* ) cvRange( CvArr* mat, double start, double end );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvRange(mat: pCvArr; start: double; end_: double): pCvArr; cdecl;
|
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Calculates covariation matrix for a set of vectors
|
|
|
|
|
|
|
|
|
|
transpose([v1-avg, v2-avg,...]) * [v1-avg,v2-avg,...]
|
|
|
|
|
*)
|
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
const
|
2014-10-18 01:12:32 +02:00
|
|
|
|
CV_COVAR_SCRAMBLED = 0;
|
2019-08-14 12:21:31 +02:00
|
|
|
|
CV_COVAR_NORMAL = 1; // [v1-avg, v2-avg,...] * transpose([v1-avg,v2-avg,...])
|
|
|
|
|
CV_COVAR_USE_AVG = 2; // do not calc average (i.e. mean vector) - use the input vector instead
|
2017-09-10 01:16:52 +02:00
|
|
|
|
/// //////////////////// (useful for calculating covariance matrix by parts)
|
|
|
|
|
CV_COVAR_SCALE = 4; // scale the covariance matrix coefficients by number of the vectors
|
2019-08-14 12:21:31 +02:00
|
|
|
|
CV_COVAR_ROWS = 8; // all the input vectors are stored in a single matrix, as its rows
|
|
|
|
|
CV_COVAR_COLS = 16; // all the input vectors are stored in a single matrix, as its columns
|
2017-09-10 01:16:52 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
CVAPI(void) cvCalcCovarMatrix( const CvArr** vects, int count,
|
|
|
|
|
CvArr* cov_mat, CvArr* avg, int flags );
|
|
|
|
|
*)
|
2015-03-30 23:02:32 +02:00
|
|
|
|
procedure cvCalcCovarMatrix(const vects: pCvArrArray; count: Integer; cov_mat: pCvArr; avg: pCvArr; flags: Integer); cdecl;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
|
|
|
|
|
const
|
|
|
|
|
CV_PCA_DATA_AS_ROW = 0; // #define CV_PCA_DATA_AS_ROW 0
|
|
|
|
|
CV_PCA_DATA_AS_COL = 1; // #define CV_PCA_DATA_AS_COL 1
|
2019-08-14 12:21:31 +02:00
|
|
|
|
CV_PCA_USE_AVG = 2; // #define CV_PCA_USE_AVG 2
|
2017-09-10 01:16:52 +02:00
|
|
|
|
(*
|
|
|
|
|
CVAPI(void) cvCalcPCA( const CvArr* data, CvArr* mean,
|
|
|
|
|
CvArr* eigenvals, CvArr* eigenvects, int flags );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvCalcPCA(const data: pCvArr; mean: pCvArr; eigenvals: pCvArr; eigenvects: pCvArr; flags: Integer); cdecl;
|
|
|
|
|
(*
|
|
|
|
|
CVAPI(void) cvProjectPCA( const CvArr* data, const CvArr* mean,
|
|
|
|
|
const CvArr* eigenvects, CvArr* result );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvProjectPCA(const data: pCvArr; const mean: pCvArr; const eigenvects: pCvArr; result: pCvArr); cdecl;
|
|
|
|
|
(*
|
|
|
|
|
CVAPI(void) cvBackProjectPCA( const CvArr* proj, const CvArr* mean,
|
|
|
|
|
const CvArr* eigenvects, CvArr* result );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvBackProjectPCA(const proj: pCvArr; const mean: pCvArr; const eigenvects: pCvArr; result: pCvArr); cdecl;
|
|
|
|
|
(*
|
|
|
|
|
Calculates Mahalanobis(weighted) distance
|
|
|
|
|
*)
|
|
|
|
|
(*
|
|
|
|
|
CVAPI(double) cvMahalanobis( const CvArr* vec1, const CvArr* vec2, const CvArr* mat );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvMahalanobis(const vec1: pCvArr; const vec2: pCvArr; const mat: pCvArr): double; cdecl;
|
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Calculates mean value of array elements
|
|
|
|
|
|
|
|
|
|
CVAPI(CvScalar) cvAvg( const CvArr* arr, const CvArr* mask CV_DEFAULT(NULL) );
|
|
|
|
|
*)
|
|
|
|
|
function cvAvg(const arr: pCvArr; const mask: pCvArr = nil): TCvScalar; cdecl;
|
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
// (* ***************************************************************************************\
|
|
|
|
|
// * cArray Statistics *
|
|
|
|
|
// *************************************************************************************** *)
|
|
|
|
|
|
2013-09-12 11:49:13 +02:00
|
|
|
|
// * Finds sum of array elements */
|
|
|
|
|
// CVAPI(CvScalar) cvSum( const CvArr* arr );
|
|
|
|
|
function cvSum(const arr: pCvArr): TCvScalar; cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Calculates number of non-zero pixels
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(Integer)cvCountNonZero(pCvArr * arr);
|
|
|
|
|
}
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// function cvCountNonZero(arr: pIplImage): Integer; cdecl; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
function cvCountNonZero(arr: pCvArr): Integer; cdecl; overload;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
|
|
|
|
// * Calculates mean and standard deviation of pixel values */
|
2017-09-07 12:38:44 +02:00
|
|
|
|
procedure cvAvgSdv(const arr: pCvArr; mean: pCvScalar; std_dev: pCvScalar; const mask: pCvArr = nil); cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Finds global minimum, maximum and their positions
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvMinMaxLoc(const pCvArr* arr, double* min_val, double* max_val, CvPoint* min_loc CV_DEFAULT(NULL), CvPoint* max_loc CV_DEFAULT(NULL), const pCvArr* mask CV_DEFAULT(NULL) );
|
|
|
|
|
}
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvMinMaxLoc(const arr: pIplImage; min_val: pDouble; max_val: pDouble; min_loc: pCVPoint = nil; max_loc: pCVPoint = nil;
|
|
|
|
|
// const mask: pIplImage = nil); cdecl; overload;
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvMinMaxLoc(const arr: pCvArr; min_val: pDouble; max_val: pDouble; min_loc: pCVPoint = nil; max_loc: pCVPoint = nil; const mask: pCvArr = nil);
|
|
|
|
|
cdecl; overload;
|
2013-01-07 15:02:10 +01:00
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
const
|
|
|
|
|
CV_REDUCE_SUM = 0;
|
|
|
|
|
CV_REDUCE_AVG = 1;
|
|
|
|
|
CV_REDUCE_MAX = 2;
|
|
|
|
|
CV_REDUCE_MIN = 3;
|
|
|
|
|
|
|
|
|
|
// CVAPI(void) cvReduce( const CvArr* src, CvArr* dst, int dim CV_DEFAULT(-1),
|
|
|
|
|
// int op CV_DEFAULT(CV_REDUCE_SUM) );
|
|
|
|
|
|
|
|
|
|
procedure cvReduce(const src: pCvArr; dst: pCvArr; dim: Integer = -1; op: Integer = CV_REDUCE_SUM); cdecl;
|
|
|
|
|
|
2013-09-25 21:18:23 +02:00
|
|
|
|
// ****************************************************************************************
|
|
|
|
|
// * Discrete Linear Transforms and Related Functions
|
|
|
|
|
// ****************************************************************************************
|
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
const
|
2019-08-14 12:21:31 +02:00
|
|
|
|
CV_DXT_FORWARD = 0;
|
|
|
|
|
CV_DXT_INVERSE = 1;
|
|
|
|
|
CV_DXT_SCALE = 2; // * divide result by size of array */
|
|
|
|
|
CV_DXT_INV_SCALE = (CV_DXT_INVERSE + CV_DXT_SCALE);
|
2013-09-25 21:18:23 +02:00
|
|
|
|
CV_DXT_INVERSE_SCALE = CV_DXT_INV_SCALE;
|
2019-08-14 12:21:31 +02:00
|
|
|
|
CV_DXT_ROWS = 4; // * transform each row individually */
|
|
|
|
|
CV_DXT_MUL_CONJ = 8; // * conjugate the second argument of cvMulSpectrums */
|
2013-09-25 21:18:23 +02:00
|
|
|
|
|
|
|
|
|
// * Discrete Fourier Transform:
|
|
|
|
|
// complex->complex,
|
|
|
|
|
// real->ccs (forward),
|
|
|
|
|
// ccs->real (inverse) */
|
|
|
|
|
// CVAPI(void) cvDFT( const CvArr* src, CvArr* dst, int flags, int nonzero_rows CV_DEFAULT(0) );
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2013-09-25 21:18:23 +02:00
|
|
|
|
procedure cvDFT(const src: pCvArr; dst: pCvArr; flags: Integer; nonzero_rows: Integer = 0); cdecl;
|
|
|
|
|
procedure cvFFT(const src: pCvArr; dst: pCvArr; flags: Integer; nonzero_rows: Integer = 0); cdecl;
|
|
|
|
|
|
|
|
|
|
// #define cvFFT cvDFT
|
|
|
|
|
|
|
|
|
|
// * Multiply results of DFTs: DFT(X) * DFT(Y) or DFT(X) * conj(DFT(Y)) */
|
|
|
|
|
// CVAPI(void) cvMulSpectrums(const CvArr * src1, const CvArr * src2, CvArr * dst, int flags);
|
|
|
|
|
procedure cvMulSpectrums(const src1: pCvArr; const src2: pCvArr; dst: pCvArr; flags: Integer); cdecl;
|
|
|
|
|
|
|
|
|
|
// * Finds optimal DFT vector size >= size0 */
|
|
|
|
|
// CVAPI(int)cvGetOptimalDFTSize(int size0);
|
|
|
|
|
function cvGetOptimalDFTSize(size0: Integer): Integer; cdecl;
|
|
|
|
|
|
|
|
|
|
/// * Discrete Cosine Transform */
|
|
|
|
|
// CVAPI(void)cvDCT(const CvArr * src, CvArr * dst, int flags);
|
|
|
|
|
procedure cvDCT(const src: pCvArr; dst: pCvArr; flags: Integer); cdecl;
|
|
|
|
|
|
2013-01-07 15:02:10 +01:00
|
|
|
|
// ****************************************************************************************
|
|
|
|
|
// * Dynamic data structures *
|
|
|
|
|
// ****************************************************************************************
|
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
Calculates length of sequence slice (with support of negative indices).
|
|
|
|
|
|
|
|
|
|
CVAPI(int) cvSliceLength( CvSlice slice, const CvSeq* seq );
|
|
|
|
|
*)
|
|
|
|
|
function cvSliceLength(slice: TCvSlice; const seq: pCvSeq): Integer; cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Creates new memory storage.
|
2013-04-16 08:40:44 +02:00
|
|
|
|
block_size == 0 means that default,
|
|
|
|
|
somewhat optimal size, is used (currently, it is 64K)
|
|
|
|
|
CVAPI(CvMemStorage*) cvCreateMemStorage( int block_size CV_DEFAULT(0));
|
2013-01-07 15:02:10 +01:00
|
|
|
|
}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvCreateMemStorage(block_size: Integer = 0): pCvMemStorage; cdecl;
|
2013-01-07 15:02:10 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Creates a memory storage that will borrow memory blocks from parent storage
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(CvMemStorage*) cvCreateChildMemStorage( CvMemStorage* parent );
|
|
|
|
|
}
|
2014-05-19 21:29:48 +02:00
|
|
|
|
function cvCreateChildMemStorage(parent: pCvMemStorage): pCvMemStorage; cdecl;
|
2013-01-07 15:02:10 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Releases memory storage. All the children of a parent must be released before
|
2013-04-15 18:14:12 +02:00
|
|
|
|
the parent. A child storage returns all the blocks to parent when it is released
|
2013-03-23 18:01:36 +01:00
|
|
|
|
CVAPI(void) cvReleaseMemStorage( CvMemStorage** storage );
|
2013-01-07 15:02:10 +01:00
|
|
|
|
}
|
|
|
|
|
procedure cvReleaseMemStorage(var storage: pCvMemStorage); cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Clears memory storage. This is the only way(!!!) (besides cvRestoreMemStoragePos)
|
2013-04-15 18:14:12 +02:00
|
|
|
|
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
|
|
|
|
|
CVAPI(void) cvClearMemStorage( CvMemStorage* storage );
|
|
|
|
|
}
|
2013-04-05 22:58:24 +02:00
|
|
|
|
procedure cvClearMemStorage(storage: pCvMemStorage); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
Allocates continuous buffer of the specified size in the storage
|
|
|
|
|
|
|
|
|
|
CVAPI(void* ) cvMemStorageAlloc( CvMemStorage* storage, size_t size );
|
|
|
|
|
*)
|
|
|
|
|
function cvMemStorageAlloc(storage: pCvMemStorage; size: size_t): Pointer; cdecl;
|
|
|
|
|
(*
|
|
|
|
|
Allocates string in memory storage
|
|
|
|
|
|
|
|
|
|
CVAPI(CvString) cvMemStorageAllocString( CvMemStorage* storage, const char* ptr,
|
|
|
|
|
int len CV_DEFAULT(-1) );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvMemStorageAllocString(storage: pCvMemStorage; const ptr: pCvChar; len: Integer = -1): TCvString; cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Creates new empty sequence that will reside in the specified storage
|
2013-04-05 13:36:47 +02:00
|
|
|
|
CVAPI(CvSeq*) cvCreateSeq( int seq_flags, size_t header_size,
|
|
|
|
|
size_t elem_size, CvMemStorage* storage );
|
|
|
|
|
}
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvCreateSeq(seq_flags: Integer; header_size: NativeUInt; elem_size: NativeUInt; storage: pCvMemStorage): pCvSeq; cdecl;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
// Removes specified sequence element
|
2013-04-14 19:17:55 +02:00
|
|
|
|
// CVAPI(void) cvSeqRemove( CvSeq* seq, int index );
|
2013-04-16 08:40:44 +02:00
|
|
|
|
procedure cvSeqRemove(seq: pCvSeq; index: Integer); cdecl;
|
2013-04-14 19:17:55 +02:00
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
// or cvRestoreMemStoragePos is called
|
2013-04-14 19:17:55 +02:00
|
|
|
|
// CVAPI(void) cvClearSeq( CvSeq* seq );
|
|
|
|
|
procedure cvClearSeq(seq: pCvSeq); cdecl;
|
2013-01-07 15:02:10 +01:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Adds new element to the end of sequence. Returns pointer to the element
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(schar*) cvSeqPush( CvSeq* seq, const void* element CV_DEFAULT(NULL));
|
|
|
|
|
}
|
2013-09-25 21:18:23 +02:00
|
|
|
|
function cvSeqPush(seq: pCvSeq; const element: Pointer = nil): Pointer; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
Adds new element to the beginning of sequence. Returns pointer to it
|
|
|
|
|
|
|
|
|
|
CVAPI(schar* ) cvSeqPushFront( CvSeq* seq, const void* element CV_DEFAULT(NULL));
|
|
|
|
|
*)
|
|
|
|
|
function cvSeqPushFront(seq: pCvSeq; const element: Pointer = nil): pschar; cdecl;
|
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Inserts a new element in the middle of sequence.
|
|
|
|
|
cvSeqInsert(seq,0,elem) == cvSeqPushFront(seq,elem)
|
|
|
|
|
|
|
|
|
|
CVAPI(schar* ) cvSeqInsert( CvSeq* seq, int before_index,
|
|
|
|
|
const void* element CV_DEFAULT(NULL));
|
|
|
|
|
*)
|
|
|
|
|
function cvSeqInsert(seq: pCvSeq; before_index: Integer; const element: Pointer = nil): pschar; cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Retrieves pointer to specified sequence element.
|
2013-03-23 18:01:36 +01:00
|
|
|
|
Negative indices are supported and mean counting from the end
|
2013-04-15 18:14:12 +02:00
|
|
|
|
(e.g -1 means the last sequence element)
|
2013-03-23 18:01:36 +01:00
|
|
|
|
CVAPI(schar*) cvGetSeqElem( const CvSeq* seq, int index );
|
2013-01-07 15:02:10 +01:00
|
|
|
|
}
|
2013-09-25 21:18:23 +02:00
|
|
|
|
function cvGetSeqElem(const seq: pCvSeq; index: Integer): Pointer; cdecl;
|
2013-01-07 15:02:10 +01:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
Calculates index of the specified sequence element.
|
|
|
|
|
Returns -1 if element does not belong to the sequence
|
|
|
|
|
|
|
|
|
|
CVAPI(int) cvSeqElemIdx( const CvSeq* seq, const void* element,
|
|
|
|
|
CvSeqBlock** block CV_DEFAULT(NULL) );
|
|
|
|
|
*)
|
|
|
|
|
function cvSeqElemIdx(const seq: pCvSeq; const element: Pointer; block: pCvSeqBlockArray = nil): Integer; cdecl;
|
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Closes sequence writer, updates sequence header and returns pointer
|
|
|
|
|
to the resultant sequence
|
|
|
|
|
(which may be useful if the sequence was created using cvStartWriteSeq))
|
|
|
|
|
|
|
|
|
|
CVAPI(CvSeq* cvEndWriteSeq( CvSeqWriter* writer );
|
|
|
|
|
*)
|
|
|
|
|
function cvEndWriteSeq(writer: pCvSeqWriter): pCvSeq; cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Initializes sequence reader.
|
2013-04-15 18:14:12 +02:00
|
|
|
|
The sequence can be read in forward or backward direction
|
|
|
|
|
CVAPI(void) cvStartReadSeq( const CvSeq* seq, CvSeqReader* reader, int reverse CV_DEFAULT(0) );
|
2013-04-05 13:36:47 +02:00
|
|
|
|
}
|
2013-09-25 21:18:23 +02:00
|
|
|
|
procedure cvStartReadSeq(const seq: Pointer; reader: pCvSeqReader; reverse: Integer = 0); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
Returns current sequence reader position (currently observed sequence element)
|
|
|
|
|
|
|
|
|
|
CVAPI(int) cvGetSeqReaderPos( CvSeqReader* reader );
|
|
|
|
|
*)
|
|
|
|
|
function cvGetSeqReaderPos(reader: pCvSeqReader): Integer; cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Copies sequence content to a continuous piece of memory
|
|
|
|
|
CVAPI(void*) cvCvtSeqToArray( const CvSeq* seq, void* elements, CvSlice slice CV_DEFAULT(CV_WHOLE_SEQ)); }
|
|
|
|
|
procedure cvCvtSeqToArray(const seq: pCvSeq; elements: pCvArr; slice: TCvSlice { =CV_WHOLE_SEQ } ); cdecl;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
Creates sequence header for array.
|
|
|
|
|
After that all the operations on sequences that do not alter the content
|
|
|
|
|
can be applied to the resultant sequence
|
|
|
|
|
|
|
|
|
|
CVAPI(CvSeq* ) cvMakeSeqHeaderForArray( int seq_type, int header_size,
|
|
|
|
|
int elem_size, void* elements, int total,
|
|
|
|
|
CvSeq* seq, CvSeqBlock* block );
|
|
|
|
|
*)
|
2019-08-14 12:21:31 +02:00
|
|
|
|
function cvMakeSeqHeaderForArray(seq_type: Integer; header_size: Integer; elem_size: Integer; elements: Pointer; total: Integer; seq: pCvSeq;
|
|
|
|
|
block: pCvSeqBlock): pCvSeq; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Extracts sequence slice (with or without copying sequence elements)
|
|
|
|
|
|
|
|
|
|
CVAPI(CvSeq* ) cvSeqSlice( const CvSeq* seq, CvSlice slice,
|
|
|
|
|
CvMemStorage* storage CV_DEFAULT(NULL),
|
|
|
|
|
int copy_data CV_DEFAULT(0));
|
|
|
|
|
*)
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvSeqSlice(const seq: pCvSeq; slice: TCvSlice; storage: pCvMemStorage = nil; copy_data: Integer = 0): pCvSeq; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
2013-04-05 13:36:47 +02:00
|
|
|
|
// ************ Internal sequence functions ************/
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2013-04-05 13:36:47 +02:00
|
|
|
|
// CVAPI(void) cvChangeSeqBlock( void* reader, int direction );
|
|
|
|
|
procedure cvChangeSeqBlock(reader: pCvSeqReader; direction: Integer); cdecl;
|
|
|
|
|
// CVAPI(void) cvCreateSeqBlock( CvSeqWriter* writer );
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2013-04-05 13:36:47 +02:00
|
|
|
|
procedure cvCreateSeqBlock(writer: pCvSeqWriter); cdecl;
|
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
Creates a new set
|
|
|
|
|
|
|
|
|
|
CVAPI(CvSet* ) cvCreateSet( int set_flags, int header_size,
|
|
|
|
|
int elem_size, CvMemStorage* storage );
|
|
|
|
|
*)
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvCreateSet(set_flags: Integer; header_size: Integer; elem_size: Integer; storage: pCvMemStorage): pCvSet; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Creates new graph
|
|
|
|
|
|
|
|
|
|
CVAPI(CvGraph* ) cvCreateGraph( int graph_flags, int header_size,
|
|
|
|
|
int vtx_size, int edge_size,
|
|
|
|
|
CvMemStorage* storage );
|
|
|
|
|
*)
|
2019-08-14 12:21:31 +02:00
|
|
|
|
function cvCreateGraph(graph_flags: Integer; header_size: Integer; vtx_size: Integer; edge_size: Integer; storage: pCvMemStorage): pCvGraph; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Adds new vertex to the graph
|
|
|
|
|
|
|
|
|
|
CVAPI(int) cvGraphAddVtx( CvGraph* graph, const CvGraphVtx* vtx CV_DEFAULT(NULL),
|
|
|
|
|
CvGraphVtx** inserted_vtx CV_DEFAULT(NULL) );
|
|
|
|
|
*)
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvGraphAddVtx(graph: pCvGraph; const vtx: pCvGraphVtx = nil; inserted_vtx: pCvGraphVtxArray = nil): Integer; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Removes vertex from the graph together with all incident edges
|
|
|
|
|
|
|
|
|
|
CVAPI(int) cvGraphRemoveVtx( CvGraph* graph, int index );
|
|
|
|
|
*)
|
|
|
|
|
function cvGraphRemoveVtx(graph: pCvGraph; index: Integer): Integer; cdecl;
|
|
|
|
|
(*
|
|
|
|
|
CVAPI(int) cvGraphRemoveVtxByPtr( CvGraph* graph, CvGraphVtx* vtx );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvGraphRemoveVtxByPtr(graph: pCvGraph; vtx: pCvGraphVtx): Integer; cdecl;
|
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Link two vertices specifed by indices or pointers if they
|
|
|
|
|
are not connected or return pointer to already existing edge
|
|
|
|
|
connecting the vertices.
|
|
|
|
|
Functions return 1 if a new edge was created, 0 otherwise
|
|
|
|
|
*)
|
|
|
|
|
(*
|
|
|
|
|
CVAPI(int) cvGraphAddEdge( CvGraph* graph,
|
|
|
|
|
int start_idx, int end_idx,
|
|
|
|
|
const CvGraphEdge* edge CV_DEFAULT(NULL),
|
|
|
|
|
CvGraphEdge** inserted_edge CV_DEFAULT(NULL) );
|
|
|
|
|
*)
|
2019-08-14 12:21:31 +02:00
|
|
|
|
function cvGraphAddEdge(graph: pCvGraph; start_idx: Integer; end_idx: Integer; const edge: pCvGraphEdge = nil; inserted_edge: pCvGraphEdgeArray = nil)
|
|
|
|
|
: Integer; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
CVAPI(int) cvGraphAddEdgeByPtr( CvGraph* graph,
|
|
|
|
|
CvGraphVtx* start_vtx, CvGraphVtx* end_vtx,
|
|
|
|
|
const CvGraphEdge* edge CV_DEFAULT(NULL),
|
|
|
|
|
CvGraphEdge** inserted_edge CV_DEFAULT(NULL) );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvGraphAddEdgeByPtr(graph: pCvGraph; start_vtx: pCvGraphVtx; end_vtx: pCvGraphVtx; const edge: pCvGraphEdge = nil;
|
|
|
|
|
inserted_edge: pCvGraphEdgeArray = nil): Integer; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
Remove edge connecting two vertices
|
|
|
|
|
|
|
|
|
|
CVAPI(void) cvGraphRemoveEdge( CvGraph* graph, int start_idx, int end_idx );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvGraphRemoveEdge(graph: pCvGraph; start_idx: Integer; end_idx: Integer); cdecl;
|
|
|
|
|
(*
|
|
|
|
|
CVAPI(void) cvGraphRemoveEdgeByPtr( CvGraph* graph, CvGraphVtx* start_vtx,
|
|
|
|
|
CvGraphVtx* end_vtx );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvGraphRemoveEdgeByPtr(graph: pCvGraph; start_vtx: pCvGraphVtx; end_vtx: pCvGraphVtx); cdecl;
|
|
|
|
|
(*
|
|
|
|
|
Find edge connecting two vertices
|
|
|
|
|
|
|
|
|
|
CVAPI(CvGraphEdge* ) cvFindGraphEdge( const CvGraph* graph, int start_idx, int end_idx );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvFindGraphEdge(const graph: pCvGraph; start_idx: Integer; end_idx: Integer): pCvGraphEdge; cdecl;
|
|
|
|
|
(*
|
|
|
|
|
CVAPI(CvGraphEdge* ) cvFindGraphEdgeByPtr( const CvGraph* graph,
|
|
|
|
|
const CvGraphVtx* start_vtx,
|
|
|
|
|
const CvGraphVtx* end_vtx );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvFindGraphEdgeByPtr(const graph: pCvGraph; const start_vtx: pCvGraphVtx; const end_vtx: pCvGraphVtx): pCvGraphEdge; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
// #define cvGraphFindEdge cvFindGraphEdge
|
|
|
|
|
// #define cvGraphFindEdgeByPtr cvFindGraphEdgeByPtr
|
|
|
|
|
(*
|
|
|
|
|
Remove all vertices and edges from the graph
|
|
|
|
|
|
|
|
|
|
CVAPI(void) cvClearGraph( CvGraph* graph );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvClearGraph(graph: pCvGraph); cdecl;
|
|
|
|
|
(*
|
|
|
|
|
Count number of edges incident to the vertex
|
|
|
|
|
|
|
|
|
|
CVAPI(int) cvGraphVtxDegree( const CvGraph* graph, int vtx_idx );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvGraphVtxDegree(const graph: pCvGraph; vtx_idx: Integer): Integer; cdecl;
|
|
|
|
|
(*
|
|
|
|
|
CVAPI(int) cvGraphVtxDegreeByPtr( const CvGraph* graph, const CvGraphVtx* vtx );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvGraphVtxDegreeByPtr(const graph: pCvGraph; const vtx: pCvGraphVtx): Integer; cdecl;
|
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Retrieves graph vertex by given index
|
|
|
|
|
|
|
|
|
|
#define cvGetGraphVtx( graph, idx ) (CvGraphVtx* )cvGetSetElem((CvSet* )(graph), (idx))
|
|
|
|
|
*)
|
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Retrieves index of a graph vertex given its pointer
|
|
|
|
|
#define cvGraphVtxIdx( graph, vtx ) ((vtx)->flags & CV_SET_ELEM_IDX_MASK)
|
|
|
|
|
*)
|
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Retrieves index of a graph edge given its pointer
|
|
|
|
|
|
|
|
|
|
#define cvGraphEdgeIdx( graph, edge ) ((edge)->flags & CV_SET_ELEM_IDX_MASK)
|
|
|
|
|
#define cvGraphGetVtxCount( graph ) ((graph)->active_count)
|
|
|
|
|
#define cvGraphGetEdgeCount( graph ) ((graph)->edges->active_count)
|
|
|
|
|
*)
|
|
|
|
|
|
|
|
|
|
const
|
2019-08-14 12:21:31 +02:00
|
|
|
|
CV_GRAPH_VERTEX = 1;
|
|
|
|
|
CV_GRAPH_TREE_EDGE = 2;
|
|
|
|
|
CV_GRAPH_BACK_EDGE = 4;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
CV_GRAPH_FORWARD_EDGE = 8;
|
2019-08-14 12:21:31 +02:00
|
|
|
|
CV_GRAPH_CROSS_EDGE = 16;
|
|
|
|
|
CV_GRAPH_ANY_EDGE = 30;
|
|
|
|
|
CV_GRAPH_NEW_TREE = 32;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
CV_GRAPH_BACKTRACKING = 64;
|
2019-08-14 12:21:31 +02:00
|
|
|
|
CV_GRAPH_OVER = -1;
|
|
|
|
|
CV_GRAPH_ALL_ITEMS = -1;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
flags for graph vertices and edges
|
|
|
|
|
*)
|
|
|
|
|
CV_GRAPH_ITEM_VISITED_FLAG = (1 shl 30);
|
|
|
|
|
|
|
|
|
|
// #define CV_IS_GRAPH_VERTEX_VISITED(vtx) \
|
|
|
|
|
// (((CvGraphVtx*)(vtx))->flags & CV_GRAPH_ITEM_VISITED_FLAG)
|
|
|
|
|
// #define CV_IS_GRAPH_EDGE_VISITED(edge) \
|
|
|
|
|
// (((CvGraphEdge*)(edge))->flags & CV_GRAPH_ITEM_VISITED_FLAG)
|
|
|
|
|
|
|
|
|
|
CV_GRAPH_SEARCH_TREE_NODE_FLAG = (1 shl 29);
|
2019-08-14 12:21:31 +02:00
|
|
|
|
CV_GRAPH_FORWARD_EDGE_FLAG = (1 shl 28);
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
type
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(* typedef struct CvGraphScanner
|
|
|
|
|
{
|
|
|
|
|
CvGraphVtx* vtx; /* current graph vertex (or current edge origin) */
|
|
|
|
|
CvGraphVtx* dst; /* current graph edge destination vertex */
|
|
|
|
|
CvGraphEdge* edge; /* current edge */
|
|
|
|
|
|
|
|
|
|
CvGraph* graph; /* the graph */
|
|
|
|
|
CvSeq* stack; /* the graph vertex stack */
|
|
|
|
|
int index; /* the lower bound of certainly visited vertices */
|
|
|
|
|
int mask; /* event mask */
|
|
|
|
|
} CvGraphScanner; *)
|
|
|
|
|
|
|
|
|
|
pCvGraphScanner = ^TCvGraphScanner;
|
|
|
|
|
|
|
|
|
|
TCvGraphScanner = record
|
|
|
|
|
vtx: pCvGraphVtx; (* current graph vertex (or current edge origin) *)
|
|
|
|
|
dst: pCvGraphVtx; (* current graph edge destination vertex *)
|
|
|
|
|
edge: pCvGraphEdge; (* current edge *)
|
|
|
|
|
graph: pCvGraph; (* the graph *)
|
|
|
|
|
stack: pCvSeq; (* the graph vertex stack *)
|
|
|
|
|
index: Integer; (* the lower bound of certainly visited vertices *)
|
|
|
|
|
mask: Integer; (* event mask *)
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Creates new graph scanner.
|
|
|
|
|
|
|
|
|
|
CVAPI(CvGraphScanner * ) cvCreateGraphScanner(CvGraph * graph, CvGraphVtx * vtx CV_DEFAULT(NULL), int mask CV_DEFAULT(CV_GRAPH_ALL_ITEMS));
|
|
|
|
|
*)
|
|
|
|
|
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvCreateGraphScanner(graph: pCvGraph; vtx: pCvGraphVtx = nil; mask: Integer = CV_GRAPH_ALL_ITEMS): pCvGraphScanner; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
Releases graph scanner.
|
|
|
|
|
|
|
|
|
|
CVAPI(void) cvReleaseGraphScanner( CvGraphScanner** scanner );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
|
|
|
|
procedure cvReleaseGraphScanner(var scanner: pCvGraphScanner); cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Get next graph element
|
|
|
|
|
|
|
|
|
|
CVAPI(int) cvNextGraphItem( CvGraphScanner* scanner );
|
|
|
|
|
*)
|
|
|
|
|
function cvNextGraphItem(scanner: pCvGraphScanner): Integer; cdecl;
|
|
|
|
|
(*
|
|
|
|
|
Creates a copy of graph
|
|
|
|
|
|
|
|
|
|
CVAPI(CvGraph* ) cvCloneGraph( const CvGraph* graph, CvMemStorage* storage );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvCloneGraph(const graph: pCvGraph; storage: pCvMemStorage): pCvGraph; cdecl;
|
|
|
|
|
|
2015-10-05 18:46:36 +02:00
|
|
|
|
(* Does look-up transformation. Elements of the source array
|
|
|
|
|
(that should be 8uC1 or 8sC1) are used as indexes in lutarr 256-element table
|
|
|
|
|
|
|
|
|
|
CVAPI(void) cvLUT( const CvArr* src, CvArr* dst, const CvArr* lut );
|
|
|
|
|
|
|
|
|
|
*)
|
|
|
|
|
procedure cvLUT(const src: pCvArr; dst: pCvArr; const lut: pCvArr); cdecl;
|
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
Adds new element to the set and returns pointer to it
|
|
|
|
|
|
|
|
|
|
CVAPI(int) cvSetAdd( CvSet* set_header, CvSetElem* elem CV_DEFAULT(NULL),
|
|
|
|
|
CvSetElem** inserted_elem CV_DEFAULT(NULL) );
|
|
|
|
|
*)
|
|
|
|
|
function cvSetAdd(set_header: pCvSet; elem: pCvSetElem = nil; inserted_elem: pCvSetElemArray = nil): Integer; cdecl;
|
|
|
|
|
|
2013-09-16 13:49:10 +02:00
|
|
|
|
// * writes an integer */
|
|
|
|
|
// CVAPI(void) cvWriteInt( CvFileStorage* fs, const char* name, int value );
|
|
|
|
|
procedure cvWriteInt(fs: pCvFileStorage; const name: pCvChar; value: Integer); cdecl;
|
|
|
|
|
|
|
|
|
|
// * writes a floating-point number */
|
|
|
|
|
// CVAPI(void) cvWriteReal( CvFileStorage* fs, const char* name, double value );
|
|
|
|
|
procedure cvWriteReal(fs: pCvFileStorage; const name: pCvChar; value: double); cdecl;
|
|
|
|
|
|
|
|
|
|
// * writes a string */
|
|
|
|
|
// CVAPI(void) cvWriteString( CvFileStorage* fs, const char* name,const char* str, int quote CV_DEFAULT(0) );
|
|
|
|
|
procedure cvWriteString(fs: pCvFileStorage; const name: pCvChar; const str: pCvChar; quote: Integer = 0); cdecl;
|
|
|
|
|
|
|
|
|
|
// * writes a comment */
|
|
|
|
|
// CVAPI(void) cvWriteComment( CvFileStorage* fs, const char* comment,int eol_comment );
|
|
|
|
|
procedure cvWriteComment(fs: pCvFileStorage; const comment: pCvChar; eol_comment: Integer); cdecl;
|
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
// writes instance of a standard type (matrix, image, sequence, graph etc.)
|
|
|
|
|
// or user-defined type */
|
|
|
|
|
// CVAPI(void) cvWrite( CvFileStorage* fs, const char* name, const void* ptr,
|
|
|
|
|
// CvAttrList attributes CV_DEFAULT(cvAttrList()));
|
2015-03-30 23:02:32 +02:00
|
|
|
|
procedure cvWrite(fs: pCvFileStorage; const name: pCvChar; const ptr: pCvArr; attributes: TCvAttrList { = cvAttrList() } ); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
starts the next stream
|
|
|
|
|
|
|
|
|
|
CVAPI(void) cvStartNextStream( CvFileStorage* fs );
|
|
|
|
|
*)
|
|
|
|
|
procedure cvStartNextStream(fs: pCvFileStorage); cdecl;
|
|
|
|
|
(*
|
|
|
|
|
helper function: writes multiple integer or floating-point numbers
|
|
|
|
|
|
|
|
|
|
CVAPI(void) cvWriteRawData( CvFileStorage* fs, const void* src,
|
|
|
|
|
int len, const char* dt );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvWriteRawData(fs: pCvFileStorage; const src: Pointer; len: Integer; const dt: pCvChar); cdecl;
|
|
|
|
|
(*
|
|
|
|
|
returns the hash entry corresponding to the specified literal key string or 0
|
|
|
|
|
if there is no such a key in the storage
|
|
|
|
|
|
|
|
|
|
CVAPI(CvStringHashNode* ) cvGetHashedKey( CvFileStorage* fs, const char* name,
|
|
|
|
|
int len CV_DEFAULT(-1),
|
|
|
|
|
int create_missing CV_DEFAULT(0));
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvGetHashedKey(fs: pCvFileStorage; const name: pCvChar; len: Integer = -1; create_missing: Integer = 0): pCvStringHashNode; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
returns file node with the specified key within the specified map
|
|
|
|
|
(collection of named nodes)
|
|
|
|
|
|
|
|
|
|
CVAPI(CvFileNode* ) cvGetRootFileNode( const CvFileStorage* fs,
|
|
|
|
|
int stream_index CV_DEFAULT(0) );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvGetRootFileNode(const fs: pCvFileStorage; stream_index: Integer = 0): pCvFileNode; cdecl;
|
|
|
|
|
(*
|
|
|
|
|
returns file node with the specified key within the specified map
|
|
|
|
|
(collection of named nodes)
|
|
|
|
|
|
|
|
|
|
CVAPI(CvFileNode* cvGetFileNode( CvFileStorage* fs, CvFileNode* map,
|
|
|
|
|
const CvStringHashNode* key,
|
|
|
|
|
int create_missing CV_DEFAULT(0) );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvGetFileNode(fs: pCvFileStorage; map: pCvFileNode; const key: pCvStringHashNode; create_missing: Integer = 0): pCvFileNode; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
type
|
2013-09-25 21:18:23 +02:00
|
|
|
|
TCvCmpFunc = function(const A: Pointer; const B: Pointer; userdata: Pointer): Integer; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvSeqPartition(const seq: pCvSeq; storage: pCvMemStorage; labels: pCvSeq; is_equal: TCvCmpFunc; userdata: Pointer): Integer; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
Finds element in a [sorted] sequence
|
|
|
|
|
|
|
|
|
|
CVAPI(schar* ) cvSeqSearch( CvSeq* seq, const void* elem, CvCmpFunc func,
|
|
|
|
|
int is_sorted, int* elem_idx,
|
|
|
|
|
void* userdata CV_DEFAULT(NULL) );
|
|
|
|
|
*)
|
2019-08-14 12:21:31 +02:00
|
|
|
|
function cvSeqSearch(seq: pCvSeq; const elem: Pointer; func: TCvCmpFunc; is_sorted: Integer; elem_idx: pInteger; userdata: Pointer = nil): pschar; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{ ****************************************************************************************
|
|
|
|
|
* Drawing *
|
|
|
|
|
**************************************************************************************** }
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
|
|
|
|
// Following declaration is a macro definition!
|
2017-09-07 12:38:44 +02:00
|
|
|
|
function CV_RGB(const r, g, B: double): TCvScalar; {$IFDEF USE_INLINE} inline; {$ENDIF}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
|
|
|
|
const
|
|
|
|
|
CV_FILLED = -1;
|
2013-04-16 08:40:44 +02:00
|
|
|
|
{$EXTERNALSYM CV_FILLED}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
CV_AA = 16;
|
2013-04-16 08:40:44 +02:00
|
|
|
|
{$EXTERNALSYM CV_AA}
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ procedure cvLine(8: v1: ); shift CV_DEFAULT(0): Integer): Integer;
|
2013-04-16 08:40:44 +02:00
|
|
|
|
CVAPI(void) cvLine( pCvArr* img, CvPoint pt1, CvPoint pt2,
|
|
|
|
|
CvScalar color, int thickness CV_DEFAULT(1),
|
|
|
|
|
int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0) );
|
|
|
|
|
}
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvLine(img: pCvArr; pt1, pt2: TCvPoint; color: TCvScalar; thickness: Integer = 1; line_type: Integer = 8; shift: Integer = 0); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Draws a rectangle specified by a CvRect structure
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvRectangleR(8: v1: ); shift CV_DEFAULT(0): Integer): Integer;
|
|
|
|
|
}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvRectangle(img: pCvArr; pt1: TCvPoint; pt2: TCvPoint; color: TCvScalar; thickness: Integer = 1; line_type: Integer = 8; shift: Integer = 0); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Draws a circle with specified center and radius.
|
2013-04-15 18:14:12 +02:00
|
|
|
|
Thickness works in the same way as with cvRectangle
|
|
|
|
|
CVAPI(void) cvCircle( pCvArr* img, CvPoint center, int radius,
|
|
|
|
|
CvScalar color, int thickness CV_DEFAULT(1), int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0));
|
2013-01-01 13:29:34 +01:00
|
|
|
|
}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvCircle(img: pCvArr; center: TCvPoint; radius: Integer; color: TCvScalar; thickness: Integer = 1; line_type: Integer = 8; shift: Integer = 0); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Draws ellipse outline, filled ellipse, elliptic arc or filled elliptic sector,
|
2013-04-05 13:36:47 +02:00
|
|
|
|
depending on <thickness>, <start_angle> and <end_angle> parameters. The resultant figure
|
2013-04-15 18:14:12 +02:00
|
|
|
|
is rotated by <angle>. All the angles are in degrees
|
2017-09-12 15:30:23 +02:00
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvEllipse( pCvArr* img, CvPoint center, CvSize axes,
|
2013-04-05 13:36:47 +02:00
|
|
|
|
double angle, double start_angle, double end_angle,
|
|
|
|
|
CvScalar color, int thickness CV_DEFAULT(1),
|
|
|
|
|
int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0));
|
|
|
|
|
}
|
2017-09-12 15:30:23 +02:00
|
|
|
|
procedure cvEllipse(img: pCvArr; center: TCvPoint; axes: TCvSize; angle: double; start_angle: double; nd_angle: double; color: TCvScalar;
|
2015-03-30 23:02:32 +02:00
|
|
|
|
thickness: Integer = 1; line_type: Integer = 8; shift: Integer = 0); cdecl;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ CV_INLINE void cvEllipseBox( pCvArr* img, CvBox2D box, CvScalar color,
|
2013-04-05 13:36:47 +02:00
|
|
|
|
int thickness CV_DEFAULT(1),
|
|
|
|
|
int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0) )
|
|
|
|
|
{
|
|
|
|
|
CvSize axes;
|
|
|
|
|
axes.width = cvRound(box.size.width*0.5);
|
|
|
|
|
axes.height = cvRound(box.size.height*0.5);
|
|
|
|
|
cvEllipse( img, cvPointFrom32f( box.center ), axes, box.angle,
|
|
|
|
|
0, 360, color, thickness, line_type, shift );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2017-09-12 15:30:23 +02:00
|
|
|
|
procedure cvEllipseBox(img: pCvArr; box: TCvBox2D; color: TCvScalar; thickness: Integer = 1; line_type: Integer = 8; shift: Integer = 0);
|
2017-09-07 12:38:44 +02:00
|
|
|
|
{$IFDEF USE_INLINE} inline; {$ENDIF}
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Fills convex or monotonous polygon.
|
2013-04-16 08:40:44 +02:00
|
|
|
|
CVAPI(void) cvFillConvexPoly( pCvArr* img, const CvPoint* pts, int npts, CvScalar color,
|
|
|
|
|
int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0));
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvFillConvexPoly(img: pCvArr; const pts: pCVPoint; npts: Integer; color: TCvScalar; line_type: Integer = 8; shift: Integer = 0); cdecl;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Draws one or more polygonal curves
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvPolyLine( pCvArr* img, CvPoint** pts, const int* npts, int contours,
|
2013-04-05 13:36:47 +02:00
|
|
|
|
int is_closed, CvScalar color, int thickness CV_DEFAULT(1),
|
|
|
|
|
int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0) );
|
|
|
|
|
}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvPolyLine(img: pCvArr; pts: pCVPoint; const npts: pInteger; contours: Integer; is_closed: Integer; color: TCvScalar; thickness: Integer = 1;
|
|
|
|
|
line_type: Integer = 8; shift: Integer = 0); cdecl;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
Clips the line segment connecting *pt1 and *pt2
|
|
|
|
|
by the rectangular window
|
|
|
|
|
(0<=x<img_size.width, 0<=y<img_size.height).
|
|
|
|
|
|
|
|
|
|
CVAPI(int) cvClipLine( CvSize img_size, CvPoint* pt1, CvPoint* pt2 );
|
|
|
|
|
*)
|
|
|
|
|
function cvClipLine(img_size: TCvSize; pt1: pCVPoint; pt2: pCVPoint): Integer; cdecl;
|
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Initializes line iterator. Initially, line_iterator->ptr will point
|
|
|
|
|
to pt1 (or pt2, see left_to_right description) location in the image.
|
|
|
|
|
Returns the number of pixels on the line between the ending points.
|
|
|
|
|
|
|
|
|
|
CVAPI(int) cvInitLineIterator( const CvArr* image, CvPoint pt1, CvPoint pt2,
|
|
|
|
|
CvLineIterator* line_iterator,
|
|
|
|
|
int connectivity CV_DEFAULT(8),
|
|
|
|
|
int left_to_right CV_DEFAULT(0));
|
|
|
|
|
*)
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvInitLineIterator(const image: pCvArr; pt1: TCvPoint; pt2: TCvPoint; line_iterator: pCvLineIterator; connectivity: Integer = 8;
|
|
|
|
|
left_to_right: Integer = 0): Integer; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ basic font types }
|
2013-01-01 13:29:34 +01:00
|
|
|
|
const
|
|
|
|
|
CV_FONT_HERSHEY_SIMPLEX = 0;
|
|
|
|
|
{$EXTERNALSYM CV_FONT_HERSHEY_SIMPLEX}
|
|
|
|
|
CV_FONT_HERSHEY_PLAIN = 1;
|
|
|
|
|
{$EXTERNALSYM CV_FONT_HERSHEY_PLAIN}
|
|
|
|
|
CV_FONT_HERSHEY_DUPLEX = 2;
|
|
|
|
|
{$EXTERNALSYM CV_FONT_HERSHEY_DUPLEX}
|
|
|
|
|
CV_FONT_HERSHEY_COMPLEX = 3;
|
|
|
|
|
{$EXTERNALSYM CV_FONT_HERSHEY_COMPLEX}
|
|
|
|
|
CV_FONT_HERSHEY_TRIPLEX = 4;
|
|
|
|
|
{$EXTERNALSYM CV_FONT_HERSHEY_TRIPLEX}
|
|
|
|
|
CV_FONT_HERSHEY_COMPLEX_SMALL = 5;
|
|
|
|
|
{$EXTERNALSYM CV_FONT_HERSHEY_COMPLEX_SMALL}
|
|
|
|
|
CV_FONT_HERSHEY_SCRIPT_SIMPLEX = 6;
|
|
|
|
|
{$EXTERNALSYM CV_FONT_HERSHEY_SCRIPT_SIMPLEX}
|
|
|
|
|
CV_FONT_HERSHEY_SCRIPT_COMPLEX = 7;
|
|
|
|
|
{$EXTERNALSYM CV_FONT_HERSHEY_SCRIPT_COMPLEX}
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ font flags }
|
2013-01-01 13:29:34 +01:00
|
|
|
|
CV_FONT_ITALIC = 16;
|
|
|
|
|
{$EXTERNALSYM CV_FONT_ITALIC}
|
|
|
|
|
CV_FONT_VECTOR0 = CV_FONT_HERSHEY_SIMPLEX;
|
|
|
|
|
{$EXTERNALSYM CV_FONT_VECTOR0}
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Font structure }
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2013-01-01 13:29:34 +01:00
|
|
|
|
type
|
|
|
|
|
pCvFont = ^TCvFont;
|
2013-04-16 08:40:44 +02:00
|
|
|
|
|
2014-05-21 07:14:38 +02:00
|
|
|
|
TCvFont = record
|
2013-09-16 13:49:10 +02:00
|
|
|
|
nameFont: pCvChar;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
color: TCvScalar;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
font_face: Integer;
|
|
|
|
|
ascii: pInteger;
|
|
|
|
|
greek: pInteger;
|
|
|
|
|
cyrillic: pInteger;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
hscale, vscale: Single;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
shear: Single;
|
|
|
|
|
thickness: Integer;
|
|
|
|
|
dx: Single;
|
|
|
|
|
line_type: Integer;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Initializes font structure used further in cvPutText
|
2013-04-16 08:40:44 +02:00
|
|
|
|
CVAPI(void) cvInitFont(CvFont* font, int font_face,
|
2013-04-15 18:14:12 +02:00
|
|
|
|
double hscale, double vscale, double shear CV_DEFAULT(0),
|
|
|
|
|
int thickness CV_DEFAULT(1), int line_type CV_DEFAULT(8));
|
2013-04-16 08:40:44 +02:00
|
|
|
|
}
|
2015-03-30 23:02:32 +02:00
|
|
|
|
procedure cvInitFont(font: pCvFont; font_face: Integer; hscale: double; vscale: double; shear: double = 0; thickness: Integer = 1;
|
|
|
|
|
line_type: Integer = 8); cdecl;
|
2013-09-25 21:18:23 +02:00
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
function cvFont(scale: double; thickness: Integer = 1): TCvFont; {$IFDEF USE_INLINE} inline; {$ENDIF}
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ CVAPI(void) cvPutText( pCvArr* img, const char* text, CvPoint org,
|
2013-01-01 13:29:34 +01:00
|
|
|
|
const CvFont* font, CvScalar color );
|
|
|
|
|
}
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2013-09-16 13:49:10 +02:00
|
|
|
|
procedure cvPutText(img: pCvArr; const text: pCvChar; org: TCvPoint; const font: pCvFont; color: TCvScalar); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2013-09-25 21:18:23 +02:00
|
|
|
|
// * Calculates bounding box of text stroke (useful for alignment) */
|
|
|
|
|
// CVAPI(void) cvGetTextSize( const char* text_string, const CvFont* font,
|
|
|
|
|
// CvSize* text_size, int* baseline );
|
2017-09-07 12:38:44 +02:00
|
|
|
|
procedure cvGetTextSize(const text_string: pCvChar; const font: pCvFont; text_size: pCvSize; var baseline: Integer); cdecl;
|
2013-09-25 21:18:23 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
Unpacks color value, if arrtype is CV_8UC?, <color> is treated as
|
|
|
|
|
packed color value, otherwise the first channels (depending on arrtype)
|
|
|
|
|
of destination scalar are set to the same value = <color>
|
|
|
|
|
|
|
|
|
|
CVAPI(CvScalar) cvColorToScalar( double packed_color, int arrtype );
|
|
|
|
|
*)
|
|
|
|
|
function cvColorToScalar(packed_color: double; arrtype: Integer): TCvScalar; cdecl;
|
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Returns the polygon points which make up the given ellipse. The ellipse is define by
|
|
|
|
|
the box of size 'axes' rotated 'angle' around the 'center'. A partial sweep
|
|
|
|
|
of the ellipse arc can be done by spcifying arc_start and arc_end to be something
|
|
|
|
|
other than 0 and 360, respectively. The input array 'pts' must be large enough to
|
|
|
|
|
hold the result. The total number of points stored into 'pts' is returned by this
|
|
|
|
|
function.
|
|
|
|
|
|
|
|
|
|
CVAPI(int) cvEllipse2Poly( CvPoint center, CvSize axes,
|
|
|
|
|
int angle, int arc_start, int arc_end, CvPoint * pts, int delta );
|
|
|
|
|
*)
|
2019-08-14 12:21:31 +02:00
|
|
|
|
function cvEllipse2Poly(center: TCvPoint; axes: TCvSize; angle: Integer; arc_start: Integer; arc_end: Integer; pts: pCVPoint; delta: Integer): Integer; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ Draws contour outlines or filled interiors on the image
|
2013-04-16 08:40:44 +02:00
|
|
|
|
CVAPI(void) cvDrawContours( pCvArr *img, CvSeq* contour,
|
|
|
|
|
CvScalar external_color, CvScalar hole_color,
|
|
|
|
|
int max_level, int thickness CV_DEFAULT(1),
|
|
|
|
|
int line_type CV_DEFAULT(8),
|
|
|
|
|
CvPoint offset CV_DEFAULT(cvPoint(0,0)));
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvDrawContours(img: pIplImage; contour: pCvSeq; external_color, hole_color: TCvScalar; max_level, thickness { =1 } , line_type: Integer { =8 };
|
|
|
|
|
offset: TCvPoint { =cvPoint(0,0) } ); cdecl;
|
2013-09-25 21:18:23 +02:00
|
|
|
|
|
|
|
|
|
// ******************* Iteration through the sequence tree *****************/
|
2017-09-07 12:38:44 +02:00
|
|
|
|
type
|
2013-09-25 21:18:23 +02:00
|
|
|
|
pCvTreeNodeIterator = ^TCvTreeNodeIterator;
|
|
|
|
|
|
2014-05-21 07:14:38 +02:00
|
|
|
|
TCvTreeNodeIterator = record
|
2014-05-19 21:29:48 +02:00
|
|
|
|
node: Pointer; // const void* node;
|
|
|
|
|
level: Integer; // int level;
|
2013-09-25 21:18:23 +02:00
|
|
|
|
max_level: Integer; // int max_level;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
// CVAPI(void) cvInitTreeNodeIterator( CvTreeNodeIterator* tree_iterator,const void* first, int max_level );
|
2017-09-07 12:38:44 +02:00
|
|
|
|
procedure cvInitTreeNodeIterator(var tree_iterator: TCvTreeNodeIterator; const first: Pointer; max_level: Integer); cdecl;
|
2013-09-25 21:18:23 +02:00
|
|
|
|
// CVAPI(void*) cvNextTreeNode( CvTreeNodeIterator* tree_iterator );
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2013-09-25 21:18:23 +02:00
|
|
|
|
function cvNextTreeNode(tree_iterator: pCvTreeNodeIterator): Pointer; cdecl;
|
|
|
|
|
// CVAPI(void*) cvPrevTreeNode( CvTreeNodeIterator* tree_iterator );
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2013-09-25 21:18:23 +02:00
|
|
|
|
function cvPrevTreeNode(tree_iterator: pCvTreeNodeIterator): Pointer; cdecl;
|
|
|
|
|
|
|
|
|
|
// * 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. */
|
|
|
|
|
// CVAPI(void) cvInsertNodeIntoTree( void* node, void* parent, void* frame );
|
|
|
|
|
procedure cvInsertNodeIntoTree(node: Pointer; parent: Pointer; frame: Pointer); cdecl;
|
|
|
|
|
|
|
|
|
|
// * Removes contour from tree (together with the contour children). */
|
|
|
|
|
// CVAPI(void) cvRemoveNodeFromTree( void* node, void* frame );
|
|
|
|
|
procedure cvRemoveNodeFromTree(node: Pointer; frame: Pointer); cdecl;
|
|
|
|
|
|
|
|
|
|
// * Gathers pointers to all the sequences,
|
|
|
|
|
// accessible from the <first>, to the single sequence */
|
|
|
|
|
// CVAPI(CvSeq*) cvTreeToNodeSeq( const void* first, int header_size,CvMemStorage* storage );
|
|
|
|
|
function cvTreeToNodeSeq(const first: Pointer; header_size: Integer; storage: pCvMemStorage): pCvSeq; cdecl;
|
|
|
|
|
|
2015-04-07 01:39:39 +02:00
|
|
|
|
(*
|
|
|
|
|
The function implements the K-means algorithm for clustering an array of sample
|
|
|
|
|
vectors in a specified number of classes
|
|
|
|
|
|
|
|
|
|
CVAPI(int) cvKMeans2( const CvArr* samples, int cluster_count, CvArr* labels,
|
|
|
|
|
CvTermCriteria termcrit, int attempts CV_DEFAULT(1),
|
|
|
|
|
CvRNG* rng CV_DEFAULT(0), int flags CV_DEFAULT(0),
|
|
|
|
|
CvArr* _centers CV_DEFAULT(0), double* compactness CV_DEFAULT(0) );
|
|
|
|
|
*)
|
2013-09-25 21:18:23 +02:00
|
|
|
|
const
|
|
|
|
|
CV_KMEANS_USE_INITIAL_LABELS = 1;
|
|
|
|
|
|
2019-08-14 12:21:31 +02:00
|
|
|
|
function cvKMeans2(const samples: pCvArr; cluster_count: Integer; labels: pCvArr; termcrit: TCvTermCriteria; attempts: Integer = 1; rng: pCvRNG = nil;
|
|
|
|
|
flags: Integer = 0; _centers: pCvArr = nil; compactness: pDouble = nil): Integer; cdecl;
|
2013-04-02 00:17:25 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
***************************************************************************************\
|
|
|
|
|
* System functions *
|
|
|
|
|
\***************************************************************************************
|
|
|
|
|
*)
|
|
|
|
|
(*
|
|
|
|
|
Add the function pointers table with associated information to the IPP primitives list
|
|
|
|
|
|
|
|
|
|
CVAPI(int) cvRegisterModule( const CvModuleInfo* module_info );
|
|
|
|
|
*)
|
|
|
|
|
function cvRegisterModule(const module_info: pCvModuleInfo): Integer; cdecl;
|
|
|
|
|
(*
|
|
|
|
|
Loads optimized functions from IPP, MKL etc. or switches back to pure C code
|
|
|
|
|
|
|
|
|
|
CVAPI(int) cvUseOptimized( int on_off );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvUseOptimized(on_off: Integer): Integer; cdecl;
|
|
|
|
|
(*
|
|
|
|
|
Retrieves information about the registered modules and loaded optimized plugins
|
|
|
|
|
|
|
|
|
|
CVAPI(void) cvGetModuleInfo( const char* module_name,
|
|
|
|
|
const char** version,
|
|
|
|
|
const char** loaded_addon_plugins );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2015-03-30 23:02:32 +02:00
|
|
|
|
procedure cvGetModuleInfo(const module_name: pCvChar; const version: ppCvChar; const loaded_addon_plugins: ppCvChar); cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
type
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(* typedef void* (CV_CDECL *CvAllocFunc)(size_t size, void* userdata); *)
|
|
|
|
|
TCvAllocFunc = function(size: size_t; userdata: Pointer): Pointer; cdecl;
|
|
|
|
|
(* typedef int (CV_CDECL *CvFreeFunc)(void* pptr, void* userdata); *)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
TCvFreeFunc = function(pptr: Pointer; userdata: Pointer): Integer; cdecl;
|
|
|
|
|
(*
|
|
|
|
|
Set user-defined memory managment functions (substitutors for malloc and free) that
|
|
|
|
|
will be called by cvAlloc, cvFree and higher-level functions (e.g. cvCreateImage)
|
|
|
|
|
|
|
|
|
|
CVAPI(void) cvSetMemoryManager( CvAllocFunc alloc_func CV_DEFAULT(NULL),
|
|
|
|
|
CvFreeFunc free_func CV_DEFAULT(NULL),
|
|
|
|
|
void* userdata CV_DEFAULT(NULL));
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2015-03-30 23:02:32 +02:00
|
|
|
|
procedure cvSetMemoryManager(alloc_func: TCvAllocFunc = nil; free_func: TCvFreeFunc = nil; userdata: Pointer = nil); cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
(* typedef IplImage* (CV_STDCALL* Cv_iplCreateImageHeader)
|
|
|
|
|
(int,int,int,char*,char*,int,int,int,int,int,
|
|
|
|
|
IplROI*,IplImage*,void*,IplTileInfo *)
|
2019-08-14 12:21:31 +02:00
|
|
|
|
TCv_iplCreateImageHeader = function(A: Integer; B: Integer; C: Integer; D: pCvChar; E: pCvChar; F: Integer; g: Integer; H: Integer; i: Integer; j: Integer;
|
|
|
|
|
K: pIplROI; L: pIplImage; M: Pointer; N: PIplTileInfo): pIplImage; stdcall;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
|
|
|
|
(* typedef void (CV_STDCALL* Cv_iplAllocateImageData)(IplImage*,int,int); *)
|
|
|
|
|
TCv_iplAllocateImageData = procedure(A: pIplImage; B: Integer); stdcall;
|
|
|
|
|
(* typedef void (CV_STDCALL* Cv_iplDeallocate)(IplImage*,int); *)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
TCv_iplDeallocate = procedure(A: pIplImage; B: Integer); stdcall;
|
|
|
|
|
(* typedef IplROI* (CV_STDCALL* Cv_iplCreateROI)(int,int,int,int,int); *)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
TCv_iplCreateROI = function(const A: pIplImage): pIplROI; stdcall;
|
|
|
|
|
(* typedef IplImage* (CV_STDCALL* Cv_iplCloneImage)(const IplImage *)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
TCv_iplCloneImage = function(const A: pIplImage): pIplImage; stdcall;
|
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Makes OpenCV use IPL functions for IplImage allocation/deallocation
|
|
|
|
|
|
|
|
|
|
CVAPI(void) cvSetIPLAllocators( Cv_iplCreateImageHeader create_header,
|
|
|
|
|
Cv_iplAllocateImageData allocate_data,
|
|
|
|
|
Cv_iplDeallocate deallocate,
|
|
|
|
|
Cv_iplCreateROI create_roi,
|
|
|
|
|
Cv_iplCloneImage clone_image );
|
|
|
|
|
*)
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvSetIPLAllocators(create_header: TCv_iplCreateImageHeader; allocate_data: TCv_iplAllocateImageData; deallocate: TCv_iplDeallocate;
|
|
|
|
|
create_roi: TCv_iplCreateROI; clone_image: TCv_iplCloneImage); cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{ ****************************************************************************************
|
|
|
|
|
* Data Persistence *
|
|
|
|
|
**************************************************************************************** }
|
|
|
|
|
|
|
|
|
|
{ ********************************* High-level functions ********************************* }
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ opens existing or creates new file storage
|
2013-04-02 00:17:25 +02:00
|
|
|
|
CVAPI(CvFileStorage*) cvOpenFileStorage( const char* filename, CvMemStorage* memstorage,
|
|
|
|
|
int flags, const char* encoding CV_DEFAULT(NULL) );
|
|
|
|
|
}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
function cvOpenFileStorage(const filename: pCvChar; memstorage: pCvMemStorage; flags: Integer; const encoding: pCvChar = nil): pCvFileStorage; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ closes file storage and deallocates buffers
|
2013-04-02 00:17:25 +02:00
|
|
|
|
CVAPI(void) cvReleaseFileStorage( CvFileStorage** fs );
|
|
|
|
|
}
|
2017-09-07 12:38:44 +02:00
|
|
|
|
procedure cvReleaseFileStorage(var fs: pCvFileStorage); cdecl;
|
2013-04-02 00:17:25 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
returns attribute value or 0 (NULL) if there is no such attribute
|
|
|
|
|
|
|
|
|
|
CVAPI(const char* ) cvAttrValue( const CvAttrList* attr, const char* attr_name );
|
|
|
|
|
*)
|
|
|
|
|
function cvAttrValue(const attr: pCvAttrList; const attr_name: pCvChar): pCvChar; cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ this is a slower version of cvGetFileNode that takes the key as a literal string
|
2013-04-02 00:17:25 +02:00
|
|
|
|
CVAPI(CvFileNode*) cvGetFileNodeByName( const CvFileStorage* fs,
|
2013-04-15 18:14:12 +02:00
|
|
|
|
const CvFileNode* map, const char* name );
|
2013-04-02 00:17:25 +02:00
|
|
|
|
}
|
2013-09-16 13:49:10 +02:00
|
|
|
|
function cvGetFileNodeByName(const fs: pCvFileStorage; const map: pCvFileNode; const name: pCvChar): pCvFileNode; cdecl;
|
2013-04-02 00:17:25 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ CV_INLINE int cvReadInt( const CvFileNode* node, int default_value CV_DEFAULT(0) )
|
2013-04-02 00:17:25 +02:00
|
|
|
|
return !node ? default_value :
|
|
|
|
|
CV_NODE_IS_INT(node->tag) ? node->data.i :
|
|
|
|
|
CV_NODE_IS_REAL(node->tag) ? cvRound(node->data.f) : 0x7fffffff;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2017-09-07 12:38:44 +02:00
|
|
|
|
function cvReadInt(const node: pCvFileNode; default_value: Integer = 0): Integer; {$IFDEF USE_INLINE} inline; {$ENDIF}
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ CV_INLINE int cvReadIntByName( const CvFileStorage* fs, const CvFileNode* map,
|
2013-04-02 00:17:25 +02:00
|
|
|
|
const char* name, int default_value CV_DEFAULT(0) )
|
|
|
|
|
{
|
|
|
|
|
return cvReadInt( cvGetFileNodeByName( fs, map, name ), default_value );
|
2013-04-15 18:14:12 +02:00
|
|
|
|
}
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvReadIntByName(const fs: pCvFileStorage; const map: pCvFileNode; const name: pCvChar; default_value: Integer = 0): Integer;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
{$IFDEF USE_INLINE} inline; {$ENDIF}
|
2013-09-25 21:18:23 +02:00
|
|
|
|
// CV_INLINE const char* cvReadString( const CvFileNode* node,
|
|
|
|
|
// const char* default_value CV_DEFAULT(NULL) )
|
|
|
|
|
// {
|
|
|
|
|
// return !node ? default_value : CV_NODE_IS_STRING(node->tag) ? node->data.str.ptr : 0;
|
|
|
|
|
// }
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
|
|
|
|
function cvReadString(const node: pCvFileNode; const default_value: pCvChar = nil): pCvChar; {$IFDEF USE_INLINE} inline;
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{$ENDIF}
|
2013-09-25 21:18:23 +02:00
|
|
|
|
// CV_INLINE const char* cvReadStringByName( const CvFileStorage* fs, const CvFileNode* map,
|
|
|
|
|
// const char* name, const char* default_value CV_DEFAULT(NULL) )
|
|
|
|
|
// {
|
|
|
|
|
// return cvReadString( cvGetFileNodeByName( fs, map, name ), default_value );
|
|
|
|
|
// }
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2019-08-14 12:21:31 +02:00
|
|
|
|
function cvReadStringByName(const fs: pCvFileStorage; const map: pCvFileNode; const name: pCvChar; const default_value: pCvChar = nil): pCvChar;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
{$IFDEF USE_INLINE} inline; {$ENDIF}
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ decodes standard or user-defined object and returns it
|
2013-04-02 00:17:25 +02:00
|
|
|
|
CVAPI(void*) cvRead( CvFileStorage* fs, CvFileNode* node,
|
|
|
|
|
CvAttrList* attributes CV_DEFAULT(NULL));
|
|
|
|
|
}
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2013-04-02 19:07:49 +02:00
|
|
|
|
function cvRead(fs: pCvFileStorage; node: pCvFileNode; attributes: pCvAttrList = nil): pPointer; cdecl;
|
2013-04-02 00:17:25 +02:00
|
|
|
|
|
2013-09-16 13:49:10 +02:00
|
|
|
|
// * decodes standard or user-defined object and returns it */
|
|
|
|
|
// CV_INLINE void* cvReadByName( CvFileStorage* fs, const CvFileNode* map, const char* name, CvAttrList* attributes CV_DEFAULT(NULL) )
|
|
|
|
|
// {return cvRead( fs, cvGetFileNodeByName( fs, map, name ), attributes );}
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvReadByName(fs: pCvFileStorage; const map: pCvFileNode; const name: pCvChar; attributes: pCvAttrList = nil): Pointer;
|
2013-09-16 13:49:10 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
starts reading data from sequence or scalar numeric node
|
|
|
|
|
|
|
|
|
|
CVAPI(void) cvStartReadRawData( const CvFileStorage* fs, const CvFileNode* src,
|
|
|
|
|
CvSeqReader* reader );
|
|
|
|
|
*)
|
|
|
|
|
procedure cvStartReadRawData(const fs: pCvFileStorage; const src: pCvFileNode; reader: pCvSeqReader); cdecl;
|
|
|
|
|
(*
|
|
|
|
|
reads multiple numbers and stores them to array
|
|
|
|
|
|
|
|
|
|
CVAPI(void) cvReadRawDataSlice( const CvFileStorage* fs, CvSeqReader* reader,
|
|
|
|
|
int count, void* dst, const char* dt );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2015-03-30 23:02:32 +02:00
|
|
|
|
procedure cvReadRawDataSlice(const fs: pCvFileStorage; reader: pCvSeqReader; count: Integer; dst: Pointer; const dt: pCvChar); cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
combination of two previous functions for easier reading of whole sequences
|
|
|
|
|
|
|
|
|
|
CVAPI(void) cvReadRawData( const CvFileStorage* fs, const CvFileNode* src,
|
|
|
|
|
void* dst, const char* dt );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvReadRawData(const fs: pCvFileStorage; const src: pCvFileNode; dst: Pointer; const dt: pCvChar); cdecl;
|
|
|
|
|
(*
|
|
|
|
|
writes a copy of file node to file storage
|
|
|
|
|
|
|
|
|
|
CVAPI(void) cvWriteFileNode( CvFileStorage* fs, const char* new_node_name,
|
|
|
|
|
const CvFileNode* node, int embed );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2015-03-30 23:02:32 +02:00
|
|
|
|
procedure cvWriteFileNode(fs: pCvFileStorage; const new_node_name: pCvChar; const node: pCvFileNode; embed: Integer); cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
returns name of file node
|
|
|
|
|
*)
|
|
|
|
|
(*
|
|
|
|
|
CVAPI(const char* ) cvGetFileNodeName( const CvFileNode* node );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvGetFileNodeName(const node: pCvFileNode): pCvChar; cdecl;
|
|
|
|
|
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{ *********************************** Adding own types *********************************** }
|
2013-04-10 01:22:08 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
CVAPI(void) cvRegisterType( const CvTypeInfo* info );
|
|
|
|
|
*)
|
|
|
|
|
procedure cvRegisterType(const info: pCvTypeInfo); cdecl;
|
|
|
|
|
(*
|
|
|
|
|
CVAPI(void) cvUnregisterType( const char* type_name );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvUnregisterType(const type_name: pCvChar); cdecl;
|
|
|
|
|
(*
|
|
|
|
|
CVAPI(CvTypeInfo* ) cvFirstType(void);
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvFirstType: pCvTypeInfo; cdecl;
|
|
|
|
|
(*
|
|
|
|
|
CVAPI(CvTypeInfo* ) cvFindType( const char* type_name );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvFindType(const type_name: pCvChar): pCvTypeInfo; cdecl;
|
|
|
|
|
(*
|
|
|
|
|
CVAPI(CvTypeInfo* ) cvTypeOf( const void* struct_ptr );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvTypeOf(const struct_ptr: Pointer): pCvTypeInfo; cdecl;
|
|
|
|
|
|
2013-04-10 01:22:08 +02:00
|
|
|
|
// * universal functions */
|
|
|
|
|
// CVAPI(void) cvRelease( void** struct_ptr );
|
2013-09-25 21:18:23 +02:00
|
|
|
|
procedure cvRelease(var struct_ptr: Pointer); cdecl; overload;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvRelease(var struct_ptr: pCvSeq); cdecl; overload;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
CVAPI(void* ) cvClone( const void* struct_ptr );
|
|
|
|
|
*)
|
|
|
|
|
function cvClone(const struct_ptr: Pointer): Pointer; cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ simple API for reading/writing data
|
2013-01-01 13:29:34 +01:00
|
|
|
|
CVAPI(void) cvSave( const char* filename,
|
|
|
|
|
const void* struct_ptr,
|
|
|
|
|
const char* name CV_DEFAULT(NULL),
|
|
|
|
|
const char* comment CV_DEFAULT(NULL),
|
|
|
|
|
CvAttrList attributes CV_DEFAULT(cvAttrList()));
|
|
|
|
|
CVAPI(void*) cvLoad( const char* filename,
|
|
|
|
|
CvMemStorage* memstorage CV_DEFAULT(NULL),
|
|
|
|
|
const char* name CV_DEFAULT(NULL),
|
|
|
|
|
const char** real_name CV_DEFAULT(NULL) );
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvSave(const filename: pCvChar; const struct_ptr: Pointer; const name: pCvChar; const comment: pCvChar; attributes: TCvAttrList); cdecl; overload;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2015-03-30 23:02:32 +02:00
|
|
|
|
procedure cvSave(const filename: pCvChar; const struct_ptr: Pointer; const name: pCvChar = Nil; const comment: pCvChar = Nil); overload;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
{$IFDEF USE_INLINE} inline; {$ENDIF}
|
2019-08-14 12:21:31 +02:00
|
|
|
|
function cvLoad(const filename: pCvChar; memstorage: pCvMemStorage = Nil; const name: pCvChar = nil; const real_name: ppCvChar = nil): Pointer; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-10-10 21:08:51 +02:00
|
|
|
|
{ *********************************** Measuring Execution Time *************************** }
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
{ helper functions for RNG initialization and accurate time measurement:
|
|
|
|
|
uses internal clock counter on x86 }
|
2015-04-07 01:39:39 +02:00
|
|
|
|
function cvGetTickCount: int64; cdecl; // {$IFDEF USE_INLINE}inline; {$ENDIF}
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2015-04-07 01:39:39 +02:00
|
|
|
|
function cvGetTickFrequency: double; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2013-04-12 21:33:12 +02:00
|
|
|
|
// *********************************** CPU capabilities ***********************************/
|
|
|
|
|
// CVAPI(int) cvCheckHardwareSupport(int feature);
|
|
|
|
|
function cvCheckHardwareSupport(feature: Integer): Integer; cdecl;
|
|
|
|
|
|
|
|
|
|
// *********************************** Multi-Threading ************************************/
|
|
|
|
|
|
|
|
|
|
// * retrieve/set the number of threads used in OpenMP implementations */
|
|
|
|
|
// CVAPI(int) cvGetNumThreads( void );
|
|
|
|
|
function cvGetNumThreads: Integer; cdecl;
|
|
|
|
|
// CVAPI(void) cvSetNumThreads( int threads CV_DEFAULT(0) );
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2013-04-12 21:33:12 +02:00
|
|
|
|
procedure cvSetNumThreads(threads: Integer = 0); cdecl;
|
|
|
|
|
// * get index of the thread being executed */
|
|
|
|
|
// CVAPI(int) cvGetThreadNum( void );
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvGetThreadNum: Integer; cdecl;
|
2013-03-27 23:20:08 +01:00
|
|
|
|
|
2013-01-01 13:29:34 +01:00
|
|
|
|
const
|
2019-08-14 12:21:31 +02:00
|
|
|
|
CV_CPU_NONE = 0;
|
|
|
|
|
CV_CPU_MMX = 1;
|
|
|
|
|
CV_CPU_SSE = 2;
|
|
|
|
|
CV_CPU_SSE2 = 3;
|
|
|
|
|
CV_CPU_SSE3 = 4;
|
|
|
|
|
CV_CPU_SSSE3 = 5;
|
|
|
|
|
CV_CPU_SSE4_1 = 6;
|
|
|
|
|
CV_CPU_SSE4_2 = 7;
|
|
|
|
|
CV_CPU_POPCNT = 8;
|
|
|
|
|
CV_CPU_AVX = 10;
|
|
|
|
|
CV_CPU_AVX2 = 11;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
CV_HARDWARE_MAX_FEATURE = 255;
|
|
|
|
|
|
2013-09-25 21:18:23 +02:00
|
|
|
|
// ********************************** Error Handling **************************************/
|
|
|
|
|
|
|
|
|
|
// * Get current OpenCV error status */
|
|
|
|
|
// CVAPI(int) cvGetErrStatus( void );
|
|
|
|
|
function cvGetErrStatus: Integer; cdecl;
|
|
|
|
|
|
|
|
|
|
// * Sets error status silently */
|
|
|
|
|
// CVAPI(void) cvSetErrStatus( int status );
|
|
|
|
|
procedure cvSetErrStatus(status: Integer); cdecl;
|
|
|
|
|
|
|
|
|
|
const
|
2019-08-14 12:21:31 +02:00
|
|
|
|
CV_ErrModeLeaf = 0; // * Print error and exit program */
|
2013-09-25 21:18:23 +02:00
|
|
|
|
CV_ErrModeParent = 1; // * Print error and continue */
|
|
|
|
|
CV_ErrModeSilent = 2; // * Don't print and continue */
|
|
|
|
|
|
|
|
|
|
// * Retrives current error processing mode */
|
|
|
|
|
// CVAPI(int) cvGetErrMode( void );
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2013-09-25 21:18:23 +02:00
|
|
|
|
function cvGetErrMode: Integer; cdecl;
|
|
|
|
|
|
|
|
|
|
// * Sets error processing mode, returns previously used mode */
|
|
|
|
|
// CVAPI(int) cvSetErrMode( int mode );
|
|
|
|
|
function cvSetErrMode(mode: Integer): Integer; cdecl;
|
|
|
|
|
|
2014-07-17 22:27:13 +02:00
|
|
|
|
(* Sets error status and performs some additonal actions (displaying message box,
|
2013-09-25 21:18:23 +02:00
|
|
|
|
writing message to stderr, terminating application etc.)
|
2014-07-17 22:27:13 +02:00
|
|
|
|
depending on the current error mode *)
|
2013-09-25 21:18:23 +02:00
|
|
|
|
// CVAPI(void) cvError( int status, const char* func_name,const char* err_msg, const char* file_name, int line );
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvError(status: Integer; const func_name: pCvChar; const err_msg: pCvChar; const file_name: pCvChar = nil; line: Integer = 0); cdecl;
|
2013-09-25 21:18:23 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
Retrieves textual description of the error given its code
|
|
|
|
|
|
|
|
|
|
CVAPI(const char* ) cvErrorStr( int status );
|
|
|
|
|
*)
|
|
|
|
|
function cvErrorStr(status: Integer): pCvChar; cdecl;
|
|
|
|
|
(*
|
|
|
|
|
Retrieves detailed information about the last error occured
|
|
|
|
|
|
|
|
|
|
CVAPI(int) cvGetErrInfo( const char** errcode_desc, const char** description,
|
|
|
|
|
const char** filename, int* line );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvGetErrInfo(const errcode_desc: ppCvChar; const description: ppCvChar; const filename: ppCvChar; line: pInteger): Integer; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
Maps IPP error codes to the counterparts from OpenCV
|
|
|
|
|
|
|
|
|
|
CVAPI(int) cvErrorFromIppStatus( int ipp_status );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvErrorFromIppStatus(ipp_status: Integer): Integer; cdecl;
|
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
type
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(* typedef int (CV_CDECL *CvErrorCallback)( int status, const char* func_name,
|
|
|
|
|
const char* err_msg, const char* file_name, int line, void* userdata ); *)
|
2019-08-14 12:21:31 +02:00
|
|
|
|
TCvErrorCallback = function(status: Integer; const func_name: pCvChar; const err_msg: pCvChar; const file_name: pCvChar; line: Integer; userdata: Pointer)
|
|
|
|
|
: Integer; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
Assigns a new error-handling function
|
|
|
|
|
|
|
|
|
|
CVAPI(CvErrorCallback) cvRedirectError( CvErrorCallback error_handler,
|
|
|
|
|
void* userdata CV_DEFAULT(NULL),
|
|
|
|
|
void** prev_userdata CV_DEFAULT(NULL) );
|
|
|
|
|
*)
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvRedirectError(error_handler: TCvErrorCallback; userdata: Pointer = nil; prev_userdata: ppvoid = nil): TCvErrorCallback; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
|
|
|
|
(*
|
|
|
|
|
|
|
|
|
|
Output to:
|
|
|
|
|
cvNulDevReport - nothing
|
|
|
|
|
cvStdErrReport - console(fprintf(stderr,...))
|
|
|
|
|
cvGuiBoxReport - MessageBox(WIN32)
|
|
|
|
|
|
|
|
|
|
*)
|
|
|
|
|
(*
|
|
|
|
|
CVAPI(int) cvNulDevReport( int status, const char* func_name, const char* err_msg,
|
|
|
|
|
const char* file_name, int line, void* userdata );
|
|
|
|
|
*)
|
2019-08-14 12:21:31 +02:00
|
|
|
|
function cvNulDevReport(status: Integer; const func_name: pCvChar; const err_msg: pCvChar; const file_name: pCvChar; line: Integer; userdata: Pointer)
|
|
|
|
|
: Integer; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
CVAPI(int) cvStdErrReport( int status, const char* func_name, const char* err_msg,
|
|
|
|
|
const char* file_name, int line, void* userdata );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2019-08-14 12:21:31 +02:00
|
|
|
|
function cvStdErrReport(status: Integer; const func_name: pCvChar; const err_msg: pCvChar; const file_name: pCvChar; line: Integer; userdata: Pointer)
|
|
|
|
|
: Integer; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
(*
|
|
|
|
|
CVAPI(int) cvGuiBoxReport( int status, const char* func_name, const char* err_msg,
|
|
|
|
|
const char* file_name, int line, void* userdata );
|
|
|
|
|
*)
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2019-08-14 12:21:31 +02:00
|
|
|
|
function cvGuiBoxReport(status: Integer; const func_name: pCvChar; const err_msg: pCvChar; const file_name: pCvChar; line: Integer; userdata: Pointer)
|
|
|
|
|
: Integer; cdecl;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
2017-09-12 15:30:23 +02:00
|
|
|
|
// defined in compat.hpp
|
|
|
|
|
procedure cvCvtPixToPlane(const src: pCvArr; dst0: pCvArr; dst1: pCvArr; dst2: pCvArr; dst3: pCvArr); cdecl;
|
|
|
|
|
procedure cvCvtPlaneToPix(const src0: pCvArr; const src1: pCvArr; const src2: pCvArr; const src3: pCvArr; dst: pCvArr); cdecl;
|
|
|
|
|
|
2013-01-01 13:29:34 +01:00
|
|
|
|
implementation
|
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
uses
|
|
|
|
|
ocv.lib;
|
2014-05-22 08:53:48 +02:00
|
|
|
|
|
|
|
|
|
function cvCreateImageHeader; external core_lib;
|
|
|
|
|
function cvInitImageHeader; external core_lib;
|
|
|
|
|
function cvCreateImage; external core_lib;
|
|
|
|
|
procedure cvReleaseImageHeader; external core_lib;
|
|
|
|
|
procedure cvReleaseImage; external core_lib;
|
|
|
|
|
function cvCloneImage; external core_lib;
|
|
|
|
|
procedure cvSetImageCOI; external core_lib;
|
|
|
|
|
function cvGetImageCOI; external core_lib;
|
|
|
|
|
procedure cvSetImageROI; external core_lib;
|
|
|
|
|
procedure cvResetImageROI; external core_lib;
|
|
|
|
|
function cvGetImageROI; external core_lib;
|
|
|
|
|
function cvCreateMatHeader; external core_lib;
|
|
|
|
|
function cvInitMatHeader; external core_lib;
|
|
|
|
|
function cvCreateMat; external core_lib;
|
|
|
|
|
procedure cvReleaseMat; external core_lib;
|
|
|
|
|
function cvCloneMat; external core_lib;
|
|
|
|
|
function cvGetSubRect; external core_lib;
|
|
|
|
|
procedure cvGetSubArr; external core_lib name 'cvGetSubRect';
|
2017-09-10 01:16:52 +02:00
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
function cvGetRow(const arr: pCvArr; submat: pCvMat; row: Integer): pCvMat;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
begin
|
2014-10-18 01:12:32 +02:00
|
|
|
|
result := cvGetRows(arr, submat, row, row + 1, 1);
|
2013-04-15 18:14:12 +02:00
|
|
|
|
end;
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGetCols; external core_lib;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
function cvGetCol(const arr: pCvArr; submat: pCvMat; col: Integer): pCvMat;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
begin
|
2014-10-18 01:12:32 +02:00
|
|
|
|
result := cvGetCols(arr, submat, col, col + 1);
|
2013-04-15 18:14:12 +02:00
|
|
|
|
end;
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGetDiag; external core_lib;
|
|
|
|
|
procedure cvScalarToRawData; external core_lib;
|
|
|
|
|
procedure cvRawDataToScalar; external core_lib;
|
|
|
|
|
function cvCreateMatNDHeader; external core_lib;
|
|
|
|
|
function cvCreateMatND; external core_lib;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
function cvInitMatNDHeader; external core_lib;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
procedure cvReleaseMatND(var mat: pCvMatND); {$IFDEF USE_INLINE} inline; {$ENDIF}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
begin
|
|
|
|
|
cvReleaseMat(pCvMat(mat));
|
|
|
|
|
end;
|
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvCloneMatND; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvCreateSparseMat; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvReleaseSparseMat; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvCloneSparseMat; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvInitSparseMatIterator; external core_lib;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
|
|
|
|
// returns next sparse array node (or NULL if there is no more nodes)
|
2013-04-16 08:40:44 +02:00
|
|
|
|
// CV_INLINE CvSparseNode* cvGetNextSparseNode( CvSparseMatIterator* mat_iterator )
|
|
|
|
|
// {
|
|
|
|
|
// if( mat_iterator->node->next )
|
|
|
|
|
// return mat_iterator->node = mat_iterator->node->next;
|
|
|
|
|
// else
|
|
|
|
|
// {
|
|
|
|
|
// int idx;
|
|
|
|
|
// for( idx = ++mat_iterator->curidx; idx < mat_iterator->mat->hashsize; idx++ )
|
|
|
|
|
// {
|
|
|
|
|
// CvSparseNode* node = (CvSparseNode*)mat_iterator->mat->hashtable[idx];
|
|
|
|
|
// if( node )
|
|
|
|
|
// {
|
|
|
|
|
// mat_iterator->curidx = idx;
|
|
|
|
|
// return mat_iterator->node = node;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// return NULL;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
2014-07-17 22:27:13 +02:00
|
|
|
|
|
2014-09-29 09:12:47 +02:00
|
|
|
|
{$IFDEF DELPHIXE_UP}
|
2014-10-05 00:51:42 +02:00
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
function cvGetNextSparseNode(mat_iterator: pCvSparseMatIterator): pCvSparseNode;
|
|
|
|
|
var
|
2014-05-19 21:29:48 +02:00
|
|
|
|
idx: Integer;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
node: pCvSparseNode;
|
|
|
|
|
begin
|
|
|
|
|
if Assigned(mat_iterator.node.next) then
|
|
|
|
|
begin
|
|
|
|
|
mat_iterator.node := mat_iterator.node.next;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
result := mat_iterator.node;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
Inc(mat_iterator.curidx);
|
2013-04-16 08:40:44 +02:00
|
|
|
|
for idx := mat_iterator.curidx to mat_iterator.mat.hashsize - 1 do
|
2013-04-15 18:14:12 +02:00
|
|
|
|
begin
|
|
|
|
|
node := mat_iterator.mat.hashtable[idx];
|
|
|
|
|
if Assigned(node) then
|
|
|
|
|
begin
|
|
|
|
|
mat_iterator.curidx := idx;
|
2014-05-19 21:29:48 +02:00
|
|
|
|
mat_iterator.node := node;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
result := mat_iterator.node;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
result := nil;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
end;
|
|
|
|
|
end;
|
2014-09-29 09:12:47 +02:00
|
|
|
|
{$ENDIF}
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvInitNArrayIterator; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvNextNArraySlice; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGetElemType; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGetDims; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGetDimSize; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvPtr1D; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvPtr2D; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvPtr3D; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvPtrND; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGet1D; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGet2D; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGet3D; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGetND; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// function cvGetReal1D(const arr: pIplImage; idx0: Integer): double; cdecl; external core_lib; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
function cvGetReal1D(const arr: pCvArr; idx0: Integer): double; cdecl; external core_lib; overload;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// function cvGetReal2D(const arr: pCvMat; idx0, idx1: Integer): double; cdecl; external core_lib; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
function cvGetReal2D(const arr: pCvArr; idx0, idx1: Integer): double; cdecl; external core_lib; overload;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGetReal3D; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGetRealND; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvSet1D; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvSet2D; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvSet3D; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvSetND; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvSetReal1D; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvSetReal2D; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvSetReal3D; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvSetRealND; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvClearND; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGetMat; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGetImage; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvReshapeMatND; external core_lib;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2015-03-30 23:02:32 +02:00
|
|
|
|
function cvReshapeND(const arr: pCvArr; sizeof_header: Integer; header: pCvArr; new_cn, new_dims: Integer; new_sizes: pInteger): pCvArr;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
{$IFDEF USE_INLINE} inline; {$ENDIF}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
begin
|
2014-10-18 01:12:32 +02:00
|
|
|
|
result := cvReshapeMatND(arr, sizeof(sizeof_header), header, new_cn, new_dims, new_sizes);
|
2013-04-15 18:14:12 +02:00
|
|
|
|
end;
|
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvReshape; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvRepeat; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvCreateData; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvReleaseData; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvSetData; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvGetRawData; external core_lib;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2015-04-07 01:39:39 +02:00
|
|
|
|
{$IF DEFINED(DelphiOCVVersion_29)}
|
2015-04-23 00:23:04 +02:00
|
|
|
|
// {$IFDEF VER290}
|
|
|
|
|
// function cvGetSize(const arr: pCvArr): TCvSize; external core_lib;
|
|
|
|
|
// {$ELSE}
|
|
|
|
|
/// / ----------------------
|
2017-09-07 12:38:44 +02:00
|
|
|
|
procedure _cvGetSize(const arr: pCvArr; var size: TCvSize); cdecl; external core_lib name 'cvGetSize';
|
2014-09-29 11:12:13 +02:00
|
|
|
|
{$IFDEF CPU32}
|
2014-10-05 00:51:42 +02:00
|
|
|
|
|
2013-01-01 22:36:38 +01:00
|
|
|
|
function cvGetSize(const arr: pCvArr): TCvSize; assembler;
|
|
|
|
|
asm
|
2014-05-22 16:23:41 +02:00
|
|
|
|
// mov eax,arr // <20> eax <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> arr
|
2015-04-23 00:23:04 +02:00
|
|
|
|
// push eax
|
2017-09-07 12:38:44 +02:00
|
|
|
|
push edx // <20> edx <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Result - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>.<2E>. _cvGetSize <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> eax:edx
|
|
|
|
|
push eax
|
|
|
|
|
call _cvGetSize
|
|
|
|
|
pop ecx // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
mov ecx, edx // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> _cvGetSize
|
|
|
|
|
pop edx // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Result
|
|
|
|
|
mov Result.width, eax
|
|
|
|
|
mov Result.height, ecx
|
2013-01-01 22:36:38 +01:00
|
|
|
|
end;
|
2014-09-29 11:12:13 +02:00
|
|
|
|
{$ENDIF CPU32}
|
|
|
|
|
{$IFDEF CPU64}
|
2014-10-05 00:51:42 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +02:00
|
|
|
|
function cvGetSize(const arr: pCvArr): TCvSize; assembler;
|
|
|
|
|
asm
|
2017-09-07 12:38:44 +02:00
|
|
|
|
call _cvGetSize
|
|
|
|
|
mov Result.width, eax
|
|
|
|
|
SHR rax, 32
|
|
|
|
|
mov Result.height, eax
|
2014-05-19 11:56:41 +02:00
|
|
|
|
end;
|
2014-09-29 11:12:13 +02:00
|
|
|
|
{$ENDIF CPU64}
|
2015-04-23 00:23:04 +02:00
|
|
|
|
// {$ENDIF}
|
2015-04-09 23:15:02 +02:00
|
|
|
|
// -------------------
|
2015-04-07 01:39:39 +02:00
|
|
|
|
{$ELSEIF DEFINED(DelphiOCVVersion_30)}
|
|
|
|
|
function cvGetSize(const arr: pCvArr): TCvSize; external core_lib;
|
2017-10-23 01:37:17 +02:00
|
|
|
|
{$IFEND}
|
2017-09-08 11:02:08 +02:00
|
|
|
|
// procedure cvCopy; external core_lib;
|
|
|
|
|
procedure cvCopy(const src: pCvArr; dst: pCvArr; const mask: pCvArr = nil); cdecl; external core_lib; overload;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvCopy(const src: pIplImage; dst: pIplImage; const mask: pIplImage = nil); cdecl; external core_lib; overload;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
procedure cvSet(arr: pCvArr; value: TCvScalar; const mask: pCvArr = Nil); external core_lib;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
procedure cvSet(mat: pCvMat; i, j: Integer; val: Single); {$IFDEF USE_INLINE} inline; {$ENDIF}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
var
|
2015-10-05 18:46:36 +02:00
|
|
|
|
// type_: Integer;
|
2015-03-30 23:02:32 +02:00
|
|
|
|
ptr: pByte;
|
2014-05-19 21:29:48 +02:00
|
|
|
|
pf: PSingle;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
begin
|
2015-10-05 18:46:36 +02:00
|
|
|
|
// type_ := CV_MAT_TYPE(mat._type);
|
2015-09-19 21:49:45 +02:00
|
|
|
|
assert((i < mat^.rows) and (j < mat^.cols) and (CV_MAT_TYPE(mat._type) = CV_32FC1));
|
2017-09-08 11:02:08 +02:00
|
|
|
|
ptr := mat^.data.ptr;
|
2014-05-19 21:29:48 +02:00
|
|
|
|
Inc(ptr, mat.step * i + sizeof(Single) * j);
|
|
|
|
|
pf := PSingle(ptr);
|
2013-04-15 18:14:12 +02:00
|
|
|
|
pf^ := val;
|
|
|
|
|
end;
|
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvSetZero; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvZero; external core_lib name 'cvSetZero';
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvSplit; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvMerge(const src0: pIplImage; const src1: pIplImage; const src2: pIplImage; const src3: pIplImage; dst: pIplImage); cdecl;
|
|
|
|
|
// external core_lib; overload;
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvMerge(const src0: pCvArr; const src1: pCvArr; const src2: pCvArr; const src3: pCvArr; dst: pCvArr); cdecl; external core_lib; overload;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvMixChannels; external core_lib;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
procedure cvConvertScale; external core_lib;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
procedure cvConvert(const src: pCvArr; dst: pCvArr); {$IFDEF USE_INLINE} inline; {$ENDIF}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
begin
|
2014-05-19 21:29:48 +02:00
|
|
|
|
cvConvertScale(src, dst, 1, 0);
|
2013-04-15 18:14:12 +02:00
|
|
|
|
end;
|
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvScale; external core_lib name 'cvConvertScale';
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvCvtScale; external core_lib name 'cvConvertScale';
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvConvertScaleAbs; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvCvtScaleAbs; external core_lib name 'cvConvertScaleAbs';
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvCheckTermCriteria; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2017-09-08 11:02:08 +02:00
|
|
|
|
// procedure cvAdd; external core_lib;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvAdd(const src1, src2: pIplImage; dst: pIplImage; const mask: pIplImage = nil); cdecl; external core_lib; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvAdd(const src1, src2: pCvArr; dst: pCvArr; const mask: pCvArr = nil); cdecl; external core_lib; overload;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2017-09-08 11:02:08 +02:00
|
|
|
|
// procedure cvAddS; external core_lib;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvAddS(const src: pIplImage; value: TCvScalar; dst: pIplImage; const mask: pIplImage = nil); cdecl; external core_lib; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvAddS(const src: pCvArr; value: TCvScalar; dst: pCvArr; const mask: pCvArr = nil); cdecl; external core_lib; overload;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
2017-09-08 11:02:08 +02:00
|
|
|
|
// procedure cvSub; external core_lib;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvSub(const src1, src2: pIplImage; dst: pIplImage; const mask: pIplImage = nil); cdecl; external core_lib; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvSub(const src1, src2: pCvArr; dst: pCvArr; const mask: pCvArr = nil); cdecl; external core_lib; overload;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvSubS(const src: pCvArr; value: TCvScalar; dst: pCvArr; const mask: pCvArr); overload;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
begin
|
2014-05-19 21:29:48 +02:00
|
|
|
|
cvAddS(src, CvScalar(-value.val[0], -value.val[1], -value.val[2], -value.val[3]), dst, mask);
|
2013-04-15 18:14:12 +02:00
|
|
|
|
end;
|
|
|
|
|
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvSubS(const src: pIplImage; value: TCvScalar; dst: pIplImage; const mask: pIplImage); overload;
|
|
|
|
|
begin
|
|
|
|
|
cvAddS(src, CvScalar(-value.val[0], -value.val[1], -value.val[2], -value.val[3]), dst, mask);
|
|
|
|
|
end;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2017-09-08 11:02:08 +02:00
|
|
|
|
// procedure cvSubRS; external core_lib;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvSubRS(const src: pIplImage; value: TCvScalar; dst: pIplImage; const mask: pIplImage = nil); cdecl; external core_lib; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvSubRS(const src: pCvArr; value: TCvScalar; dst: pCvArr; const mask: pCvArr = nil); cdecl; external core_lib; overload;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2017-09-08 11:02:08 +02:00
|
|
|
|
// procedure cvMul; external core_lib;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvMul(const src1, src2: pIplImage; dst: pIplImage; scale: double = 1); cdecl; external core_lib; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvMul(const src1, src2: pCvArr; dst: pCvArr; scale: double = 1); cdecl; external core_lib; overload;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2017-09-08 11:02:08 +02:00
|
|
|
|
// procedure cvDiv; external core_lib;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvDiv(const src1, src2: pIplImage; dst: pIplImage; scale: double = 1); cdecl; external core_lib; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvDiv(const src1, src2: pCvArr; dst: pCvArr; scale: double = 1); cdecl; external core_lib; overload;
|
|
|
|
|
|
|
|
|
|
// procedure cvScaleAdd; external core_lib;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvScaleAdd(const src1: pIplImage; scale: TCvScalar; const src2: pIplImage; dst: pIplImage); cdecl; external core_lib; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvScaleAdd(const src1: pCvArr; scale: TCvScalar; const src2: pCvArr; dst: pCvArr); cdecl; external core_lib; overload;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2013-04-16 08:40:44 +02:00
|
|
|
|
// define cvAXPY( A, real_scalar, B, C ) cvScaleAdd(A, cvRealScalar(real_scalar), B, C)
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvAXPY(A: pCvArr; real_scalar: double; B, C: pCvArr); {$IFDEF USE_INLINE} inline; {$ENDIF} overload;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
begin
|
2014-05-19 21:29:48 +02:00
|
|
|
|
cvScaleAdd(A, cvRealScalar(real_scalar), B, C);
|
2013-04-15 18:14:12 +02:00
|
|
|
|
end;
|
|
|
|
|
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvAXPY(A: pIplImage; real_scalar: double; B, C: pIplImage); {$IFDEF USE_INLINE} inline; {$ENDIF} overload;
|
|
|
|
|
begin
|
|
|
|
|
cvScaleAdd(A, cvRealScalar(real_scalar), B, C);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
// procedure cvAddWeighted; external core_lib;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvAddWeighted(const src1: pIplImage; alpha: double; const src2: pIplImage; beta: double; gamma: double; dst: pIplImage); cdecl;
|
|
|
|
|
// external core_lib; overload;
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvAddWeighted(const src1: pCvArr; alpha: double; const src2: pCvArr; beta: double; gamma: double; dst: pCvArr); cdecl; external core_lib; overload;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvDotProduct; external core_lib;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-05-23 11:53:54 +02:00
|
|
|
|
function cvAlloc(size: NativeUInt): Pointer; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvFree_(ptr: Pointer); external core_lib;
|
2013-01-01 22:36:38 +01:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvInitFont; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvPutText; external core_lib;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
function cvFont(scale: double; thickness: Integer = 1): TCvFont; {$IFDEF USE_INLINE} inline; {$ENDIF}
|
2013-09-25 21:18:23 +02:00
|
|
|
|
begin
|
2014-10-18 01:12:32 +02:00
|
|
|
|
cvInitFont(@result, CV_FONT_HERSHEY_PLAIN, scale, scale, 0, thickness, CV_AA);
|
2013-09-25 21:18:23 +02:00
|
|
|
|
end;
|
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvCircle; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvLine; external core_lib;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2017-09-08 11:02:08 +02:00
|
|
|
|
// procedure cvCopyImage; external core_lib name 'cvCopy';
|
|
|
|
|
// procedure cvCopyImage(const src: pIplImage; dst: pIplImage; const mask: pIplImage = nil); cdecl; external core_lib name 'cvCopy'; overload;
|
|
|
|
|
// procedure cvCopyImage(const src: pCvArr; dst: pCvArr; const mask: pCvArr = nil); cdecl; external core_lib name 'cvCopy'; overload;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
function CV_RGB(const r, g, B: double): TCvScalar; {$IFDEF USE_INLINE} inline; {$ENDIF}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
begin
|
2014-10-18 01:12:32 +02:00
|
|
|
|
result := CvScalar(B, g, r, 0);
|
2013-01-01 13:29:34 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2015-03-30 23:02:32 +02:00
|
|
|
|
procedure cvSave(const filename: pCvChar; const struct_ptr: Pointer; const name: pCvChar; const comment: pCvChar; attributes: TCvAttrList);
|
|
|
|
|
external core_lib; overload;
|
2013-04-09 12:41:27 +02:00
|
|
|
|
|
2015-03-30 23:02:32 +02:00
|
|
|
|
procedure cvSave(const filename: pCvChar; const struct_ptr: Pointer; const name: pCvChar = Nil; const comment: pCvChar = Nil); overload;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
{$IFDEF USE_INLINE} inline; {$ENDIF}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
begin
|
2014-05-19 21:29:48 +02:00
|
|
|
|
cvSave(filename, struct_ptr, name, comment, ZeroCvAttrList);
|
2013-01-01 13:29:34 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvLoad; external core_lib;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2017-09-08 11:02:08 +02:00
|
|
|
|
// procedure cvInRange; external core_lib;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvInRange(const src: pIplImage; const lower: pIplImage; const upper: pIplImage; dst: pIplImage); cdecl;
|
|
|
|
|
// external core_lib; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvInRange(const src: pCvArr; const lower: pCvArr; const upper: pCvArr; dst: pCvArr); cdecl; external core_lib; overload;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2017-09-08 11:02:08 +02:00
|
|
|
|
// procedure cvInRangeS; external core_lib;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvInRangeS(const src: pIplImage; lower: TCvScalar; upper: TCvScalar; dst: pIplImage); cdecl; external core_lib; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvInRangeS(const src: pCvArr; lower: TCvScalar; upper: TCvScalar; dst: pCvArr); cdecl; external core_lib; overload;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2017-09-09 19:04:36 +02:00
|
|
|
|
// procedure cvMinMaxLoc; external core_lib;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvMinMaxLoc(const arr: pIplImage; min_val: pDouble; max_val: pDouble; min_loc: pCVPoint = nil; max_loc: pCVPoint = nil;
|
|
|
|
|
// const mask: pIplImage = nil); cdecl; external core_lib; overload;
|
2019-08-14 12:21:31 +02:00
|
|
|
|
procedure cvMinMaxLoc(const arr: pCvArr; min_val: pDouble; max_val: pDouble; min_loc: pCVPoint = nil; max_loc: pCVPoint = nil; const mask: pCvArr = nil); cdecl;
|
|
|
|
|
external core_lib; overload;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2017-09-08 11:02:08 +02:00
|
|
|
|
// procedure cvAnd; external core_lib;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvAnd(const src1: pIplImage; const src2: pIplImage; dst: pIplImage; masl: pIplImage = nil); cdecl; external core_lib; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvAnd(const src1: pCvArr; const src2: pCvArr; dst: pCvArr; masl: pCvArr = nil); cdecl; external core_lib; overload;
|
2013-01-01 22:36:38 +01:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvCreateMemStorage; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGetSeqElem; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvReleaseMemStorage; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvRectangle; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGetRows; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvFlip; external core_lib;
|
|
|
|
|
procedure cvMirror; external core_lib name 'cvFlip';
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvClearMemStorage; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvDrawContours; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvCreateChildMemStorage; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvCvtSeqToArray; external core_lib;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvOpenFileStorage; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvReleaseFileStorage; external core_lib;
|
2013-04-02 00:17:25 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGetFileNodeByName; external core_lib;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2013-04-05 13:36:47 +02:00
|
|
|
|
function cvReadInt;
|
2013-04-02 00:17:25 +02:00
|
|
|
|
begin
|
|
|
|
|
// return !node ? default_value :
|
|
|
|
|
// CV_NODE_IS_INT(node->tag) ? node->data.i :
|
|
|
|
|
// CV_NODE_IS_REAL(node->tag) ? cvRound(node->data.f) : 0x7fffffff;
|
2019-08-14 12:21:31 +02:00
|
|
|
|
result := iif(not Assigned(node), default_value, iif(CV_NODE_IS_INT(node^.tag), node^.i, iif(CV_NODE_IS_REAL(node^.tag), node^.F, $7FFFFFFF)));
|
2013-04-02 00:17:25 +02:00
|
|
|
|
end;
|
|
|
|
|
|
2013-04-05 13:36:47 +02:00
|
|
|
|
function cvReadIntByName;
|
2013-04-02 00:17:25 +02:00
|
|
|
|
begin
|
|
|
|
|
// return cvReadInt( cvGetFileNodeByName( fs, map, name ), default_value );
|
2014-10-18 01:12:32 +02:00
|
|
|
|
result := cvReadInt(cvGetFileNodeByName(fs, map, name), default_value);
|
2013-04-02 00:17:25 +02:00
|
|
|
|
end;
|
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvRead; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvStartReadSeq; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvChangeSeqBlock; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvFillConvexPoly; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvPolyLine; external core_lib;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvCreateSeq; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvCreateSeqBlock; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvSeqPush; external core_lib;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
|
|
|
|
|
procedure cvEllipseBox;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
var
|
2013-04-05 13:36:47 +02:00
|
|
|
|
axes: TCvSize;
|
|
|
|
|
begin
|
2014-05-19 21:29:48 +02:00
|
|
|
|
axes.width := cvRound(box.size.width * 0.5);
|
2013-04-05 13:36:47 +02:00
|
|
|
|
axes.height := cvRound(box.size.height * 0.5);
|
2014-05-19 21:29:48 +02:00
|
|
|
|
cvEllipse(img, cvPointFrom32f(box.center), axes, box.angle, 0, 360, color, thickness, line_type, shift);
|
2013-04-05 13:36:47 +02:00
|
|
|
|
end;
|
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvOr; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvXor; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2017-09-08 11:02:08 +02:00
|
|
|
|
// procedure cvXorS; external core_lib;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// procedure cvXorS(const src: pIplImage; value: TCvScalar; dst: pIplImage; const mask: pCvArr = nil); cdecl; external core_lib; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvXorS(const src: pCvArr; value: TCvScalar; dst: pCvArr; const mask: pCvArr = nil); cdecl; external core_lib; overload;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvNot; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvEllipse; external core_lib;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
|
|
|
|
|
procedure cvFree;
|
|
|
|
|
begin
|
2013-04-07 12:41:15 +02:00
|
|
|
|
// #define cvFree(ptr) (cvFree_(*(ptr)), *(ptr)=0)
|
2013-04-05 13:36:47 +02:00
|
|
|
|
cvFree_(@ptr);
|
2013-09-25 21:18:23 +02:00
|
|
|
|
Pointer(ptr) := nil;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
end;
|
|
|
|
|
|
2017-09-10 01:16:52 +02:00
|
|
|
|
// function cvCountNonZero(arr: pIplImage): Integer; cdecl; external core_lib; overload;
|
2017-09-08 11:02:08 +02:00
|
|
|
|
function cvCountNonZero(arr: pCvArr): Integer; cdecl; external core_lib; overload;
|
2013-04-10 01:22:08 +02:00
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
function cvGet(const mat: pCvMat; i, j: Integer): Single; {$IFDEF USE_INLINE} inline; {$ENDIF}
|
2013-04-10 01:22:08 +02:00
|
|
|
|
var
|
2015-10-05 18:46:36 +02:00
|
|
|
|
// type_: Integer;
|
2015-03-30 23:02:32 +02:00
|
|
|
|
ptr: pByte;
|
2014-05-19 21:29:48 +02:00
|
|
|
|
pf: PSingle;
|
2013-04-10 01:22:08 +02:00
|
|
|
|
begin
|
2015-10-05 18:46:36 +02:00
|
|
|
|
// type_ := CV_MAT_TYPE(mat^._type);
|
2015-09-19 21:49:45 +02:00
|
|
|
|
assert((i < mat^.rows) and (j < mat^.cols) and (CV_MAT_TYPE(mat^._type) = CV_32FC1));
|
2017-09-08 11:02:08 +02:00
|
|
|
|
ptr := mat^.data.ptr;
|
2014-05-19 21:29:48 +02:00
|
|
|
|
Inc(ptr, mat.step * i + sizeof(Single) * j);
|
|
|
|
|
pf := PSingle(ptr);
|
2014-10-18 01:12:32 +02:00
|
|
|
|
result := pf^;
|
2013-04-10 01:22:08 +02:00
|
|
|
|
end;
|
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvRelease(var struct_ptr: Pointer); external core_lib name 'cvRelease';
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvRelease(var struct_ptr: pCvSeq); external core_lib name 'cvRelease';
|
2013-04-12 21:33:12 +02:00
|
|
|
|
|
2015-04-07 01:39:39 +02:00
|
|
|
|
// {$IFDEF MSWINDOWS}
|
|
|
|
|
//
|
|
|
|
|
// function cvGetTickCount;
|
|
|
|
|
// begin
|
|
|
|
|
// result := GetTickCount;
|
|
|
|
|
// end;
|
|
|
|
|
//
|
|
|
|
|
// function GetTickFrequency: double;
|
|
|
|
|
// Var
|
|
|
|
|
// freq: TLargeInteger;
|
|
|
|
|
// begin
|
|
|
|
|
// QueryPerformanceFrequency(freq);
|
|
|
|
|
// result := freq;
|
|
|
|
|
// end;
|
|
|
|
|
// {$ENDIF ~MSWINDOWS}
|
|
|
|
|
//
|
|
|
|
|
// function cvGetTickFrequency: double;
|
|
|
|
|
// begin
|
|
|
|
|
// result := GetTickFrequency() * 1E-6;
|
|
|
|
|
// end;
|
|
|
|
|
|
|
|
|
|
function cvGetTickCount; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2015-04-07 01:39:39 +02:00
|
|
|
|
function cvGetTickFrequency; external core_lib;
|
2013-04-12 21:33:12 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvCheckHardwareSupport; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGetNumThreads; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvSetNumThreads; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGetThreadNum; external core_lib;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvAbsDiff; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvNorm; external core_lib;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvSeqRemove; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvClearSeq; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvWrite; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvSeqPartition; external core_lib;
|
2013-04-13 16:59:47 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvSum; external core_lib;
|
2013-09-12 11:49:13 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvRandArr; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvRandShuffle; external core_lib;
|
2013-09-15 14:02:26 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvWriteInt; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvWriteReal; external core_lib;
|
2013-09-16 13:49:10 +02:00
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
procedure cvWriteString; external core_lib;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
procedure cvWriteComment; external core_lib;
|
2014-10-18 01:12:32 +02:00
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
function cvReadByName(fs: pCvFileStorage; const map: pCvFileNode; const name: pCvChar; attributes: pCvAttrList = nil): Pointer;
|
2013-09-16 13:49:10 +02:00
|
|
|
|
begin
|
2014-10-18 01:12:32 +02:00
|
|
|
|
result := cvRead(fs, cvGetFileNodeByName(fs, map, name), attributes);
|
2013-09-16 13:49:10 +02:00
|
|
|
|
end;
|
|
|
|
|
|
2019-08-14 12:21:31 +02:00
|
|
|
|
function cvReadStringByName(const fs: pCvFileStorage; const map: pCvFileNode; const name: pCvChar; const default_value: pCvChar = nil): pCvChar;
|
|
|
|
|
{$IFDEF USE_INLINE} inline; {$ENDIF}
|
2013-09-25 21:18:23 +02:00
|
|
|
|
begin
|
2014-10-18 01:12:32 +02:00
|
|
|
|
result := cvReadString(cvGetFileNodeByName(fs, map, name), default_value);
|
2013-09-25 21:18:23 +02:00
|
|
|
|
end;
|
|
|
|
|
|
2017-09-07 12:38:44 +02:00
|
|
|
|
function cvReadString(const node: pCvFileNode; const default_value: pCvChar = nil): pCvChar; {$IFDEF USE_INLINE} inline;
|
2014-10-05 00:51:42 +02:00
|
|
|
|
{$ENDIF}
|
2013-09-25 21:18:23 +02:00
|
|
|
|
begin
|
|
|
|
|
if Assigned(node) then
|
|
|
|
|
begin
|
|
|
|
|
if CV_NODE_IS_STRING(node^.tag) then
|
2014-10-18 01:12:32 +02:00
|
|
|
|
result := node^.str.ptr
|
2013-09-25 21:18:23 +02:00
|
|
|
|
else
|
2014-10-18 01:12:32 +02:00
|
|
|
|
result := nil;
|
2013-09-25 21:18:23 +02:00
|
|
|
|
end
|
|
|
|
|
else
|
2014-10-18 01:12:32 +02:00
|
|
|
|
result := default_value;
|
2013-09-25 21:18:23 +02:00
|
|
|
|
end;
|
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGetErrStatus; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvSetErrStatus; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGetErrMode; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvSetErrMode; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvError; external core_lib;
|
|
|
|
|
|
|
|
|
|
procedure cvDFT; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvFFT; external core_lib name 'cvDFT';
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvMulSpectrums; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvGetOptimalDFTSize; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvDCT; external core_lib;
|
|
|
|
|
|
|
|
|
|
procedure cvCartToPolar; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvPolarToCart; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvPow; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvExp; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvLog; external core_lib;
|
|
|
|
|
|
|
|
|
|
procedure cvCrossProduct; external core_lib;
|
2015-04-23 00:23:04 +02:00
|
|
|
|
|
|
|
|
|
procedure cvMatMulAdd(const src1, src2, src3: pCvArr; dst: pCvArr);
|
|
|
|
|
begin
|
|
|
|
|
cvGEMM(src1, src2, 1, src3, 1, dst, 0);
|
|
|
|
|
end;
|
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvGEMM; external core_lib;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
procedure cvMatMulAddEx; external core_lib name 'cvGEMM';
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvInvert; external core_lib;
|
|
|
|
|
|
|
|
|
|
function cvFastArctan; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvCbrt; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvCheckArr; external core_lib;
|
|
|
|
|
|
|
|
|
|
procedure cvGetTextSize; external core_lib;
|
|
|
|
|
|
|
|
|
|
procedure cvInitTreeNodeIterator; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvNextTreeNode; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvPrevTreeNode; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvInsertNodeIntoTree; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
procedure cvRemoveNodeFromTree; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvTreeToNodeSeq; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
|
function cvKMeans2; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvAndS; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvOrS; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvCmp; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvCmpS; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvMin; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvMax; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvMinS; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvMaxS; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvAbsDiffS; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSort; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvSolveCubic; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSolvePoly; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvTransform; external core_lib;
|
2017-09-22 22:11:32 +02:00
|
|
|
|
procedure cvMatMulAddS; external core_lib name 'cvTransform';
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvPerspectiveTransform; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvMulTransposed; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvTranspose; external core_lib;
|
2017-09-22 22:11:32 +02:00
|
|
|
|
procedure cvT; external core_lib name 'cvTranspose';
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvCompleteSymm; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSVD; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSVBkSb; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvSolve; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvDet; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvTrace; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvEigenVV; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSetIdentity; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvRange; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvCalcCovarMatrix; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvCalcPCA; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvProjectPCA; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvBackProjectPCA; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvMahalanobis; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvAvg; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvAvgSdv; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvNormalize; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvReduce; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvSliceLength; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSaveMemStoragePos; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvRestoreMemStoragePos; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvMemStorageAlloc; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvMemStorageAllocString; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSetSeqBlockSize; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvSeqPushFront; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSeqPop; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSeqPopFront; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSeqPushMulti; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSeqPopMulti; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvSeqInsert; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvSeqElemIdx; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvStartAppendToSeq; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvStartWriteSeq; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvEndWriteSeq; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvFlushSeqWriter; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvGetSeqReaderPos; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSetSeqReaderPos; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvMakeSeqHeaderForArray; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvSeqSlice; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSeqRemoveSlice; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSeqInsertSlice; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSeqSort; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvSeqSearch; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSeqInvert; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvCreateSet; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvSetAdd; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSetRemove; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvClearSet; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvCreateGraph; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvGraphAddVtx; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvGraphRemoveVtx; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvGraphRemoveVtxByPtr; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvGraphAddEdge; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvGraphAddEdgeByPtr; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvGraphRemoveEdge; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvGraphRemoveEdgeByPtr; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvFindGraphEdge; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvFindGraphEdgeByPtr; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvClearGraph; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvGraphVtxDegree; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvGraphVtxDegreeByPtr; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvCreateGraphScanner; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvReleaseGraphScanner; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvNextGraphItem; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvCloneGraph; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvRectangleR; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvFillPoly; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvClipLine; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvInitLineIterator; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvColorToScalar; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvEllipse2Poly; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvLUT; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvRegisterModule; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvUseOptimized; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvGetModuleInfo; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSetMemoryManager; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvSetIPLAllocators; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvAttrValue; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvStartWriteStruct; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvEndWriteStruct; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvStartNextStream; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvWriteRawData; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvGetHashedKey; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvGetRootFileNode; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvGetFileNode; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvStartReadRawData; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvReadRawDataSlice; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvReadRawData; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvWriteFileNode; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvGetFileNodeName; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvRegisterType; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
procedure cvUnregisterType; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvFirstType; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvFindType; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvTypeOf; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvClone; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvErrorStr; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvGetErrInfo; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvErrorFromIppStatus; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvRedirectError; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvNulDevReport; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvStdErrReport; external core_lib;
|
2017-09-07 12:38:44 +02:00
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
|
function cvGuiBoxReport; external core_lib;
|
2013-09-25 21:18:23 +02:00
|
|
|
|
|
2017-09-08 11:02:08 +02:00
|
|
|
|
procedure cvDecRefData(arr: pCvArr); inline;
|
|
|
|
|
Var
|
|
|
|
|
mat: pCvMat;
|
|
|
|
|
matND: pCvMatND;
|
|
|
|
|
begin
|
|
|
|
|
if CV_IS_MAT(arr) then
|
|
|
|
|
begin
|
|
|
|
|
// CvMat* mat = (CvMat*)arr;
|
|
|
|
|
mat := arr;
|
|
|
|
|
// mat->data.ptr = NULL;
|
|
|
|
|
mat^.data.ptr := nil;
|
|
|
|
|
// if( mat->refcount != NULL && --*mat->refcount == 0 )
|
|
|
|
|
if Assigned(mat^.refcount) then
|
|
|
|
|
begin
|
|
|
|
|
Dec(mat^.refcount^);
|
|
|
|
|
if (mat^.refcount^ = 0) then
|
|
|
|
|
begin
|
|
|
|
|
cvFree(mat^.refcount);
|
|
|
|
|
mat^.refcount := nil;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else if CV_IS_MATND(arr) then
|
|
|
|
|
begin
|
|
|
|
|
// CvMatND* mat = (CvMatND*)arr;
|
|
|
|
|
matND := arr;
|
|
|
|
|
// mat->data.ptr = NULL;
|
|
|
|
|
matND^.data.ptr := nil;
|
|
|
|
|
// if( mat->refcount != NULL && --*mat->refcount == 0 )
|
|
|
|
|
if Assigned(matND^.refcount) then
|
|
|
|
|
begin
|
|
|
|
|
Dec(matND^.refcount^);
|
|
|
|
|
if (matND^.refcount^ = 0) then
|
|
|
|
|
begin
|
|
|
|
|
cvFree(matND^.refcount);
|
|
|
|
|
matND^.refcount := nil;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
2017-09-10 01:16:52 +02:00
|
|
|
|
function cvIncRefData(arr: pCvArr): Integer; inline;
|
|
|
|
|
Var
|
|
|
|
|
mat: pCvMat;
|
|
|
|
|
matND: pCvMatND;
|
|
|
|
|
begin
|
2017-09-11 23:15:07 +02:00
|
|
|
|
result := 0;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
if CV_IS_MAT(arr) then
|
|
|
|
|
begin
|
|
|
|
|
// CvMat* mat = (CvMat*)arr;
|
|
|
|
|
mat := arr;
|
|
|
|
|
// if( mat->refcount != NULL )
|
|
|
|
|
// refcount = ++*mat->refcount;
|
|
|
|
|
if Assigned(mat^.refcount) then
|
|
|
|
|
begin
|
|
|
|
|
Inc(mat^.refcount^);
|
|
|
|
|
result := mat^.refcount^;
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else if CV_IS_MATND(arr) then
|
|
|
|
|
begin
|
|
|
|
|
// CvMatND* mat = (CvMatND*)arr;
|
|
|
|
|
matND := arr;
|
|
|
|
|
// if( mat->refcount != NULL )
|
|
|
|
|
// refcount = ++*mat->refcount;
|
|
|
|
|
if Assigned(matND^.refcount) then
|
|
|
|
|
begin
|
|
|
|
|
Inc(matND^.refcount^);
|
|
|
|
|
result := matND^.refcount^;
|
|
|
|
|
end;
|
2017-09-11 23:15:07 +02:00
|
|
|
|
end;
|
2017-09-10 01:16:52 +02:00
|
|
|
|
end;
|
|
|
|
|
|
2017-09-12 15:30:23 +02:00
|
|
|
|
procedure cvCvtPixToPlane; external core_lib name 'cvSplit';
|
|
|
|
|
procedure cvCvtPlaneToPix; external core_lib name 'cvMerge';
|
|
|
|
|
|
2013-01-01 13:29:34 +01:00
|
|
|
|
end.
|