Update function def

Signed-off-by: Laentir Valetov <laex@bk.ru>
This commit is contained in:
Laentir Valetov 2014-10-10 23:08:51 +04:00
parent fe2351f5da
commit 4714f021ae
7 changed files with 1653 additions and 1620 deletions

6
.gitignore vendored
View File

@ -1,9 +1,13 @@
buildtest
__history __history
Debug Debug
Release Release
ipch ipch
lib lib
/resource/result/*.* /resource/result/*.*
/bin/Win32/*.exe
/bin/Win64/*.exe
*.ini *.ini
*.bsc *.bsc
*.sdf *.sdf
@ -12,8 +16,6 @@ lib
*.~* *.~*
*.dcu *.dcu
*.local *.local
/bin/Win32/*.exe
/bin/Win64/*.exe
*.dsk *.dsk
*.identcache *.identcache
*.tvsconfig *.tvsconfig

View File

@ -116,7 +116,7 @@
<DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput> <DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo> <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Locale>1033</VerInfo_Locale> <VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;LastCompiledTime=06.10.2014 22:47:34</VerInfo_Keys> <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;LastCompiledTime=06.10.2014 22:49:19</VerInfo_Keys>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win64)'!=''"> <PropertyGroup Condition="'$(Cfg_2_Win64)'!=''">
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo> <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>

View File

@ -1,87 +1,48 @@
// --------------------------------- OpenCV license.txt --------------------------- // **************************************************************************************************
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // Project Delphi-OpenCV
// // **************************************************************************************************
// By downloading, copying, installing or using the software you agree to this license. // Contributor:
// If you do not agree to this license, do not download, install, // Laentir Valetov
// copy or use the software. // email:laex@bk.ru
// // Mikhail Grigorev
// // email:sleuthound@gmail.com
// License Agreement // **************************************************************************************************
// For Open Source Computer Vision Library // You may retrieve the latest version of this file at the GitHub,
// // located at git://github.com/Laex/Delphi-OpenCV.git
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. // **************************************************************************************************
// Copyright (C) 2009, Willow Garage Inc., all rights reserved. // License:
// Third party copyrights are property of their respective owners. // 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
// Redistribution and use in source and binary forms, with or without modification, // License at http://www.mozilla.org/MPL/
// are permitted provided that the following conditions are met: //
// // Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
// * Redistribution's of source code must retain the above copyright notice, // ANY KIND, either express or implied. See the License for the specific language governing rights
// this list of conditions and the following disclaimer. // and limitations under the License.
// //
// * Redistribution's in binary form must reproduce the above copyright notice, // Alternatively, the contents of this file may be used under the terms of the
// this list of conditions and the following disclaimer in the documentation // GNU Lesser General Public License (the "LGPL License"), in which case the
// and/or other materials provided with the distribution. // 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
// * The name of the copyright holders may not be used to endorse or promote products // of the LGPL License and not to allow others to use your version of this file
// derived from this software without specific prior written permission. // under the MPL, indicate your decision by deleting the provisions above and
// // replace them with the notice and other provisions required by the LGPL
// This software is provided by the copyright holders and contributors "as is" and // License. If you do not delete the provisions above, a recipient may use
// any express or implied warranties, including, but not limited to, the implied // your version of this file under either the MPL or the LGPL License.
// warranties of merchantability and fitness for a particular purpose are disclaimed. //
// In no event shall the Intel Corporation or contributors be liable for any direct, // For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html
// indirect, incidental, special, exemplary, or consequential damages // **************************************************************************************************
// (including, but not limited to, procurement of substitute goods or services; // Warning: Using Delphi XE3 syntax!
// loss of use, data, or profits; or business interruption) however caused // **************************************************************************************************
// and on any theory of liability, whether in contract, strict liability, // The Initial Developer of the Original Code:
// or tort (including negligence or otherwise) arising in any way out of // OpenCV: open source computer vision library
// the use of this software, even if advised of the possibility of such damage. // Homepage: http://ocv.org
// Online docs: http://docs.ocv.org
//************************************************************************************************** // Q&A forum: http://answers.ocv.org
// Project Delphi-OpenCV // Dev zone: http://code.ocv.org
// ************************************************************************************************** // **************************************************************************************************
// Contributor: // Original file:
// Laentir Valetov // opencv\modules\calib3d\include\opencv2\calib3d\calib3d_c.h
// email:laex@bk.ru // *************************************************************************************************
// Mikhail Grigorev
// email:sleuthound@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\calib3d\include\opencv2\calib3d\calib3d_c.h
// *************************************************************************************************
{$IFDEF DEBUG} {$IFDEF DEBUG}
{$A8,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O-,P+,Q+,R+,S-,T-,U-,V+,W+,X+,Y+,Z1} {$A8,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O-,P+,Q+,R+,S-,T-,U-,V+,W+,X+,Y+,Z1}

View File

@ -1,42 +1,3 @@
// --------------------------------- OpenCV license.txt ---------------------------
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
// ************************************************************************************************** // **************************************************************************************************
// Project Delphi-OpenCV // Project Delphi-OpenCV
// ************************************************************************************************** // **************************************************************************************************
@ -112,6 +73,7 @@ uses
(as well as other OpenCV functions that call cvAlloc) (as well as other OpenCV functions that call cvAlloc)
raises an error. raises an error.
} }
{$EXTERNALSYM cvAlloc}
function cvAlloc(size: NativeUInt): Pointer; cdecl; function cvAlloc(size: NativeUInt): Pointer; cdecl;
{ <free> wrapper. { <free> wrapper.
@ -120,11 +82,14 @@ function cvAlloc(size: NativeUInt): Pointer; cdecl;
to clear cPointer to the data after releasing it. to clear cPointer to the data after releasing it.
Passing cPointer to 0 cPointer is Ok: nothing happens in this Passing cPointer to 0 cPointer is Ok: nothing happens in this
} }
{$EXTERNALSYM cvFree_}
procedure cvFree_(ptr: Pointer); cdecl; procedure cvFree_(ptr: Pointer); cdecl;
{$EXTERNALSYM cvFree}
procedure cvFree(var ptr); {$IFDEF USE_INLINE}inline; {$ENDIF} procedure cvFree(var ptr); {$IFDEF USE_INLINE}inline; {$ENDIF}
{ Allocates and initializes IplImage header { Allocates and initializes IplImage header
CVAPI(IplImage*) cvCreateImageHeader( CvSize size, int depth, int channels ); CVAPI(IplImage*) cvCreateImageHeader( CvSize size, int depth, int channels );
} }
{$EXTERNALSYM cvCreateImageHeader}
function cvCreateImageHeader(size: TCvSize; depth: Integer; channels: Integer): pIplImage; cdecl; function cvCreateImageHeader(size: TCvSize; depth: Integer; channels: Integer): pIplImage; cdecl;
{ Inializes IplImage header { Inializes IplImage header
@ -132,58 +97,69 @@ function cvCreateImageHeader(size: TCvSize; depth: Integer; channels: Integer):
int channels, int origin CV_DEFAULT(0), int channels, int origin CV_DEFAULT(0),
int align CV_DEFAULT(4)); int align CV_DEFAULT(4));
} }
{$EXTERNALSYM cvInitImageHeader}
function cvInitImageHeader(image: pIplImage; size: TCvSize; depth: Integer; channels: Integer; origin: Integer = 0; function cvInitImageHeader(image: pIplImage; size: TCvSize; depth: Integer; channels: Integer; origin: Integer = 0;
align: Integer = 4): pIplImage; cdecl; align: Integer = 4): pIplImage; cdecl;
{ Creates IPL image (header and data { Creates IPL image (header and data
CVAPI(IplImage*) cvCreateImage( CvSize size, int depth, int channels ); CVAPI(IplImage*) cvCreateImage( CvSize size, int depth, int channels );
} }
{$EXTERNALSYM cvCreateImage}
function cvCreateImage(size: TCvSize; depth, channels: Integer): pIplImage; cdecl; function cvCreateImage(size: TCvSize; depth, channels: Integer): pIplImage; cdecl;
{ Releases (i.e. deallocates) IPL image header { Releases (i.e. deallocates) IPL image header
CVAPI(void) cvReleaseImageHeader( IplImage** image ); CVAPI(void) cvReleaseImageHeader( IplImage** image );
} }
{$EXTERNALSYM cvReleaseImageHeader}
procedure cvReleaseImageHeader(var image: pIplImage); cdecl; procedure cvReleaseImageHeader(var image: pIplImage); cdecl;
{ Releases IPL image header and data { Releases IPL image header and data
CVAPI(void) cvReleaseImage( IplImage** image ); CVAPI(void) cvReleaseImage( IplImage** image );
} }
{$EXTERNALSYM cvReleaseImage}
procedure cvReleaseImage(var image: pIplImage); cdecl; procedure cvReleaseImage(var image: pIplImage); cdecl;
{ Creates a copy of IPL image (widthStep may differ) { Creates a copy of IPL image (widthStep may differ)
CVAPI(IplImage*) cvCloneImage( const IplImage* image ); CVAPI(IplImage*) cvCloneImage( const IplImage* image );
} }
{$EXTERNALSYM cvCloneImage}
function cvCloneImage(const image: pIplImage): pIplImage; cdecl; function cvCloneImage(const image: pIplImage): pIplImage; cdecl;
{ Sets a Channel Of Interest (only a few functions support COI) - { Sets a Channel Of Interest (only a few functions support COI) -
use cvCopy to extract the selected channel and/or put it back use cvCopy to extract the selected channel and/or put it back
CVAPI(void) cvSetImageCOI( IplImage* image, int coi ); CVAPI(void) cvSetImageCOI( IplImage* image, int coi );
} }
{$EXTERNALSYM cvSetImageCOI}
procedure cvSetImageCOI(image: pIplImage; coi: Integer); cdecl; procedure cvSetImageCOI(image: pIplImage; coi: Integer); cdecl;
{ Retrieves image Channel Of Interest { Retrieves image Channel Of Interest
CVAPI(int) cvGetImageCOI( const IplImage* image ); CVAPI(int) cvGetImageCOI( const IplImage* image );
} }
{$EXTERNALSYM cvGetImageCOI}
function cvGetImageCOI(const image: pIplImage): Integer; cdecl; function cvGetImageCOI(const image: pIplImage): Integer; cdecl;
{ Sets image ROI (region of interest) (COI is not changed) { Sets image ROI (region of interest) (COI is not changed)
CVAPI(void) cvSetImageROI( IplImage* image, CvRect rect ); CVAPI(void) cvSetImageROI( IplImage* image, CvRect rect );
} }
{$EXTERNALSYM cvSetImageROI}
procedure cvSetImageROI(image: pIplImage; rect: TCvRect); cdecl; procedure cvSetImageROI(image: pIplImage; rect: TCvRect); cdecl;
{ Resets image ROI and COI { Resets image ROI and COI
CVAPI(void) cvResetImageROI( IplImage* image ); CVAPI(void) cvResetImageROI( IplImage* image );
} }
{$EXTERNALSYM cvResetImageROI}
procedure cvResetImageROI(image: pIplImage); cdecl; procedure cvResetImageROI(image: pIplImage); cdecl;
{ Retrieves image ROI { Retrieves image ROI
CVAPI(CvRect) cvGetImageROI( const IplImage* image ); CVAPI(CvRect) cvGetImageROI( const IplImage* image );
} }
{$EXTERNALSYM cvGetImageROI}
function cvGetImageROI(const image: pIplImage): TCvRect; cdecl; function cvGetImageROI(const image: pIplImage): TCvRect; cdecl;
{ Allocates and initalizes CvMat header { Allocates and initalizes CvMat header
CVAPI(CvMat*) cvCreateMatHeader( int rows, int cols, int type ); CVAPI(CvMat*) cvCreateMatHeader( int rows, int cols, int type );
} }
{$EXTERNALSYM cvCreateMatHeader}
function cvCreateMatHeader(rows: Integer; cols: Integer; cType: Integer): TCvMat; cdecl; function cvCreateMatHeader(rows: Integer; cols: Integer; cType: Integer): TCvMat; cdecl;
const const
@ -194,18 +170,21 @@ const
int type, void* data CV_DEFAULT(NULL), int type, void* data CV_DEFAULT(NULL),
int step CV_DEFAULT(CV_AUTOSTEP) ); int step CV_DEFAULT(CV_AUTOSTEP) );
} }
{$EXTERNALSYM cvInitMatHeader}
function cvInitMatHeader(mat: pCvMat; rows: Integer; cols: Integer; _type: Integer; data: Pointer = nil; function cvInitMatHeader(mat: pCvMat; rows: Integer; cols: Integer; _type: Integer; data: Pointer = nil;
step: Integer = CV_AUTOSTEP): pCvMat; cdecl; step: Integer = CV_AUTOSTEP): pCvMat; cdecl;
{ Allocates and initializes CvMat header and allocates data { Allocates and initializes CvMat header and allocates data
CVAPI(CvMat*) cvCreateMat( int rows, int cols, int type ); CVAPI(CvMat*) cvCreateMat( int rows, int cols, int type );
} }
{$EXTERNALSYM cvCreateMat}
function cvCreateMat(rows, cols, cType: Integer): pCvMat; cdecl; function cvCreateMat(rows, cols, cType: Integer): pCvMat; cdecl;
{ Releases CvMat header and deallocates matrix data { Releases CvMat header and deallocates matrix data
(reference counting is used for data) (reference counting is used for data)
CVAPI(void) cvReleaseMat( CvMat** mat ); CVAPI(void) cvReleaseMat( CvMat** mat );
} }
{$EXTERNALSYM cvReleaseMat}
procedure cvReleaseMat(var mat: pCvMat); cdecl; procedure cvReleaseMat(var mat: pCvMat); cdecl;
// Decrements CvMat data reference counter and deallocates the data if // Decrements CvMat data reference counter and deallocates the data if
@ -252,6 +231,7 @@ procedure cvReleaseMat(var mat: pCvMat); cdecl;
{ Creates an exact copy of the input matrix (except, may be, step value) { Creates an exact copy of the input matrix (except, may be, step value)
CVAPI(CvMat*) cvCloneMat( const CvMat* mat ); CVAPI(CvMat*) cvCloneMat( const CvMat* mat );
} }
{$EXTERNALSYM cvCloneMat}
function cvCloneMat(const mat: pCvMat): pCvMat; cdecl; function cvCloneMat(const mat: pCvMat): pCvMat; cdecl;
{ Makes a new matrix from <rect> subrectangle of input array. { Makes a new matrix from <rect> subrectangle of input array.
@ -259,6 +239,7 @@ function cvCloneMat(const mat: pCvMat): pCvMat; cdecl;
CVAPI(CvMat*) cvGetSubRect( const pCvArr* arr, CvMat* submat, CvRect rect ); CVAPI(CvMat*) cvGetSubRect( const pCvArr* arr, CvMat* submat, CvRect rect );
#define cvGetSubArr cvGetSubRect #define cvGetSubArr cvGetSubRect
} }
{$EXTERNALSYM cvGetSubRect}
function cvGetSubRect(arr: pCvArr; submat: pCvArr; rect: TCvRect): pCvMat; cdecl; function cvGetSubRect(arr: pCvArr; submat: pCvArr; rect: TCvRect): pCvMat; cdecl;
{ Selects row span of the input array: arr(start_row:delta_row:end_row,:) { Selects row span of the input array: arr(start_row:delta_row:end_row,:)
@ -267,25 +248,29 @@ function cvGetSubRect(arr: pCvArr; submat: pCvArr; rect: TCvRect): pCvMat; cdecl
int start_row, int end_row, int start_row, int end_row,
int delta_row CV_DEFAULT(1)); int delta_row CV_DEFAULT(1));
} }
{$EXTERNALSYM cvGetRows}
function cvGetRows(const arr: pCvArr; submat: pCvMat; start_row, end_row: Integer; delta_row: Integer = 1) function cvGetRows(const arr: pCvArr; submat: pCvMat; start_row, end_row: Integer; delta_row: Integer = 1)
: pCvMat; cdecl; : pCvMat; cdecl;
// CV_INLINE CvMat* cvGetRow( const pCvArr* arr, CvMat* submat, int row ) (*
// { CV_INLINE CvMat* cvGetRow( const pCvArr* arr, CvMat* submat, int row )
// return cvGetRows( arr, submat, row, row + 1, 1 ); { return cvGetRows( arr, submat, row, row + 1, 1 );}
// } *)
{$EXTERNALSYM cvGetRow}
function cvGetRow(const arr: pCvArr; submat: pCvMat; row: Integer): pCvMat; {$IFDEF USE_INLINE}inline; {$ENDIF} function cvGetRow(const arr: pCvArr; submat: pCvMat; row: Integer): pCvMat; {$IFDEF USE_INLINE}inline; {$ENDIF}
{ Selects column span of the input array: arr(:,start_col:end_col) { Selects column span of the input array: arr(:,start_col:end_col)
(end_col is not included into the span) (end_col is not included into the span)
CVAPI(CvMat*) cvGetCols( const pCvArr* arr, CvMat* submat, CVAPI(CvMat*) cvGetCols( const pCvArr* arr, CvMat* submat,
int start_col, int end_col ); int start_col, int end_col );
} }
{$EXTERNALSYM cvGetCols}
function cvGetCols(const arr: pCvArr; submat: pCvMat; start_col, end_col: Integer): pCvMat; cdecl; function cvGetCols(const arr: pCvArr; submat: pCvMat; start_col, end_col: Integer): pCvMat; cdecl;
// CV_INLINE CvMat* cvGetCol( const pCvArr* arr, CvMat* submat, int col ) (*
// { CV_INLINE CvMat* cvGetCol( const pCvArr* arr, CvMat* submat, int col )
// return cvGetCols( arr, submat, col, col + 1 ); {return cvGetCols( arr, submat, col, col + 1 );}
// } *)
{$EXTERNALSYM cvGetCol}
function cvGetCol(const arr: pCvArr; submat: pCvMat; col: Integer): pCvMat; {$IFDEF USE_INLINE}inline; {$ENDIF} function cvGetCol(const arr: pCvArr; submat: pCvMat; col: Integer): pCvMat; {$IFDEF USE_INLINE}inline; {$ENDIF}
{ Select a diagonal of the input array. { Select a diagonal of the input array.
(diag = 0 means the main diagonal, >0 means a diagonal above the main one, (diag = 0 means the main diagonal, >0 means a diagonal above the main one,
@ -294,58 +279,70 @@ function cvGetCol(const arr: pCvArr; submat: pCvMat; col: Integer): pCvMat; {$IF
CVAPI(CvMat*) cvGetDiag( const pCvArr* arr, CvMat* submat, CVAPI(CvMat*) cvGetDiag( const pCvArr* arr, CvMat* submat,
int diag CV_DEFAULT(0)); int diag CV_DEFAULT(0));
} }
{$EXTERNALSYM cvGetDiag}
function cvGetDiag(const arr: pCvArr; submat: pCvMat; diag: Integer = 0): pCvMat; cdecl; function cvGetDiag(const arr: pCvArr; submat: pCvMat; diag: Integer = 0): pCvMat; cdecl;
{ low-level scalar <-> raw data conversion functions { low-level scalar <-> raw data conversion functions
CVAPI(void) cvScalarToRawData( const CvScalar* scalar, void* data, int type, CVAPI(void) cvScalarToRawData( const CvScalar* scalar, void* data, int type,
int extend_to_12 CV_DEFAULT(0) ); int extend_to_12 CV_DEFAULT(0) );
} }
{$EXTERNALSYM cvScalarToRawData}
procedure cvScalarToRawData(const scalar: pCvScalar; data: pCvArr; cType: Integer; extend_to_12: Integer = 0); cdecl; procedure cvScalarToRawData(const scalar: pCvScalar; data: pCvArr; cType: Integer; extend_to_12: Integer = 0); cdecl;
// CVAPI(void) cvRawDataToScalar( const void* data, int type, CvScalar* scalar ); // CVAPI(void) cvRawDataToScalar( const void* data, int type, CvScalar* scalar );
{$EXTERNALSYM cvRawDataToScalar}
procedure cvRawDataToScalar(const data: pCvArr; cType: Integer; scalar: pCvScalar); cdecl; procedure cvRawDataToScalar(const data: pCvArr; cType: Integer; scalar: pCvScalar); cdecl;
{ Allocates and initializes CvMatND header { Allocates and initializes CvMatND header
CVAPI(CvMatND*) cvCreateMatNDHeader( int dims, const int* sizes, int type ); CVAPI(CvMatND*) cvCreateMatNDHeader( int dims, const int* sizes, int type );
} }
{$EXTERNALSYM cvCreateMatNDHeader}
function cvCreateMatNDHeader(dims: Integer; const sizes: pInteger; cType: Integer): pCvMatND; cdecl; function cvCreateMatNDHeader(dims: Integer; const sizes: pInteger; cType: Integer): pCvMatND; cdecl;
{ Allocates and initializes CvMatND header and allocates data { Allocates and initializes CvMatND header and allocates data
CVAPI(CvMatND*) cvCreateMatND( int dims, const int* sizes, int type ); CVAPI(CvMatND*) cvCreateMatND( int dims, const int* sizes, int type );
} }
{$EXTERNALSYM cvCreateMatND}
function cvCreateMatND(dims: Integer; const sizes: pInteger; cType: Integer): pCvMatND; cdecl; function cvCreateMatND(dims: Integer; const sizes: pInteger; cType: Integer): pCvMatND; cdecl;
{ Initializes preallocated CvMatND header */ { Initializes preallocated CvMatND header */
CVAPI(CvMatND*) cvInitMatNDHeader( CvMatND* mat, int dims, const int* sizes, CVAPI(CvMatND*) cvInitMatNDHeader( CvMatND* mat, int dims, const int* sizes,
int type, void* data CV_DEFAULT(NULL) ); int type, void* data CV_DEFAULT(NULL) );
} }
{$EXTERNALSYM cvInitMatNDHeader}
function cvInitMatNDHeader(mat: pCvMatND; dims: Integer; const sizes: pInteger; cType: Integer; data: pCvArr = nil) function cvInitMatNDHeader(mat: pCvMatND; dims: Integer; const sizes: pInteger; cType: Integer; data: pCvArr = nil)
: pCvMatND; cdecl; : pCvMatND; cdecl;
// Releases CvMatND (*
// CV_INLINE void cvReleaseMatND( CvMatND** mat ) Releases CvMatND
// {
// cvReleaseMat( (CvMat**)mat ); CV_INLINE void cvReleaseMatND( CvMatND** mat )
// } {cvReleaseMat( (CvMat** )mat ); }
*)
{$EXTERNALSYM cvReleaseMatND}
procedure cvReleaseMatND(var mat: pCvMatND); {$IFDEF USE_INLINE}inline; {$ENDIF} procedure cvReleaseMatND(var mat: pCvMatND); {$IFDEF USE_INLINE}inline; {$ENDIF}
{ Creates a copy of CvMatND (except, may be, steps) { Creates a copy of CvMatND (except, may be, steps)
CVAPI(CvMatND*) cvCloneMatND( const CvMatND* mat ); CVAPI(CvMatND*) cvCloneMatND( const CvMatND* mat );
} }
{$EXTERNALSYM cvCloneMatND}
function cvCloneMatND(const mat: pCvMatND): pCvMatND; cdecl; function cvCloneMatND(const mat: pCvMatND): pCvMatND; cdecl;
{ Allocates and initializes CvSparseMat header and allocates data { Allocates and initializes CvSparseMat header and allocates data
CVAPI(CvSparseMat*) cvCreateSparseMat( int dims, const int* sizes, int type ); CVAPI(CvSparseMat*) cvCreateSparseMat( int dims, const int* sizes, int type );
} }
{$EXTERNALSYM cvCreateSparseMat}
function cvCreateSparseMat(dims: Integer; sizes: pInteger; cType: Integer): pCvSparseMat; cdecl; function cvCreateSparseMat(dims: Integer; sizes: pInteger; cType: Integer): pCvSparseMat; cdecl;
{ Releases CvSparseMat { Releases CvSparseMat
CVAPI(void) cvReleaseSparseMat( CvSparseMat** mat ); CVAPI(void) cvReleaseSparseMat( CvSparseMat** mat );
} }
{$EXTERNALSYM cvReleaseSparseMat}
procedure cvReleaseSparseMat(mat: pCvSparseMat); cdecl; procedure cvReleaseSparseMat(mat: pCvSparseMat); cdecl;
{ Creates a copy of CvSparseMat (except, may be, zero items) { Creates a copy of CvSparseMat (except, may be, zero items)
CVAPI(CvSparseMat*) cvCloneSparseMat( const CvSparseMat* mat ); CVAPI(CvSparseMat*) cvCloneSparseMat( const CvSparseMat* mat );
} }
{$EXTERNALSYM cvCloneSparseMat}
function cvCloneSparseMat(const mat: pCvSparseMat): pCvSparseMat; cdecl; function cvCloneSparseMat(const mat: pCvSparseMat): pCvSparseMat; cdecl;
{ Initializes sparse array iterator { Initializes sparse array iterator
@ -353,10 +350,12 @@ function cvCloneSparseMat(const mat: pCvSparseMat): pCvSparseMat; cdecl;
CVAPI(CvSparseNode*) cvInitSparseMatIterator( const CvSparseMat* mat, CVAPI(CvSparseNode*) cvInitSparseMatIterator( const CvSparseMat* mat,
CvSparseMatIterator* mat_iterator ); CvSparseMatIterator* mat_iterator );
} }
{$EXTERNALSYM cvInitSparseMatIterator}
function cvInitSparseMatIterator(const mat: pCvSparseMat; mat_iterator: pCvSparseMatIterator): pCvSparseNode; cdecl; function cvInitSparseMatIterator(const mat: pCvSparseMat; mat_iterator: pCvSparseMatIterator): pCvSparseNode; cdecl;
// returns next sparse array node (or NULL if there is no more nodes) // returns next sparse array node (or NULL if there is no more nodes)
{$IFDEF DELPHIXE_UP} {$IFDEF DELPHIXE_UP}
{$EXTERNALSYM cvGetNextSparseNode}
function cvGetNextSparseNode(mat_iterator: pCvSparseMatIterator): pCvSparseNode; {$IFDEF USE_INLINE}inline; {$ENDIF} function cvGetNextSparseNode(mat_iterator: pCvSparseMatIterator): pCvSparseNode; {$IFDEF USE_INLINE}inline; {$ENDIF}
{$ENDIF} {$ENDIF}
@ -376,24 +375,28 @@ const
CvNArrayIterator* array_iterator, CvNArrayIterator* array_iterator,
int flags CV_DEFAULT(0) ); int flags CV_DEFAULT(0) );
} }
{$EXTERNALSYM cvInitNArrayIterator}
function cvInitNArrayIterator(count: Integer; arrs: pCvArr; const mask: pCvArr; stubs: pCvMatND; function cvInitNArrayIterator(count: Integer; arrs: pCvArr; const mask: pCvArr; stubs: pCvMatND;
array_iterator: pCvNArrayIterator; flags: Integer = 0): Integer; cdecl; array_iterator: pCvNArrayIterator; flags: Integer = 0): Integer; cdecl;
{ returns zero value if iteration is finished, non-zero (slice length) otherwise */ { returns zero value if iteration is finished, non-zero (slice length) otherwise */
CVAPI(int) cvNextNArraySlice( CvNArrayIterator* array_iterator ); CVAPI(int) cvNextNArraySlice( CvNArrayIterator* array_iterator );
} }
{$EXTERNALSYM cvNextNArraySlice}
function cvNextNArraySlice(array_iterator: pCvNArrayIterator): Integer; cdecl; function cvNextNArraySlice(array_iterator: pCvNArrayIterator): Integer; cdecl;
{ Returns type of array elements: { Returns type of array elements:
CV_8UC1 ... CV_64FC4 ... CV_8UC1 ... CV_64FC4 ...
CVAPI(int) cvGetElemType( const pCvArr* arr ); CVAPI(int) cvGetElemType( const pCvArr* arr );
} }
{$EXTERNALSYM cvGetElemType}
function cvGetElemType(const arr: pCvArr): Integer; cdecl; function cvGetElemType(const arr: pCvArr): Integer; cdecl;
{ Retrieves number of an array dimensions and { Retrieves number of an array dimensions and
optionally sizes of the dimensions */ optionally sizes of the dimensions */
CVAPI(int) cvGetDims( const pCvArr* arr, int* sizes CV_DEFAULT(NULL) ); CVAPI(int) cvGetDims( const pCvArr* arr, int* sizes CV_DEFAULT(NULL) );
} }
{$EXTERNALSYM cvGetDims}
function cvGetDims(const arr: pCvArr; sizes: pInteger = nil): Integer; cdecl; function cvGetDims(const arr: pCvArr; sizes: pInteger = nil): Integer; cdecl;
{ Retrieves size of a particular array dimension. { Retrieves size of a particular array dimension.
@ -401,6 +404,7 @@ function cvGetDims(const arr: pCvArr; sizes: pInteger = nil): Integer; cdecl;
and cvGetDimSize(arr,1) returns number of columns (image width) */ and cvGetDimSize(arr,1) returns number of columns (image width) */
CVAPI(int) cvGetDimSize( const pCvArr* arr, int index ); CVAPI(int) cvGetDimSize( const pCvArr* arr, int index );
} }
{$EXTERNALSYM cvGetDimSize}
function cvGetDimSize(const arr: pCvArr; index: Integer): Integer; cdecl; function cvGetDimSize(const arr: pCvArr; index: Integer): Integer; cdecl;
{ ptr = &arr(idx0,idx1,...). All indexes are zero-based, { ptr = &arr(idx0,idx1,...). All indexes are zero-based,
@ -410,8 +414,11 @@ function cvGetDimSize(const arr: pCvArr; index: Integer): Integer; cdecl;
CVAPI(uchar*) cvPtr3D( const pCvArr* arr, int idx0, int idx1, int idx2, CVAPI(uchar*) cvPtr3D( const pCvArr* arr, int idx0, int idx1, int idx2,
int* type CV_DEFAULT(NULL)); int* type CV_DEFAULT(NULL));
} }
{$EXTERNALSYM cvPtr1D}
function cvPtr1D(const arr: pCvArr; idx0: Integer; cType: pInteger = nil): pCvArr; cdecl; function cvPtr1D(const arr: pCvArr; idx0: Integer; cType: pInteger = nil): pCvArr; cdecl;
{$EXTERNALSYM cvPtr2D}
function cvPtr2D(const arr: pCvArr; idx0, idx1: Integer; cType: pInteger = nil): pCvArr; cdecl; function cvPtr2D(const arr: pCvArr; idx0, idx1: Integer; cType: pInteger = nil): pCvArr; cdecl;
{$EXTERNALSYM cvPtr3D}
function cvPtr3D(const arr: pCvArr; idx0, idx1, idx2: Integer; cType: pInteger = nil): pCvArr; cdecl; function cvPtr3D(const arr: pCvArr; idx0, idx1, idx2: Integer; cType: pInteger = nil): pCvArr; cdecl;
{ For CvMat or IplImage number of indices should be 2 { For CvMat or IplImage number of indices should be 2
@ -422,6 +429,7 @@ function cvPtr3D(const arr: pCvArr; idx0, idx1, idx2: Integer; cType: pInteger =
int create_node CV_DEFAULT(1), int create_node CV_DEFAULT(1),
unsigned* precalc_hashval CV_DEFAULT(NULL)); unsigned* precalc_hashval CV_DEFAULT(NULL));
} }
{$EXTERNALSYM cvPtrND}
function cvPtrND(const arr: pCvArr; idx: pInteger; cType: pInteger = nil; create_node: Integer = 1; function cvPtrND(const arr: pCvArr; idx: pInteger; cType: pInteger = nil; create_node: Integer = 1;
precalc_hashval: punsigned = nil): pCvArr; cdecl; precalc_hashval: punsigned = nil): pCvArr; cdecl;
@ -431,10 +439,14 @@ function cvPtrND(const arr: pCvArr; idx: pInteger; cType: pInteger = nil; create
CVAPI(CvScalar) cvGet3D( const pCvArr* arr, int idx0, int idx1, int idx2 ); CVAPI(CvScalar) cvGet3D( const pCvArr* arr, int idx0, int idx1, int idx2 );
CVAPI(CvScalar) cvGetND( const pCvArr* arr, const int* idx ); CVAPI(CvScalar) cvGetND( const pCvArr* arr, const int* idx );
} }
{$EXTERNALSYM cvGet1D}
function cvGet1D(const arr: pCvArr; idx0: Integer): TCvScalar; cdecl; function cvGet1D(const arr: pCvArr; idx0: Integer): TCvScalar; cdecl;
{$EXTERNALSYM cvGet2D}
function cvGet2D(const arr: pCvMat; idx0, idx1: Integer): TCvScalar; cdecl; function cvGet2D(const arr: pCvMat; idx0, idx1: Integer): TCvScalar; cdecl;
// function cvGet2D(const arr: pCvArr; idx0, idx1: Integer): TCvScalar; cdecl; // function cvGet2D(const arr: pCvArr; idx0, idx1: Integer): TCvScalar; cdecl;
{$EXTERNALSYM cvGet3D}
function cvGet3D(const arr: pCvArr; idx0, idx1, idx2: Integer): TCvScalar; cdecl; function cvGet3D(const arr: pCvArr; idx0, idx1, idx2: Integer): TCvScalar; cdecl;
{$EXTERNALSYM cvGetND}
function cvGetND(const arr: pCvArr; idx: pInteger): TCvScalar; cdecl; function cvGetND(const arr: pCvArr; idx: pInteger): TCvScalar; cdecl;
{ for 1-channel arrays { for 1-channel arrays
@ -443,9 +455,13 @@ function cvGetND(const arr: pCvArr; idx: pInteger): TCvScalar; cdecl;
CVAPI(double) cvGetReal3D( const pCvArr* arr, int idx0, int idx1, int idx2 ); CVAPI(double) cvGetReal3D( const pCvArr* arr, int idx0, int idx1, int idx2 );
CVAPI(double) cvGetRealND( const pCvArr* arr, const int* idx ); CVAPI(double) cvGetRealND( const pCvArr* arr, const int* idx );
} }
{$EXTERNALSYM cvGetReal1D}
function cvGetReal1D(const arr: pIplImage; idx0: Integer): double; cdecl; function cvGetReal1D(const arr: pIplImage; idx0: Integer): double; cdecl;
{$EXTERNALSYM cvGetReal2D}
function cvGetReal2D(const arr: pCvMat; idx0, idx1: Integer): double; cdecl; function cvGetReal2D(const arr: pCvMat; idx0, idx1: Integer): double; cdecl;
{$EXTERNALSYM cvGetReal3D}
function cvGetReal3D(const arr: pCvArr; idx0, idx1, idx2: Integer): double; cdecl; function cvGetReal3D(const arr: pCvArr; idx0, idx1, idx2: Integer): double; cdecl;
{$EXTERNALSYM cvGetRealND}
function cvGetRealND(const arr: pCvArr; idx: pInteger): double; cdecl; function cvGetRealND(const arr: pCvArr; idx: pInteger): double; cdecl;
{ arr(idx0,idx1,...) = value { arr(idx0,idx1,...) = value
@ -454,9 +470,13 @@ function cvGetRealND(const arr: pCvArr; idx: pInteger): double; cdecl;
CVAPI(void) cvSet3D( pCvArr* arr, int idx0, int idx1, int idx2, CvScalar value ); CVAPI(void) cvSet3D( pCvArr* arr, int idx0, int idx1, int idx2, CvScalar value );
CVAPI(void) cvSetND( pCvArr* arr, const int* idx, CvScalar value ); CVAPI(void) cvSetND( pCvArr* arr, const int* idx, CvScalar value );
} }
{$EXTERNALSYM cvSet1D}
procedure cvSet1D(arr: pCvArr; idx0: Integer; var value: TCvScalar); cdecl; procedure cvSet1D(arr: pCvArr; idx0: Integer; var value: TCvScalar); cdecl;
{$EXTERNALSYM cvSet2D}
procedure cvSet2D(arr: pCvArr; idx0, idx1: Integer; var value: TCvScalar); cdecl; procedure cvSet2D(arr: pCvArr; idx0, idx1: Integer; var value: TCvScalar); cdecl;
{$EXTERNALSYM cvSet3D}
procedure cvSet3D(arr: pCvArr; idx0, idx1, idx2: Integer; var value: TCvScalar); cdecl; procedure cvSet3D(arr: pCvArr; idx0, idx1, idx2: Integer; var value: TCvScalar); cdecl;
{$EXTERNALSYM cvSetND}
procedure cvSetND(arr: pCvArr; idx: pInteger; var value: TCvScalar); cdecl; procedure cvSetND(arr: pCvArr; idx: pInteger; var value: TCvScalar); cdecl;
{ for 1-channel arrays */ { for 1-channel arrays */
@ -465,15 +485,20 @@ procedure cvSetND(arr: pCvArr; idx: pInteger; var value: TCvScalar); cdecl;
CVAPI(void) cvSetReal3D( pCvArr* arr, int idx0, int idx1, int idx2, double value ); CVAPI(void) cvSetReal3D( pCvArr* arr, int idx0, int idx1, int idx2, double value );
CVAPI(void) cvSetRealND( pCvArr* arr, const int* idx, double value ); CVAPI(void) cvSetRealND( pCvArr* arr, const int* idx, double value );
} }
{$EXTERNALSYM cvSetReal1D}
procedure cvSetReal1D(arr: pCvArr; idx0: Integer; var value: double); cdecl; procedure cvSetReal1D(arr: pCvArr; idx0: Integer; var value: double); cdecl;
{$EXTERNALSYM cvSetReal2D}
procedure cvSetReal2D(arr: pCvArr; idx0, idx1: Integer; var value: double); cdecl; procedure cvSetReal2D(arr: pCvArr; idx0, idx1: Integer; var value: double); cdecl;
{$EXTERNALSYM cvSetReal3D}
procedure cvSetReal3D(arr: pCvArr; idx0, idx1, idx2: Integer; var value: double); cdecl; procedure cvSetReal3D(arr: pCvArr; idx0, idx1, idx2: Integer; var value: double); cdecl;
{$EXTERNALSYM cvSetRealND}
procedure cvSetRealND(arr: pCvArr; idx: pInteger; var value: double); cdecl; procedure cvSetRealND(arr: pCvArr; idx: pInteger; var value: double); cdecl;
{ clears element of ND dense array, { clears element of ND dense array,
in case of sparse arrays it deletes the specified node */ in case of sparse arrays it deletes the specified node */
CVAPI(void) cvClearND( pCvArr* arr, const int* idx ); CVAPI(void) cvClearND( pCvArr* arr, const int* idx );
} }
{$EXTERNALSYM cvClearND}
procedure cvClearND(arr: pCvArr; idx: pInteger); cdecl; procedure cvClearND(arr: pCvArr; idx: pInteger); cdecl;
{ Converts pCvArr (IplImage or CvMat,...) to CvMat. { Converts pCvArr (IplImage or CvMat,...) to CvMat.
@ -485,11 +510,13 @@ procedure cvClearND(arr: pCvArr; idx: pInteger); cdecl;
int* coi CV_DEFAULT(NULL), int* coi CV_DEFAULT(NULL),
int allowND CV_DEFAULT(0)); int allowND CV_DEFAULT(0));
} }
{$EXTERNALSYM cvGetMat}
function cvGetMat(const arr: pCvArr; header: pCvMat; coi: pInteger = nil; allowND: Integer = 0): pCvMat; cdecl; function cvGetMat(const arr: pCvArr; header: pCvMat; coi: pInteger = nil; allowND: Integer = 0): pCvMat; cdecl;
{ Converts pCvArr (IplImage or CvMat) to IplImage { Converts pCvArr (IplImage or CvMat) to IplImage
CVAPI(IplImage*) cvGetImage( const pCvArr* arr, IplImage* image_header ); CVAPI(IplImage*) cvGetImage( const pCvArr* arr, IplImage* image_header );
} }
{$EXTERNALSYM cvGetImage}
function cvGetImage(const arr: pCvArr; image_header: pIplImage): pIplImage; cdecl; function cvGetImage(const arr: pCvArr; image_header: pIplImage): pIplImage; cdecl;
{ Changes a shape of multi-dimensional array. { Changes a shape of multi-dimensional array.
@ -509,19 +536,23 @@ function cvGetImage(const arr: pCvArr; image_header: pIplImage): pIplImage; cdec
cvReshapeMatND( (arr), sizeof(*(header)), (header), \ cvReshapeMatND( (arr), sizeof(*(header)), (header), \
(new_cn), (new_dims), (new_sizes)) (new_cn), (new_dims), (new_sizes))
} }
{$EXTERNALSYM cvReshapeMatND}
function cvReshapeMatND(const arr: pCvArr; sizeof_header: Integer; header: pCvArr; new_cn, new_dims: Integer; function cvReshapeMatND(const arr: pCvArr; sizeof_header: Integer; header: pCvArr; new_cn, new_dims: Integer;
new_sizes: pInteger): pCvArr; cdecl; new_sizes: pInteger): pCvArr; cdecl;
{$EXTERNALSYM cvReshapeND}
function cvReshapeND(const arr: pCvArr; sizeof_header: Integer; header: pCvArr; new_cn, new_dims: Integer; function cvReshapeND(const arr: pCvArr; sizeof_header: Integer; header: pCvArr; new_cn, new_dims: Integer;
new_sizes: pInteger): pCvArr; {$IFDEF USE_INLINE}inline; {$ENDIF} new_sizes: pInteger): pCvArr; {$IFDEF USE_INLINE}inline; {$ENDIF}
{ CVAPI(CvMat*) cvReshape( const pCvArr* arr, CvMat* header, { CVAPI(CvMat*) cvReshape( const pCvArr* arr, CvMat* header,
int new_cn, int new_rows CV_DEFAULT(0) ); int new_cn, int new_rows CV_DEFAULT(0) );
} }
{$EXTERNALSYM cvReshape}
function cvReshape(const arr: pCvArr; header: pCvMat; new_cn: Integer; new_rows: Integer = 0): pCvMat; cdecl; function cvReshape(const arr: pCvArr; header: pCvMat; new_cn: Integer; new_rows: Integer = 0): pCvMat; cdecl;
{ Repeats source 2d array several times in both horizontal and { Repeats source 2d array several times in both horizontal and
vertical direction to fill destination array vertical direction to fill destination array
CVAPI(void) cvRepeat( const pCvArr* src, pCvArr* dst ); CVAPI(void) cvRepeat( const pCvArr* src, pCvArr* dst );
} }
{$EXTERNALSYM cvRepeat}
procedure cvRepeat(src, dst: pCvArr); cdecl; procedure cvRepeat(src, dst: pCvArr); cdecl;
{ Allocates array data { Allocates array data
@ -640,9 +671,9 @@ procedure cvConvertScaleAbs(const src: pCvArr; dst: pCvArr; scale: double = 1; s
function cvCheckTermCriteria(criteria: TCvTermCriteria; default_eps: double; default_max_iters: Integer) function cvCheckTermCriteria(criteria: TCvTermCriteria; default_eps: double; default_max_iters: Integer)
: TCvTermCriteria; cdecl; : TCvTermCriteria; cdecl;
// *************************************************************************************** { ***************************************************************************************
// * Arithmetic, logic and comparison operations * * Arithmetic, logic and comparison operations *
// *************************************************************************************** *************************************************************************************** }
{ {
dst(mask) = src1(mask) + src2(mask) dst(mask) = src1(mask) + src2(mask)
@ -774,10 +805,9 @@ procedure cvRandArr(rng: pCvRNG; arr: pCvArr; dist_type: Integer; param1: TCvSca
// CVAPI(void)cvRandShuffle(CvArr * mat, CvRNG * rng, double iter_factor CV_DEFAULT(1. )); // CVAPI(void)cvRandShuffle(CvArr * mat, CvRNG * rng, double iter_factor CV_DEFAULT(1. ));
procedure cvRandShuffle(mat: pCvArr; rng: pCvRNG; iter_factor: double = 1); cdecl; procedure cvRandShuffle(mat: pCvArr; rng: pCvRNG; iter_factor: double = 1); cdecl;
{ ****************************************************************************************
// (* ***************************************************************************************\ * Math operations *
// * Math operations * **************************************************************************************** }
// *************************************************************************************** *)
// * Does cartesian->polar coordinates conversion. // * Does cartesian->polar coordinates conversion.
// Either of output components (magnitude or angle) is optional */ // Either of output components (magnitude or angle) is optional */
@ -1061,9 +1091,9 @@ type
function cvSeqPartition(const seq: pCvSeq; storage: pCvMemStorage; labels: pCvSeq; is_equal: TCvCmpFunc; function cvSeqPartition(const seq: pCvSeq; storage: pCvMemStorage; labels: pCvSeq; is_equal: TCvCmpFunc;
userdata: Pointer): Integer; cdecl; userdata: Pointer): Integer; cdecl;
// **************************************************************************************** { ****************************************************************************************
// * Drawing * * Drawing *
// **************************************************************************************** **************************************************************************************** }
// Following declaration is a macro definition! // Following declaration is a macro definition!
function CV_RGB(const r, g, B: double): TCvScalar; {$IFDEF USE_INLINE}inline; {$ENDIF} function CV_RGB(const r, g, B: double): TCvScalar; {$IFDEF USE_INLINE}inline; {$ENDIF}
@ -1251,11 +1281,11 @@ function cvKMeans2(const samples: pCvArr; cluster_count: Integer; labels: pCvArr
attempts: Integer = 1; rng: pCvRNG = nil; flags: Integer = 0; _centers: pCvArr = nil; compactness: pDouble = nil) attempts: Integer = 1; rng: pCvRNG = nil; flags: Integer = 0; _centers: pCvArr = nil; compactness: pDouble = nil)
: Integer; cdecl; : Integer; cdecl;
// **************************************************************************************** { ****************************************************************************************
// * Data Persistence * * Data Persistence *
// **************************************************************************************** **************************************************************************************** }
//
// ********************************* High-level functions ********************************* { ********************************* High-level functions ********************************* }
{ opens existing or creates new file storage { opens existing or creates new file storage
CVAPI(CvFileStorage*) cvOpenFileStorage( const char* filename, CvMemStorage* memstorage, CVAPI(CvFileStorage*) cvOpenFileStorage( const char* filename, CvMemStorage* memstorage,
@ -1314,8 +1344,7 @@ function cvRead(fs: pCvFileStorage; node: pCvFileNode; attributes: pCvAttrList =
function cvReadByName(fs: pCvFileStorage; const map: pCvFileNode; const name: pCvChar; function cvReadByName(fs: pCvFileStorage; const map: pCvFileNode; const name: pCvChar;
attributes: pCvAttrList = nil): Pointer; attributes: pCvAttrList = nil): Pointer;
{ *********************************** Adding own types *********************************** }
// *********************************** Adding own types ***********************************/
// * universal functions */ // * universal functions */
// CVAPI(void) cvRelease( void** struct_ptr ); // CVAPI(void) cvRelease( void** struct_ptr );
@ -1341,7 +1370,7 @@ procedure cvSave(const filename: pCvChar; const struct_ptr: Pointer; const name:
function cvLoad(const filename: pCvChar; memstorage: pCvMemStorage = Nil; const name: pCvChar = nil; function cvLoad(const filename: pCvChar; memstorage: pCvMemStorage = Nil; const name: pCvChar = nil;
const real_name: ppChar = nil): Pointer; cdecl; const real_name: ppChar = nil): Pointer; cdecl;
// *********************************** Measuring Execution Time ***************************/ { *********************************** Measuring Execution Time *************************** }
{ helper functions for RNG initialization and accurate time measurement: { helper functions for RNG initialization and accurate time measurement:
uses internal clock counter on x86 } uses internal clock counter on x86 }

View File

@ -276,7 +276,7 @@ function getStructuringElement(shape: Integer; ksize: TccvSize): TccvMat; overlo
// ! returns "magic" border value for erosion and dilation. It is automatically transformed to Scalar::all(-DBL_MAX) for dilation. // ! returns "magic" border value for erosion and dilation. It is automatically transformed to Scalar::all(-DBL_MAX) for dilation.
// static inline Scalar morphologyDefaultBorderValue() { return Scalar::all(DBL_MAX); } // static inline Scalar morphologyDefaultBorderValue() { return Scalar::all(DBL_MAX); }
function morphologyDefaultBorderValue: TccvScalar; inline; function morphologyDefaultBorderValue: TccvScalar;
implementation implementation
@ -286,7 +286,7 @@ Var
_morphologyDefaultBorderValue: TccvScalar = nil; _morphologyDefaultBorderValue: TccvScalar = nil;
// static inline Scalar morphologyDefaultBorderValue() { return Scalar::all(DBL_MAX); } // static inline Scalar morphologyDefaultBorderValue() { return Scalar::all(DBL_MAX); }
function morphologyDefaultBorderValue: TccvScalar; inline; function morphologyDefaultBorderValue: TccvScalar;
begin begin
if not Assigned(_morphologyDefaultBorderValue) then if not Assigned(_morphologyDefaultBorderValue) then
_morphologyDefaultBorderValue := TccvScalar.Create(0, 0); _morphologyDefaultBorderValue := TccvScalar.Create(0, 0);

File diff suppressed because it is too large Load Diff

View File

@ -1,87 +1,48 @@
// --------------------------------- OpenCV license.txt --------------------------- // **************************************************************************************************
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // Project Delphi-OpenCV
// // **************************************************************************************************
// By downloading, copying, installing or using the software you agree to this license. // Contributor:
// If you do not agree to this license, do not download, install, // Laentir Valetov
// copy or use the software. // email:laex@bk.ru
// // Mikhail Grigorev
// // email:sleuthound@gmail.com
// License Agreement // **************************************************************************************************
// For Open Source Computer Vision Library // You may retrieve the latest version of this file at the GitHub,
// // located at git://github.com/Laex/Delphi-OpenCV.git
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. // **************************************************************************************************
// Copyright (C) 2009, Willow Garage Inc., all rights reserved. // License:
// Third party copyrights are property of their respective owners. // 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
// Redistribution and use in source and binary forms, with or without modification, // License at http://www.mozilla.org/MPL/
// are permitted provided that the following conditions are met: //
// // Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
// * Redistribution's of source code must retain the above copyright notice, // ANY KIND, either express or implied. See the License for the specific language governing rights
// this list of conditions and the following disclaimer. // and limitations under the License.
// //
// * Redistribution's in binary form must reproduce the above copyright notice, // Alternatively, the contents of this file may be used under the terms of the
// this list of conditions and the following disclaimer in the documentation // GNU Lesser General Public License (the "LGPL License"), in which case the
// and/or other materials provided with the distribution. // 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
// * The name of the copyright holders may not be used to endorse or promote products // of the LGPL License and not to allow others to use your version of this file
// derived from this software without specific prior written permission. // under the MPL, indicate your decision by deleting the provisions above and
// // replace them with the notice and other provisions required by the LGPL
// This software is provided by the copyright holders and contributors "as is" and // License. If you do not delete the provisions above, a recipient may use
// any express or implied warranties, including, but not limited to, the implied // your version of this file under either the MPL or the LGPL License.
// warranties of merchantability and fitness for a particular purpose are disclaimed. //
// In no event shall the Intel Corporation or contributors be liable for any direct, // For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html
// indirect, incidental, special, exemplary, or consequential damages // **************************************************************************************************
// (including, but not limited to, procurement of substitute goods or services; // Warning: Using Delphi XE3 syntax!
// loss of use, data, or profits; or business interruption) however caused // **************************************************************************************************
// and on any theory of liability, whether in contract, strict liability, // The Initial Developer of the Original Code:
// or tort (including negligence or otherwise) arising in any way out of // OpenCV: open source computer vision library
// the use of this software, even if advised of the possibility of such damage. // Homepage: http://ocv.org
// Online docs: http://docs.ocv.org
//************************************************************************************************** // Q&A forum: http://answers.ocv.org
// Project Delphi-OpenCV // Dev zone: http://code.ocv.org
// ************************************************************************************************** // **************************************************************************************************
// Contributor: // Original file:
// Laentir Valetov // opencv\modules\video\include\opencv2\video\tracking_c.h
// email:laex@bk.ru // *************************************************************************************************
// Mikhail Grigorev
// email:sleuthound@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\video\include\opencv2\video\tracking_c.h
// *************************************************************************************************
{$IFDEF DEBUG} {$IFDEF DEBUG}
{$A8,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O-,P+,Q+,R+,S-,T-,U-,V+,W+,X+,Y+,Z1} {$A8,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O-,P+,Q+,R+,S-,T-,U-,V+,W+,X+,Y+,Z1}
@ -94,200 +55,268 @@
{$WARN UNSAFE_TYPE OFF} {$WARN UNSAFE_TYPE OFF}
{$WARN UNSAFE_CODE OFF} {$WARN UNSAFE_CODE OFF}
{$WARN UNSAFE_CAST OFF} {$WARN UNSAFE_CAST OFF}
{$I OpenCV.inc}
unit ocv.tracking_c; unit ocv.tracking_c;
interface interface
uses ocv.core.types_c, ocv.imgproc.types_c; uses ocv.core.types_c, ocv.imgproc.types_c;
/// ****************************************************************************************\ (* ****************************************************************************************
// * Motion Analysis * * Motion Analysis *
// \****************************************************************************************/ *************************************************************************************** *)
//
/// ************************************ optical flow ***************************************/ // ************************************ optical flow ***************************************
const const
CV_LKFLOW_PYR_A_READY = 1; CV_LKFLOW_PYR_A_READY = 1;
CV_LKFLOW_PYR_B_READY = 2; CV_LKFLOW_PYR_B_READY = 2;
CV_LKFLOW_INITIAL_GUESSES = 4; CV_LKFLOW_INITIAL_GUESSES = 4;
CV_LKFLOW_GET_MIN_EIGENVALS = 8; CV_LKFLOW_GET_MIN_EIGENVALS = 8;
/// * It is Lucas & Kanade method, modified to use pyramids. (*
// Also it does several iterations to get optical flow for It is Lucas & Kanade method, modified to use pyramids.
// every point at every pyramid level. Also it does several iterations to get optical flow for
// Calculates optical flow between two images for certain set of points (i.e. every point at every pyramid level.
// it is a "sparse" optical flow, which is opposite to the previous 3 methods) */ Calculates optical flow between two images for certain set of points (i.e.
// CVAPI(void) cvCalcOpticalFlowPyrLK( const CvArr* prev, const CvArr* curr, it is a "sparse" optical flow, which is opposite to the previous 3 methods)
// CvArr* prev_pyr, CvArr* curr_pyr,
// const CvPoint2D32f* prev_features, CVAPI(void) cvCalcOpticalFlowPyrLK( const CvArr* prev, const CvArr* curr,
// CvPoint2D32f* curr_features, CvArr* prev_pyr, CvArr* curr_pyr,
// int count, const CvPoint2D32f* prev_features,
// CvSize win_size, CvPoint2D32f* curr_features,
// int level, int count,
// char* status, CvSize win_size,
// float* track_error, int level,
// CvTermCriteria criteria, char* status,
// int flags ); float* track_error,
CvTermCriteria criteria,
int flags );
*)
{$EXTERNALSYM cvCalcOpticalFlowPyrLK}
procedure cvCalcOpticalFlowPyrLK(const prev: pIplImage; const curr: pIplImage; prev_pyr: pIplImage; curr_pyr: pIplImage; procedure cvCalcOpticalFlowPyrLK(const prev: pIplImage; const curr: pIplImage; prev_pyr: pIplImage; curr_pyr: pIplImage;
const prev_features: pCvPoint2D32f; curr_features: pCvPoint2D32f; count: Integer; win_size: TCvSize; level: Integer; const prev_features: pCvPoint2D32f; curr_features: pCvPoint2D32f; count: Integer; win_size: TCvSize; level: Integer;
status: pCVChar; track_error: PSingle; criteria: TCvTermCriteria; flags: Integer); cdecl; status: pCVChar; track_error: PSingle; criteria: TCvTermCriteria; flags: Integer); cdecl;
/// * Modification of a previous sparse optical flow algorithm to calculate (* Modification of a previous sparse optical flow algorithm to calculate
// affine flow */ affine flow
// CVAPI(void) cvCalcAffineFlowPyrLK( const CvArr* prev, const CvArr* curr,
// CvArr* prev_pyr, CvArr* curr_pyr, CVAPI(void) cvCalcAffineFlowPyrLK( const CvArr* prev, const CvArr* curr,
// const CvPoint2D32f* prev_features, CvArr* prev_pyr, CvArr* curr_pyr,
// CvPoint2D32f* curr_features, const CvPoint2D32f* prev_features,
// float* matrices, int count, CvPoint2D32f* curr_features,
// CvSize win_size, int level, float* matrices, int count,
// char* status, float* track_error, CvSize win_size, int level,
// CvTermCriteria criteria, int flags ); char* status, float* track_error,
// CvTermCriteria criteria, int flags );
/// * Estimate rigid transformation between 2 images or 2 point sets */ *)
// CVAPI(int) cvEstimateRigidTransform( const CvArr* A, const CvArr* B, {$EXTERNALSYM cvCalcAffineFlowPyrLK}
// CvMat* M, int full_affine ); procedure cvCalcAffineFlowPyrLK(const prev: pCvArr; const curr: pCvArr; prev_pyr: pCvArr; curr_pyr: pCvArr;
// const prev_features: pCvPoint2D32f; var curr_features: TCvPoint2D32f; var matrices: Single; count: Integer;
/// * Estimate optical flow for each pixel using the two-frame G. Farneback algorithm */ win_size: TCvSize; level: Integer; status: pCVChar; var track_error: Single; criteria: TCvTermCriteria;
// CVAPI(void) cvCalcOpticalFlowFarneback( const CvArr* prev, const CvArr* next, flags: Integer); cdecl;
// CvArr* flow, double pyr_scale, int levels,
// int winsize, int iterations, int poly_n, (*
// double poly_sigma, int flags ); Estimate rigid transformation between 2 images or 2 point sets
CVAPI(int) cvEstimateRigidTransform( const CvArr* A, const CvArr* B,
CvMat* M, int full_affine );
*)
{$EXTERNALSYM cvEstimateRigidTransform}
function cvEstimateRigidTransform(const A: pCvArr; const B: pCvArr; var M: TCvMat; full_affine: Integer)
: Integer; cdecl;
(*
Estimate optical flow for each pixel using the two-frame G. Farneback algorithm
CVAPI(void) cvCalcOpticalFlowFarneback( const CvArr* prev, const CvArr* next,
CvArr* flow, double pyr_scale, int levels,
int winsize, int iterations, int poly_n,
double poly_sigma, int flags );
*)
{$EXTERNALSYM cvCalcOpticalFlowFarneback}
procedure cvCalcOpticalFlowFarneback(const prev: pCvMat; const next: pCvMat; flow: pCvMat; pyr_scale: double; procedure cvCalcOpticalFlowFarneback(const prev: pCvMat; const next: pCvMat; flow: pCvMat; pyr_scale: double;
levels: Integer; winsize: Integer; iterations: Integer; poly_n: Integer; poly_sigma: double; flags: Integer); cdecl; levels: Integer; winsize: Integer; iterations: Integer; poly_n: Integer; poly_sigma: double; flags: Integer); cdecl;
/// ********************************* motion templates *************************************/ (* ******************************** motion templates ************************************ *)
//
/// ****************************************************************************************\
// * All the motion template functions work only with single channel images. *
// * Silhouette image must have depth IPL_DEPTH_8U or IPL_DEPTH_8S *
// * Motion history image must have depth IPL_DEPTH_32F, *
// * Gradient mask - IPL_DEPTH_8U or IPL_DEPTH_8S, *
// * Motion orientation image - IPL_DEPTH_32F *
// * Segmentation mask - IPL_DEPTH_32F *
// * All the angles are in degrees, all the times are in milliseconds *
// \****************************************************************************************/
/// * Updates motion history image given motion silhouette */ (* *****************************************************************************************
// CVAPI(void) cvUpdateMotionHistory( const CvArr* silhouette, CvArr* mhi, * All the motion template functions work only with single channel images. *
// double timestamp, double duration ); * Silhouette image must have depth IPL_DEPTH_8U or IPL_DEPTH_8S *
* Motion history image must have depth IPL_DEPTH_32F, *
* Gradient mask - IPL_DEPTH_8U or IPL_DEPTH_8S, *
* Motion orientation image - IPL_DEPTH_32F *
* Segmentation mask - IPL_DEPTH_32F *
* All the angles are in degrees, all the times are in milliseconds *
*************************************************************************************** *)
(*
Updates motion history image given motion silhouette
CVAPI(void) cvUpdateMotionHistory( const CvArr* silhouette, CvArr* mhi,
double timestamp, double duration );
*)
{$EXTERNALSYM cvUpdateMotionHistory}
procedure cvUpdateMotionHistory(const silhouette: pCvArr; mhi: pCvArr; timestamp: double; duration: double); cdecl; procedure cvUpdateMotionHistory(const silhouette: pCvArr; mhi: pCvArr; timestamp: double; duration: double); cdecl;
/// * Calculates gradient of the motion history image and fills (*
// a mask indicating where the gradient is valid */ Calculates gradient of the motion history image and fills
// CVAPI(void) cvCalcMotionGradient( const CvArr* mhi, CvArr* mask, CvArr* orientation, a mask indicating where the gradient is valid
// double delta1, double delta2,
// int aperture_size CV_DEFAULT(3)); CVAPI(void) cvCalcMotionGradient( const CvArr* mhi, CvArr* mask, CvArr* orientation,
double delta1, double delta2,
int aperture_size CV_DEFAULT(3));
*)
{$EXTERNALSYM cvCalcMotionGradient}
procedure cvCalcMotionGradient(const mhi: pCvArr; mask: pCvArr; orientation: pCvArr; delta1: double; delta2: double; procedure cvCalcMotionGradient(const mhi: pCvArr; mask: pCvArr; orientation: pCvArr; delta1: double; delta2: double;
aperture_size: Integer = 3); cdecl; aperture_size: Integer = 3); cdecl;
/// * Calculates average motion direction within a selected motion region (* Calculates average motion direction within a selected motion region
// (region can be selected by setting ROIs and/or by composing a valid gradient mask (region can be selected by setting ROIs and/or by composing a valid gradient mask
// with the region mask) */ with the region mask)
// CVAPI(double) cvCalcGlobalOrientation( const CvArr* orientation, const CvArr* mask,
// const CvArr* mhi, double timestamp, CVAPI(double) cvCalcGlobalOrientation( const CvArr* orientation, const CvArr* mask,
// double duration ); const CvArr* mhi, double timestamp,
double duration );
*)
{$EXTERNALSYM cvCalcGlobalOrientation}
function cvCalcGlobalOrientation(const orientation: pCvArr; const mask: pCvArr; const mhi: pCvArr; timestamp: double; function cvCalcGlobalOrientation(const orientation: pCvArr; const mask: pCvArr; const mhi: pCvArr; timestamp: double;
duration: double): double; cdecl; duration: double): double; cdecl;
/// * Splits a motion history image into a few parts corresponding to separate independent motions (* Splits a motion history image into a few parts corresponding to separate independent motions
// (e.g. left hand, right hand) */ (e.g. left hand, right hand)
// CVAPI(CvSeq*) cvSegmentMotion( const CvArr* mhi, CvArr* seg_mask,
// CvMemStorage* storage, CVAPI(CvSeq* ) cvSegmentMotion( const CvArr* mhi, CvArr* seg_mask,
// double timestamp, double seg_thresh ); CvMemStorage* storage,
double timestamp, double seg_thresh );
*)
{$EXTERNALSYM cvSegmentMotion}
function cvSegmentMotion(const mhi: pCvArr; seg_mask: pCvArr; storage: pCvMemStorage; timestamp: double; function cvSegmentMotion(const mhi: pCvArr; seg_mask: pCvArr; storage: pCvMemStorage; timestamp: double;
seg_thresh: double): pCvSeq; cdecl; seg_thresh: double): pCvSeq; cdecl;
/// ****************************************************************************************\ (* ****************************************************************************************
// * Tracking * * Tracking *
// \****************************************************************************************/ *************************************************************************************** *)
//
/// * Implements CAMSHIFT algorithm - determines object position, size and orientation (*
// from the object histogram back project (extension of meanshift) */ Implements CAMSHIFT algorithm - determines object position, size and orientation
// CVAPI(int) cvCamShift( const CvArr* prob_image, CvRect window, from the object histogram back project (extension of meanshift)
// CvTermCriteria criteria, CvConnectedComp* comp,
// CvBox2D* box CV_DEFAULT(NULL) ); CVAPI(int) cvCamShift( const CvArr* prob_image, CvRect window,
CvTermCriteria criteria, CvConnectedComp* comp,
CvBox2D* box CV_DEFAULT(NULL) );
*)
{$EXTERNALSYM cvCamShift}
function cvCamShift(const prob_image: pIplImage; window: TCvRect; criteria: TCvTermCriteria; comp: pCvConnectedComp; function cvCamShift(const prob_image: pIplImage; window: TCvRect; criteria: TCvTermCriteria; comp: pCvConnectedComp;
box: pCvBox2D = nil): Integer; cdecl; box: pCvBox2D = nil): Integer; cdecl;
/// * Implements MeanShift algorithm - determines object position (* Implements MeanShift algorithm - determines object position
// from the object histogram back project */ from the object histogram back project
// CVAPI(int) cvMeanShift( const CvArr* prob_image, CvRect window,
// CvTermCriteria criteria, CvConnectedComp* comp ); CVAPI(int) cvMeanShift( const CvArr* prob_image, CvRect window,
// CvTermCriteria criteria, CvConnectedComp* comp );
/// * *)
// standard Kalman filter (in G. Welch' and G. Bishop's notation): {$EXTERNALSYM cvMeanShift}
// function cvMeanShift(const prob_image: pCvArr; window: TCvRect; criteria: TCvTermCriteria; var comp: TCvConnectedComp)
// x(k)=A*x(k-1)+B*u(k)+w(k) p(w)~N(0,Q) : Integer; cdecl;
// z(k)=H*x(k)+v(k), p(v)~N(0,R)
// */ (*
// typedef struct CvKalman standard Kalman filter (in G. Welch' and G. Bishop's notation):
// {
// int MP; /* number of measurement vector dimensions */ x(k)=A*x(k-1)+B*u(k)+w(k) p(w)~N(0,Q)
// int DP; /* number of state vector dimensions */ z(k)=H*x(k)+v(k), p(v)~N(0,R)
// int CP; /* number of control vector dimensions */ *)
// Type
// /* backward compatibility fields */ pCvKalman = ^TCvKalman;
// #if 1
// float* PosterState; /* =state_pre->data.fl */ {$EXTERNALSYM TCvKalman}
// float* PriorState; /* =state_post->data.fl */
// float* DynamMatr; /* =transition_matrix->data.fl */ TCvKalman = record
// float* MeasurementMatr; /* =measurement_matrix->data.fl */ MP: Integer; (* number of measurement vector dimensions *)
// float* MNCovariance; /* =measurement_noise_cov->data.fl */ DP: Integer; (* number of state vector dimensions *)
// float* PNCovariance; /* =process_noise_cov->data.fl */ CP: Integer; (* number of control vector dimensions *)
// float* KalmGainMatr; /* =gain->data.fl */
// float* PriorErrorCovariance;/* =error_cov_pre->data.fl */ (* backward compatibility fields *)
// float* PosterErrorCovariance;/* =error_cov_post->data.fl */ {$IFDEF 1}
// float* Temp1; /* temp1->data.fl */ PosterState: PSingle; (* =state_pre->data.fl *)
// float* Temp2; /* temp2->data.fl */ PriorState: PSingle; (* =state_post->data.fl *)
// #endif DynamMatr: PSingle; (* =transition_matrix->data.fl *)
// MeasurementMatr: PSingle; (* =measurement_matrix->data.fl *)
// CvMat* state_pre; /* predicted state (x'(k)): MNCovariance: PSingle; (* =measurement_noise_cov->data.fl *)
// x(k)=A*x(k-1)+B*u(k) */ PNCovariance: PSingle; (* =process_noise_cov->data.fl *)
// CvMat* state_post; /* corrected state (x(k)): KalmGainMatr: PSingle; (* =gain->data.fl *)
// x(k)=x'(k)+K(k)*(z(k)-H*x'(k)) */ PriorErrorCovariance: PSingle; (* =error_cov_pre->data.fl *)
// CvMat* transition_matrix; /* state transition matrix (A) */ PosterErrorCovariance: PSingle; (* =error_cov_post->data.fl *)
// CvMat* control_matrix; /* control matrix (B) Temp1: PSingle; (* temp1->data.fl *)
// (it is not used if there is no control)*/ Temp2: PSingle; (* temp2->data.fl *)
// CvMat* measurement_matrix; /* measurement matrix (H) */ {$ENDIF}
// CvMat* process_noise_cov; /* process noise covariance matrix (Q) */ state_pre: pCvMat; (* predicted state (x'(k)):
// CvMat* measurement_noise_cov; /* measurement noise covariance matrix (R) */ x(k)=A*x(k-1)+B*u(k) *)
// CvMat* error_cov_pre; /* priori error estimate covariance matrix (P'(k)): state_post: pCvMat; (* corrected state (x(k)):
// P'(k)=A*P(k-1)*At + Q)*/ x(k)=x'(k)+K(k)*(z(k)-H*x'(k)) *)
// CvMat* gain; /* Kalman gain matrix (K(k)): transition_matrix: pCvMat; (* state transition matrix (A) *)
// K(k)=P'(k)*Ht*inv(H*P'(k)*Ht+R)*/ control_matrix: pCvMat; (* control matrix (B)
// CvMat* error_cov_post; /* posteriori error estimate covariance matrix (P(k)): (it is not used if there is no control) *)
// P(k)=(I-K(k)*H)*P'(k) */ measurement_matrix: pCvMat; (* measurement matrix (H) *)
// CvMat* temp1; /* temporary matrices */ process_noise_cov: pCvMat; (* process noise covariance matrix (Q) *)
// CvMat* temp2; measurement_noise_cov: pCvMat; (* measurement noise covariance matrix (R) *)
// CvMat* temp3; error_cov_pre: pCvMat; (* priori error estimate covariance matrix (P'(k)):
// CvMat* temp4; P'(k)=A*P(k-1)*At + Q) *)
// CvMat* temp5; gain: pCvMat; (* Kalman gain matrix (K(k)):
// } CvKalman; K(k)=P'(k)*Ht*inv(H*P'(k)*Ht+R) *)
// error_cov_post: pCvMat; (* posteriori error estimate covariance matrix (P(k)):
/// * Creates Kalman filter and sets A, B, Q, R and state to some initial values */ P(k)=(I-K(k)*H)*P'(k) *)
// CVAPI(CvKalman*) cvCreateKalman( int dynam_params, int measure_params, Temp1: pCvMat; (* temporary matrices *)
// int control_params CV_DEFAULT(0)); Temp2: pCvMat;
// temp3: pCvMat;
/// * Releases Kalman filter state */ temp4: pCvMat;
// CVAPI(void) cvReleaseKalman( CvKalman** kalman); temp5: pCvMat;
// end;
/// * Updates Kalman filter by time (predicts future state of the system) */ //
// CVAPI(const CvMat*) cvKalmanPredict( CvKalman* kalman, (*
// const CvMat* control CV_DEFAULT(NULL)); Creates Kalman filter and sets A, B, Q, R and state to some initial values
//
/// * Updates Kalman filter by measurement CVAPI(CvKalman* ) cvCreateKalman( int dynam_params, int measure_params,
// (corrects state of the system and internal matrices) */ int control_params CV_DEFAULT(0));
// CVAPI(const CvMat*) cvKalmanCorrect( CvKalman* kalman, const CvMat* measurement ); *)
// {$EXTERNALSYM cvCreateKalman}
// #define cvKalmanUpdateByTime cvKalmanPredict
// #define cvKalmanUpdateByMeasurement cvKalmanCorrect function cvCreateKalman(dynam_params: Integer; measure_params: Integer; control_params: Integer = 0): pCvKalman; cdecl;
//
// (*
// #ifdef __cplusplus Releases Kalman filter state
// } // extern "C"
// #endif CVAPI(void) cvReleaseKalman( CvKalman** kalman);
// *)
// {$EXTERNALSYM cvReleaseKalman}
// #endif // __OPENCV_TRACKING_C_H__ procedure cvReleaseKalman(var kalman: pCvKalman); cdecl;
(*
Updates Kalman filter by time (predicts future state of the system)
CVAPI(const CvMat* cvKalmanPredict( CvKalman* kalman,
const CvMat* control CV_DEFAULT(NULL));
*)
{$EXTERNALSYM cvKalmanPredict}
function cvKalmanPredict(var kalman: TCvKalman; const control: pCvMat = nil): pCvMat; cdecl;
(* Updates Kalman filter by measurement
(corrects state of the system and internal matrices)
CVAPI(const CvMat* ) cvKalmanCorrect( CvKalman* kalman, const CvMat* measurement );
*)
{$EXTERNALSYM cvKalmanCorrect}
function cvKalmanCorrect(var kalman: TCvKalman; const measurement: pCvMat): pCvMat; cdecl;
Type
TcvKalmanPredict = function(var kalman: TCvKalman; const control: pCvMat = nil): pCvMat; cdecl;
TcvKalmanCorrect = function(var kalman: TCvKalman; const measurement: pCvMat): pCvMat; cdecl;
Var
{$EXTERNALSYM cvKalmanUpdateByTime}
cvKalmanUpdateByTime: TcvKalmanPredict = cvKalmanPredict;
{$EXTERNALSYM cvKalmanUpdateByMeasurement}
cvKalmanUpdateByMeasurement: TcvKalmanCorrect = cvKalmanCorrect;
implementation implementation
@ -302,5 +331,12 @@ procedure cvUpdateMotionHistory; external tracking_lib;
procedure cvCalcMotionGradient; external tracking_lib; procedure cvCalcMotionGradient; external tracking_lib;
function cvSegmentMotion; external tracking_lib; function cvSegmentMotion; external tracking_lib;
function cvCalcGlobalOrientation; external tracking_lib; function cvCalcGlobalOrientation; external tracking_lib;
procedure cvCalcAffineFlowPyrLK; external tracking_lib;
function cvEstimateRigidTransform; external tracking_lib;
function cvMeanShift; external tracking_lib;
function cvCreateKalman; external tracking_lib;
function cvKalmanPredict; external tracking_lib;
function cvKalmanCorrect; external tracking_lib;
procedure cvReleaseKalman; external tracking_lib;
end. end.