2013-04-16 08:40:44 +02:00
|
|
|
|
// --------------------------------- OpenCV license.txt ---------------------------
|
2013-04-09 12:41:27 +02:00
|
|
|
|
(* // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
2013-01-01 13:29:34 +01:00
|
|
|
|
//
|
2013-04-09 12:41:27 +02:00
|
|
|
|
// 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.
|
2013-01-01 13:29:34 +01:00
|
|
|
|
//
|
|
|
|
|
//
|
2013-04-09 12:41:27 +02:00
|
|
|
|
// License Agreement
|
|
|
|
|
// For Open Source Computer Vision Library
|
2013-01-01 13:29:34 +01:00
|
|
|
|
//
|
2013-04-09 12:41:27 +02:00
|
|
|
|
// 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.
|
2013-01-01 13:29:34 +01:00
|
|
|
|
//
|
2013-04-09 12:41:27 +02:00
|
|
|
|
// Redistribution and use in source and binary forms, with or without modification,
|
|
|
|
|
// are permitted provided that the following conditions are met:
|
2013-01-01 13:29:34 +01:00
|
|
|
|
//
|
2013-04-09 12:41:27 +02:00
|
|
|
|
// * Redistribution's of source code must retain the above copyright notice,
|
|
|
|
|
// this list of conditions and the following disclaimer.
|
2013-01-01 13:29:34 +01:00
|
|
|
|
//
|
2013-04-09 12:41:27 +02:00
|
|
|
|
// * 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.
|
2013-01-01 13:29:34 +01:00
|
|
|
|
//
|
2013-04-09 12:41:27 +02:00
|
|
|
|
// * The name of the copyright holders may not be used to endorse or promote products
|
|
|
|
|
// derived from this software without specific prior written permission.
|
2013-01-01 13:29:34 +01:00
|
|
|
|
//
|
2013-04-09 12:41:27 +02:00
|
|
|
|
// 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
|
2014-05-19 21:29:48 +02:00
|
|
|
|
// the use of this software, even if advised of the possibility of such damage.*)
|
2013-04-09 12:41:27 +02:00
|
|
|
|
|
2013-04-16 08:40:44 +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://opencv.org
|
|
|
|
|
// Online docs: http://docs.opencv.org
|
|
|
|
|
// Q&A forum: http://answers.opencv.org
|
|
|
|
|
// Dev zone: http://code.opencv.org
|
|
|
|
|
// **************************************************************************************************
|
|
|
|
|
// Original file:
|
|
|
|
|
// opencv\modules\core\include\opencv2\core\core_c.h
|
2014-05-19 21:29:48 +02:00
|
|
|
|
// **************************************************************************************************)
|
2013-04-16 08:40:44 +02:00
|
|
|
|
|
2013-04-05 13:36:47 +02:00
|
|
|
|
{$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}
|
|
|
|
|
{$ELSE}
|
|
|
|
|
{$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}
|
|
|
|
|
{$ENDIF}
|
|
|
|
|
{$WARN SYMBOL_DEPRECATED OFF}
|
|
|
|
|
{$WARN SYMBOL_PLATFORM OFF}
|
|
|
|
|
{$WARN UNIT_PLATFORM OFF}
|
|
|
|
|
{$WARN UNSAFE_TYPE OFF}
|
|
|
|
|
{$WARN UNSAFE_CODE OFF}
|
|
|
|
|
{$WARN UNSAFE_CAST OFF}
|
|
|
|
|
unit core_c;
|
|
|
|
|
|
|
|
|
|
interface
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2013-04-05 13:36:47 +02:00
|
|
|
|
uses
|
2013-09-12 11:49:13 +02:00
|
|
|
|
Windows,
|
|
|
|
|
core.types_c;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +02:00
|
|
|
|
{****************************************************************************************
|
2013-04-16 08:40:44 +02:00
|
|
|
|
* cArray allocation, deallocation, initialization and access to elements *
|
2014-05-19 21:29:48 +02:00
|
|
|
|
****************************************************************************************}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +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.
|
|
|
|
|
}
|
2013-09-25 21:18:23 +02:00
|
|
|
|
function cvAlloc(size: size_t): Pointer; cdecl;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
2013-09-25 21:18:23 +02:00
|
|
|
|
procedure cvFree_(ptr: Pointer); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvFree(var ptr); inline;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +02:00
|
|
|
|
{Allocates and initializes IplImage header
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(IplImage*) cvCreateImageHeader( CvSize size, int depth, int channels );
|
|
|
|
|
}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
function cvCreateImageHeader(size: TCvSize; depth: Integer; channels: Integer): pIplImage; cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
2013-04-16 08:40:44 +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-05-19 21:29:48 +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 );
|
|
|
|
|
}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
function cvCreateImage(size: TCvSize; depth, channels: Integer): pIplImage; cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +02:00
|
|
|
|
{Releases (i.e. deallocates) IPL image header
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvReleaseImageHeader( IplImage** image );
|
|
|
|
|
}
|
2013-04-05 13:36:47 +02:00
|
|
|
|
procedure cvReleaseImageHeader(var image: pIplImage); cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +02:00
|
|
|
|
{Releases IPL image header and data
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvReleaseImage( IplImage** image );
|
|
|
|
|
}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
procedure cvReleaseImage(var image: pIplImage); cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +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 );
|
|
|
|
|
}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
function cvCloneImage(const image: pIplImage): pIplImage; cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +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 );
|
|
|
|
|
}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
procedure cvSetImageCOI(image: pIplImage; coi: Integer); cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +02:00
|
|
|
|
{Retrieves image Channel Of Interest
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(int) cvGetImageCOI( const IplImage* image );
|
|
|
|
|
}
|
2013-04-05 13:36:47 +02:00
|
|
|
|
function cvGetImageCOI(const image: pIplImage): Integer; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +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 );
|
|
|
|
|
}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
procedure cvSetImageROI(image: pIplImage; rect: TCvRect); cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +02:00
|
|
|
|
{Resets image ROI and COI
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvResetImageROI( IplImage* image );
|
|
|
|
|
}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
procedure cvResetImageROI(image: pIplImage); cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +02:00
|
|
|
|
{Retrieves image ROI
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(CvRect) cvGetImageROI( const IplImage* image );
|
|
|
|
|
}
|
2013-04-05 13:36:47 +02:00
|
|
|
|
function cvGetImageROI(const image: pIplImage): TCvRect; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +02:00
|
|
|
|
{Allocates and initalizes CvMat header
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(CvMat*) cvCreateMatHeader( int rows, int cols, int type );
|
|
|
|
|
}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
function cvCreateMatHeader(rows: Integer; cols: Integer; cType: Integer): TCvMat; cdecl;
|
|
|
|
|
|
|
|
|
|
const
|
|
|
|
|
CV_AUTOSTEP = $7FFFFFFF;
|
|
|
|
|
{$EXTERNALSYM CV_AUTOSTEP}
|
2014-05-19 21:29:48 +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) );
|
|
|
|
|
}
|
2013-09-25 21:18:23 +02:00
|
|
|
|
function cvInitMatHeader(mat: pCvMat; rows: Integer; cols: Integer; _type: Integer; data: Pointer = nil;
|
2013-04-16 08:40:44 +02:00
|
|
|
|
step: Integer = CV_AUTOSTEP): pCvMat; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +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 );
|
|
|
|
|
}
|
|
|
|
|
function cvCreateMat(rows, cols, cType: Integer): pCvMat; cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +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 );
|
|
|
|
|
}
|
|
|
|
|
procedure cvReleaseMat(var mat: pCvMat); cdecl;
|
|
|
|
|
|
|
|
|
|
// Decrements CvMat data reference counter and deallocates the data if
|
|
|
|
|
// it reaches 0 }
|
2013-04-16 08:40:44 +02:00
|
|
|
|
// CV_INLINE void cvDecRefData( pCvArr* arr )
|
|
|
|
|
// {
|
|
|
|
|
// 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;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
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
|
|
|
|
|
2014-05-19 21:29:48 +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 );
|
|
|
|
|
}
|
2013-04-12 21:33:12 +02:00
|
|
|
|
function cvCloneMat(const mat: pCvMat): pCvMat; cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
|
}
|
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-05-19 21:29:48 +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-05-19 21:29:48 +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
|
|
|
|
|
2013-04-16 08:40:44 +02:00
|
|
|
|
// CV_INLINE CvMat* cvGetRow( const pCvArr* arr, CvMat* submat, int row )
|
|
|
|
|
// {
|
|
|
|
|
// return cvGetRows( arr, submat, row, row + 1, 1 );
|
|
|
|
|
// }
|
|
|
|
|
function cvGetRow(const arr: pCvArr; submat: pCvMat; row: Integer): pCvMat; inline;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
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
|
|
|
|
|
2013-04-16 08:40:44 +02:00
|
|
|
|
// CV_INLINE CvMat* cvGetCol( const pCvArr* arr, CvMat* submat, int col )
|
|
|
|
|
// {
|
|
|
|
|
// return cvGetCols( arr, submat, col, col + 1 );
|
|
|
|
|
// }
|
|
|
|
|
function cvGetCol(const arr: pCvArr; submat: pCvMat; col: Integer): pCvMat; inline;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
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-05-19 21:29:48 +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
|
|
|
|
}
|
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 );
|
|
|
|
|
procedure cvRawDataToScalar(const data: pCvArr; cType: Integer; scalar: pCvScalar); cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +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 );
|
|
|
|
|
}
|
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-05-19 21:29:48 +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 );
|
|
|
|
|
}
|
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-05-19 21:29:48 +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
|
|
|
|
}
|
2013-04-16 08:40:44 +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
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
// Releases CvMatND
|
2013-04-16 08:40:44 +02:00
|
|
|
|
// CV_INLINE void cvReleaseMatND( CvMatND** mat )
|
|
|
|
|
// {
|
|
|
|
|
// cvReleaseMat( (CvMat**)mat );
|
|
|
|
|
// }
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvReleaseMatND(var mat: pCvMatND); inline;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
|
|
|
|
function cvCloneMatND(const mat: pCvMatND): pCvMatND; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
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-05-19 21:29:48 +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
|
|
|
|
}
|
|
|
|
|
procedure cvReleaseSparseMat(mat: pCvSparseMat); cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
|
|
|
|
function cvCloneSparseMat(const mat: pCvSparseMat): pCvSparseMat; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
|
function cvGetNextSparseNode(mat_iterator: pCvSparseMatIterator): pCvSparseNode; inline;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
// **************** matrix iterator: used for n-ary operations on dense arrays *********
|
|
|
|
|
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-05-19 21:29:48 +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) );
|
|
|
|
|
}
|
|
|
|
|
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-05-19 21:29:48 +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
|
|
|
|
}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvNextNArraySlice(array_iterator: pCvNArrayIterator): Integer; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +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 );
|
|
|
|
|
}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvGetElemType(const arr: pCvArr): Integer; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +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) );
|
|
|
|
|
}
|
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-05-19 21:29:48 +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 );
|
|
|
|
|
}
|
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-05-19 21:29:48 +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
|
|
|
|
}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvPtr1D(const arr: pCvArr; idx0: Integer; cType: pInteger = nil): pCvArr; cdecl;
|
|
|
|
|
function cvPtr2D(const arr: pCvArr; idx0, idx1: Integer; cType: pInteger = nil): pCvArr; cdecl;
|
|
|
|
|
function cvPtr3D(const arr: pCvArr; idx0, idx1, idx2: Integer; cType: pInteger = nil): pCvArr; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
2013-04-16 08:40:44 +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-05-19 21:29:48 +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 );
|
|
|
|
|
}
|
2013-04-10 01:22:08 +02:00
|
|
|
|
function cvGet1D(const arr: pCvArr; idx0: Integer): TCvScalar; cdecl;
|
2013-04-02 00:17:25 +02:00
|
|
|
|
function cvGet2D(const arr: pCvMat; idx0, idx1: Integer): TCvScalar; cdecl;
|
2013-04-16 08:40:44 +02:00
|
|
|
|
// function cvGet2D(const arr: pCvArr; idx0, idx1: Integer): TCvScalar; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
function cvGet3D(const arr: pCvArr; idx0, idx1, idx2: Integer): TCvScalar; cdecl;
|
|
|
|
|
function cvGetND(const arr: pCvArr; idx: pInteger): TCvScalar; cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +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 );
|
|
|
|
|
}
|
|
|
|
|
function cvGetReal1D(const arr: pIplImage; idx0: Integer): double; cdecl;
|
|
|
|
|
function cvGetReal2D(const arr: pCvMat; idx0, idx1: Integer): double; cdecl;
|
|
|
|
|
function cvGetReal3D(const arr: pCvArr; idx0, idx1, idx2: Integer): double; cdecl;
|
|
|
|
|
function cvGetRealND(const arr: pCvArr; idx: pInteger): double; cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +02:00
|
|
|
|
{arr(idx0,idx1,...) = value
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvSet1D( pCvArr* arr, int idx0, CvScalar value );
|
|
|
|
|
CVAPI(void) cvSet2D( pCvArr* arr, int idx0, int idx1, 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 );
|
|
|
|
|
}
|
|
|
|
|
procedure cvSet1D(arr: pCvArr; idx0: Integer; var value: TCvScalar); cdecl;
|
|
|
|
|
procedure cvSet2D(arr: pCvArr; idx0, idx1: Integer; var value: TCvScalar); cdecl;
|
|
|
|
|
procedure cvSet3D(arr: pCvArr; idx0, idx1, idx2: Integer; var value: TCvScalar); cdecl;
|
|
|
|
|
procedure cvSetND(arr: pCvArr; idx: pInteger; var value: TCvScalar); cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +02:00
|
|
|
|
{for 1-channel arrays */
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvSetReal1D( pCvArr* arr, int idx0, double value );
|
|
|
|
|
CVAPI(void) cvSetReal2D( pCvArr* arr, int idx0, int idx1, 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 );
|
|
|
|
|
}
|
|
|
|
|
procedure cvSetReal1D(arr: pCvArr; idx0: Integer; var value: double); cdecl;
|
|
|
|
|
procedure cvSetReal2D(arr: pCvArr; idx0, idx1: Integer; var value: double); cdecl;
|
|
|
|
|
procedure cvSetReal3D(arr: pCvArr; idx0, idx1, idx2: Integer; var value: double); cdecl;
|
|
|
|
|
procedure cvSetRealND(arr: pCvArr; idx: pInteger; var value: double); cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +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 */
|
|
|
|
|
CVAPI(void) cvClearND( pCvArr* arr, const int* idx );
|
2013-04-05 13:36:47 +02:00
|
|
|
|
}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvClearND(arr: pCvArr; idx: pInteger); cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
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-05-19 21:29:48 +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 );
|
|
|
|
|
}
|
|
|
|
|
function cvGetImage(const arr: pCvArr; image_header: pIplImage): pIplImage; cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +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-05-19 21:29:48 +02:00
|
|
|
|
function cvReshapeMatND(const arr: pCvArr; sizeof_header: Integer; header: pCvArr; new_cn, new_dims: Integer; new_sizes: pInteger)
|
|
|
|
|
: pCvArr; cdecl;
|
|
|
|
|
function cvReshapeND(const arr: pCvArr; sizeof_header: Integer; header: pCvArr; new_cn, new_dims: Integer; new_sizes: pInteger)
|
|
|
|
|
: pCvArr; inline;
|
2013-04-02 00:17:25 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
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-05-19 21:29:48 +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 );
|
|
|
|
|
}
|
|
|
|
|
procedure cvRepeat(src, dst: pCvArr); cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +02:00
|
|
|
|
{Allocates array data
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvCreateData( pCvArr* arr );
|
|
|
|
|
}
|
|
|
|
|
procedure cvCreateData(arr: pCvArr); cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +02:00
|
|
|
|
{Releases array data
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(void) cvReleaseData( pCvArr* arr );
|
|
|
|
|
}
|
|
|
|
|
procedure cvReleaseData(arr: pCvArr); cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +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-05-19 21:29:48 +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
|
|
|
|
}
|
|
|
|
|
procedure cvGetRawData(arr: pCvArr; data: puchar; step: pInteger = nil; roi_size: pCvSize = nil); cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +02:00
|
|
|
|
{Returns width and height of array in elements
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(CvSize) cvGetSize( const pCvArr* arr );
|
|
|
|
|
}
|
2014-05-19 21:29:48 +02:00
|
|
|
|
function cvGetSize(const arr: pCvArr): TCvSize; //cdecl;
|
|
|
|
|
procedure _cvGetSize(const arr: pCvArr; Var size: TCvSize); cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
2013-09-25 21:18:23 +02:00
|
|
|
|
procedure cvCopy(const src: pCvArr; dst: pCvArr; const mask: pCvArr = nil); cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +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;
|
2013-04-10 01:22:08 +02:00
|
|
|
|
procedure cvSet(mat: pCvMat; i, j: Integer; val: Single); inline; overload;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +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;
|
2013-04-07 12:41:15 +02:00
|
|
|
|
procedure cvZero(arr: pCvArr); cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
2013-09-25 21:18:23 +02:00
|
|
|
|
procedure cvSplit(const src: pCvArr; dst0: pCvArr; dst1: pCvArr; dst2: pCvArr; dst3: pCvArr); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
procedure cvMerge(const src0: pIplImage; const src1: pIplImage; const src2: pIplImage; const src3: pIplImage;
|
|
|
|
|
dst: pIplImage); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
procedure cvMixChannels(src: Array of pCvArr; src_count: Integer; dst: Array of pCvArr; dst_count: Integer;
|
|
|
|
|
const from_to: pInteger; pair_count: Integer); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
|
procedure cvScale(const src: pCvArr; dst: pCvArr; scale: double = 1; shift: double = 0); cdecl;
|
2013-04-16 08:40:44 +02:00
|
|
|
|
procedure cvCvtScale(const src: pCvArr; dst: pCvArr; scale: double = 1; shift: double = 0); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvConvert(const src: pCvArr; dst: pCvArr); inline;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
|
}
|
|
|
|
|
procedure cvConvertScaleAbs(const src: pCvArr; dst: pCvArr; scale: double = 1; shift: double = 0); cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
2014-05-19 21:29:48 +02:00
|
|
|
|
function cvCheckTermCriteria(criteria: TCvTermCriteria; default_eps: double; default_max_iters: Integer): TCvTermCriteria; cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2013-04-16 08:40:44 +02:00
|
|
|
|
// ***************************************************************************************
|
|
|
|
|
// * Arithmetic, logic and comparison operations *
|
|
|
|
|
// ***************************************************************************************
|
2013-01-07 15:02:10 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvAdd(const src1, src2: pIplImage; dst: pIplImage; const mask: pIplImage = nil); cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvAddS(const src: pIplImage; value: TCvScalar; dst: pIplImage; const mask: pIplImage = nil); cdecl;
|
2013-01-07 15:02:10 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
2013-01-07 15:02:10 +01:00
|
|
|
|
procedure cvSub(const src1, src2: pIplImage; dst: pIplImage; const mask: pIplImage = nil); cdecl;
|
|
|
|
|
|
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 );
|
|
|
|
|
// }
|
2013-01-07 15:02:10 +01:00
|
|
|
|
procedure cvSubS(const src: pIplImage; value: TCvScalar; dst: pIplImage; const mask: pIplImage = nil); inline;
|
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvSubRS(const src: pIplImage; value: TCvScalar; dst: pIplImage; const mask: pIplImage = nil); cdecl;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
|
|
|
|
procedure cvMul(const src1, src2: pIplImage; dst: pIplImage; scale: double = 1); cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
|
|
|
|
procedure cvDiv(const src1, src2: pIplImage; dst: pIplImage; scale: double = 1); cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +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)
|
|
|
|
|
}
|
|
|
|
|
procedure cvScaleAdd(const src1: pIplImage; scale: TCvScalar; const src2: pIplImage; dst: pIplImage); cdecl;
|
2013-04-16 08:40:44 +02:00
|
|
|
|
procedure cvAXPY(A: pIplImage; real_scalar: double; B, C: pIplImage); inline;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
procedure cvAddWeighted(const src1: pIplImage; alpha: double; const src2: pIplImage; beta: double; gamma: double;
|
|
|
|
|
dst: pIplImage); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +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-05-19 21:29:48 +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
|
|
|
|
}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
procedure cvAnd(const src1: pIplImage; const src2: pIplImage; dst: pIplImage; masl: pIplImage = nil); cdecl;
|
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;
|
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
function cvGet(const mat: pCvMat; i, j: Integer): Single; inline;
|
|
|
|
|
procedure cvCopyImage(const src: pIplImage; dst: pIplImage; const mask: pIplImage = nil); cdecl;
|
2014-05-19 21:29:48 +02:00
|
|
|
|
procedure cvCvtPixToPlane(const src: pIplImage; dst0: pIplImage; dst1: pIplImage; dst2: pIplImage; dst3: pIplImage); cdecl;
|
2013-04-16 08:40:44 +02:00
|
|
|
|
procedure cvCvtPlaneToPix(const src0: pIplImage; const src1: pIplImage; const src2: pIplImage; const src3: pIplImage;
|
|
|
|
|
dst: pIplImage); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +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-05-19 21:29:48 +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-05-19 21:29:48 +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));
|
|
|
|
|
}
|
|
|
|
|
procedure cvXorS(const src: pIplImage; value: TCvScalar; dst: pIplImage; const mask: pCvArr = nil); cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +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-05-19 21:29:48 +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 );
|
|
|
|
|
}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
procedure cvInRange(const src: pIplImage; const lower: pIplImage; const upper: pIplImage; dst: pIplImage); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +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 );
|
|
|
|
|
}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
procedure cvInRangeS(const src: pIplImage; lower: TCvScalar; upper: TCvScalar; dst: pIplImage); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2013-09-15 14:02:26 +02:00
|
|
|
|
const
|
2014-05-19 21:29:48 +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;
|
|
|
|
|
|
|
|
|
|
|
2013-01-01 13:29:34 +01: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));
|
|
|
|
|
procedure cvCartToPolar(const x: pCvArr; const y: pCvArr; magnitude: pCvArr; angle: pCvArr = nil;
|
|
|
|
|
angle_in_degrees: Integer = 0); cdecl;
|
|
|
|
|
|
|
|
|
|
// * 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));
|
2014-05-19 21:29:48 +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 * )
|
|
|
|
|
procedure cvFlip(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 */
|
2014-05-19 21:29:48 +02:00
|
|
|
|
CV_C = 1;
|
|
|
|
|
CV_L1 = 2;
|
|
|
|
|
CV_L2 = 4;
|
2013-04-13 16:59:47 +02:00
|
|
|
|
CV_NORM_MASK = 7;
|
2014-05-19 21:29:48 +02:00
|
|
|
|
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) );
|
2013-04-16 08:40:44 +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
|
|
|
|
|
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 )
|
|
|
|
|
// #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));
|
|
|
|
|
procedure cvGEMM(const src1: pCvArr; const src2: pCvArr; alpha: double; const src3: pCvArr; beta: double; dst: pCvArr;
|
|
|
|
|
tABC: Integer = 0); cdecl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// #define cvMatMulAddEx cvGEMM
|
|
|
|
|
|
|
|
|
|
const
|
2014-05-19 21:29:48 +02:00
|
|
|
|
CV_LU = 0;
|
|
|
|
|
CV_SVD = 1;
|
|
|
|
|
CV_SVD_SYM = 2;
|
2013-09-25 21:18:23 +02:00
|
|
|
|
CV_CHOLESKY = 3;
|
2014-05-19 21:29:48 +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
|
|
|
|
|
|
|
|
|
// (* ***************************************************************************************\
|
|
|
|
|
// * 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-05-19 21:29:48 +02:00
|
|
|
|
{Calculates number of non-zero pixels
|
2013-04-15 18:14:12 +02:00
|
|
|
|
CVAPI(Integer)cvCountNonZero(pCvArr * arr);
|
|
|
|
|
}
|
|
|
|
|
function cvCountNonZero(arr: pIplImage): Integer; cdecl;
|
2013-01-07 15:02:10 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +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) );
|
|
|
|
|
}
|
2014-05-19 21:29:48 +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;
|
2013-01-07 15:02:10 +01:00
|
|
|
|
|
2013-09-25 21:18:23 +02:00
|
|
|
|
// ****************************************************************************************
|
|
|
|
|
// * Discrete Linear Transforms and Related Functions
|
|
|
|
|
// ****************************************************************************************
|
|
|
|
|
|
|
|
|
|
Const
|
2014-05-19 21:29:48 +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;
|
2014-05-19 21:29:48 +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) );
|
|
|
|
|
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-05-19 21:29:48 +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-05-19 21:29:48 +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-05-19 21:29:48 +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-05-19 21:29:48 +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-05-19 21:29:48 +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 );
|
|
|
|
|
}
|
|
|
|
|
function cvCreateSeq(seq_flags: Integer; header_size: size_t; elem_size: size_t; storage: pCvMemStorage): pCvSeq; cdecl;
|
|
|
|
|
|
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-05-19 21:29:48 +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-05-19 21:29:48 +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-05-19 21:29:48 +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-05-19 21:29:48 +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
|
|
|
|
|
|
|
|
|
// ************ 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 );
|
|
|
|
|
procedure cvCreateSeqBlock(writer: pCvSeqWriter); 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()));
|
2014-05-19 21:29:48 +02:00
|
|
|
|
procedure cvWrite(fs: pCvFileStorage; const name: pCvChar; const ptr: pCvArr; attributes: TCvAttrList {= cvAttrList()} ); cdecl;
|
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
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
|
|
|
|
|
// ****************************************************************************************
|
|
|
|
|
// * Drawing *
|
|
|
|
|
// ****************************************************************************************
|
|
|
|
|
|
|
|
|
|
// Following declaration is a macro definition!
|
|
|
|
|
function CV_RGB(const r, g, B: double): TCvScalar; inline;
|
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-05-19 21:29:48 +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) );
|
|
|
|
|
}
|
|
|
|
|
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-05-19 21:29:48 +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;
|
|
|
|
|
}
|
2014-05-19 21:29:48 +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-05-19 21:29:48 +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
|
|
|
|
}
|
2013-04-07 12:41:15 +02:00
|
|
|
|
procedure cvCircle(img: pCvArr; center: TCvPoint; radius: Integer; color: TCvScalar; thickness: Integer = 1;
|
2013-04-16 08:40:44 +02:00
|
|
|
|
line_type: Integer = 8; shift: Integer = 0); cdecl;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
|
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));
|
|
|
|
|
}
|
2014-05-19 21:29:48 +02:00
|
|
|
|
procedure cvEllipse(img: pIplImage; center: TCvPoint; axes: TCvSize; angle: double; start_angle: double; nd_angle: double;
|
|
|
|
|
color: TCvScalar; thickness: Integer = 1; line_type: Integer = 8; shift: Integer = 0); cdecl;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
2013-04-05 13:36:47 +02:00
|
|
|
|
procedure cvEllipseBox(img: pIplImage; box: TCvBox2D; color: TCvScalar; thickness: Integer = 1; line_type: Integer = 8;
|
|
|
|
|
shift: Integer = 0); inline;
|
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
2013-04-07 12:41:15 +02:00
|
|
|
|
procedure cvFillConvexPoly(img: pIplImage; const pts: pCVPoint; npts: Integer; color: TCvScalar; line_type: Integer = 8;
|
|
|
|
|
shift: Integer = 0); cdecl;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +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) );
|
|
|
|
|
}
|
2014-05-19 21:29:48 +02:00
|
|
|
|
procedure cvPolyLine(img: pIplImage; 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-05-19 21:29:48 +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-05-19 21:29:48 +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-05-19 21:29:48 +02:00
|
|
|
|
{Font structure}
|
2013-01-01 13:29:34 +01:00
|
|
|
|
type
|
|
|
|
|
pCvFont = ^TCvFont;
|
2013-04-16 08:40:44 +02:00
|
|
|
|
|
2013-01-01 13:29:34 +01:00
|
|
|
|
TCvFont = packed 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-05-19 21:29:48 +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
|
|
|
|
}
|
2014-05-19 21:29:48 +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-04-15 18:14:12 +02:00
|
|
|
|
|
2013-09-25 21:18:23 +02:00
|
|
|
|
function cvFont(scale: double; thickness: Integer = 1): TCvFont; inline;
|
|
|
|
|
|
2014-05-19 21:29:48 +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 );
|
|
|
|
|
}
|
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 );
|
2014-05-19 21:29:48 +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-05-19 21:29:48 +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
|
|
|
|
}
|
2013-04-16 08:40:44 +02:00
|
|
|
|
procedure cvDrawContours(img: pIplImage; contour: pCvSeq; external_color, hole_color: TCvScalar;
|
2014-05-19 21:29:48 +02:00
|
|
|
|
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 *****************/
|
|
|
|
|
Type
|
|
|
|
|
pCvTreeNodeIterator = ^TCvTreeNodeIterator;
|
|
|
|
|
|
|
|
|
|
TCvTreeNodeIterator = packed 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 );
|
2014-05-19 21:29:48 +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 );
|
|
|
|
|
function cvNextTreeNode(tree_iterator: pCvTreeNodeIterator): Pointer; cdecl;
|
|
|
|
|
// CVAPI(void*) cvPrevTreeNode( CvTreeNodeIterator* tree_iterator );
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
// * The function implements the K-means algorithm for clustering an array of sample
|
|
|
|
|
// vectors in a specified number of classes */
|
|
|
|
|
const
|
|
|
|
|
CV_KMEANS_USE_INITIAL_LABELS = 1;
|
|
|
|
|
|
|
|
|
|
// 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) );
|
|
|
|
|
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
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
// ****************************************************************************************
|
|
|
|
|
// * Data Persistence *
|
|
|
|
|
// ****************************************************************************************
|
2013-09-25 21:18:23 +02:00
|
|
|
|
//
|
2013-04-15 18:14:12 +02:00
|
|
|
|
// ********************************* High-level functions *********************************
|
|
|
|
|
|
2014-05-19 21:29:48 +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) );
|
|
|
|
|
}
|
2014-05-19 21:29:48 +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-05-19 21:29:48 +02:00
|
|
|
|
{closes file storage and deallocates buffers
|
2013-04-02 00:17:25 +02:00
|
|
|
|
CVAPI(void) cvReleaseFileStorage( CvFileStorage** fs );
|
|
|
|
|
}
|
|
|
|
|
procedure cvReleaseFileStorage(Var fs: pCvFileStorage); cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +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-05-19 21:29:48 +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
|
|
|
|
}
|
2013-04-02 00:17:25 +02:00
|
|
|
|
function cvReadInt(const node: pCvFileNode; default_value: Integer = 0): Integer; inline;
|
|
|
|
|
|
2014-05-19 21:29:48 +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
|
|
|
|
}
|
2014-05-19 21:29:48 +02:00
|
|
|
|
function cvReadIntByName(const fs: pCvFileStorage; const map: pCvFileNode; const name: pCvChar; default_value: Integer = 0)
|
|
|
|
|
: Integer; inline;
|
2013-04-02 00:17:25 +02:00
|
|
|
|
|
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;
|
|
|
|
|
// }
|
|
|
|
|
function cvReadString(const node: pCvFileNode; const default_value: pCvChar = nil): pCvChar; inline;
|
|
|
|
|
|
|
|
|
|
// 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 );
|
|
|
|
|
// }
|
|
|
|
|
function cvReadStringByName(const fs: pCvFileStorage; const map: pCvFileNode; const name: pCvChar;
|
|
|
|
|
const default_value: pCvChar = nil): pCvChar; inline;
|
|
|
|
|
|
2014-05-19 21:29:48 +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));
|
|
|
|
|
}
|
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 );}
|
2014-05-19 21:29:48 +02:00
|
|
|
|
function cvReadByName(fs: pCvFileStorage; const map: pCvFileNode; const name: pCvChar; attributes: pCvAttrList = nil): Pointer;
|
2013-09-16 13:49:10 +02:00
|
|
|
|
|
|
|
|
|
|
2013-04-16 08:40:44 +02:00
|
|
|
|
// *********************************** Adding own types ***********************************/
|
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;
|
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-05-19 21:29:48 +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) );
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-25 21:18:23 +02:00
|
|
|
|
procedure cvSave(const filename: pCvChar; const struct_ptr: Pointer; const name: pCvChar; const comment: pCvChar;
|
2013-01-01 22:36:38 +01:00
|
|
|
|
attributes: TCvAttrList); cdecl; overload;
|
2014-05-19 21:29:48 +02:00
|
|
|
|
procedure cvSave(const filename: pCvChar; const struct_ptr: Pointer; const name: pCvChar = Nil; const comment: pCvChar = Nil);
|
|
|
|
|
overload; inline;
|
2013-09-16 13:49:10 +02:00
|
|
|
|
function cvLoad(const filename: pCvChar; memstorage: pCvMemStorage = Nil; const name: pCvChar = nil;
|
2013-09-25 21:18:23 +02:00
|
|
|
|
const real_name: ppChar = nil): Pointer; cdecl;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2013-04-16 08:40:44 +02:00
|
|
|
|
// *********************************** Measuring Execution Time ***************************/
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2014-05-19 21:29:48 +02:00
|
|
|
|
{helper functions for RNG initialization and accurate time measurement:
|
|
|
|
|
uses internal clock counter on x86}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
function cvGetTickCount: int64; inline;
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvGetTickFrequency: double;
|
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) );
|
|
|
|
|
procedure cvSetNumThreads(threads: Integer = 0); cdecl;
|
|
|
|
|
// * get index of the thread being executed */
|
|
|
|
|
// CVAPI(int) cvGetThreadNum( void );
|
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
|
2014-05-19 21:29:48 +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;
|
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
|
2014-05-19 21:29:48 +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 );
|
|
|
|
|
function cvGetErrMode: Integer; cdecl;
|
|
|
|
|
|
|
|
|
|
// * Sets error processing mode, returns previously used mode */
|
|
|
|
|
// CVAPI(int) cvSetErrMode( int mode );
|
|
|
|
|
function cvSetErrMode(mode: Integer): Integer; cdecl;
|
|
|
|
|
|
2014-05-19 21:29:48 +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-05-19 21:29:48 +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 );
|
2013-09-26 18:32:37 +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
|
|
|
|
|
2013-01-01 13:29:34 +01:00
|
|
|
|
implementation
|
|
|
|
|
|
2013-09-12 11:49:13 +02:00
|
|
|
|
uses
|
|
|
|
|
ulibname;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
|
|
|
|
function cvCreateImageHeader; external Core_Dll;
|
|
|
|
|
function cvInitImageHeader; external Core_Dll;
|
|
|
|
|
function cvCreateImage; external Core_Dll;
|
|
|
|
|
procedure cvReleaseImageHeader; external Core_Dll;
|
|
|
|
|
procedure cvReleaseImage; external Core_Dll;
|
|
|
|
|
function cvCloneImage; external Core_Dll;
|
|
|
|
|
procedure cvSetImageCOI; external Core_Dll;
|
|
|
|
|
function cvGetImageCOI; external Core_Dll;
|
|
|
|
|
procedure cvSetImageROI; external Core_Dll;
|
|
|
|
|
procedure cvResetImageROI; external Core_Dll;
|
|
|
|
|
function cvGetImageROI; external Core_Dll;
|
|
|
|
|
function cvCreateMatHeader; external Core_Dll;
|
|
|
|
|
function cvInitMatHeader; external Core_Dll;
|
|
|
|
|
function cvCreateMat; external Core_Dll;
|
|
|
|
|
procedure cvReleaseMat; external Core_Dll;
|
|
|
|
|
function cvCloneMat; external Core_Dll;
|
|
|
|
|
function cvGetSubRect; external Core_Dll;
|
2013-09-26 18:32:37 +02:00
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvGetSubArr; external Core_Dll name 'cvGetSubRect';
|
|
|
|
|
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvGetRow(const arr: pCvArr; submat: pCvMat; row: Integer): pCvMat;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
begin
|
2014-05-19 21:29:48 +02:00
|
|
|
|
Result := cvGetRows(arr, submat, row, row + 1, 1);
|
2013-04-15 18:14:12 +02:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function cvGetCols; external Core_Dll;
|
|
|
|
|
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvGetCol(const arr: pCvArr; submat: pCvMat; col: Integer): pCvMat;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
begin
|
2014-05-19 21:29:48 +02:00
|
|
|
|
Result := cvGetCols(arr, submat, col, col + 1);
|
2013-04-15 18:14:12 +02:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function cvGetDiag; external Core_Dll;
|
|
|
|
|
procedure cvScalarToRawData; external Core_Dll;
|
|
|
|
|
procedure cvRawDataToScalar; external Core_Dll;
|
|
|
|
|
function cvCreateMatNDHeader; external Core_Dll;
|
|
|
|
|
function cvCreateMatND; external Core_Dll;
|
|
|
|
|
function cvInitMatNDHeader; external Core_Dll;
|
|
|
|
|
|
|
|
|
|
procedure cvReleaseMatND(var mat: pCvMatND); inline;
|
|
|
|
|
begin
|
|
|
|
|
cvReleaseMat(pCvMat(mat));
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function cvCloneMatND; external Core_Dll;
|
|
|
|
|
function cvCreateSparseMat; external Core_Dll;
|
|
|
|
|
procedure cvReleaseSparseMat; external Core_Dll;
|
|
|
|
|
function cvCloneSparseMat; external Core_Dll;
|
|
|
|
|
function cvInitSparseMatIterator; external Core_Dll;
|
|
|
|
|
|
|
|
|
|
// 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;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
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-05-19 21:29:48 +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;
|
|
|
|
|
Result := mat_iterator.node;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
2013-04-16 08:40:44 +02:00
|
|
|
|
Result := nil;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function cvInitNArrayIterator; external Core_Dll;
|
|
|
|
|
function cvNextNArraySlice; external Core_Dll;
|
|
|
|
|
function cvGetElemType; external Core_Dll;
|
|
|
|
|
function cvGetDims; external Core_Dll;
|
|
|
|
|
function cvGetDimSize; external Core_Dll;
|
|
|
|
|
function cvPtr1D; external Core_Dll;
|
|
|
|
|
function cvPtr2D; external Core_Dll;
|
|
|
|
|
function cvPtr3D; external Core_Dll;
|
|
|
|
|
function cvPtrND; external Core_Dll;
|
|
|
|
|
function cvGet1D; external Core_Dll;
|
|
|
|
|
function cvGet2D; external Core_Dll;
|
|
|
|
|
function cvGet3D; external Core_Dll;
|
|
|
|
|
function cvGetND; external Core_Dll;
|
|
|
|
|
function cvGetReal1D; external Core_Dll;
|
|
|
|
|
function cvGetReal2D; external Core_Dll;
|
|
|
|
|
function cvGetReal3D; external Core_Dll;
|
|
|
|
|
function cvGetRealND; external Core_Dll;
|
|
|
|
|
procedure cvSet1D; external Core_Dll;
|
|
|
|
|
procedure cvSet2D; external Core_Dll;
|
|
|
|
|
procedure cvSet3D; external Core_Dll;
|
|
|
|
|
procedure cvSetND; external Core_Dll;
|
|
|
|
|
procedure cvSetReal1D; external Core_Dll;
|
|
|
|
|
procedure cvSetReal2D; external Core_Dll;
|
|
|
|
|
procedure cvSetReal3D; external Core_Dll;
|
|
|
|
|
procedure cvSetRealND; external Core_Dll;
|
|
|
|
|
procedure cvClearND; external Core_Dll;
|
|
|
|
|
function cvGetMat; external Core_Dll;
|
|
|
|
|
function cvGetImage; external Core_Dll;
|
|
|
|
|
function cvReshapeMatND; external Core_Dll;
|
|
|
|
|
|
2014-05-19 21:29:48 +02:00
|
|
|
|
function cvReshapeND(const arr: pCvArr; sizeof_header: Integer; header: pCvArr; new_cn, new_dims: Integer; new_sizes: pInteger)
|
|
|
|
|
: pCvArr; inline;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
begin
|
2014-05-19 21:29:48 +02:00
|
|
|
|
Result := cvReshapeMatND(arr, sizeof(sizeof_header), header, new_cn, new_dims, new_sizes);
|
2013-04-15 18:14:12 +02:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function cvReshape; external Core_Dll;
|
|
|
|
|
procedure cvRepeat; external Core_Dll;
|
|
|
|
|
procedure cvCreateData; external Core_Dll;
|
|
|
|
|
procedure cvReleaseData; external Core_Dll;
|
|
|
|
|
procedure cvSetData; external Core_Dll;
|
|
|
|
|
procedure cvGetRawData; external Core_Dll;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2014-05-19 21:29:48 +02:00
|
|
|
|
procedure _cvGetSize(const arr: pCvArr; Var size: TCvSize); external Core_Dll name 'cvGetSize';
|
|
|
|
|
|
2014-05-19 11:56:41 +02:00
|
|
|
|
{$IFDEF CPUX86}
|
2014-05-19 21:29:48 +02:00
|
|
|
|
|
2013-01-01 22:36:38 +01:00
|
|
|
|
function cvGetSize(const arr: pCvArr): TCvSize; assembler;
|
|
|
|
|
asm
|
2014-05-19 21:29:48 +02:00
|
|
|
|
// mov eax,arr // <20> eax <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> arr
|
2013-04-15 18:14:12 +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
|
2013-01-01 22:36:38 +01:00
|
|
|
|
push eax
|
|
|
|
|
call _cvGetSize
|
2013-04-15 18:14:12 +02:00
|
|
|
|
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
|
2013-01-01 22:36:38 +01:00
|
|
|
|
mov Result.width,eax
|
|
|
|
|
mov Result.height,ecx
|
|
|
|
|
end;
|
2014-05-19 11:56:41 +02:00
|
|
|
|
{$ELSE}
|
2014-05-19 21:29:48 +02:00
|
|
|
|
|
|
|
|
|
function cvGetSize(const arr: pCvArr): TCvSize; assembler;
|
|
|
|
|
asm
|
|
|
|
|
call _cvGetSize
|
|
|
|
|
mov Result.width,eax
|
|
|
|
|
shr rax,32
|
|
|
|
|
mov Result.height,eax
|
2014-05-19 11:56:41 +02:00
|
|
|
|
end;
|
|
|
|
|
{$ENDIF}
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvCopy; external Core_Dll;
|
|
|
|
|
procedure cvSet(arr: pCvArr; value: TCvScalar; const mask: pCvArr = Nil); external Core_Dll;
|
|
|
|
|
|
|
|
|
|
procedure cvSet(mat: pCvMat; i, j: Integer; val: Single); inline;
|
|
|
|
|
var
|
|
|
|
|
type_: Integer;
|
2014-05-19 21:29:48 +02:00
|
|
|
|
ptr: puchar;
|
|
|
|
|
pf: PSingle;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
begin
|
|
|
|
|
type_ := CV_MAT_TYPE(mat._type);
|
|
|
|
|
assert((i < mat^.rows) and (j < mat^.cols) and (type_ = CV_32FC1));
|
|
|
|
|
ptr := mat^.data;
|
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;
|
|
|
|
|
|
|
|
|
|
procedure cvSetZero; external Core_Dll;
|
|
|
|
|
procedure cvZero; external Core_Dll name 'cvSetZero';
|
|
|
|
|
procedure cvSplit; external Core_Dll;
|
|
|
|
|
procedure cvMerge; external Core_Dll;
|
|
|
|
|
procedure cvMixChannels; external Core_Dll;
|
|
|
|
|
procedure cvConvertScale; external Core_Dll;
|
|
|
|
|
|
|
|
|
|
procedure cvConvert(const src: pCvArr; dst: pCvArr); inline;
|
|
|
|
|
begin
|
2014-05-19 21:29:48 +02:00
|
|
|
|
cvConvertScale(src, dst, 1, 0);
|
2013-04-15 18:14:12 +02:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure cvScale; external Core_Dll name 'cvConvertScale';
|
|
|
|
|
procedure cvCvtScale; external Core_Dll name 'cvConvertScale';
|
|
|
|
|
procedure cvConvertScaleAbs; external Core_Dll;
|
|
|
|
|
procedure cvCvtScaleAbs; external Core_Dll name 'cvConvertScaleAbs';
|
|
|
|
|
function cvCheckTermCriteria; external Core_Dll;
|
|
|
|
|
procedure cvAdd; external Core_Dll;
|
|
|
|
|
procedure cvAddS; external Core_Dll;
|
|
|
|
|
procedure cvSub; external Core_Dll;
|
|
|
|
|
|
|
|
|
|
procedure cvSubS(const src: pIplImage; value: TCvScalar; dst: pIplImage; const mask: pIplImage);
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
procedure cvSubRS; external Core_Dll;
|
|
|
|
|
procedure cvMul; external Core_Dll;
|
|
|
|
|
procedure cvDiv; external Core_Dll;
|
|
|
|
|
procedure cvScaleAdd; external Core_Dll;
|
|
|
|
|
|
2013-04-16 08:40:44 +02:00
|
|
|
|
// define cvAXPY( A, real_scalar, B, C ) cvScaleAdd(A, cvRealScalar(real_scalar), B, C)
|
|
|
|
|
procedure cvAXPY(A: pIplImage; real_scalar: double; B, C: pIplImage); inline;
|
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;
|
|
|
|
|
|
|
|
|
|
procedure cvAddWeighted; external Core_Dll;
|
|
|
|
|
function cvDotProduct; external Core_Dll;
|
|
|
|
|
|
2013-09-25 21:18:23 +02:00
|
|
|
|
function cvAlloc(size: size_t): Pointer; external Core_Dll;
|
|
|
|
|
procedure cvFree_(ptr: Pointer); external Core_Dll;
|
2013-01-01 22:36:38 +01:00
|
|
|
|
|
2013-03-27 23:20:08 +01:00
|
|
|
|
procedure cvInitFont; external Core_Dll;
|
|
|
|
|
procedure cvPutText; external Core_Dll;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2013-09-25 21:18:23 +02:00
|
|
|
|
function cvFont(scale: double; thickness: Integer = 1): TCvFont; inline;
|
|
|
|
|
begin
|
2014-05-19 21:29:48 +02:00
|
|
|
|
cvInitFont(@Result, CV_FONT_HERSHEY_PLAIN, scale, scale, 0, thickness, CV_AA);
|
2013-09-25 21:18:23 +02:00
|
|
|
|
end;
|
|
|
|
|
|
2013-04-07 12:41:15 +02:00
|
|
|
|
procedure cvCircle; external Core_Dll;
|
|
|
|
|
procedure cvLine; external Core_Dll;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2013-03-27 23:20:08 +01:00
|
|
|
|
procedure cvCopyImage; external Core_Dll name 'cvCopy';
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
function CV_RGB(const r, g, B: double): TCvScalar; inline;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
begin
|
2014-05-19 21:29:48 +02:00
|
|
|
|
Result := CvScalar(B, g, r, 0);
|
2013-01-01 13:29:34 +01:00
|
|
|
|
end;
|
|
|
|
|
|
2013-09-25 21:18:23 +02:00
|
|
|
|
procedure cvSave(const filename: pCvChar; const struct_ptr: Pointer; const name: pCvChar; const comment: pCvChar;
|
2013-04-09 12:41:27 +02:00
|
|
|
|
attributes: TCvAttrList); external Core_Dll; overload;
|
|
|
|
|
|
2014-05-19 21:29:48 +02:00
|
|
|
|
procedure cvSave(const filename: pCvChar; const struct_ptr: Pointer; const name: pCvChar = Nil; const comment: pCvChar = Nil);
|
|
|
|
|
overload; inline;
|
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;
|
|
|
|
|
|
2013-03-27 23:20:08 +01:00
|
|
|
|
function cvLoad; external Core_Dll;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
2013-03-27 23:20:08 +01:00
|
|
|
|
procedure cvInRange; external Core_Dll;
|
|
|
|
|
procedure cvInRangeS; external Core_Dll;
|
|
|
|
|
procedure cvMinMaxLoc; external Core_Dll;
|
|
|
|
|
procedure cvAnd; external Core_Dll;
|
2013-01-01 22:36:38 +01:00
|
|
|
|
|
2013-03-27 23:20:08 +01:00
|
|
|
|
procedure cvCvtPixToPlane; external Core_Dll name 'cvSplit';
|
|
|
|
|
procedure cvCvtPlaneToPix; external Core_Dll name 'cvMerge';
|
2013-01-01 22:36:38 +01:00
|
|
|
|
|
2013-03-27 23:20:08 +01:00
|
|
|
|
function cvCreateMemStorage; external Core_Dll;
|
|
|
|
|
function cvGetSeqElem; external Core_Dll;
|
|
|
|
|
procedure cvReleaseMemStorage; external Core_Dll;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvRectangle; external Core_Dll;
|
|
|
|
|
function cvGetRows; external Core_Dll;
|
2013-03-27 23:20:08 +01:00
|
|
|
|
procedure cvFlip; external Core_Dll;
|
|
|
|
|
procedure cvMirror; external Core_Dll name 'cvFlip';
|
|
|
|
|
procedure cvClearMemStorage; external Core_Dll;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvDrawContours; external Core_Dll;
|
|
|
|
|
function cvCreateChildMemStorage; external Core_Dll;
|
|
|
|
|
procedure cvCvtSeqToArray; external Core_Dll;
|
|
|
|
|
|
2013-04-02 00:17:25 +02:00
|
|
|
|
function cvOpenFileStorage; external Core_Dll;
|
|
|
|
|
procedure cvReleaseFileStorage; external Core_Dll;
|
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
function cvGetFileNodeByName; external Core_Dll;
|
|
|
|
|
|
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;
|
2014-05-19 21:29:48 +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-05-19 21:29:48 +02:00
|
|
|
|
Result := cvReadInt(cvGetFileNodeByName(fs, map, name), default_value);
|
2013-04-02 00:17:25 +02:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function cvRead; external Core_Dll;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
procedure cvStartReadSeq; external Core_Dll;
|
|
|
|
|
procedure cvChangeSeqBlock; external Core_Dll;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvFillConvexPoly; external Core_Dll;
|
|
|
|
|
procedure cvPolyLine; external Core_Dll;
|
|
|
|
|
|
|
|
|
|
function cvCreateSeq; external Core_Dll;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
procedure cvCreateSeqBlock; external Core_Dll;
|
|
|
|
|
function cvSeqPush; external Core_Dll;
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
2013-05-27 13:11:45 +02:00
|
|
|
|
procedure cvOr; external Core_Dll;
|
|
|
|
|
procedure cvXor; external Core_Dll;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
procedure cvXorS; external Core_Dll;
|
2013-05-27 13:11:45 +02:00
|
|
|
|
procedure cvNot; external Core_Dll;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
procedure cvEllipse; external Core_Dll;
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
function cvCountNonZero; external Core_Dll;
|
2013-04-10 01:22:08 +02:00
|
|
|
|
|
|
|
|
|
function cvGet(const mat: pCvMat; i, j: Integer): Single; inline;
|
|
|
|
|
var
|
|
|
|
|
type_: Integer;
|
2014-05-19 21:29:48 +02:00
|
|
|
|
ptr: puchar;
|
|
|
|
|
pf: PSingle;
|
2013-04-10 01:22:08 +02:00
|
|
|
|
begin
|
|
|
|
|
type_ := CV_MAT_TYPE(mat^._type);
|
|
|
|
|
assert((i < mat^.rows) and (j < mat^.cols) and (type_ = CV_32FC1));
|
|
|
|
|
ptr := mat^.data;
|
2014-05-19 21:29:48 +02:00
|
|
|
|
Inc(ptr, mat.step * i + sizeof(Single) * j);
|
|
|
|
|
pf := PSingle(ptr);
|
2013-04-10 01:22:08 +02:00
|
|
|
|
Result := pf^;
|
|
|
|
|
end;
|
|
|
|
|
|
2013-09-25 21:18:23 +02:00
|
|
|
|
procedure cvRelease(var struct_ptr: Pointer); external Core_Dll name 'cvRelease';
|
2013-04-15 18:14:12 +02:00
|
|
|
|
procedure cvRelease(var struct_ptr: pCvSeq); external Core_Dll name 'cvRelease';
|
2013-04-12 21:33:12 +02:00
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
function cvGetTickCount;
|
2013-04-10 01:22:08 +02:00
|
|
|
|
begin
|
2013-04-15 18:14:12 +02:00
|
|
|
|
Result := GetTickCount;
|
2013-04-10 01:22:08 +02:00
|
|
|
|
end;
|
2013-01-07 15:02:10 +01:00
|
|
|
|
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function GetTickFrequency: double;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
Var
|
|
|
|
|
freq: TLargeInteger;
|
2013-04-12 21:33:12 +02:00
|
|
|
|
begin
|
2013-04-15 18:14:12 +02:00
|
|
|
|
QueryPerformanceFrequency(freq);
|
|
|
|
|
Result := freq;
|
2013-04-12 21:33:12 +02:00
|
|
|
|
end;
|
|
|
|
|
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvGetTickFrequency: double;
|
2013-04-12 21:33:12 +02:00
|
|
|
|
begin
|
2013-04-15 18:14:12 +02:00
|
|
|
|
Result := GetTickFrequency() * 1E-6;
|
2013-04-12 21:33:12 +02:00
|
|
|
|
end;
|
|
|
|
|
|
2013-04-15 18:14:12 +02:00
|
|
|
|
function cvCheckHardwareSupport; external Core_Dll;
|
|
|
|
|
function cvGetNumThreads; external Core_Dll;
|
|
|
|
|
procedure cvSetNumThreads; external Core_Dll;
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvGetThreadNum; external Core_Dll;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2013-04-13 16:59:47 +02:00
|
|
|
|
procedure cvAbsDiff; external Core_Dll;
|
|
|
|
|
function cvNorm; external Core_Dll;
|
2013-04-15 18:14:12 +02:00
|
|
|
|
|
2013-04-14 19:17:55 +02:00
|
|
|
|
procedure cvSeqRemove; external Core_Dll;
|
|
|
|
|
procedure cvClearSeq; external Core_Dll;
|
|
|
|
|
procedure cvWrite; external Core_Dll;
|
2013-04-16 08:40:44 +02:00
|
|
|
|
function cvSeqPartition; external Core_Dll;
|
2013-04-13 16:59:47 +02:00
|
|
|
|
|
2013-09-12 11:49:13 +02:00
|
|
|
|
function cvSum; external Core_Dll;
|
|
|
|
|
|
2013-09-15 14:02:26 +02:00
|
|
|
|
procedure cvRandArr; external Core_Dll;
|
|
|
|
|
procedure cvRandShuffle; external Core_Dll;
|
|
|
|
|
|
2013-09-16 13:49:10 +02:00
|
|
|
|
procedure cvWriteInt; external Core_Dll;
|
|
|
|
|
procedure cvWriteReal; external Core_Dll;
|
|
|
|
|
procedure cvWriteString; external Core_Dll;
|
|
|
|
|
procedure cvWriteComment; external Core_Dll;
|
|
|
|
|
|
2014-05-19 21:29:48 +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-05-19 21:29:48 +02:00
|
|
|
|
Result := cvRead(fs, cvGetFileNodeByName(fs, map, name), attributes);
|
2013-09-16 13:49:10 +02:00
|
|
|
|
end;
|
|
|
|
|
|
2013-09-25 21:18:23 +02:00
|
|
|
|
function cvReadStringByName(const fs: pCvFileStorage; const map: pCvFileNode; const name: pCvChar;
|
|
|
|
|
const default_value: pCvChar = nil): pCvChar; inline;
|
|
|
|
|
begin
|
2014-05-19 21:29:48 +02:00
|
|
|
|
Result := cvReadString(cvGetFileNodeByName(fs, map, name), default_value);
|
2013-09-25 21:18:23 +02:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function cvReadString(const node: pCvFileNode; const default_value: pCvChar = nil): pCvChar; inline;
|
|
|
|
|
begin
|
|
|
|
|
if Assigned(node) then
|
|
|
|
|
begin
|
|
|
|
|
if CV_NODE_IS_STRING(node^.tag) then
|
|
|
|
|
Result := node^.str.ptr
|
|
|
|
|
else
|
|
|
|
|
Result := nil;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
Result := default_value;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function cvGetErrStatus; external Core_Dll;
|
|
|
|
|
procedure cvSetErrStatus; external Core_Dll;
|
|
|
|
|
function cvGetErrMode; external Core_Dll;
|
|
|
|
|
function cvSetErrMode; external Core_Dll;
|
|
|
|
|
procedure cvError; external Core_Dll;
|
|
|
|
|
|
|
|
|
|
procedure cvDFT; external Core_Dll;
|
|
|
|
|
procedure cvFFT; external Core_Dll name 'cvDFT';
|
|
|
|
|
procedure cvMulSpectrums; external Core_Dll;
|
|
|
|
|
function cvGetOptimalDFTSize; external Core_Dll;
|
|
|
|
|
procedure cvDCT; external Core_Dll;
|
|
|
|
|
|
|
|
|
|
procedure cvCartToPolar; external Core_Dll;
|
|
|
|
|
procedure cvPolarToCart; external Core_Dll;
|
|
|
|
|
procedure cvPow; external Core_Dll;
|
|
|
|
|
procedure cvExp; external Core_Dll;
|
|
|
|
|
procedure cvLog; external Core_Dll;
|
|
|
|
|
|
|
|
|
|
procedure cvCrossProduct; external Core_Dll;
|
|
|
|
|
procedure cvGEMM; external Core_Dll;
|
|
|
|
|
function cvInvert; external Core_Dll;
|
|
|
|
|
|
|
|
|
|
function cvFastArctan; external Core_Dll;
|
|
|
|
|
function cvCbrt; external Core_Dll;
|
|
|
|
|
function cvCheckArr; external Core_Dll;
|
|
|
|
|
|
|
|
|
|
procedure cvGetTextSize; external Core_Dll;
|
|
|
|
|
|
|
|
|
|
procedure cvInitTreeNodeIterator; external Core_Dll;
|
|
|
|
|
function cvNextTreeNode; external Core_Dll;
|
|
|
|
|
function cvPrevTreeNode; external Core_Dll;
|
|
|
|
|
procedure cvInsertNodeIntoTree; external Core_Dll;
|
|
|
|
|
procedure cvRemoveNodeFromTree; external Core_Dll;
|
|
|
|
|
function cvTreeToNodeSeq; external Core_Dll;
|
|
|
|
|
function cvKMeans2; external Core_Dll;
|
|
|
|
|
|
2013-01-01 13:29:34 +01:00
|
|
|
|
end.
|