diff --git a/samples/Components/ComponentsDemo.groupproj b/samples/Components/ComponentsDemo.groupproj index c489a8f..fe3ffdb 100644 --- a/samples/Components/ComponentsDemo.groupproj +++ b/samples/Components/ComponentsDemo.groupproj @@ -18,6 +18,9 @@ + + + Default.Personality.12 @@ -71,14 +74,23 @@ + + + + + + + + + - + - + - + diff --git a/samples/Components/cCameraCapture/cCameraCapture.dproj b/samples/Components/cCameraCapture/cCameraCapture.dproj index 24611aa..731dfa3 100644 --- a/samples/Components/cCameraCapture/cCameraCapture.dproj +++ b/samples/Components/cCameraCapture/cCameraCapture.dproj @@ -1,7 +1,7 @@  {32F0B620-F9A6-4081-8E87-C89FF09CAD04} - 16.0 + 16.1 VCL cCameraCapture.dpr True @@ -199,3 +199,11 @@ + + diff --git a/samples/Components/cCameraCapture/cCameraCapture.res b/samples/Components/cCameraCapture/cCameraCapture.res index 641a7ce..0f3facb 100644 Binary files a/samples/Components/cCameraCapture/cCameraCapture.res and b/samples/Components/cCameraCapture/cCameraCapture.res differ diff --git a/samples/Components/cFFmpegIPCamSource/cFFmpegIPCamSource.dproj b/samples/Components/cFFmpegIPCamSource/cFFmpegIPCamSource.dproj index 3ef5f5e..24e5dcc 100644 --- a/samples/Components/cFFmpegIPCamSource/cFFmpegIPCamSource.dproj +++ b/samples/Components/cFFmpegIPCamSource/cFFmpegIPCamSource.dproj @@ -1,7 +1,7 @@  {08BFF34B-6FF9-468C-9AB2-3F76BBC9E351} - 16.0 + 16.1 VCL cFFmpegIPCamSource.dpr True @@ -150,3 +150,11 @@ + + diff --git a/samples/Components/cFFmpegIPCamSource/cFFmpegIPCamSource.res b/samples/Components/cFFmpegIPCamSource/cFFmpegIPCamSource.res index 750599d..0f3facb 100644 Binary files a/samples/Components/cFFmpegIPCamSource/cFFmpegIPCamSource.res and b/samples/Components/cFFmpegIPCamSource/cFFmpegIPCamSource.res differ diff --git a/samples/Components/cFMXCameracapture/cFMXCameraCapture.dproj b/samples/Components/cFMXCameracapture/cFMXCameraCapture.dproj index abd5f6e..25ea63e 100644 --- a/samples/Components/cFMXCameracapture/cFMXCameraCapture.dproj +++ b/samples/Components/cFMXCameracapture/cFMXCameraCapture.dproj @@ -1,7 +1,7 @@  {DF744E81-26D1-44A1-826E-85DC20070C2F} - 16.0 + 16.1 FMX cFMXCameraCapture.dpr True @@ -123,6 +123,11 @@ package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=preferExternal;largeHeap=False;theme=TitleBar;hardwareAccelerated=true + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_180x180.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_87x87.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2208x1242.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1242x2208.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_750x1334.png $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_29x29.png $(MSBuildProjectName) true @@ -160,6 +165,11 @@ $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_50x50.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_87x87.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2208x1242.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_1242x2208.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_750x1334.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_180x180.png $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_144x144.png $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_29x29.png $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png @@ -375,7 +385,7 @@ - Contents + ../ 1 @@ -461,6 +471,7 @@ + ../ 1 @@ -640,3 +651,11 @@ + + diff --git a/samples/Components/cFMXCameracapture/cFMXCameraCapture.res b/samples/Components/cFMXCameracapture/cFMXCameraCapture.res index e4a520d..2d50e5c 100644 Binary files a/samples/Components/cFMXCameracapture/cFMXCameraCapture.res and b/samples/Components/cFMXCameracapture/cFMXCameraCapture.res differ diff --git a/samples/Components/cMatchTemplate/cMatchTemplate.dproj b/samples/Components/cMatchTemplate/cMatchTemplate.dproj index e3eb7ff..881f8c3 100644 --- a/samples/Components/cMatchTemplate/cMatchTemplate.dproj +++ b/samples/Components/cMatchTemplate/cMatchTemplate.dproj @@ -1,7 +1,7 @@  {37904A06-4ABD-411B-8C02-CCC73D6B4098} - 16.0 + 16.1 VCL cMatchTemplate.dpr True @@ -166,3 +166,11 @@ + + diff --git a/samples/Components/cMatchTemplate/cMatchTemplate.res b/samples/Components/cMatchTemplate/cMatchTemplate.res index 750599d..0f3facb 100644 Binary files a/samples/Components/cMatchTemplate/cMatchTemplate.res and b/samples/Components/cMatchTemplate/cMatchTemplate.res differ diff --git a/samples/Components/cObjectColorTracking/Unit1.dfm b/samples/Components/cObjectColorTracking/Unit1.dfm index ae798e2..75977a1 100644 --- a/samples/Components/cObjectColorTracking/Unit1.dfm +++ b/samples/Components/cObjectColorTracking/Unit1.dfm @@ -29,7 +29,7 @@ object Form1: TForm1 Top = 371 Width = 292 Height = 34 - TabOrder = 0 + TabOrder = 5 inherited lbl1: TLabel Caption = 'H max:' end @@ -43,7 +43,7 @@ object Form1: TForm1 Top = 334 Width = 292 Height = 34 - TabOrder = 1 + TabOrder = 4 inherited lbl1: TLabel Caption = 'V min:' end @@ -56,7 +56,7 @@ object Form1: TForm1 Top = 408 Width = 292 Height = 34 - TabOrder = 2 + TabOrder = 7 inherited lbl1: TLabel Caption = 'S min:' end @@ -83,7 +83,7 @@ object Form1: TForm1 Top = 445 Width = 292 Height = 34 - TabOrder = 4 + TabOrder = 9 inherited lbl1: TLabel Caption = 'S max:' end @@ -96,7 +96,7 @@ object Form1: TForm1 Top = 371 Width = 292 Height = 34 - TabOrder = 5 + TabOrder = 6 inherited lbl1: TLabel Caption = 'V max:' end @@ -121,14 +121,14 @@ object Form1: TForm1 BorderStyle = bsSingle Caption = 'Selected color' ParentBackground = False - TabOrder = 8 + TabOrder = 11 end inline frm22: TFrame2 Left = 299 Top = 408 Width = 292 Height = 34 - TabOrder = 9 + TabOrder = 8 inherited lbl1: TLabel Caption = 'Range' end @@ -157,7 +157,8 @@ object Form1: TForm1 Width = 97 Height = 17 Caption = 'Mask' - TabOrder = 11 + Enabled = False + TabOrder = 0 end object ocvcmrsrc1: TocvCameraSource Enabled = True diff --git a/samples/Components/cObjectColorTracking/Unit1.pas b/samples/Components/cObjectColorTracking/Unit1.pas index a5584f3..3aa8017 100644 --- a/samples/Components/cObjectColorTracking/Unit1.pas +++ b/samples/Components/cObjectColorTracking/Unit1.pas @@ -90,6 +90,7 @@ begin yy := Trunc(O.Image.Height * Y / O.Height); SelectedPixel := O.Image.Pixel[xx, yy]; UpdateTrack; + chk1.Enabled:=True; end; procedure TForm1.UpdateTrack; diff --git a/samples/Components/cVideoWriter/cVideoWriter.dproj b/samples/Components/cVideoWriter/cVideoWriter.dproj index 714935b..49dbf26 100644 --- a/samples/Components/cVideoWriter/cVideoWriter.dproj +++ b/samples/Components/cVideoWriter/cVideoWriter.dproj @@ -1,7 +1,7 @@  {15F13174-963C-4D40-A658-9AF254D2590C} - 16.0 + 16.1 VCL cVideoWriter.dpr True @@ -127,3 +127,11 @@ + + diff --git a/samples/Components/cVideoWriter/cVideoWriter.res b/samples/Components/cVideoWriter/cVideoWriter.res index 75ae46b..d6cf632 100644 Binary files a/samples/Components/cVideoWriter/cVideoWriter.res and b/samples/Components/cVideoWriter/cVideoWriter.res differ diff --git a/samples/LibDemo/cvCanny/cv_Canny.dpr b/samples/LibDemo/cvCanny/cv_Canny.dpr index ff6f4ef..7fb9e2b 100644 --- a/samples/LibDemo/cvCanny/cv_Canny.dpr +++ b/samples/LibDemo/cvCanny/cv_Canny.dpr @@ -1,26 +1,27 @@ -// ***************************************************************** -// Delphi-OpenCV Demo -// Copyright (C) 2013 Project Delphi-OpenCV -// **************************************************************** -// Contributor: - // Laentir Valetov -// email:laex@bk.ru -// **************************************************************** -// You may retrieve the latest version of this file at the GitHub, -// located at git://github.com/Laex/Delphi-OpenCV.git -// **************************************************************** -// The contents of this file are used with permission, 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/MPL-1_1Final.html -// -// 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. -// ******************************************************************* +(* + ***************************************************************** + Delphi-OpenCV Demo + Copyright (C) 2013 Project Delphi-OpenCV + **************************************************************** + Contributor: + Laentir Valetov + email:laex@bk.ru + **************************************************************** + You may retrieve the latest version of this file at the GitHub, + located at git://github.com/Laex/Delphi-OpenCV.git + **************************************************************** + The contents of this file are used with permission, 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/MPL-1_1Final.html + 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. + ******************************************************************* +*) program cv_Canny; {$APPTYPE CONSOLE} diff --git a/samples/LibDemo/cvCanny/cv_Canny.dproj b/samples/LibDemo/cvCanny/cv_Canny.dproj index b46b041..9f4375a 100644 --- a/samples/LibDemo/cvCanny/cv_Canny.dproj +++ b/samples/LibDemo/cvCanny/cv_Canny.dproj @@ -7,7 +7,7 @@ 3 Console None - 16.0 + 16.1 Win32 @@ -76,7 +76,6 @@ DEBUG;$(DCC_Define) - None CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= 1033 @@ -139,6 +138,9 @@ + + Microsoft Office XP Sample Automation Server Wrapper Components + False @@ -151,3 +153,11 @@ + + diff --git a/samples/LibDemo/cvCodeBook/cv_CodeBook.dpr b/samples/LibDemo/cvCodeBook/cv_CodeBook.dpr index abaeaa3..88df0c8 100644 --- a/samples/LibDemo/cvCodeBook/cv_CodeBook.dpr +++ b/samples/LibDemo/cvCodeBook/cv_CodeBook.dpr @@ -1,25 +1,27 @@ -// ***************************************************************** -// Delphi-OpenCV Demo -// Copyright (C) 2013 Project Delphi-OpenCV -// **************************************************************** -// Contributor: - // Laentir Valetov -// email:laex@bk.ru -// **************************************************************** -// You may retrieve the latest version of this file at the GitHub, -// located at git://github.com/Laex/Delphi-OpenCV.git -// **************************************************************** -// The contents of this file are used with permission, 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/MPL-1_1Final.html -// -// 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. -// ******************************************************************* +(* + ***************************************************************** + Delphi-OpenCV Demo + Copyright (C) 2013 Project Delphi-OpenCV + **************************************************************** + Contributor: + Laentir Valetov + email:laex@bk.ru + **************************************************************** + You may retrieve the latest version of this file at the GitHub, + located at git://github.com/Laex/Delphi-OpenCV.git + **************************************************************** + The contents of this file are used with permission, 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/MPL-1_1Final.html + + 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. + ******************************************************************* +*) program cv_CodeBook; diff --git a/samples/LibDemo/cvCodeBook/cv_CodeBook.dproj b/samples/LibDemo/cvCodeBook/cv_CodeBook.dproj index c7ce284..867010a 100644 --- a/samples/LibDemo/cvCodeBook/cv_CodeBook.dproj +++ b/samples/LibDemo/cvCodeBook/cv_CodeBook.dproj @@ -7,7 +7,7 @@ 3 Console None - 16.0 + 16.1 Win32 @@ -151,3 +151,11 @@ + + diff --git a/samples/LibDemo/cvFloodFill/cv_FloodFill.dpr b/samples/LibDemo/cvFloodFill/cv_FloodFill.dpr index d1e0e47..2359291 100644 --- a/samples/LibDemo/cvFloodFill/cv_FloodFill.dpr +++ b/samples/LibDemo/cvFloodFill/cv_FloodFill.dpr @@ -1,26 +1,27 @@ -// ***************************************************************** -// Delphi-OpenCV Demo -// Copyright (C) 2013 Project Delphi-OpenCV -// **************************************************************** -// Contributor: - // Laentir Valetov -// email:laex@bk.ru -// **************************************************************** -// You may retrieve the latest version of this file at the GitHub, -// located at git://github.com/Laex/Delphi-OpenCV.git -// **************************************************************** -// The contents of this file are used with permission, 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/MPL-1_1Final.html -// -// 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. -// ******************************************************************* +(* + ***************************************************************** + Delphi-OpenCV Demo + Copyright (C) 2013 Project Delphi-OpenCV + **************************************************************** + Contributor: + Laentir Valetov + email:laex@bk.ru + **************************************************************** + You may retrieve the latest version of this file at the GitHub, + located at git://github.com/Laex/Delphi-OpenCV.git + **************************************************************** + The contents of this file are used with permission, 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/MPL-1_1Final.html + 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. + ******************************************************************* +*) program cv_FloodFill; {$APPTYPE CONSOLE} diff --git a/samples/LibDemo/cvFloodFill/cv_FloodFill.dproj b/samples/LibDemo/cvFloodFill/cv_FloodFill.dproj index d575d61..d45607e 100644 --- a/samples/LibDemo/cvFloodFill/cv_FloodFill.dproj +++ b/samples/LibDemo/cvFloodFill/cv_FloodFill.dproj @@ -7,7 +7,7 @@ 3 Console None - 16.0 + 16.1 Win32 @@ -151,3 +151,11 @@ + + diff --git a/source/OpenCV.inc b/source/OpenCV.inc index d3ae84e..46e601c 100644 --- a/source/OpenCV.inc +++ b/source/OpenCV.inc @@ -1,6 +1,21 @@ {$IFNDEF OPENCV_INC} {$DEFINE OPENCV_INC} +{$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} + +{$POINTERMATH ON} + +{$WARN SYMBOL_DEPRECATED OFF} +{$WARN SYMBOL_PLATFORM OFF} +{$WARN UNIT_PLATFORM OFF} +{$WARN UNSAFE_TYPE OFF} +{$WARN UNSAFE_CODE OFF} +{$WARN UNSAFE_CAST OFF} + (* - Development environment directives diff --git a/source/component/Delphi21/dclCommonOpenCV210.dproj b/source/component/Delphi21/dclCommonOpenCV210.dproj index 2d358af..dc239a9 100644 --- a/source/component/Delphi21/dclCommonOpenCV210.dproj +++ b/source/component/Delphi21/dclCommonOpenCV210.dproj @@ -468,3 +468,11 @@ + + diff --git a/source/component/Delphi21/dclFMXOpenCV210.dproj b/source/component/Delphi21/dclFMXOpenCV210.dproj index 117af6b..f11017f 100644 --- a/source/component/Delphi21/dclFMXOpenCV210.dproj +++ b/source/component/Delphi21/dclFMXOpenCV210.dproj @@ -483,3 +483,11 @@ + + diff --git a/source/component/Delphi21/dclVCLOpenCV210.dproj b/source/component/Delphi21/dclVCLOpenCV210.dproj index 5f6e9f0..0a44a55 100644 --- a/source/component/Delphi21/dclVCLOpenCV210.dproj +++ b/source/component/Delphi21/dclVCLOpenCV210.dproj @@ -449,3 +449,11 @@ + + diff --git a/source/ocv.calib3d_c.pas b/source/ocv.calib3d_c.pas index 088a322..b45cc01 100644 --- a/source/ocv.calib3d_c.pas +++ b/source/ocv.calib3d_c.pas @@ -1,65 +1,55 @@ -// ************************************************************************************************** -// Project Delphi-OpenCV -// ************************************************************************************************** -// Contributor: -// Laentir Valetov -// email:laex@bk.ru -// Mikhail Grigorev -// email:sleuthound@gmail.com -// ************************************************************************************************** -// You may retrieve the latest version of this file at the GitHub, -// located at git://github.com/Laex/Delphi-OpenCV.git -// ************************************************************************************************** -// License: -// The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); -// you may not use this file except in compliance with the License. You may obtain a copy of the -// License at http://www.mozilla.org/MPL/ -// -// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF -// ANY KIND, either express or implied. See the License for the specific language governing rights -// and limitations under the License. -// -// Alternatively, the contents of this file may be used under the terms of the -// GNU Lesser General Public License (the "LGPL License"), in which case the -// provisions of the LGPL License are applicable instead of those above. -// If you wish to allow use of your version of this file only under the terms -// of the LGPL License and not to allow others to use your version of this file -// under the MPL, indicate your decision by deleting the provisions above and -// replace them with the notice and other provisions required by the LGPL -// License. If you do not delete the provisions above, a recipient may use -// your version of this file under either the MPL or the LGPL License. -// -// For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html -// ************************************************************************************************** -// Warning: Using Delphi XE3 syntax! -// ************************************************************************************************** -// The Initial Developer of the Original Code: -// OpenCV: open source computer vision library -// Homepage: http://ocv.org -// Online docs: http://docs.ocv.org -// Q&A forum: http://answers.ocv.org -// Dev zone: http://code.ocv.org -// ************************************************************************************************** -// Original file: -// opencv\modules\calib3d\include\opencv2\calib3d\calib3d_c.h -// ************************************************************************************************* +(* + ************************************************************************************************** + Project Delphi-OpenCV + ************************************************************************************************** + Contributor: + Laentir Valetov + email:laex@bk.ru + Mikhail Grigorev + email:sleuthound@gmail.com + ************************************************************************************************** + You may retrieve the latest version of this file at the GitHub, + located at git://github.com/Laex/Delphi-OpenCV.git + ************************************************************************************************** + License: + The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy of the + License at http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF + ANY KIND, either express or implied. See the License for the specific language governing rights + and limitations under the License. + + Alternatively, the contents of this file may be used under the terms of the + GNU Lesser General Public License (the "LGPL License"), in which case the + provisions of the LGPL License are applicable instead of those above. + If you wish to allow use of your version of this file only under the terms + of the LGPL License and not to allow others to use your version of this file + under the MPL, indicate your decision by deleting the provisions above and + replace them with the notice and other provisions required by the LGPL + License. If you do not delete the provisions above, a recipient may use + your version of this file under either the MPL or the LGPL License. + + For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html + ************************************************************************************************** + Warning: Using Delphi XE3 syntax! + ************************************************************************************************** + The Initial Developer of the Original Code: + OpenCV: open source computer vision library + Homepage: http://ocv.org + Online docs: http://docs.ocv.org + Q&A forum: http://answers.ocv.org + Dev zone: http://code.ocv.org + ************************************************************************************************** + Original file: + opencv\modules\calib3d\include\opencv2\calib3d\calib3d_c.h + ************************************************************************************************* +*) -// -{$I OpenCV.inc} -// -{$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 ocv.calib3d_c; +{$I OpenCV.inc} + interface uses @@ -93,8 +83,8 @@ function cvCreatePOSITObject(points: pCvPoint3D32f; point_count: Integer): PCvPO double focal_length, CvTermCriteria criteria, float* rotation_matrix, float* translation_vector); *) -procedure cvPOSIT(posit_object: PCvPOSITObject; imagePoints: pCvPoint2D32f; focal_length: double; - criteria: TCvTermCriteria; rotation_matrix: TCvMatr32f; translation_vector: TCvVect32f); cdecl; +procedure cvPOSIT(posit_object: PCvPOSITObject; imagePoints: pCvPoint2D32f; focal_length: double; criteria: TCvTermCriteria; + rotation_matrix: TCvMatr32f; translation_vector: TCvVect32f); cdecl; (* Releases CvPOSITObject structure CVAPI(void) cvReleasePOSITObject( CvPOSITObject** posit_object ); *) @@ -121,8 +111,8 @@ const CV_FM_RANSAC = CV_RANSAC; CV_ITERATIVE = 0; - CV_EPNP = 1; // F.Moreno-Noguer, V.Lepetit and P.Fua "EPnP: Efficient Perspective-n-Point Camera Pose Estimation" - CV_P3P = 2; + CV_EPNP = 1; // F.Moreno-Noguer, V.Lepetit and P.Fua "EPnP: Efficient Perspective-n-Point Camera Pose Estimation" + CV_P3P = 2; // X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang; "Complete Solution Classification for the Perspective-Three-Point Problem" (* @@ -132,8 +122,8 @@ const double param1 CV_DEFAULT(3.), double param2 CV_DEFAULT(0.99), CvMat* status CV_DEFAULT(NULL) ); *) -function cvFindFundamentalMat(const points1: pCvMat; const points2: pCvMat; fundamental_matrix: pCvMat; - method: Integer = CV_FM_RANSAC; param1: double = 3; param2: double = 0.99; status: pCvMat = nil): Integer; cdecl; +function cvFindFundamentalMat(const points1: pCvMat; const points2: pCvMat; fundamental_matrix: pCvMat; method: Integer = CV_FM_RANSAC; + param1: double = 3; param2: double = 0.99; status: pCvMat = nil): Integer; cdecl; (* For each input point on one of images @@ -146,17 +136,26 @@ function cvFindFundamentalMat(const points1: pCvMat; const points2: pCvMat; fund CvMat* correspondent_lines ); *) -(* Triangulation functions +procedure cvComputeCorrespondEpilines(const points: pCvMat; which_image: Integer; const fundamental_matrix: pCvMat; + correspondent_lines: pCvMat); cdecl; + +(* + Triangulation functions + CVAPI(void) cvTriangulatePoints(CvMat* projMatr1, CvMat* projMatr2, CvMat* projPoints1, CvMat* projPoints2, CvMat* points4D); *) +procedure cvTriangulatePoints(projMatr1: pCvMat; projMatr2: pCvMat; projPoints1: pCvMat; projPoints2: pCvMat; points4D: pCvMat); cdecl; + (* CVAPI(void) cvCorrectMatches(CvMat* F, CvMat* points1, CvMat* points2, CvMat* new_points1, CvMat* new_points2); *) +procedure cvCorrectMatches(F: pCvMat; points1: pCvMat; points2: pCvMat; new_points1: pCvMat; new_points2: pCvMat); cdecl; + (* Computes the optimal new camera matrix according to the free scaling parameter alpha: alpha=0 - only valid pixels will be retained in the undistorted image @@ -171,6 +170,10 @@ function cvFindFundamentalMat(const points1: pCvMat; const points2: pCvMat; fund int center_principal_point CV_DEFAULT(0)); *) +procedure cvGetOptimalNewCameraMatrix(const camera_matrix: pCvMat; const dist_coeffs: pCvMat; image_size: TCvSize; alpha: double; + new_camera_matrix: pCvMat; new_imag_size: TCvSize { = CV_DEFAULT(cvSize(0,0))) }; valid_pixel_ROI: PCvRect = nil; + center_principal_point: Integer = 0); cdecl; + (* Converts rotation vector to rotation matrix or vice versa @@ -194,6 +197,7 @@ function cvFindHomography(const src_points: pCvMat; const dst_points: pCvMat; ho (* Computes RQ decomposition for 3x3 matrices + CVAPI(void) cvRQDecomp3x3( const CvMat *matrixM, CvMat *matrixR, CvMat *matrixQ, CvMat *matrixQx CV_DEFAULT(NULL), CvMat *matrixQy CV_DEFAULT(NULL), @@ -201,6 +205,9 @@ function cvFindHomography(const src_points: pCvMat; const dst_points: pCvMat; ho CvPoint3D64f *eulerAngles CV_DEFAULT(NULL)); *) +procedure cvRQDecomp3x3(const matrixM: pCvMat; matrixR: pCvMat; matrixQ: pCvMat; matrixQx: pCvMat = nil; matrixQy: pCvMat = nil; + matrixQz: pCvMat = nil; eulerAngles: PCvPoint3D64f = nil); cdecl; + (* Computes projection matrix decomposition @@ -212,12 +219,17 @@ function cvFindHomography(const src_points: pCvMat; const dst_points: pCvMat; ho CvPoint3D64f *eulerAngles CV_DEFAULT(NULL)); *) +procedure cvDecomposeProjectionMatrix(const projMatr: pCvMat; calibMatr: pCvMat; rotMatr: pCvMat; posVect: pCvMat; rotMatrX: pCvMat = nil; + rotMatrY: pCvMat = nil; rotMatrZ: pCvMat = nil; eulerAngles: PCvPoint3D64f = nil); cdecl; + (* Computes d(AB)/dA and d(AB)/dB CVAPI(void) cvCalcMatMulDeriv( const CvMat* A, const CvMat* B, CvMat* dABdA, CvMat* dABdB ); *) +procedure cvCalcMatMulDeriv(const A: pCvMat; const B: pCvMat; dABdA: pCvMat; dABdB: pCvMat); cdecl; + (* Computes r3 = rodrigues(rodrigues(r2)*rodrigues(r1)), t3 = rodrigues(r2)*t1 + t2 and the respective derivatives @@ -231,6 +243,10 @@ function cvFindHomography(const src_points: pCvMat; const dst_points: pCvMat; ho CvMat* dt3dr2 CV_DEFAULT(0), CvMat* dt3dt2 CV_DEFAULT(0) ); *) +procedure cvComposeRT(const _rvec1: pCvMat; const _tvec1: pCvMat; const _rvec2: pCvMat; const _tvec2: pCvMat; _rvec3: pCvMat; + _tvec3: pCvMat; dr3dr1: pCvMat = nil; dr3dt1: pCvMat = nil; dr3dr2: pCvMat = nil; dr3dt2: pCvMat = nil; dt3dr1: pCvMat = nil; + dt3dt1: pCvMat = nil; dt3dr2: pCvMat = nil; dt3dt2: pCvMat = nil); cdecl; + (* Projects object points to the view plane using the specified extrinsic and intrinsic camera parameters @@ -244,52 +260,61 @@ function cvFindHomography(const src_points: pCvMat; const dst_points: pCvMat; ho double aspect_ratio CV_DEFAULT(0)); *) procedure cvProjectPoints2(const object_points: pCvMat; const rotation_vector: pCvMat; const translation_vector: pCvMat; - const camera_matrix: pCvMat; const distortion_coeffs: pCvMat; image_points: pCvMat; dpdrot: pCvMat = nil; - dpdt: pCvMat = nil; dpdf: pCvMat = nil; dpdc: pCvMat = nil; dpddist: pCvMat = nil; aspect_ratio: double = 0); cdecl; + const camera_matrix: pCvMat; const distortion_coeffs: pCvMat; image_points: pCvMat; dpdrot: pCvMat = nil; dpdt: pCvMat = nil; + dpdf: pCvMat = nil; dpdc: pCvMat = nil; dpddist: pCvMat = nil; aspect_ratio: double = 0); cdecl; -// * Finds extrinsic camera parameters from -// a few known corresponding point pairs and intrinsic parameters *) -// CVAPI(void) cvFindExtrinsicCameraParams2( const CvMat* object_points, -// const CvMat* image_points, -// const CvMat* camera_matrix, -// const CvMat* distortion_coeffs, -// CvMat* rotation_vector, -// CvMat* translation_vector, -// int use_extrinsic_guess CV_DEFAULT(0) ); -procedure cvFindExtrinsicCameraParams2(const object_points: pCvMat; const image_points: pCvMat; - const camera_matrix: pCvMat; const distortion_coeffs: pCvMat; rotation_vector: pCvMat; translation_vector: pCvMat; - use_extrinsic_guess: Integer = 0); cdecl; +(* Finds extrinsic camera parameters from + a few known corresponding point pairs and intrinsic parameters + + CVAPI(void) cvFindExtrinsicCameraParams2( const CvMat* object_points, + const CvMat* image_points, + const CvMat* camera_matrix, + const CvMat* distortion_coeffs, + CvMat* rotation_vector, + CvMat* translation_vector, + int use_extrinsic_guess CV_DEFAULT(0) ); +*) +procedure cvFindExtrinsicCameraParams2(const object_points: pCvMat; const image_points: pCvMat; const camera_matrix: pCvMat; + const distortion_coeffs: pCvMat; rotation_vector: pCvMat; translation_vector: pCvMat; use_extrinsic_guess: Integer = 0); cdecl; (* Computes initial estimate of the intrinsic camera parameters - // in case of planar calibration target (e.g. chessboard) *) -// CVAPI(void) cvInitIntrinsicParams2D( const CvMat* object_points, -// const CvMat* image_points, -// const CvMat* npoints, CvSize image_size, -// CvMat* camera_matrix, -// double aspect_ratio CV_DEFAULT(1.) ); -// -// #define CV_CALIB_CB_ADAPTIVE_THRESH 1 -// #define CV_CALIB_CB_NORMALIZE_IMAGE 2 -// #define CV_CALIB_CB_FILTER_QUADS 4 -// #define CV_CALIB_CB_FAST_CHECK 8 -// + in case of planar calibration target (e.g. chessboard) -{ // Performs a fast check if a chessboard is in the input image. This is a workaround to - // a problem of cvFindChessboardCorners being slow on images with no chessboard - // - src: input image - // - size: chessboard size - // Returns 1 if a chessboard can be in this image and findChessboardCorners should be called, - // 0 if there is no chessboard, -1 in case of error - CVAPI(int) cvCheckChessboard(IplImage* src, CvSize size); -} + CVAPI(void) cvInitIntrinsicParams2D( const CvMat* object_points, + const CvMat* image_points, + const CvMat* npoints, CvSize image_size, + CvMat* camera_matrix, + double aspect_ratio CV_DEFAULT(1.) ); +*) +const + CV_CALIB_CB_ADAPTIVE_THRESH = 1; + CV_CALIB_CB_NORMALIZE_IMAGE = 2; + CV_CALIB_CB_FILTER_QUADS = 4; + CV_CALIB_CB_FAST_CHECK = 8; + + (* Performs a fast check if a chessboard is in the input image. This is a workaround to + a problem of cvFindChessboardCorners being slow on images with no chessboard + - src: input image + - size: chessboard size + Returns 1 if a chessboard can be in this image and findChessboardCorners should be called, + 0 if there is no chessboard, -1 in case of error + + CVAPI(int) cvCheckChessboard(IplImage* src, CvSize size); + *) function cvCheckChessboard(const image: pCvArr; size: TCvSize): Integer; cdecl; +(* + Detects corners on a chessboard calibration pattern -// /* Detects corners on a chessboard calibration pattern *) -// CVAPI(int) cvFindChessboardCorners( const void* image, CvSize pattern_size, -// CvPoint2D32f* corners, -// int* corner_count CV_DEFAULT(NULL), -// int flags CV_DEFAULT(CV_CALIB_CB_ADAPTIVE_THRESH+CV_CALIB_CB_NORMALIZE_IMAGE) ); + CVAPI(int) cvFindChessboardCorners( + const void* image, + CvSize pattern_size, + CvPoint2D32f* corners, + int* corner_count CV_DEFAULT(NULL), + int flags CV_DEFAULT(CV_CALIB_CB_ADAPTIVE_THRESH+CV_CALIB_CB_NORMALIZE_IMAGE) ); +*) +function cvFindChessboardCorners(const image: Pointer; pattern_size: TCvSize; corners: pCvPoint2D32f; corner_count: pInteger = nil; + flags: Integer = CV_CALIB_CB_ADAPTIVE_THRESH + CV_CALIB_CB_NORMALIZE_IMAGE): Integer; cdecl; const CV_CALIB_USE_INTRINSIC_GUESS = 1; @@ -362,6 +387,11 @@ function cvCalibrateCamera2( CvPoint2D64f *principal_point CV_DEFAULT(NULL), double *pixel_aspect_ratio CV_DEFAULT(NULL)); *) + +procedure cvCalibrationMatrixValues(const camera_matrix: pCvMat; image_size: TCvSize; aperture_width: double = 0; + aperture_height: double = 0; fovx: PDouble = nil; fovy: PDouble = nil; focal_length: PDouble = nil; principal_point: PCvPoint2D64f = nil; + pixel_aspect_ratio: PDouble = nil); cdecl; + const CV_CALIB_FIX_INTRINSIC = 256; CV_CALIB_SAME_FOCAL_LENGTH = 512; @@ -380,9 +410,9 @@ const CV_TERMCRIT_ITER+CV_TERMCRIT_EPS,30,1e-6)), int flags CV_DEFAULT(CV_CALIB_FIX_INTRINSIC)); *) -function cvStereoCalibrate(const object_points: pCvMat; const image_points1: pCvMat; const image_points2: pCvMat; - const npoints: pCvMat; camera_matrix1: pCvMat; dist_coeffs1: pCvMat; camera_matrix2: pCvMat; dist_coeffs2: pCvMat; - image_size: TCvSize; R: pCvMat; T: pCvMat; E: pCvMat { = nil }; F: pCvMat { = nil }; +function cvStereoCalibrate(const object_points: pCvMat; const image_points1: pCvMat; const image_points2: pCvMat; const npoints: pCvMat; + camera_matrix1: pCvMat; dist_coeffs1: pCvMat; camera_matrix2: pCvMat; dist_coeffs2: pCvMat; image_size: TCvSize; R: pCvMat; T: pCvMat; + E: pCvMat { = nil }; F: pCvMat { = nil }; term_crit: TCvTermCriteria { = CV_DEFAULT(cvTermCriteria(CV_TERMCRIT_ITER + CV_TERMCRIT_EPS, 30, 1E-6)) }; flags: Integer { = CV_DEFAULT(CV_CALIB_FIX_INTRINSIC) } ): double; cdecl; @@ -405,10 +435,9 @@ const CvRect* valid_pix_ROI2 CV_DEFAULT(0)); *) procedure cvStereoRectify(const camera_matrix1: pCvMat; const camera_matrix2: pCvMat; const dist_coeffs1: pCvMat; - const dist_coeffs2: pCvMat; image_size: TCvSize; const R: pCvMat; const T: pCvMat; R1: pCvMat; R2: pCvMat; P1: pCvMat; - P2: pCvMat; Q: pCvMat { = nil }; flags: Integer { = CV_CALIB_ZERO_DISPARITY }; alpha: double { = -1 }; - new_image_size: TCvSize { =CV_DEFAULT(cvSize(0,0)) }; valid_pix_ROI1: pCvRect { =nil }; - valid_pix_ROI2: pCvRect { =nil } ); cdecl; + const dist_coeffs2: pCvMat; image_size: TCvSize; const R: pCvMat; const T: pCvMat; R1: pCvMat; R2: pCvMat; P1: pCvMat; P2: pCvMat; + Q: pCvMat { = nil }; flags: Integer { = CV_CALIB_ZERO_DISPARITY }; alpha: double { = -1 }; + new_image_size: TCvSize { =CV_DEFAULT(cvSize(0,0)) }; valid_pix_ROI1: PCvRect { =nil }; valid_pix_ROI2: PCvRect { =nil } ); cdecl; (* Computes rectification transformations for uncalibrated pair of images using a set @@ -419,8 +448,8 @@ procedure cvStereoRectify(const camera_matrix1: pCvMat; const camera_matrix2: pC CvMat* H1, CvMat* H2, double threshold CV_DEFAULT(5)); *) -function cvStereoRectifyUncalibrated(const points1: pCvMat; const points2: pCvMat; const F: pCvMat; img_size: TCvSize; - H1: pCvMat; H2: pCvMat; threshold: double = 5): Integer; cdecl; +function cvStereoRectifyUncalibrated(const points1: pCvMat; const points2: pCvMat; const F: pCvMat; img_size: TCvSize; H1: pCvMat; + H2: pCvMat; threshold: double = 5): Integer; cdecl; (* stereo correspondence parameters and functions *) const @@ -508,24 +537,36 @@ const CVAPI(CvStereoBMState* ) cvCreateStereoBMState(int preset CV_DEFAULT(CV_STEREO_BM_BASIC), int numberOfDisparities CV_DEFAULT(0)); *) -function cvCreateStereoBMState(preset: Integer = CV_STEREO_BM_BASIC; numberOfDisparities: Integer = 0) - : pCvStereoBMState; cdecl; +function cvCreateStereoBMState(preset: Integer = CV_STEREO_BM_BASIC; numberOfDisparities: Integer = 0): pCvStereoBMState; cdecl; -// CVAPI(void) cvReleaseStereoBMState( CvStereoBMState** state ); -// -// CVAPI(void) cvFindStereoCorrespondenceBM( const CvArr* left, const CvArr* right, -// CvArr* disparity, CvStereoBMState* state ); +(* + CVAPI(void) cvReleaseStereoBMState( CvStereoBMState** state ); +*) + +procedure cvReleaseStereoBMState(Var state: pCvStereoBMState); cdecl; + +(* + CVAPI(void) cvFindStereoCorrespondenceBM( const CvArr* left, const CvArr* right, + CvArr* disparity, CvStereoBMState* state ); +*) + +procedure cvFindStereoCorrespondenceBM(const left: pCvArr; const right: pCvArr; disparity: pCvArr; state: pCvStereoBMState); cdecl; (* CVAPI(CvRect) cvGetValidDisparityROI( CvRect roi1, CvRect roi2, int minDisparity, int numberOfDisparities, int SADWindowSize ); *) -function cvGetValidDisparityROI(roi1: TCvRect; roi2: TCvRect; minDisparity: Integer; numberOfDisparities: Integer; - SADWindowSize: Integer): TCvRect; cdecl; +function cvGetValidDisparityROI(roi1: TCvRect; roi2: TCvRect; minDisparity: Integer; numberOfDisparities: Integer; SADWindowSize: Integer) + : TCvRect; cdecl; -// CVAPI(void) cvValidateDisparity( CvArr* disparity, const CvArr* cost, -// int minDisparity, int numberOfDisparities, -// int disp12MaxDiff CV_DEFAULT(1) ); +(* + CVAPI(void) cvValidateDisparity( CvArr* disparity, const CvArr* cost, + int minDisparity, int numberOfDisparities, + int disp12MaxDiff CV_DEFAULT(1) ); +*) + +procedure cvValidateDisparity(disparity: pCvArr; const cost: pCvArr; minDisparity: Integer; numberOfDisparities: Integer; + disp12MaxDiff: Integer = 1); cdecl; (* Reprojects the computed disparity image to the 3D space using the specified 4x4 matrix @@ -543,26 +584,6 @@ procedure cvReprojectImageTo3D( { } const Q: pCvMat; { } handleMissingValues: Integer = 0); cdecl; -Const - CV_CALIB_CB_ADAPTIVE_THRESH = 1; - CV_CALIB_CB_NORMALIZE_IMAGE = 2; - CV_CALIB_CB_FILTER_QUADS = 4; - CV_CALIB_CB_FAST_CHECK = 8; - - (* - Detects corners on a chessboard calibration pattern - - CVAPI(int) cvFindChessboardCorners( - const void* image, - CvSize pattern_size, - CvPoint2D32f* corners, - int* corner_count CV_DEFAULT(NULL), - int flags CV_DEFAULT(CV_CALIB_CB_ADAPTIVE_THRESH+CV_CALIB_CB_NORMALIZE_IMAGE) ); - *) -function cvFindChessboardCorners(const image: Pointer; pattern_size: TCvSize; corners: pCvPoint2D32f; - corner_count: pInteger = nil; flags: Integer = CV_CALIB_CB_ADAPTIVE_THRESH + CV_CALIB_CB_NORMALIZE_IMAGE) - : Integer; cdecl; - implementation uses ocv.lib; diff --git a/source/ocv.compat.pas b/source/ocv.compat.pas index 9ac7848..cf515a3 100644 --- a/source/ocv.compat.pas +++ b/source/ocv.compat.pas @@ -1,70 +1,59 @@ -// ************************************************************************************************** -// Project Delphi-OpenCV -// ************************************************************************************************** -// Contributor: -// Laentir Valetov -// email:laex@bk.ru -// Mikhail Grigorev -// email:sleuthound@gmail.com -// ************************************************************************************************** -// You may retrieve the latest version of this file at the GitHub, -// located at git://github.com/Laex/Delphi-OpenCV.git -// ************************************************************************************************** -// License: -// The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); -// you may not use this file except in compliance with the License. You may obtain a copy of the -// License at http://www.mozilla.org/MPL/ -// -// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF -// ANY KIND, either express or implied. See the License for the specific language governing rights -// and limitations under the License. -// -// Alternatively, the contents of this file may be used under the terms of the -// GNU Lesser General Public License (the "LGPL License"), in which case the -// provisions of the LGPL License are applicable instead of those above. -// If you wish to allow use of your version of this file only under the terms -// of the LGPL License and not to allow others to use your version of this file -// under the MPL, indicate your decision by deleting the provisions above and -// replace them with the notice and other provisions required by the LGPL -// License. If you do not delete the provisions above, a recipient may use -// your version of this file under either the MPL or the LGPL License. -// -// For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html -// ************************************************************************************************** -// Warning: Using Delphi XE3 syntax! -// ************************************************************************************************** -// The Initial Developer of the Original Code: -// OpenCV: open source computer vision library -// Homepage: http://ocv.org -// Online docs: http://docs.ocv.org -// Q&A forum: http://answers.ocv.org -// Dev zone: http://code.ocv.org -// ************************************************************************************************** -// Original file: -// opencv\modules\legacy\include\opencv2\legacy\compat.hpp -// ************************************************************************************************* +(* + ************************************************************************************************** + Project Delphi-OpenCV + ************************************************************************************************** + Contributor: + Laentir Valetov + email:laex@bk.ru + Mikhail Grigorev + email:sleuthound@gmail.com + ************************************************************************************************** + You may retrieve the latest version of this file at the GitHub, + located at git://github.com/Laex/Delphi-OpenCV.git + ************************************************************************************************** + License: + The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy of the + License at http://www.mozilla.org/MPL/ -// -{$I OpenCV.inc} -// + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF + ANY KIND, either express or implied. See the License for the specific language governing rights + and limitations under the License. + + Alternatively, the contents of this file may be used under the terms of the + GNU Lesser General Public License (the "LGPL License"), in which case the + provisions of the LGPL License are applicable instead of those above. + If you wish to allow use of your version of this file only under the terms + of the LGPL License and not to allow others to use your version of this file + under the MPL, indicate your decision by deleting the provisions above and + replace them with the notice and other provisions required by the LGPL + License. If you do not delete the provisions above, a recipient may use + your version of this file under either the MPL or the LGPL License. + + For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html + ************************************************************************************************** + Warning: Using Delphi XE3 syntax! + ************************************************************************************************** + The Initial Developer of the Original Code: + OpenCV: open source computer vision library + Homepage: http://ocv.org + Online docs: http://docs.ocv.org + Q&A forum: http://answers.ocv.org + Dev zone: http://code.ocv.org + ************************************************************************************************** + Original file: + opencv\modules\legacy\include\opencv2\legacy\compat.hpp + ************************************************************************************************* +*) -{$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} -{$POINTERMATH ON} unit ocv.compat; +{$I OpenCV.inc} +{$POINTERMATH ON} + interface -uses ocv.core.types_c, ocv.imgproc.types_c; +uses ocv.core.types_c, ocv.imgproc.types_c, ocv.core_c; type // typedef int CvMatType; @@ -145,7 +134,7 @@ type *) function cvMatArray(rows: Integer; cols: Integer; type_: Integer; count: Integer; data: Pointer = nil): TCvMat; cdecl; -// + // #define cvUpdateMHIByTime cvUpdateMotionHistory // // #define cvAccMask cvAcc @@ -166,12 +155,25 @@ function cvMean(const image: pCvArr; const mask: pCvArr = nil): double; cdecl; *) function cvSumPixels(const image: pCvArr): double; cdecl; -// CV_EXPORTS void cvMean_StdDev( const CvArr* image, double* mean, double* sdv, -// const CvArr* mask CV_DEFAULT(0)); -// -// CV_EXPORTS void cvmPerspectiveProject( const CvMat* mat, const CvArr* src, CvArr* dst ); -// CV_EXPORTS void cvFillImage( CvArr* mat, double color ); -// +(* + CV_EXPORTS void cvMean_StdDev( const CvArr* image, double* mean, double* sdv, + const CvArr* mask CV_DEFAULT(0)); +*) + +procedure cvMean_StdDev(const image: pCvArr; mean: PDouble; sdv: PDouble; const mask: pCvArr = nil); cdecl; + +(* + CV_EXPORTS void cvmPerspectiveProject( const CvMat* mat, const CvArr* src, CvArr* dst ); +*) + +procedure cvmPerspectiveProject(const mat: PCvMat; const src: pCvArr; dst: pCvArr); cdecl; + +(* + CV_EXPORTS void cvFillImage( CvArr* mat, double color ); +*) + +procedure cvFillImage(mat: pCvArr; color: double); cdecl; + // #define cvCvtPixToPlane cvSplit // #define cvCvtPlaneToPix cvMerge type @@ -189,33 +191,52 @@ type param: array [0 .. 1] of TCvScalar; (* parameters of RNG *) end; - /// * Changes RNG range while preserving RNG state */ - // CV_EXPORTS void cvRandSetRange( CvRandState* state, double param1, - // double param2, int index CV_DEFAULT(-1)); - // - // CV_EXPORTS void cvRandInit( CvRandState* state, double param1, - // double param2, int seed, - // int disttype CV_DEFAULT(CV_RAND_UNI)); - // - /// * Fills array with random numbers */ - // CV_EXPORTS void cvRand( CvRandState* state, CvArr* arr ); - // - // #define cvRandNext( _state ) cvRandInt( &(_state)->state ) - // - // CV_EXPORTS void cvbRand( CvRandState* state, float* dst, int len ); - // - // CV_EXPORTS void cvbCartToPolar( const float* y, const float* x, - // float* magnitude, float* angle, int len ); - // CV_EXPORTS void cvbFastArctan( const float* y, const float* x, float* angle, int len ); - // CV_EXPORTS void cvbSqrt( const float* x, float* y, int len ); - // CV_EXPORTS void cvbInvSqrt( const float* x, float* y, int len ); - // CV_EXPORTS void cvbReciprocal( const float* x, float* y, int len ); - // CV_EXPORTS void cvbFastExp( const float* x, double* y, int len ); - // CV_EXPORTS void cvbFastLog( const double* x, float* y, int len ); - (* - CV_EXPORTS CvRect cvContourBoundingRect( void* point_set, int update CV_DEFAULT(0)); + Changes RNG range while preserving RNG state + + CV_EXPORTS void cvRandSetRange( CvRandState* state, double param1, + double param2, int index CV_DEFAULT(-1)); *) + +procedure cvRandSetRange(state: pCvRandState; param1: double; param2: double; index: Integer = -1); cdecl; + +(* + CV_EXPORTS void cvRandInit( CvRandState* state, double param1, + double param2, int seed, + int disttype CV_DEFAULT(CV_RAND_UNI)); +*) +procedure cvRandInit(state: pCvRandState; param1: double; param2: double; seed: Integer; disttype: Integer = CV_RAND_UNI); cdecl; + +(* + Fills array with random numbers + + CV_EXPORTS void cvRand( CvRandState* state, CvArr* arr ); +*) + +procedure cvRand(state: pCvRandState; arr: pCvArr); cdecl; + +// #define cvRandNext( _state ) cvRandInt( &(_state)->state ) + +// CV_EXPORTS void cvbRand( CvRandState* state, float* dst, int len ); +procedure cvbRand(state: pCvRandState; dst: PSingle; len: Integer); cdecl; +// CV_EXPORTS void cvbCartToPolar( const float* y, const float* x, float* magnitude, float* angle, int len ); +procedure cvbCartToPolar(const y: PSingle; const x: PSingle; Var magnitude: Single; Var angle: Single; len: Integer); cdecl; +// CV_EXPORTS void cvbFastArctan( const float* y, const float* x, float* angle, int len ); +procedure cvbFastArctan(const y: PSingle; const x: PSingle; Var angle: Single; len: Integer); cdecl; +// CV_EXPORTS void cvbSqrt( const float* x, float* y, int len ); +procedure cvbSqrt(const x: PSingle; Var y: Single; len: Integer); cdecl; +// CV_EXPORTS void cvbInvSqrt( const float* x, float* y, int len ); +procedure cvbInvSqrt(const x: PSingle; Var y: Single; len: Integer); cdecl; +// CV_EXPORTS void cvbReciprocal( const float* x, float* y, int len ); +procedure cvbReciprocal(const x: PSingle; var y: Single; len: Integer); cdecl; +// CV_EXPORTS void cvbFastExp( const float* x, double* y, int len ); +procedure cvbFastExp(const x: PSingle; Var y: double; len: Integer); cdecl; +// CV_EXPORTS void cvbFastLog( const double* x, float* y, int len ); +procedure cvbFastLog(const x: PDouble; Var y: Single; len: Integer); cdecl; + +(* + CV_EXPORTS CvRect cvContourBoundingRect( void* point_set, int update CV_DEFAULT(0)); +*) function cvContourBoundingRect(point_set: Pointer; update: Integer = 0): TCvRect; cdecl; (* @@ -224,7 +245,6 @@ function cvContourBoundingRect(point_set: Pointer; update: Integer = 0): TCvRect function cvPseudoInverse(const src: pCvArr; dst: pCvArr): double; cdecl; // #define cvPseudoInv cvPseudoInverse -// // #define cvContourMoments( contour, moments ) cvMoments( contour, moments, 0 ) // // #define cvGetPtrAt cvPtr2D @@ -261,63 +281,91 @@ function cvPseudoInverse(const src: pCvArr; dst: pCvArr): double; cdecl; // // #define cvCopyImage( src, dst ) cvCopy( src, dst, 0 ) // #define cvReleaseMatHeader cvReleaseMat -// -/// * Calculates exact convex hull of 2d point set */ -// CV_EXPORTS void cvConvexHull( CvPoint* points, int num_points, -// CvRect* bound_rect, -// int orientation, int* hull, int* hullsize ); -// -// -// CV_EXPORTS void cvMinAreaRect( CvPoint* points, int n, -// int left, int bottom, -// int right, int top, -// CvPoint2D32f* anchor, -// CvPoint2D32f* vect1, -// CvPoint2D32f* vect2 ); -// -// typedef int CvDisType; -// typedef int CvChainApproxMethod; -// typedef int CvContourRetrievalMode; -// -// CV_EXPORTS void cvFitLine3D( CvPoint3D32f* points, int count, int dist, -// void *param, float reps, float aeps, float* line ); -// -/// * Fits a line into set of 2d points in a robust way (M-estimator technique) */ -// CV_EXPORTS void cvFitLine2D( CvPoint2D32f* points, int count, int dist, -// void *param, float reps, float aeps, float* line ); -// + +(* + Calculates exact convex hull of 2d point set + + CV_EXPORTS void cvConvexHull( CvPoint* points, int num_points, + CvRect* bound_rect, + int orientation, int* hull, int* hullsize ); +*) +procedure cvConvexHull(points: PCvPoint; num_points: Integer; bound_rect: PCvRect; orientation: Integer; Var hull: Integer; + Var hullsize: Integer); cdecl; + +(* + CV_EXPORTS void cvMinAreaRect( CvPoint* points, int n, + int left, int bottom, + int right, int top, + CvPoint2D32f* anchor, + CvPoint2D32f* vect1, + CvPoint2D32f* vect2 ); +*) +procedure cvMinAreaRect(points: PCvPoint; n: Integer; left: Integer; bottom: Integer; right: Integer; top: Integer; anchor: PCvPoint2D32f; + vect1: PCvPoint2D32f; vect2: PCvPoint2D32f); cdecl; + +Type + TCvDisType = type Integer; + TCvChainApproxMethod = type Integer; + TCvContourRetrievalMode = type Integer; + + (* + CV_EXPORTS void cvFitLine3D( CvPoint3D32f* points, int count, int dist, + void *param, float reps, float aeps, float* line ); + *) +procedure cvFitLine3D(points: PCvPoint3D32f; count: Integer; dist: Integer; param: Pointer; reps: Single; aeps: Single; + Var line: Single); cdecl; + +(* + Fits a line into set of 2d points in a robust way (M-estimator technique) + + CV_EXPORTS void cvFitLine2D( CvPoint2D32f* points, int count, int dist, + void *param, float reps, float aeps, float* line ); +*) + +procedure cvFitLine2D(points: PCvPoint2D32f; count: Integer; dist: Integer; param: Pointer; reps: Single; aeps: Single; + Var line: Single); cdecl; + // CV_EXPORTS void cvFitEllipse( const CvPoint2D32f* points, int count, CvBox2D* box ); -// -/// * Projects 2d points to one of standard coordinate planes -// (i.e. removes one of coordinates) */ -// CV_EXPORTS void cvProject3D( CvPoint3D32f* points3D, int count, -// CvPoint2D32f* points2D, -// int xIndx CV_DEFAULT(0), -// int yIndx CV_DEFAULT(1)); -// -/// * Retrieves value of the particular bin -// of x-dimensional (x=1,2,3,...) histogram */ -// #define cvQueryHistValue_1D( hist, idx0 ) \ -// ((float)cvGetReal1D( (hist)->bins, (idx0))) -// #define cvQueryHistValue_2D( hist, idx0, idx1 ) \ -// ((float)cvGetReal2D( (hist)->bins, (idx0), (idx1))) -// #define cvQueryHistValue_3D( hist, idx0, idx1, idx2 ) \ -// ((float)cvGetReal3D( (hist)->bins, (idx0), (idx1), (idx2))) -// #define cvQueryHistValue_nD( hist, idx ) \ -// ((float)cvGetRealND( (hist)->bins, (idx))) -// -/// * Returns pointer to the particular bin of x-dimesional histogram. -// For sparse histogram the bin is created if it didn't exist before */ -// #define cvGetHistValue_1D( hist, idx0 ) \ -// ((float*)cvPtr1D( (hist)->bins, (idx0), 0)) -// #define cvGetHistValue_2D( hist, idx0, idx1 ) \ -// ((float*)cvPtr2D( (hist)->bins, (idx0), (idx1), 0)) -// #define cvGetHistValue_3D( hist, idx0, idx1, idx2 ) \ -// ((float*)cvPtr3D( (hist)->bins, (idx0), (idx1), (idx2), 0)) -// #define cvGetHistValue_nD( hist, idx ) \ -// ((float*)cvPtrND( (hist)->bins, (idx), 0)) -// -// +procedure cvFitEllipse(const points: PCvPoint2D32f; count: Integer; Var box: TCvBox2D); cdecl; + +(* + Projects 2d points to one of standard coordinate planes + (i.e. removes one of coordinates) + + CV_EXPORTS void cvProject3D( CvPoint3D32f* points3D, int count, + CvPoint2D32f* points2D, + int xIndx CV_DEFAULT(0), + int yIndx CV_DEFAULT(1)); +*) + +procedure cvProject3D(points3D: PCvPoint3D32f; count: Integer; points2D: PCvPoint2D32f; xIndx: Integer = 0; yIndx: Integer = 1); cdecl; + +(* Retrieves value of the particular bin + of x-dimensional (x=1,2,3,...) histogram + + #define cvQueryHistValue_1D( hist, idx0 ) \ + ((float)cvGetReal1D( (hist)->bins, (idx0))) + #define cvQueryHistValue_2D( hist, idx0, idx1 ) \ + ((float)cvGetReal2D( (hist)->bins, (idx0), (idx1))) + #define cvQueryHistValue_3D( hist, idx0, idx1, idx2 ) \ + ((float)cvGetReal3D( (hist)->bins, (idx0), (idx1), (idx2))) + #define cvQueryHistValue_nD( hist, idx ) \ + ((float)cvGetRealND( (hist)->bins, (idx))) +*) + +(* Returns pointer to the particular bin of x-dimesional histogram. + For sparse histogram the bin is created if it didn't exist before + + #define cvGetHistValue_1D( hist, idx0 ) \ + ((float* )cvPtr1D( (hist)->bins, (idx0), 0)) + #define cvGetHistValue_2D( hist, idx0, idx1 ) \ + ((float* )cvPtr2D( (hist)->bins, (idx0), (idx1), 0)) + #define cvGetHistValue_3D( hist, idx0, idx1, idx2 ) \ + ((float* )cvPtr3D( (hist)->bins, (idx0), (idx1), (idx2), 0)) + #define cvGetHistValue_nD( hist, idx ) \ + ((float* )cvPtrND( (hist)->bins, (idx), 0)) +*) + // #define CV_IS_SET_ELEM_EXISTS CV_IS_SET_ELEM (* @@ -325,8 +373,7 @@ function cvPseudoInverse(const src: pCvArr; dst: pCvArr): double; cdecl; double theta, int threshold, float* lines, int linesNumber ); *) -function cvHoughLines(image: pCvArr; rho: double; theta: double; threshold: Integer; lines: pfloat; - linesNumber: Integer): Integer; cdecl; +function cvHoughLines(image: pCvArr; rho: double; theta: double; threshold: Integer; lines: pfloat; linesNumber: Integer): Integer; cdecl; (* CV_EXPORTS int cvHoughLinesP( CvArr* image, double rho, @@ -334,16 +381,16 @@ function cvHoughLines(image: pCvArr; rho: double; theta: double; threshold: Inte int lineLength, int lineGap, int* lines, int linesNumber ); *) -function cvHoughLinesP(image: pCvArr; rho: double; theta: double; threshold: Integer; lineLength: Integer; - lineGap: Integer; lines: pInteger; linesNumber: Integer): Integer; cdecl; +function cvHoughLinesP(image: pCvArr; rho: double; theta: double; threshold: Integer; lineLength: Integer; lineGap: Integer; + lines: pInteger; linesNumber: Integer): Integer; cdecl; (* CV_EXPORTS int cvHoughLinesSDiv( CvArr* image, double rho, int srn, double theta, int stn, int threshold, float* lines, int linesNumber ); *) -function cvHoughLinesSDiv(image: pCvArr; rho: double; srn: Integer; theta: double; stn: Integer; threshold: Integer; - lines: pfloat; linesNumber: Integer): Integer; cdecl; +function cvHoughLinesSDiv(image: pCvArr; rho: double; srn: Integer; theta: double; stn: Integer; threshold: Integer; lines: pfloat; + linesNumber: Integer): Integer; cdecl; (* CV_EXPORTS float cvCalcEMD( const float* signature1, int size1, @@ -354,327 +401,433 @@ function cvHoughLinesSDiv(image: pCvArr; rho: double; srn: Integer; theta: doubl void* user_param CV_DEFAULT(0)); *) function cvCalcEMD(const signature1: pfloat; size1: Integer; const signature2: pfloat; size2: Integer; dims: Integer; - dist_type: Integer = CV_DIST_L2; dist_func: TCvDistanceFunction = nil; lower_bound: pfloat = nil; - user_param: Pointer = nil): float; cdecl; + dist_type: Integer = CV_DIST_L2; dist_func: TCvDistanceFunction = nil; lower_bound: pfloat = nil; user_param: Pointer = nil) + : float; cdecl; + +(* + CV_EXPORTS void cvKMeans( int num_clusters, float** samples, + int num_samples, int vec_size, + CvTermCriteria termcrit, int* cluster_idx ); +*) + +procedure cvKMeans(num_clusters: Integer; Var samples: PSingle; num_samples: Integer; vec_size: Integer; termcrit: TCvTermCriteria; + Var cluster_idx: Integer); cdecl; + +(* + CV_EXPORTS void cvStartScanGraph( CvGraph* graph, CvGraphScanner* scanner, + CvGraphVtx* vtx CV_DEFAULT(NULL), + int mask CV_DEFAULT(CV_GRAPH_ALL_ITEMS)); +*) + +procedure cvStartScanGraph(graph: PCvGraph; scanner: PCvGraphScanner; vtx: PCvGraphVtx = nil; mask: Integer = CV_GRAPH_ALL_ITEMS); cdecl; -// -// CV_EXPORTS void cvKMeans( int num_clusters, float** samples, -// int num_samples, int vec_size, -// CvTermCriteria termcrit, int* cluster_idx ); -// -// CV_EXPORTS void cvStartScanGraph( CvGraph* graph, CvGraphScanner* scanner, -// CvGraphVtx* vtx CV_DEFAULT(NULL), -// int mask CV_DEFAULT(CV_GRAPH_ALL_ITEMS)); -// // CV_EXPORTS void cvEndScanGraph( CvGraphScanner* scanner ); -// -// -/// * old drawing functions */ -// CV_EXPORTS void cvLineAA( CvArr* img, CvPoint pt1, CvPoint pt2, -// double color, int scale CV_DEFAULT(0)); -// -// CV_EXPORTS void cvCircleAA( CvArr* img, CvPoint center, int radius, -// double color, int scale CV_DEFAULT(0) ); -// -// CV_EXPORTS void cvEllipseAA( CvArr* img, CvPoint center, CvSize axes, -// double angle, double start_angle, -// double end_angle, double color, -// int scale CV_DEFAULT(0) ); -// -// CV_EXPORTS void cvPolyLineAA( CvArr* img, CvPoint** pts, int* npts, int contours, -// int is_closed, double color, int scale CV_DEFAULT(0) ); -// -/// ****************************************************************************************\ -// * Pixel Access Macros * -// \****************************************************************************************/ -// -// typedef struct _CvPixelPosition8u -// { -// uchar* currline; /* pointer to the start of the current pixel line */ -// uchar* topline; /* pointer to the start of the top pixel line */ -// uchar* bottomline; /* pointer to the start of the first line */ -// /* which is below the image */ -// int x; /* current x coordinate ( in pixels ) */ -// int width; /* width of the image ( in pixels ) */ -// int height; /* height of the image ( in pixels ) */ -// int step; /* distance between lines ( in elements of single */ -// /* plane ) */ -// int step_arr[3]; /* array: ( 0, -step, step ). It is used for */ -// /* vertical moving */ -// } CvPixelPosition8u; -// -/// * this structure differs from the above only in data type */ -// typedef struct _CvPixelPosition8s -// { -// schar* currline; -// schar* topline; -// schar* bottomline; -// int x; -// int width; -// int height; -// int step; -// int step_arr[3]; -// } CvPixelPosition8s; -// -/// * this structure differs from the CvPixelPosition8u only in data type */ -// typedef struct _CvPixelPosition32f -// { -// float* currline; -// float* topline; -// float* bottomline; -// int x; -// int width; -// int height; -// int step; -// int step_arr[3]; -// } CvPixelPosition32f; -// -// -/// * Initialize one of the CvPixelPosition structures. */ -/// * pos - initialized structure */ -/// * origin - pointer to the left-top corner of the ROI */ -/// * step - width of the whole image in bytes */ -/// * roi - width & height of the ROI */ -/// * x, y - initial position */ -// #define CV_INIT_PIXEL_POS(pos, origin, _step, roi, _x, _y, orientation) \ -// ( \ -// (pos).step = (_step)/sizeof((pos).currline[0]) * (orientation ? -1 : 1), \ -// (pos).width = (roi).width, \ -// (pos).height = (roi).height, \ -// (pos).bottomline = (origin) + (pos).step*(pos).height, \ -// (pos).topline = (origin) - (pos).step, \ -// (pos).step_arr[0] = 0, \ -// (pos).step_arr[1] = -(pos).step, \ -// (pos).step_arr[2] = (pos).step, \ -// (pos).x = (_x), \ -// (pos).currline = (origin) + (pos).step*(_y) ) -// -// -/// * Move to specified point ( absolute shift ) */ -/// * pos - position structure */ -/// * x, y - coordinates of the new position */ -/// * cs - number of the image channels */ -// #define CV_MOVE_TO( pos, _x, _y, cs ) \ -// ((pos).currline = (_y) >= 0 && (_y) < (pos).height ? (pos).topline + ((_y)+1)*(pos).step : 0, \ -// (pos).x = (_x) >= 0 && (_x) < (pos).width ? (_x) : 0, (pos).currline + (_x) * (cs) ) -// -/// * Get current coordinates */ -/// * pos - position structure */ -/// * x, y - coordinates of the new position */ -/// * cs - number of the image channels */ -// #define CV_GET_CURRENT( pos, cs ) ((pos).currline + (pos).x * (cs)) -// -/// * Move by one pixel relatively to current position */ -/// * pos - position structure */ -/// * cs - number of the image channels */ -// -/// * left */ -// #define CV_MOVE_LEFT( pos, cs ) \ -// ( --(pos).x >= 0 ? (pos).currline + (pos).x*(cs) : 0 ) -// -/// * right */ -// #define CV_MOVE_RIGHT( pos, cs ) \ -// ( ++(pos).x < (pos).width ? (pos).currline + (pos).x*(cs) : 0 ) -// -/// * up */ -// #define CV_MOVE_UP( pos, cs ) \ -// (((pos).currline -= (pos).step) != (pos).topline ? (pos).currline + (pos).x*(cs) : 0 ) -// -/// * down */ -// #define CV_MOVE_DOWN( pos, cs ) \ -// (((pos).currline += (pos).step) != (pos).bottomline ? (pos).currline + (pos).x*(cs) : 0 ) -// -/// * left up */ -// #define CV_MOVE_LU( pos, cs ) ( CV_MOVE_LEFT(pos, cs), CV_MOVE_UP(pos, cs)) -// -/// * right up */ -// #define CV_MOVE_RU( pos, cs ) ( CV_MOVE_RIGHT(pos, cs), CV_MOVE_UP(pos, cs)) -// -/// * left down */ -// #define CV_MOVE_LD( pos, cs ) ( CV_MOVE_LEFT(pos, cs), CV_MOVE_DOWN(pos, cs)) -// -/// * right down */ -// #define CV_MOVE_RD( pos, cs ) ( CV_MOVE_RIGHT(pos, cs), CV_MOVE_DOWN(pos, cs)) -// -// -// -/// * Move by one pixel relatively to current position with wrapping when the position */ -/// * achieves image boundary */ -/// * pos - position structure */ -/// * cs - number of the image channels */ -// -/// * left */ -// #define CV_MOVE_LEFT_WRAP( pos, cs ) \ -// ((pos).currline + ( --(pos).x >= 0 ? (pos).x : ((pos).x = (pos).width-1))*(cs)) -// -/// * right */ -// #define CV_MOVE_RIGHT_WRAP( pos, cs ) \ -// ((pos).currline + ( ++(pos).x < (pos).width ? (pos).x : ((pos).x = 0))*(cs) ) -// -/// * up */ -// #define CV_MOVE_UP_WRAP( pos, cs ) \ -// ((((pos).currline -= (pos).step) != (pos).topline ? \ -// (pos).currline : ((pos).currline = (pos).bottomline - (pos).step)) + (pos).x*(cs) ) -// -/// * down */ -// #define CV_MOVE_DOWN_WRAP( pos, cs ) \ -// ((((pos).currline += (pos).step) != (pos).bottomline ? \ -// (pos).currline : ((pos).currline = (pos).topline + (pos).step)) + (pos).x*(cs) ) -// -/// * left up */ -// #define CV_MOVE_LU_WRAP( pos, cs ) ( CV_MOVE_LEFT_WRAP(pos, cs), CV_MOVE_UP_WRAP(pos, cs)) -/// * right up */ -// #define CV_MOVE_RU_WRAP( pos, cs ) ( CV_MOVE_RIGHT_WRAP(pos, cs), CV_MOVE_UP_WRAP(pos, cs)) -/// * left down */ -// #define CV_MOVE_LD_WRAP( pos, cs ) ( CV_MOVE_LEFT_WRAP(pos, cs), CV_MOVE_DOWN_WRAP(pos, cs)) -/// * right down */ -// #define CV_MOVE_RD_WRAP( pos, cs ) ( CV_MOVE_RIGHT_WRAP(pos, cs), CV_MOVE_DOWN_WRAP(pos, cs)) -// -/// * Numeric constants which used for moving in arbitrary direction */ -// enum -// { -// CV_SHIFT_NONE = 2, -// CV_SHIFT_LEFT = 1, -// CV_SHIFT_RIGHT = 3, -// CV_SHIFT_UP = 6, -// CV_SHIFT_DOWN = 10, -// CV_SHIFT_LU = 5, -// CV_SHIFT_RU = 7, -// CV_SHIFT_LD = 9, -// CV_SHIFT_RD = 11 -// }; -// -/// * Move by one pixel in specified direction */ -/// * pos - position structure */ -/// * shift - direction ( it's value must be one of the CV_SHIFT_Ö constants ) */ -/// * cs - number of the image channels */ -// #define CV_MOVE_PARAM( pos, shift, cs ) \ -// ( (pos).currline += (pos).step_arr[(shift)>>2], (pos).x += ((shift)&3)-2, \ -// ((pos).currline != (pos).topline && (pos).currline != (pos).bottomline && \ -// (pos).x >= 0 && (pos).x < (pos).width) ? (pos).currline + (pos).x*(cs) : 0 ) -// -/// * Move by one pixel in specified direction with wrapping when the */ -/// * position achieves image boundary */ -/// * pos - position structure */ -/// * shift - direction ( it's value must be one of the CV_SHIFT_Ö constants ) */ -/// * cs - number of the image channels */ -// #define CV_MOVE_PARAM_WRAP( pos, shift, cs ) \ -// ( (pos).currline += (pos).step_arr[(shift)>>2], \ -// (pos).currline = ((pos).currline == (pos).topline ? \ -// (pos).bottomline - (pos).step : \ -// (pos).currline == (pos).bottomline ? \ -// (pos).topline + (pos).step : (pos).currline), \ -// \ -// (pos).x += ((shift)&3)-2, \ -// (pos).x = ((pos).x < 0 ? (pos).width-1 : (pos).x >= (pos).width ? 0 : (pos).x), \ -// \ -// (pos).currline + (pos).x*(cs) ) -// +procedure cvEndScanGraph(scanner: PCvGraphScanner); cdecl; + +(* old drawing functions *) + +(* + CV_EXPORTS void cvLineAA( CvArr* img, CvPoint pt1, CvPoint pt2, + double color, int scale CV_DEFAULT(0)); +*) +procedure cvLineAA(img: pCvArr; pt1: TCvPoint; pt2: TCvPoint; color: double; scale: Integer = 0); cdecl; + +(* + CV_EXPORTS void cvCircleAA( CvArr* img, CvPoint center, int radius, + double color, int scale CV_DEFAULT(0) ); +*) +procedure cvCircleAA(img: pCvArr; center: TCvPoint; radius: Integer; color: double; scale: Integer = 0); cdecl; + +(* + CV_EXPORTS void cvEllipseAA( CvArr* img, CvPoint center, CvSize axes, + double angle, double start_angle, + double end_angle, double color, + int scale CV_DEFAULT(0) ); +*) +procedure cvEllipseAA(img: pCvArr; center: TCvPoint; axes: TCvSize; angle: double; start_angle: double; end_angle: double; color: double; + scale: Integer = 0); cdecl; + +(* + CV_EXPORTS void cvPolyLineAA( CvArr* img, CvPoint** pts, int* npts, int contours, + int is_closed, double color, int scale CV_DEFAULT(0) ); +*) +procedure cvPolyLineAA(img: pCvArr; Var pts: PCvPoint; Var npts: Integer; contours: Integer; is_closed: Integer; color: double; + scale: Integer = 0); cdecl; + +(* ***************************************************************************************\ + * Pixel Access Macros * + \*************************************************************************************** *) +Type + // typedef struct _CvPixelPosition8u + // { + // uchar* currline; /* pointer to the start of the current pixel line */ + // uchar* topline; /* pointer to the start of the top pixel line */ + // uchar* bottomline; /* pointer to the start of the first line */ + // /* which is below the image */ + // int x; /* current x coordinate ( in pixels ) */ + // int width; /* width of the image ( in pixels ) */ + // int height; /* height of the image ( in pixels ) */ + // int step; /* distance between lines ( in elements of single */ + // /* plane ) */ + // int step_arr[3]; /* array: ( 0, -step, step ). It is used for */ + // /* vertical moving */ + // } CvPixelPosition8u; + + TCvPixelPosition8u = record + currline: PUChar; (* pointer to the start of the current pixel line *) + topline: PUChar; (* pointer to the start of the top pixel line *) + bottomline: PUChar; (* pointer to the start of the first line *) + (* which is below the image *) + x: Integer; (* current x coordinate ( in pixels ) *) + width: Integer; (* width of the image ( in pixels ) *) + height: Integer; (* height of the image ( in pixels ) *) + step: Integer; (* distance between lines ( in elements of single *) + (* plane ) *) + step_arr: array [0 .. 2] of Integer; (* array: ( 0, -step, step ). It is used for *) + (* vertical moving *) + end; + + /// * this structure differs from the above only in data type */ + // typedef struct _CvPixelPosition8s + // { + // schar* currline; + // schar* topline; + // schar* bottomline; + // int x; + // int width; + // int height; + // int step; + // int step_arr[3]; + // } CvPixelPosition8s; + + TCvPixelPosition8s = record + currline: Pschar; + topline: Pschar; + bottomline: Pschar; + x: Integer; + width: Integer; + height: Integer; + step: Integer; + step_arr: array [0 .. 2] of Integer; + end; + + /// * this structure differs from the CvPixelPosition8u only in data type */ + // typedef struct _CvPixelPosition32f + // { + // float* currline; + // float* topline; + // float* bottomline; + // int x; + // int width; + // int height; + // int step; + // int step_arr[3]; + // } CvPixelPosition32f; + + TCvPixelPosition32f = record + currline: PSingle; + topline: PSingle; + bottomline: PSingle; + x: Integer; + width: Integer; + height: Integer; + step: Integer; + step_arr: array [0 .. 2] of Integer; + end; + + (* Initialize one of the CvPixelPosition structures. *) + (* pos - initialized structure *) + (* origin - pointer to the left-top corner of the ROI *) + (* step - width of the whole image in bytes *) + (* roi - width & height of the ROI *) + (* x, y - initial position *) + // #define CV_INIT_PIXEL_POS(pos, origin, _step, roi, _x, _y, orientation) \ + // ( \ + // (pos).step = (_step)/sizeof((pos).currline[0]) * (orientation ? -1 : 1), \ + // (pos).width = (roi).width, \ + // (pos).height = (roi).height, \ + // (pos).bottomline = (origin) + (pos).step*(pos).height, \ + // (pos).topline = (origin) - (pos).step, \ + // (pos).step_arr[0] = 0, \ + // (pos).step_arr[1] = -(pos).step, \ + // (pos).step_arr[2] = (pos).step, \ + // (pos).x = (_x), \ + // (pos).currline = (origin) + (pos).step*(_y) ) + + (* Move to specified point ( absolute shift ) *) + (* pos - position structure *) + (* x, y - coordinates of the new position *) + (* cs - number of the image channels *) + // #define CV_MOVE_TO( pos, _x, _y, cs ) \ + // ((pos).currline = (_y) >= 0 && (_y) < (pos).height ? (pos).topline + ((_y)+1)*(pos).step : 0, \ + // (pos).x = (_x) >= 0 && (_x) < (pos).width ? (_x) : 0, (pos).currline + (_x) * (cs) ) + + (* Get current coordinates *) + (* pos - position structure *) + (* x, y - coordinates of the new position *) + (* cs - number of the image channels *) + // #define CV_GET_CURRENT( pos, cs ) ((pos).currline + (pos).x * (cs)) + + (* Move by one pixel relatively to current position *) + (* pos - position structure *) + (* cs - number of the image channels *) + + (* left *) + // #define CV_MOVE_LEFT( pos, cs ) \ + // ( --(pos).x >= 0 ? (pos).currline + (pos).x*(cs) : 0 ) + + (* right *) + // #define CV_MOVE_RIGHT( pos, cs ) \ + // ( ++(pos).x < (pos).width ? (pos).currline + (pos).x*(cs) : 0 ) + + (* up *) + // #define CV_MOVE_UP( pos, cs ) \ + // (((pos).currline -= (pos).step) != (pos).topline ? (pos).currline + (pos).x*(cs) : 0 ) + + (* down *) + // #define CV_MOVE_DOWN( pos, cs ) \ + // (((pos).currline += (pos).step) != (pos).bottomline ? (pos).currline + (pos).x*(cs) : 0 ) + + (* left up *) + // #define CV_MOVE_LU( pos, cs ) ( CV_MOVE_LEFT(pos, cs), CV_MOVE_UP(pos, cs)) + + (* right up *) + // #define CV_MOVE_RU( pos, cs ) ( CV_MOVE_RIGHT(pos, cs), CV_MOVE_UP(pos, cs)) + + (* left down *) + // #define CV_MOVE_LD( pos, cs ) ( CV_MOVE_LEFT(pos, cs), CV_MOVE_DOWN(pos, cs)) + + (* right down *) + // #define CV_MOVE_RD( pos, cs ) ( CV_MOVE_RIGHT(pos, cs), CV_MOVE_DOWN(pos, cs)) + + (* Move by one pixel relatively to current position with wrapping when the position */ + (* achieves image boundary */ + (* pos - position structure */ + (* cs - number of the image channels */ + // + (* left *) + // #define CV_MOVE_LEFT_WRAP( pos, cs ) \ + // ((pos).currline + ( --(pos).x >= 0 ? (pos).x : ((pos).x = (pos).width-1))*(cs)) + // + (* right *) + // #define CV_MOVE_RIGHT_WRAP( pos, cs ) \ + // ((pos).currline + ( ++(pos).x < (pos).width ? (pos).x : ((pos).x = 0))*(cs) ) + // + (* up *) + // #define CV_MOVE_UP_WRAP( pos, cs ) \ + // ((((pos).currline -= (pos).step) != (pos).topline ? \ + // (pos).currline : ((pos).currline = (pos).bottomline - (pos).step)) + (pos).x*(cs) ) + // + (* down *) + // #define CV_MOVE_DOWN_WRAP( pos, cs ) \ + // ((((pos).currline += (pos).step) != (pos).bottomline ? \ + // (pos).currline : ((pos).currline = (pos).topline + (pos).step)) + (pos).x*(cs) ) + + (* left up *) + // #define CV_MOVE_LU_WRAP( pos, cs ) ( CV_MOVE_LEFT_WRAP(pos, cs), CV_MOVE_UP_WRAP(pos, cs)) + (* right up *) + // #define CV_MOVE_RU_WRAP( pos, cs ) ( CV_MOVE_RIGHT_WRAP(pos, cs), CV_MOVE_UP_WRAP(pos, cs)) + (* left down *) + // #define CV_MOVE_LD_WRAP( pos, cs ) ( CV_MOVE_LEFT_WRAP(pos, cs), CV_MOVE_DOWN_WRAP(pos, cs)) + (* right down *) + // #define CV_MOVE_RD_WRAP( pos, cs ) ( CV_MOVE_RIGHT_WRAP(pos, cs), CV_MOVE_DOWN_WRAP(pos, cs)) + + (* Numeric constants which used for moving in arbitrary direction *) + // enum + // { + // CV_SHIFT_NONE = 2, + // CV_SHIFT_LEFT = 1, + // CV_SHIFT_RIGHT = 3, + // CV_SHIFT_UP = 6, + // CV_SHIFT_DOWN = 10, + // CV_SHIFT_LU = 5, + // CV_SHIFT_RU = 7, + // CV_SHIFT_LD = 9, + // CV_SHIFT_RD = 11 + // }; + + (* Move by one pixel in specified direction *) + (* pos - position structure *) + (* shift - direction ( it's value must be one of the CV_SHIFT_Ö constants ) *) + (* cs - number of the image channels *) + // #define CV_MOVE_PARAM( pos, shift, cs ) \ + // ( (pos).currline += (pos).step_arr[(shift)>>2], (pos).x += ((shift)&3)-2, \ + // ((pos).currline != (pos).topline && (pos).currline != (pos).bottomline && \ + // (pos).x >= 0 && (pos).x < (pos).width) ? (pos).currline + (pos).x*(cs) : 0 ) + + (* Move by one pixel in specified direction with wrapping when the *) + (* position achieves image boundary *) + (* pos - position structure *) + (* shift - direction ( it's value must be one of the CV_SHIFT_Ö constants ) *) + (* cs - number of the image channels *) + // #define CV_MOVE_PARAM_WRAP( pos, shift, cs ) \ + // ( (pos).currline += (pos).step_arr[(shift)>>2], \ + // (pos).currline = ((pos).currline == (pos).topline ? \ + // (pos).bottomline - (pos).step : \ + // (pos).currline == (pos).bottomline ? \ + // (pos).topline + (pos).step : (pos).currline), \ + // \ + // (pos).x += ((shift)&3)-2, \ + // (pos).x = ((pos).x < 0 ? (pos).width-1 : (pos).x >= (pos).width ? 0 : (pos).x), \ + // \ + // (pos).currline + (pos).x*(cs) ) + Type // typedef float* CvVect32f; - TCvVect32f = pSingle; + TCvVect32f = PSingle; // typedef float* CvMatr32f; - TCvMatr32f = pSingle; + TCvMatr32f = PSingle; // typedef double* CvVect64d; TCvVect64d = PDouble; // typedef double* CvMatr64d; TCvMatr64d = PDouble; - // - // CV_EXPORTS void cvUnDistortOnce( const CvArr* src, CvArr* dst, - // const float* intrinsic_matrix, - // const float* distortion_coeffs, - // int interpolate ); - // - /// * the two functions below have quite hackerish implementations, use with care - // (or, which is better, switch to cvUndistortInitMap and cvRemap instead */ - // CV_EXPORTS void cvUnDistortInit( const CvArr* src, - // CvArr* undistortion_map, - // const float* A, const float* k, - // int interpolate ); - // - // CV_EXPORTS void cvUnDistort( const CvArr* src, CvArr* dst, - // const CvArr* undistortion_map, - // int interpolate ); - // - /// * Find fundamental matrix */ - // CV_EXPORTS void cvFindFundamentalMatrix( int* points1, int* points2, - // int numpoints, int method, float* matrix ); (* - CV_EXPORTS int cvFindChessBoardCornerGuesses( const void* arr, void* thresharr, - CvMemStorage* storage, - CvSize pattern_size, CvPoint2D32f * corners, - int *corner_count ); + CV_EXPORTS void cvUnDistortOnce( const CvArr* src, CvArr* dst, + const float* intrinsic_matrix, + const float* distortion_coeffs, + int interpolate ); *) -function cvFindChessBoardCornerGuesses(const arr: Pointer; thresharr: Pointer; storage: pCvMemStorage; - pattern_size: TCvSize; corners: pCvPoint2D32f; corner_count: pInteger): Integer; cdecl; +procedure cvUnDistortOnce(const src: pCvArr; dst: pCvArr; const intrinsic_matrix: PSingle; const distortion_coeffs: PSingle; + interpolate: Integer); cdecl; + +(* + the two functions below have quite hackerish implementations, use with care + (or, which is better, switch to cvUndistortInitMap and cvRemap instead + + CV_EXPORTS void cvUnDistortInit( const CvArr* src, + CvArr* undistortion_map, + const float* A, const float* k, + int interpolate ); + + CV_EXPORTS void cvUnDistort( const CvArr* src, CvArr* dst, + const CvArr* undistortion_map, + int interpolate ); +*) + +procedure cvUnDistortInit(const src: pCvArr; undistortion_map: pCvArr; const A: PSingle; const k: PSingle; interpolate: Integer); cdecl; +procedure cvUnDistort(const src: pCvArr; dst: pCvArr; const undistortion_map: pCvArr; interpolate: Integer); cdecl; + +(* + Find fundamental matrix + + CV_EXPORTS void cvFindFundamentalMatrix( int* points1, int* points2, + int numpoints, int method, float* matrix ); +*) + +procedure cvFindFundamentalMatrix(Var points1: Integer; Var points2: Integer; numpoints: Integer; method: Integer; + Var matrix: Single); cdecl; + +(* + CV_EXPORTS int cvFindChessBoardCornerGuesses( const void* arr, void* thresharr, + CvMemStorage* storage, + CvSize pattern_size, CvPoint2D32f * corners, + int *corner_count ); +*) +function cvFindChessBoardCornerGuesses(const arr: Pointer; thresharr: Pointer; storage: pCvMemStorage; pattern_size: TCvSize; + corners: PCvPoint2D32f; corner_count: pInteger): Integer; cdecl; + +(* + Calibrates camera using multiple views of calibration pattern + + CV_EXPORTS void cvCalibrateCamera( int image_count, int* _point_counts, + CvSize image_size, CvPoint2D32f* _image_points, CvPoint3D32f* _object_points, + float* _distortion_coeffs, float* _camera_matrix, float* _translation_vectors, + float* _rotation_matrices, int flags ); +*) +procedure cvCalibrateCamera(image_count: Integer; Var _point_counts: Integer; image_size: TCvSize; _image_points: PCvPoint2D32f; + _object_points: PCvPoint3D32f; _distortion_coeffs: PSingle; _camera_matrix: PSingle; _translation_vectors: PSingle; + _rotation_matrices: PSingle; flags: Integer); cdecl; + +(* + CV_EXPORTS void cvCalibrateCamera_64d( int image_count, int* _point_counts, + CvSize image_size, CvPoint2D64f* _image_points, CvPoint3D64f* _object_points, + double* _distortion_coeffs, double* _camera_matrix, double* _translation_vectors, + double* _rotation_matrices, int flags ); +*) +procedure cvCalibrateCamera_64d(image_count: Integer; Var _point_counts: Integer; image_size: TCvSize; _image_points: PCvPoint2D64f; + _object_points: PCvPoint3D64f; _distortion_coeffs: PDouble; _camera_matrix: PDouble; _translation_vectors: PDouble; + _rotation_matrices: PDouble; flags: Integer); cdecl; + +(* + Find 3d position of object given intrinsic camera parameters, + 3d model of the object and projection of the object into view plane + + CV_EXPORTS void cvFindExtrinsicCameraParams( int point_count, + CvSize image_size, CvPoint2D32f* _image_points, + CvPoint3D32f* _object_points, float* focal_length, + CvPoint2D32f principal_point, float* _distortion_coeffs, + float* _rotation_vector, float* _translation_vector ); +*) + +procedure cvFindExtrinsicCameraParams(point_count: Integer; image_size: TCvSize; _image_points: PCvPoint2D32f; + _object_points: PCvPoint3D32f; focal_length: PSingle; principal_point: TCvPoint2D32f; _distortion_coeffs: PSingle; + _rotation_vector: PSingle; _translation_vector: PSingle); cdecl; + +(* + Variant of the previous function that takes double-precision parameters + + CV_EXPORTS void cvFindExtrinsicCameraParams_64d( int point_count, + CvSize image_size, CvPoint2D64f* _image_points, + CvPoint3D64f* _object_points, double* focal_length, + CvPoint2D64f principal_point, double* _distortion_coeffs, + double* _rotation_vector, double* _translation_vector ); +*) + +procedure cvFindExtrinsicCameraParams_64d(point_count: Integer; image_size: TCvSize; _image_points: PCvPoint2D64f; + _object_points: PCvPoint3D64f; focal_length: PDouble; principal_point: TCvPoint2D64f; _distortion_coeffs: PDouble; + _rotation_vector: PDouble; _translation_vector: PDouble); cdecl; + +const + (* Rodrigues transform *) + CV_RODRIGUES_M2V = 0; + CV_RODRIGUES_V2M = 1; + + (* + Converts rotation_matrix matrix to rotation_matrix vector or vice versa + + CV_EXPORTS void cvRodrigues( CvMat* rotation_matrix, CvMat* rotation_vector, + CvMat* jacobian, int conv_type ); + *) +procedure cvRodrigues(rotation_matrix: PCvMat; rotation_vector: PCvMat; jacobian: PCvMat; conv_type: Integer); cdecl; + +(* + Does reprojection of 3d object points to the view plane + + CV_EXPORTS void cvProjectPoints( int point_count, CvPoint3D64f* _object_points, + double* _rotation_vector, double* _translation_vector, + double* focal_length, CvPoint2D64f principal_point, + double* _distortion, CvPoint2D64f* _image_points, + double* _deriv_points_rotation_matrix, + double* _deriv_points_translation_vect, + double* _deriv_points_focal, + double* _deriv_points_principal_point, + double* _deriv_points_distortion_coeffs ); +*) + +procedure cvProjectPoints(point_count: Integer; _object_points: PCvPoint3D64f; _rotation_vector: PDouble; _translation_vector: PDouble; + focal_length: PDouble; principal_point: TCvPoint2D64f; _distortion: PDouble; _image_points: PCvPoint2D64f; + _deriv_points_rotation_matrix: PDouble; _deriv_points_translation_vect: PDouble; _deriv_points_focal: PDouble; + _deriv_points_principal_point: PDouble; _deriv_points_distortion_coeffs: PDouble); cdecl; + +(* + Simpler version of the previous function + + CV_EXPORTS void cvProjectPointsSimple( int point_count, CvPoint3D64f* _object_points, + double* _rotation_matrix, double* _translation_vector, + double* _camera_matrix, double* _distortion, CvPoint2D64f* _image_points ); +*) + +procedure cvProjectPointsSimple(point_count: Integer; _object_points: PCvPoint3D64f; _rotation_matrix: PDouble; + _translation_vector: PDouble; _camera_matrix: PDouble; _distortion: PDouble; _image_points: PCvPoint2D64f); cdecl; -// -/// * Calibrates camera using multiple views of calibration pattern */ -// CV_EXPORTS void cvCalibrateCamera( int image_count, int* _point_counts, -// CvSize image_size, CvPoint2D32f* _image_points, CvPoint3D32f* _object_points, -// float* _distortion_coeffs, float* _camera_matrix, float* _translation_vectors, -// float* _rotation_matrices, int flags ); -// -// -// CV_EXPORTS void cvCalibrateCamera_64d( int image_count, int* _point_counts, -// CvSize image_size, CvPoint2D64f* _image_points, CvPoint3D64f* _object_points, -// double* _distortion_coeffs, double* _camera_matrix, double* _translation_vectors, -// double* _rotation_matrices, int flags ); -// -// -/// * Find 3d position of object given intrinsic camera parameters, -// 3d model of the object and projection of the object into view plane */ -// CV_EXPORTS void cvFindExtrinsicCameraParams( int point_count, -// CvSize image_size, CvPoint2D32f* _image_points, -// CvPoint3D32f* _object_points, float* focal_length, -// CvPoint2D32f principal_point, float* _distortion_coeffs, -// float* _rotation_vector, float* _translation_vector ); -// -/// * Variant of the previous function that takes double-precision parameters */ -// CV_EXPORTS void cvFindExtrinsicCameraParams_64d( int point_count, -// CvSize image_size, CvPoint2D64f* _image_points, -// CvPoint3D64f* _object_points, double* focal_length, -// CvPoint2D64f principal_point, double* _distortion_coeffs, -// double* _rotation_vector, double* _translation_vector ); -// -/// * Rodrigues transform */ -// enum -// { -// CV_RODRIGUES_M2V = 0, -// CV_RODRIGUES_V2M = 1 -// }; -// -/// * Converts rotation_matrix matrix to rotation_matrix vector or vice versa */ -// CV_EXPORTS void cvRodrigues( CvMat* rotation_matrix, CvMat* rotation_vector, -// CvMat* jacobian, int conv_type ); -// -/// * Does reprojection of 3d object points to the view plane */ -// CV_EXPORTS void cvProjectPoints( int point_count, CvPoint3D64f* _object_points, -// double* _rotation_vector, double* _translation_vector, -// double* focal_length, CvPoint2D64f principal_point, -// double* _distortion, CvPoint2D64f* _image_points, -// double* _deriv_points_rotation_matrix, -// double* _deriv_points_translation_vect, -// double* _deriv_points_focal, -// double* _deriv_points_principal_point, -// double* _deriv_points_distortion_coeffs ); -// -// -/// * Simpler version of the previous function */ -// CV_EXPORTS void cvProjectPointsSimple( int point_count, CvPoint3D64f* _object_points, -// double* _rotation_matrix, double* _translation_vector, -// double* _camera_matrix, double* _distortion, CvPoint2D64f* _image_points ); -// -// // #define cvMake2DPoints cvConvertPointsHomogeneous // #define cvMake3DPoints cvConvertPointsHomogeneous // // #define cvWarpPerspectiveQMatrix cvGetPerspectiveTransform // // #define cvConvertPointsHomogenious cvConvertPointsHomogeneous -// -// + /// /////////////////////////////////// feature extractors: obsolete API ////////////////////////////////// type @@ -718,19 +871,20 @@ type // CVAPI(CvSURFParams) cvSURFParams( double hessianThreshold, int extended CV_DEFAULT(0) ); function cvSURFParams(hessianThreshold: double; _extended: Integer = 0): TCvSURFParams; cdecl; -/// / If useProvidedKeyPts!=0, keypoints are not detected, but descriptors are computed -/// / at the locations provided in keypoints (a CvSeq of CvSURFPoint). -// CVAPI(void) cvExtractSURF( const CvArr* img, const CvArr* mask, -// CvSeq** keypoints, CvSeq** descriptors, -// CvMemStorage* storage, CvSURFParams params, -// int useProvidedKeyPts CV_DEFAULT(0) ); -procedure cvExtractSURF(const img: pCvArr; const mask: pCvArr; keypoints: ppCvSeq; descriptors: ppCvSeq; - storage: pCvMemStorage; params: TCvSURFParams; useProvidedKeyPts: Integer = 0); cdecl; +(* + If useProvidedKeyPts!=0, keypoints are not detected, but descriptors are computed + at the locations provided in keypoints (a CvSeq of CvSURFPoint). + + CVAPI(void) cvExtractSURF( const CvArr* img, const CvArr* mask, + CvSeq** keypoints, CvSeq** descriptors, + CvMemStorage* storage, CvSURFParams params, + int useProvidedKeyPts CV_DEFAULT(0) ); +*) +procedure cvExtractSURF(const img: pCvArr; const mask: pCvArr; keypoints: ppCvSeq; descriptors: ppCvSeq; storage: pCvMemStorage; + params: TCvSURFParams; useProvidedKeyPts: Integer = 0); cdecl; Type - (* - Maximal Stable Regions Parameters - *) + (* Maximal Stable Regions Parameters *) (* typedef struct CvMSERParams { //! delta, in the code, it compares (size_{i}-size_{i-delta})/size_{i-delta} @@ -788,30 +942,43 @@ Type double min_margin CV_DEFAULT(.003), int edge_blur_size CV_DEFAULT(5) ); *) -function cvMSERParams(delta: Integer = 5; min_area: Integer = 60; max_area: Integer = 14400; - max_variation: float = 0.25; min_diversity: float = 0.2; max_evolution: Integer = 200; area_threshold: double = 1.01; - min_margin: double = 0.003; edge_blur_size: Integer = 5): TCvMSERParams; cdecl; +function cvMSERParams(delta: Integer = 5; min_area: Integer = 60; max_area: Integer = 14400; max_variation: float = 0.25; + min_diversity: float = 0.2; max_evolution: Integer = 200; area_threshold: double = 1.01; min_margin: double = 0.003; + edge_blur_size: Integer = 5): TCvMSERParams; cdecl; + +(* + Extracts the contours of Maximally Stable Extremal Regions + + CVAPI(void) cvExtractMSER( CvArr* _img, CvArr* _mask, CvSeq** contours, CvMemStorage* storage, CvMSERParams params ); +*) +procedure cvExtractMSER(_img: pCvArr; _mask: pCvArr; Var contours: PCvSeq; storage: pCvMemStorage; params: TCvMSERParams); cdecl; -/// / Extracts the contours of Maximally Stable Extremal Regions -// CVAPI(void) cvExtractMSER( CvArr* _img, CvArr* _mask, CvSeq** contours, CvMemStorage* storage, CvMSERParams params ); -// -// -// typedef struct CvStarKeypoint -// { -// CvPoint pt; -// int size; -// float response; -// } CvStarKeypoint; -// -// CV_INLINE CvStarKeypoint cvStarKeypoint(CvPoint pt, int size, float response) -// { -// CvStarKeypoint kpt; -// kpt.pt = pt; -// kpt.size = size; -// kpt.response = response; -// return kpt; -// } Type + (* + typedef struct CvStarKeypoint + { + CvPoint pt; + int size; + float response; + } CvStarKeypoint; + *) + TCvStarKeypoint = record + pt: TCvPoint; + size: Integer; + response: Single; + end; + + (* + CV_INLINE CvStarKeypoint cvStarKeypoint(CvPoint pt, int size, float response) + { + CvStarKeypoint kpt; + kpt.pt = pt; + kpt.size = size; + kpt.response = response; + return kpt; + } + *) + (* typedef struct CvStarDetectorParams { int maxSize; @@ -850,16 +1017,15 @@ Type // return params; // } *) -function cvStarDetectorParams(maxSize: Integer = 45; responseThreshold: Integer = 30; - lineThresholdProjected: Integer = 10; lineThresholdBinarized: Integer = 8; suppressNonmaxSize: Integer = 5) - : TCvStarDetectorParams; inline; +function cvStarDetectorParams(maxSize: Integer = 45; responseThreshold: Integer = 30; lineThresholdProjected: Integer = 10; + lineThresholdBinarized: Integer = 8; suppressNonmaxSize: Integer = 5): TCvStarDetectorParams; inline; (* CVAPI(CvSeq* ) cvGetStarKeypoints( const CvArr* img, CvMemStorage* storage, CvStarDetectorParams params CV_DEFAULT(cvStarDetectorParams())); *) function cvGetStarKeypoints(const img: pCvArr; storage: pCvMemStorage; - params: TCvStarDetectorParams { = CV_DEFAULT(cvStarDetectorParams()) } ): pCvSeq; cdecl; + params: TCvStarDetectorParams { = CV_DEFAULT(cvStarDetectorParams()) } ): PCvSeq; cdecl; implementation @@ -926,9 +1092,8 @@ function cvMSERParams; external libname; procedure cvExtractMSER; external libname; function cvGetStarKeypoints; external libname; -function cvStarDetectorParams(maxSize: Integer = 45; responseThreshold: Integer = 30; - lineThresholdProjected: Integer = 10; lineThresholdBinarized: Integer = 8; suppressNonmaxSize: Integer = 5) - : TCvStarDetectorParams; inline; +function cvStarDetectorParams(maxSize: Integer = 45; responseThreshold: Integer = 30; lineThresholdProjected: Integer = 10; + lineThresholdBinarized: Integer = 8; suppressNonmaxSize: Integer = 5): TCvStarDetectorParams; inline; begin Result.maxSize := maxSize; Result.responseThreshold := responseThreshold; diff --git a/source/ocv.contrib.pas b/source/ocv.contrib.pas index 5f032a8..5f035ae 100644 --- a/source/ocv.contrib.pas +++ b/source/ocv.contrib.pas @@ -44,23 +44,10 @@ ************************************************************************************************* *) -// -{$I OpenCV.inc} -// - -{$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 ocv.contrib; +{$I OpenCV.inc} + interface uses diff --git a/source/ocv.core.pas b/source/ocv.core.pas index dafd671..ab0c5b1 100644 --- a/source/ocv.core.pas +++ b/source/ocv.core.pas @@ -43,22 +43,10 @@ ************************************************************************************************** *) -// -{$I OpenCV.inc} -// -{$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 ocv.core; +{$I OpenCV.inc} + interface uses @@ -138,7 +126,7 @@ Type end; TccvVectorOfPoint2i = TccvVectorOfPoint; - TccvVectorOfPoint = TccvVectorOfPoint2i; + TccvVectorOfPoint = TccvVectorOfPoint2i; TccvVectorOfVectorOfPoint = class public @@ -182,18 +170,17 @@ Type procedure Free; reintroduce; end; -function Scalar(const v0: double = 0; const v1: double = 0; const v2: double = 0; const v3: double = 0) +function Scalar(const v0: double = 0; const v1: double = 0; const v2: double = 0; const v3: double = 0): TccvScalar; overload; +function Scalar(const S: TccvScalar; const v0: double = 0; const v1: double = 0; const v2: double = 0; const v3: double = 0) : TccvScalar; overload; -function Scalar(const S: TccvScalar; const v0: double = 0; const v1: double = 0; const v2: double = 0; - const v3: double = 0): TccvScalar; overload; (* ! draws the circle outline or a solid circle in the image CV_EXPORTS_W void circle(CV_IN_OUT Mat& img, Point center, int radius, const Scalar& color, int thickness=1,int lineType=8, int shift=0); *) -procedure circle(img: TccvMat; center: TccvPoint; radius: integer; const color: TccvScalar; thickness: integer = 1; - lineType: integer = 8; shift: integer = 0); stdcall; +procedure circle(img: TccvMat; center: TccvPoint; radius: integer; const color: TccvScalar; thickness: integer = 1; lineType: integer = 8; + shift: integer = 0); stdcall; // ! draws the line segment (pt1, pt2) in the image // CV_EXPORTS_W void line(CV_IN_OUT Mat& img, Point pt1, Point pt2, const Scalar& color, @@ -251,14 +238,13 @@ procedure ReleaseVectorOfVectorOfPoint2i(ex: TccvVectorOfVectorOfPoint2i); stdca procedure MSER(m: TccvMat; var ex: TccvVectorOfVectorOfPoint2i); stdcall; external opencv_classes_lib; -function Scalar(const v0: double = 0; const v1: double = 0; const v2: double = 0; const v3: double = 0) - : TccvScalar; overload; +function Scalar(const v0: double = 0; const v1: double = 0; const v2: double = 0; const v3: double = 0): TccvScalar; overload; begin Result := TccvScalar.Create(v0, v1, v2, v3); end; -function Scalar(const S: TccvScalar; const v0: double = 0; const v1: double = 0; const v2: double = 0; - const v3: double = 0): TccvScalar; overload; +function Scalar(const S: TccvScalar; const v0: double = 0; const v1: double = 0; const v2: double = 0; const v3: double = 0) + : TccvScalar; overload; begin S[0] := v0; S[1] := v1; diff --git a/source/ocv.core.types_c.pas b/source/ocv.core.types_c.pas index 0ad47f2..9a01172 100644 --- a/source/ocv.core.types_c.pas +++ b/source/ocv.core.types_c.pas @@ -46,25 +46,10 @@ ************************************************************************************************* *) -// -{$I OpenCV.inc} -// -{$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} -{$IFDEF DELPHI2009_UP} -{$POINTERMATH ON} -{$ENDIF} unit ocv.core.types_c; +{$I OpenCV.inc} + interface uses @@ -135,6 +120,7 @@ procedure strcat(var str1: pCVChar; const str2: pCVChar); type uchar = Byte; {$EXTERNALSYM uchar} + puchar=PByte; ushort = Word; {$EXTERNALSYM ushort} schar = ShortInt; diff --git a/source/ocv.core_c.pas b/source/ocv.core_c.pas index 34774bd..3fb2a1e 100644 --- a/source/ocv.core_c.pas +++ b/source/ocv.core_c.pas @@ -46,21 +46,10 @@ ************************************************************************************************* *) -{$I OpenCV.inc} -// -{$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 ocv.core_c; +{$I OpenCV.inc} + interface uses diff --git a/source/ocv.highgui_c.pas b/source/ocv.highgui_c.pas index 98fa788..6b286cc 100644 --- a/source/ocv.highgui_c.pas +++ b/source/ocv.highgui_c.pas @@ -46,22 +46,10 @@ ************************************************************************************************* *) -// -{$I OpenCV.inc} -// -{$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 ocv.highgui_c; +{$I OpenCV.inc} + interface uses @@ -87,9 +75,9 @@ const (* CVAPI(CvFont) cvFontQt(const char* nameFont, int pointSize CV_DEFAULT(-1), CvScalar color CV_DEFAULT(cvScalarAll(0)), int weight CV_DEFAULT(CV_FONT_NORMAL), int style CV_DEFAULT(CV_STYLE_NORMAL), int spacing CV_DEFAULT(0)); *) -function cvFontQt(const nameFont: pCvChar; pointSize: Integer { = -1 }; - color: TCvScalar { = CV_DEFAULT(cvScalarAll(0)) }; weight: Integer { = CV_DEFAULT(CV_FONT_NORMAL) }; - style: Integer { = CV_DEFAULT(CV_STYLE_NORMAL) }; spacing: Integer { = CV_DEFAULT(0) } ): TCvFont; cdecl; +function cvFontQt(const nameFont: pCvChar; pointSize: Integer { = -1 }; color: TCvScalar { = CV_DEFAULT(cvScalarAll(0)) }; + weight: Integer { = CV_DEFAULT(CV_FONT_NORMAL) }; style: Integer { = CV_DEFAULT(CV_STYLE_NORMAL) }; spacing: Integer { = CV_DEFAULT(0) } ) + : TCvFont; cdecl; (* CVAPI(void) cvAddText(const CvArr* img, const char* text, CvPoint org, CvFont *arg2); @@ -116,7 +104,7 @@ Type (* int (*pt2Func)(int argc, char *argv[]) *) TArgvArray = array [0 .. 0] of pCvChar; pArgvArray = ^TArgvArray; - Tpt2Func = function(argc: Integer; argv: pArgvArray): Integer; cdecl; + Tpt2Func = function(argc: Integer; argv: pArgvArray): Integer; cdecl; (* CVAPI(int) cvStartLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[]); *) @@ -444,334 +432,172 @@ procedure cvReleaseCapture(Var capture: pCvCapture); cdecl; // every feature can have only one mode turned on at a time; const CV_CAP_PROP_DC1394_OFF = -4; - // turn the feature off (not controlled manually nor automatically) - CV_CAP_PROP_DC1394_MODE_MANUAL = -3; - // set automatically when a value of the feature is set by the user - - CV_CAP_PROP_DC1394_MODE_AUTO = -2; - + CV_CAP_PROP_DC1394_MODE_AUTO = -2; CV_CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO = -1; - - CV_CAP_PROP_POS_MSEC = 0; - - CV_CAP_PROP_POS_FRAMES = 1; - - CV_CAP_PROP_POS_AVI_RATIO = 2; - - CV_CAP_PROP_FRAME_WIDTH = 3; - - CV_CAP_PROP_FRAME_HEIGHT = 4; - - CV_CAP_PROP_FPS = 5; - - CV_CAP_PROP_FOURCC = 6; - - CV_CAP_PROP_FRAME_COUNT = 7; - - CV_CAP_PROP_FORMAT = 8; - - CV_CAP_PROP_MODE = 9; - - CV_CAP_PROP_BRIGHTNESS = 10; - - CV_CAP_PROP_CONTRAST = 11; - - CV_CAP_PROP_SATURATION = 12; - - CV_CAP_PROP_HUE = 13; - - CV_CAP_PROP_GAIN = 14; - - CV_CAP_PROP_EXPOSURE = 15; - - CV_CAP_PROP_CONVERT_RGB = 16; - - CV_CAP_PROP_WHITE_BALANCE_BLUE_U = 17; - - CV_CAP_PROP_RECTIFICATION = 18; - - CV_CAP_PROP_MONOCROME = 19; - - CV_CAP_PROP_SHARPNESS = 20; - - CV_CAP_PROP_AUTO_EXPOSURE = 21; // exposure control done by camera; - + CV_CAP_PROP_POS_MSEC = 0; + CV_CAP_PROP_POS_FRAMES = 1; + CV_CAP_PROP_POS_AVI_RATIO = 2; + CV_CAP_PROP_FRAME_WIDTH = 3; + CV_CAP_PROP_FRAME_HEIGHT = 4; + CV_CAP_PROP_FPS = 5; + CV_CAP_PROP_FOURCC = 6; + CV_CAP_PROP_FRAME_COUNT = 7; + CV_CAP_PROP_FORMAT = 8; + CV_CAP_PROP_MODE = 9; + CV_CAP_PROP_BRIGHTNESS = 10; + CV_CAP_PROP_CONTRAST = 11; + CV_CAP_PROP_SATURATION = 12; + CV_CAP_PROP_HUE = 13; + CV_CAP_PROP_GAIN = 14; + CV_CAP_PROP_EXPOSURE = 15; + CV_CAP_PROP_CONVERT_RGB = 16; + CV_CAP_PROP_WHITE_BALANCE_BLUE_U = 17; + CV_CAP_PROP_RECTIFICATION = 18; + CV_CAP_PROP_MONOCROME = 19; + CV_CAP_PROP_SHARPNESS = 20; + CV_CAP_PROP_AUTO_EXPOSURE = 21; // exposure control done by camera; // user can adjust refernce level; // using this feature; - - CV_CAP_PROP_GAMMA = 22; - - CV_CAP_PROP_TEMPERATURE = 23; - - CV_CAP_PROP_TRIGGER = 24; - - CV_CAP_PROP_TRIGGER_DELAY = 25; - - CV_CAP_PROP_WHITE_BALANCE_RED_V = 26; - - CV_CAP_PROP_ZOOM = 27; - - CV_CAP_PROP_FOCUS = 28; - - CV_CAP_PROP_GUID = 29; - - CV_CAP_PROP_ISO_SPEED = 30; - - CV_CAP_PROP_MAX_DC1394 = 31; - - CV_CAP_PROP_BACKLIGHT = 32; - - CV_CAP_PROP_PAN = 33; - - CV_CAP_PROP_TILT = 34; - - CV_CAP_PROP_ROLL = 35; - - CV_CAP_PROP_IRIS = 36; - - CV_CAP_PROP_SETTINGS = 37; - - CV_CAP_PROP_AUTOGRAB = 1024; // property for highgui class CvCapture_Android only - + CV_CAP_PROP_GAMMA = 22; + CV_CAP_PROP_TEMPERATURE = 23; + CV_CAP_PROP_TRIGGER = 24; + CV_CAP_PROP_TRIGGER_DELAY = 25; + CV_CAP_PROP_WHITE_BALANCE_RED_V = 26; + CV_CAP_PROP_ZOOM = 27; + CV_CAP_PROP_FOCUS = 28; + CV_CAP_PROP_GUID = 29; + CV_CAP_PROP_ISO_SPEED = 30; + CV_CAP_PROP_MAX_DC1394 = 31; + CV_CAP_PROP_BACKLIGHT = 32; + CV_CAP_PROP_PAN = 33; + CV_CAP_PROP_TILT = 34; + CV_CAP_PROP_ROLL = 35; + CV_CAP_PROP_IRIS = 36; + CV_CAP_PROP_SETTINGS = 37; + CV_CAP_PROP_AUTOGRAB = 1024; // property for highgui class CvCapture_Android only CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING = 1025; - // readonly; tricky property; returns cpnst char* indeed - CV_CAP_PROP_PREVIEW_FORMAT = 1026; // readonly; tricky property; returns cpnst char* indeed - // OpenNI map generators; - CV_CAP_OPENNI_DEPTH_GENERATOR = 1 shl 31; - CV_CAP_OPENNI_IMAGE_GENERATOR = 1 shl 30; - CV_CAP_OPENNI_GENERATORS_MASK = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_OPENNI_IMAGE_GENERATOR; - // Properties of cameras available through OpenNI interfaces; - - CV_CAP_PROP_OPENNI_OUTPUT_MODE = 100; - + CV_CAP_PROP_OPENNI_OUTPUT_MODE = 100; CV_CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101; // in mm - - CV_CAP_PROP_OPENNI_BASELINE = 102; // in mm - - CV_CAP_PROP_OPENNI_FOCAL_LENGTH = 103; // in pixels - - CV_CAP_PROP_OPENNI_REGISTRATION = 104; // flag - + CV_CAP_PROP_OPENNI_BASELINE = 102; // in mm + CV_CAP_PROP_OPENNI_FOCAL_LENGTH = 103; // in pixels + CV_CAP_PROP_OPENNI_REGISTRATION = 104; // flag CV_CAP_PROP_OPENNI_REGISTRATION_ON = CV_CAP_PROP_OPENNI_REGISTRATION; - // flag that synchronizes the remapping depth map to image map // by changing depth generator's view point (if the flag is "on") or; // sets this view point to its normal one (if the flag is "off").; - - CV_CAP_PROP_OPENNI_APPROX_FRAME_SYNC = 105; - - CV_CAP_PROP_OPENNI_MAX_BUFFER_SIZE = 106; - - CV_CAP_PROP_OPENNI_CIRCLE_BUFFER = 107; - - CV_CAP_PROP_OPENNI_MAX_TIME_DURATION = 108; - - CV_CAP_PROP_OPENNI_GENERATOR_PRESENT = 109; - - CV_CAP_OPENNI_IMAGE_GENERATOR_PRESENT = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_GENERATOR_PRESENT; - - CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_OUTPUT_MODE; - - CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_BASELINE; - - CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_FOCAL_LENGTH; - - CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_REGISTRATION; - + CV_CAP_PROP_OPENNI_APPROX_FRAME_SYNC = 105; + CV_CAP_PROP_OPENNI_MAX_BUFFER_SIZE = 106; + CV_CAP_PROP_OPENNI_CIRCLE_BUFFER = 107; + CV_CAP_PROP_OPENNI_MAX_TIME_DURATION = 108; + CV_CAP_PROP_OPENNI_GENERATOR_PRESENT = 109; + CV_CAP_OPENNI_IMAGE_GENERATOR_PRESENT = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_GENERATOR_PRESENT; + CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_OUTPUT_MODE; + CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_BASELINE; + CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_FOCAL_LENGTH; + CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_REGISTRATION; CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION; - // Properties of cameras available through GStreamer interface; - CV_CAP_GSTREAMER_QUEUE_LENGTH = 200; // default is 1 - CV_CAP_PROP_PVAPI_MULTICASTIP = 300; - // ip for anable multicast master mode. 0 for disable multicast // Properties of cameras available through XIMEA SDK interface; - CV_CAP_PROP_XI_DOWNSAMPLING = 400; // Change image resolution by binning or skipping. - - CV_CAP_PROP_XI_DATA_FORMAT = 401; // Output data format. - - CV_CAP_PROP_XI_OFFSET_X = 402; - + CV_CAP_PROP_XI_DATA_FORMAT = 401; // Output data format. + CV_CAP_PROP_XI_OFFSET_X = 402; // Horizontal offset from the origin to the area of interest (in pixels). - CV_CAP_PROP_XI_OFFSET_Y = 403; - // Vertical offset from the origin to the area of interest (in pixels). - - CV_CAP_PROP_XI_TRG_SOURCE = 404; // Defines source of trigger. - + CV_CAP_PROP_XI_TRG_SOURCE = 404; // Defines source of trigger. CV_CAP_PROP_XI_TRG_SOFTWARE = 405; - // Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE. - CV_CAP_PROP_XI_GPI_SELECTOR = 406; // Selects general purpose input - - CV_CAP_PROP_XI_GPI_MODE = 407; // Set general purpose input mode - - CV_CAP_PROP_XI_GPI_LEVEL = 408; // Get general purpose level - + CV_CAP_PROP_XI_GPI_MODE = 407; // Set general purpose input mode + CV_CAP_PROP_XI_GPI_LEVEL = 408; // Get general purpose level CV_CAP_PROP_XI_GPO_SELECTOR = 409; // Selects general purpose output - - CV_CAP_PROP_XI_GPO_MODE = 410; // Set general purpose output mode - + CV_CAP_PROP_XI_GPO_MODE = 410; // Set general purpose output mode CV_CAP_PROP_XI_LED_SELECTOR = 411; // Selects camera signalling LED - - CV_CAP_PROP_XI_LED_MODE = 412; // Define camera signalling LED functionality - - CV_CAP_PROP_XI_MANUAL_WB = 413; // Calculates White Balance(must be called during acquisition) - - CV_CAP_PROP_XI_AUTO_WB = 414; // Automatic white balance - - CV_CAP_PROP_XI_AEAG = 415; // Automatic exposure/gain - + CV_CAP_PROP_XI_LED_MODE = 412; // Define camera signalling LED functionality + CV_CAP_PROP_XI_MANUAL_WB = 413; // Calculates White Balance(must be called during acquisition) + CV_CAP_PROP_XI_AUTO_WB = 414; // Automatic white balance + CV_CAP_PROP_XI_AEAG = 415; // Automatic exposure/gain CV_CAP_PROP_XI_EXP_PRIORITY = 416; // Exposure priority (0.5 - exposure 50%; gain 50%). - CV_CAP_PROP_XI_AE_MAX_LIMIT = 417; - // Maximum limit of exposure in AEAG procedure CV_CAP_PROP_XI_AG_MAX_LIMIT = 418; // Maximum limit of gain in AEAG procedure - CV_CAP_PROP_XI_AEAG_LEVEL = 419; - // Average intensity of output signal AEAG should achieve(in %) - CV_CAP_PROP_XI_TIMEOUT = 420; // Image capture timeout in milliseconds - // Properties for Android cameras; - - CV_CAP_PROP_ANDROID_FLASH_MODE = 8001; - - CV_CAP_PROP_ANDROID_FOCUS_MODE = 8002; - - CV_CAP_PROP_ANDROID_WHITE_BALANCE = 8003; - - CV_CAP_PROP_ANDROID_ANTIBANDING = 8004; - - CV_CAP_PROP_ANDROID_FOCAL_LENGTH = 8005; - - CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_NEAR = 8006; - + CV_CAP_PROP_ANDROID_FLASH_MODE = 8001; + CV_CAP_PROP_ANDROID_FOCUS_MODE = 8002; + CV_CAP_PROP_ANDROID_WHITE_BALANCE = 8003; + CV_CAP_PROP_ANDROID_ANTIBANDING = 8004; + CV_CAP_PROP_ANDROID_FOCAL_LENGTH = 8005; + CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_NEAR = 8006; CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_OPTIMAL = 8007; - - CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_FAR = 8008; - + CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_FAR = 8008; // Properties of cameras available through AVFOUNDATION interface; - - CV_CAP_PROP_IOS_DEVICE_FOCUS = 9001; - - CV_CAP_PROP_IOS_DEVICE_EXPOSURE = 9002; - - CV_CAP_PROP_IOS_DEVICE_FLASH = 9003; - + CV_CAP_PROP_IOS_DEVICE_FOCUS = 9001; + CV_CAP_PROP_IOS_DEVICE_EXPOSURE = 9002; + CV_CAP_PROP_IOS_DEVICE_FLASH = 9003; CV_CAP_PROP_IOS_DEVICE_WHITEBALANCE = 9004; - - CV_CAP_PROP_IOS_DEVICE_TORCH = 9005; - + CV_CAP_PROP_IOS_DEVICE_TORCH = 9005; // Data given from depth generator.; - - CV_CAP_OPENNI_DEPTH_MAP = 0; // Depth values in mm (CV_16UC1) - - CV_CAP_OPENNI_POINT_CLOUD_MAP = 1; // XYZ in meters (CV_32FC3) - - CV_CAP_OPENNI_DISPARITY_MAP = 2; // Disparity in pixels (CV_8UC1) - + CV_CAP_OPENNI_DEPTH_MAP = 0; // Depth values in mm (CV_16UC1) + CV_CAP_OPENNI_POINT_CLOUD_MAP = 1; // XYZ in meters (CV_32FC3) + CV_CAP_OPENNI_DISPARITY_MAP = 2; // Disparity in pixels (CV_8UC1) CV_CAP_OPENNI_DISPARITY_MAP_32F = 3; // Disparity in pixels (CV_32FC1) - - CV_CAP_OPENNI_VALID_DEPTH_MASK = 4; // CV_8UC1 - + CV_CAP_OPENNI_VALID_DEPTH_MASK = 4; // CV_8UC1 // Data given from RGB image generator.; - - CV_CAP_OPENNI_BGR_IMAGE = 5; - + CV_CAP_OPENNI_BGR_IMAGE = 5; CV_CAP_OPENNI_GRAY_IMAGE = 6; - // Supported output modes of OpenNI image generator - - CV_CAP_OPENNI_VGA_30HZ = 0; - + CV_CAP_OPENNI_VGA_30HZ = 0; CV_CAP_OPENNI_SXGA_15HZ = 1; - CV_CAP_OPENNI_SXGA_30HZ = 2; - // supported by Android camera output formats - - CV_CAP_ANDROID_COLOR_FRAME_BGR = 0; // BGR - - CV_CAP_ANDROID_COLOR_FRAME = CV_CAP_ANDROID_COLOR_FRAME_BGR; - - CV_CAP_ANDROID_GREY_FRAME = 1; // Y - - CV_CAP_ANDROID_COLOR_FRAME_RGB = 2; - + CV_CAP_ANDROID_COLOR_FRAME_BGR = 0; // BGR + CV_CAP_ANDROID_COLOR_FRAME = CV_CAP_ANDROID_COLOR_FRAME_BGR; + CV_CAP_ANDROID_GREY_FRAME = 1; // Y + CV_CAP_ANDROID_COLOR_FRAME_RGB = 2; CV_CAP_ANDROID_COLOR_FRAME_BGRA = 3; - CV_CAP_ANDROID_COLOR_FRAME_RGBA = 4; - // supported Android camera flash modes - - CV_CAP_ANDROID_FLASH_MODE_AUTO = 0; - - CV_CAP_ANDROID_FLASH_MODE_OFF = 0; - - CV_CAP_ANDROID_FLASH_MODE_ON = 1; - + CV_CAP_ANDROID_FLASH_MODE_AUTO = 0; + CV_CAP_ANDROID_FLASH_MODE_OFF = 0; + CV_CAP_ANDROID_FLASH_MODE_ON = 1; CV_CAP_ANDROID_FLASH_MODE_RED_EYE = 2; - - CV_CAP_ANDROID_FLASH_MODE_TORCH = 3; - + CV_CAP_ANDROID_FLASH_MODE_TORCH = 3; // supported Android camera focus modes - - CV_CAP_ANDROID_FOCUS_MODE_AUTO = 0; - + CV_CAP_ANDROID_FOCUS_MODE_AUTO = 0; CV_CAP_ANDROID_FOCUS_MODE_CONTINUOUS_VIDEO = 0; - - CV_CAP_ANDROID_FOCUS_MODE_EDOF = 1; - - CV_CAP_ANDROID_FOCUS_MODE_FIXED = 2; - - CV_CAP_ANDROID_FOCUS_MODE_INFINITY = 3; - - CV_CAP_ANDROID_FOCUS_MODE_MACRO = 4; - + CV_CAP_ANDROID_FOCUS_MODE_EDOF = 1; + CV_CAP_ANDROID_FOCUS_MODE_FIXED = 2; + CV_CAP_ANDROID_FOCUS_MODE_INFINITY = 3; + CV_CAP_ANDROID_FOCUS_MODE_MACRO = 4; // supported Android camera white balance modes - - CV_CAP_ANDROID_WHITE_BALANCE_AUTO = 0; - - CV_CAP_ANDROID_WHITE_BALANCE_CLOUDY_DAYLIGHT = 0; - - CV_CAP_ANDROID_WHITE_BALANCE_DAYLIGHT = 1; - - CV_CAP_ANDROID_WHITE_BALANCE_FLUORESCENT = 2; - - CV_CAP_ANDROID_WHITE_BALANCE_INCANDESCENT = 3; - - CV_CAP_ANDROID_WHITE_BALANCE_SHADE = 4; - - CV_CAP_ANDROID_WHITE_BALANCE_TWILIGHT = 5; - + CV_CAP_ANDROID_WHITE_BALANCE_AUTO = 0; + CV_CAP_ANDROID_WHITE_BALANCE_CLOUDY_DAYLIGHT = 0; + CV_CAP_ANDROID_WHITE_BALANCE_DAYLIGHT = 1; + CV_CAP_ANDROID_WHITE_BALANCE_FLUORESCENT = 2; + CV_CAP_ANDROID_WHITE_BALANCE_INCANDESCENT = 3; + CV_CAP_ANDROID_WHITE_BALANCE_SHADE = 4; + CV_CAP_ANDROID_WHITE_BALANCE_TWILIGHT = 5; CV_CAP_ANDROID_WHITE_BALANCE_WARM_FLUORESCENT = 6; - // supported Android camera antibanding modes - CV_CAP_ANDROID_ANTIBANDING_50HZ = 0; - CV_CAP_ANDROID_ANTIBANDING_60HZ = 0; - CV_CAP_ANDROID_ANTIBANDING_AUTO = 1; - - CV_CAP_ANDROID_ANTIBANDING_OFF = 2; + CV_CAP_ANDROID_ANTIBANDING_OFF = 2; (* retrieve or set capture properties *) function cvGetCaptureProperty(capture: pCvCapture; property_id: Integer): Double; cdecl; @@ -785,8 +611,8 @@ function cvGetCaptureDomain(capture: pCvCapture): Integer; cdecl; type (* "black box" video file writer structure *) - TCvVideoWriter = Integer; - pCvVideoWriter = ^TCvVideoWriter; + TCvVideoWriter = Integer; + pCvVideoWriter = ^TCvVideoWriter; ppCvVideoWriter = ^pCvVideoWriter; // // CV_INLINE @@ -811,8 +637,8 @@ const double fps, CvSize frame_size, int is_color CV_DEFAULT(1)); } -function cvCreateVideoWriter(const filename: pCvChar; fourcc: Integer; fps: Double; frame_size: TCvSize; - is_color: Integer = 1): pCvVideoWriter; cdecl; +function cvCreateVideoWriter(const filename: pCvChar; fourcc: Integer; fps: Double; frame_size: TCvSize; is_color: Integer = 1) + : pCvVideoWriter; cdecl; function CV_FOURCC(const c1, c2, c3, c4: CVChar): Integer; {$IFDEF USE_INLINE}inline; {$ENDIF} // CVAPI(CvVideoWriter*) cvCreateImageSequenceWriter( const char* filename, @@ -913,8 +739,7 @@ function cvWriteFrame; external highgui_lib; procedure cvReleaseVideoWriter; external highgui_lib; procedure cvSetMouseCallback; external highgui_lib; procedure cvConvertImage(const src: pCvArr; dst: pCvArr; flags: Integer = 0); cdecl; overload; external highgui_lib; -procedure cvConvertImage(const src: pIplImage; dst: pIplImage; flags: Integer = 0); cdecl; overload; - external highgui_lib; +procedure cvConvertImage(const src: pIplImage; dst: pIplImage; flags: Integer = 0); cdecl; overload; external highgui_lib; procedure cvMoveWindow; external highgui_lib; function CV_FOURCC(const c1, c2, c3, c4: CVChar): Integer; {$IFDEF USE_INLINE}inline; {$ENDIF} diff --git a/source/ocv.lib.pas b/source/ocv.lib.pas index 88c5f53..01e5224 100644 --- a/source/ocv.lib.pas +++ b/source/ocv.lib.pas @@ -41,7 +41,7 @@ const CV_VERSION_EPOCH = '2'; CV_VERSION_MAJOR = '4'; - CV_VERSION_MINOR = '9'; + CV_VERSION_MINOR = '11'; CV_VERSION_REVISION = '0'; CV_VERSION = CV_VERSION_EPOCH + '.' + CV_VERSION_MAJOR + '.' + CV_VERSION_MINOR + '.' + CV_VERSION_REVISION;