diff --git a/bin/MPL-1.1.txt b/MPL-1.1.txt similarity index 100% rename from bin/MPL-1.1.txt rename to MPL-1.1.txt diff --git a/samples/Components/cFFmpegIPCamSource/cFFmpegIPCamSource.dproj b/samples/Components/cFFmpegIPCamSource/cFFmpegIPCamSource.dproj index 17ef35d..6e439f0 100644 --- a/samples/Components/cFFmpegIPCamSource/cFFmpegIPCamSource.dproj +++ b/samples/Components/cFFmpegIPCamSource/cFFmpegIPCamSource.dproj @@ -1,7 +1,7 @@  {08BFF34B-6FF9-468C-9AB2-3F76BBC9E351} - 17.2 + 18.1 VCL cFFmpegIPCamSource.dpr True @@ -67,6 +67,7 @@ false + true $(BDS)\bin\default_app.manifest dxSkinOffice2007BlackRS19;JvGlobus;JvMM;JvManagedThreads;dxSkinLiquidSkyRS19;cxBarEditItemRS19;OverbyteIcsDXE5Run;FireDACPgDriver;dxWizardControlRS19;dxPScxCommonRS19;tmswizdXE5;dxThemeRS19;JvCrypt;XiButtonXE4;cxGridRS19;dxPScxExtCommonRS19;DBXInterBaseDriver;DataSnapServer;DataSnapCommon;cxSchedulerRS19;JvNet;JvDotNetCtrls;DbxCommonDriver;vclimg;dbxcds;dxFlowChartRS19;DatasnapConnectorsFreePascal;JvXPCtrls;dxdbtrRS19;dxSkinSpringTimeRS19;vcldb;dxdborRS19;dxDockingRS19;dxSkinsdxDLPainterRS19;cxSpreadSheetRS19;dxtrmdRS19;dxSpellCheckerRS19;CustomIPTransport;dxTileControlRS19;dsnap;IndyIPServer;dxPSCoreRS19;dxSkinFoggyRS19;IndyCore;cxSchedulerGridRS19;cxPivotGridOLAPRS19;dxSkinStardustRS19;CloudService;FmxTeeUI;FireDACIBDriver;dxSkinXmas2008BlueRS19;JvDB;JvRuntimeDesign;dxSkinValentineRS19;fsIBX20;dsnapxml;dxPScxSchedulerLnkRS19;dxSkinDarkSideRS19;FireDACDb2Driver;dxSkinLondonLiquidSkyRS19;JclDeveloperTools;dxBarExtDBItemsRS19;dxTabbedMDIRS19;OpenCV200;dxSkinOffice2013WhiteRS19;dxSkinSharpRS19;bindcompfmx;dxSkinBlueprintRS19;dxSkinOffice2007PinkRS19;frx20;vcldbx;cxExportRS19;FireDACODBCDriver;RESTBackendComponents;dxSkinCoffeeRS19;dbrtl;FireDACCommon;bindcomp;inetdb;dxSkinBlueRS19;JvPluginSystem;dxServerModeRS19;DBXOdbcDriver;JvCmp;vclFireDAC;dxSkinMoneyTwinsRS19;cxPivotGridChartRS19;xmlrtl;dxSkiniMaginaryRS19;ibxpress;JvTimeFramework;dxSkinOffice2007GreenRS19;FireDACCommonDriver;bindengine;vclactnband;soaprtl;FMXTee;dxRibbonRS19;bindcompvcl;dxADOServerModeRS19;Jcl;vclie;dxPSdxLCLnkRS19;dxSkinBlackRS19;dxSkinOffice2010BlackRS19;dxSkinSevenClassicRS19;FireDACMSSQLDriver;DBXInformixDriver;Intraweb;DataSnapServerMidas;dsnapcon;DBXFirebirdDriver;dxSkinsdxNavBarPainterRS19;inet;dxPSdxFCLnkRS19;dxSkinscxSchedulerPainterRS19;JvPascalInterpreter;FireDACMySQLDriver;soapmidas;vclx;dxPSPrVwRibbonRS19;dxPSDBTeeChartRS19;DBXSybaseASADriver;RESTComponents;dxSkinLilianRS19;dxSkinscxPCPainterRS19;dbexpress;IndyIPClient;JvBDE;tmsdXE5;cxSchedulerTreeBrowserRS19;dxPScxSSLnkRS19;dxPScxPivotGridLnkRS19;dxSkinSharpPlusRS19;FireDACSqliteDriver;autoupgrXE5;FireDACDSDriver;ZComponent;DBXSqliteDriver;dxPSdxDBTVLnkRS19;dxSkinOffice2007BlueRS19;cxDataRS19;cxLibraryRS19;fmx;JvDlgs;IndySystem;RVButtonXE6;TeeDB;tethering;dxPsPrVwAdvRS19;dxSkinHighContrastRS19;inetdbbde;vclib;DataSnapClient;DataSnapProviderClient;DBXSybaseASEDriver;dxmdsRS19;dxSkinOffice2010SilverRS19;dxSkinsdxBarPainterRS19;fsBDE20;MetropolisUILiveTile;dxPSdxOCLnkRS19;vcldsnap;fmxFireDAC;DBXDb2Driver;dxSkinDevExpressDarkStyleRS19;DBXOracleDriver;dxBarDBNavRS19;JvCore;vclribbon;dxSkinSilverRS19;dxSkinVS2010RS19;fmxase;vcl;dxPSdxDBOCLnkRS19;DBXMSSQLDriver;IndyIPCommon;CodeSiteExpressPkg;dxBarRS19;cxTreeListdxBarPopupMenuRS19;DataSnapFireDAC;FireDACDBXDriver;JvAppFrm;soapserver;dxFireDACServerModeRS19;inetdbxpress;fsTee20;frxTee20;cxEditorsRS19;dxSkinMcSkinRS19;FireDACInfxDriver;JvDocking;adortl;dxSkinOffice2007SilverRS19;frxDB20;JvWizards;FireDACASADriver;dxSkinSevenRS19;JvHMI;dxDBXServerModeRS19;dxLayoutControlRS19;dxPSTeeChartRS19;dxSkinWhiteprintRS19;cxPageControlRS19;fsADO20;JvBands;ZDbc;rtl;dcldxSkinsCoreRS19;DbxClientDriver;ZPlain;dxPScxGridLnkRS19;Tee;cxPageControldxBarPopupMenuRS19;cxVerticalGridRS19;JclContainers;CPortLibDXE;JvSystem;DataSnapNativeClient;svnui;dxSkinsdxRibbonPainterRS19;dxSkinSummer2008RS19;cxPivotGridRS19;dxComnRS19;IndyProtocols;DBXMySQLDriver;dxSkinTheAsphaltWorldRS19;JvControls;tmsxlsdXE5;dxPSLnksRS19;viTimeLineDPK;bindcompdbx;TeeUI;JvJans;JvPrintPreview;JvPageComps;dxSkinDarkRoomRS19;JvStdCtrls;JvCustom;dxSkinPumpkinRS19;dxBarExtItemsRS19;FireDACADSDriver;vcltouch;ZCore;dxNavBarRS19;VclSmp;FireDAC;VCLRESTComponents;dxGDIPlusRS19;DataSnapConnectors;dxCoreRS19;dxPScxVGridLnkRS19;fsDB20;dxPScxTLLnkRS19;dxSkinsCoreRS19;fmxobj;dxSkinGlassOceansRS19;JclVcl;ZParseSql;dxPScxPCProdRS19;fs20;svn;tmsexdXE5;dxSkinOffice2010BlueRS19;FireDACOracleDriver;fmxdae;dxorgcRS19;bdertl;cxTreeListRS19;FireDACMSAccDriver;DataSnapIndy10ServerTransport;dxSkinDevExpressStyleRS19;dxSkinCaramelRS19;$(DCC_UsePackage) true @@ -139,70 +140,110 @@ Microsoft Office XP Sample Automation Server Wrapper Components - - + + 1 - .dylib + + 1 + + + + + Contents\Resources + 1 + + + + + classes + 1 + + + + + res\drawable-xxhdpi + 1 + + + + Contents\MacOS 0 - .bpl + + + 1 Contents\MacOS 1 - .dylib + + + + library\lib\mips + 1 + + + 1 - .dylib + + + 1 1 - .dylib - + 1 - .dylib + + + 1 0 - .dll;.bpl + + + 1 Contents\MacOS 1 - .dylib + + + library\lib\armeabi-v7a + 1 1 - .dylib - - - 1 - .dylib - + + + 0 + + + Contents\MacOS + 1 + .framework + + + + + 1 + 1 - - 1 - 1 - - - Contents - 1 - - + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF @@ -213,221 +254,35 @@ 1 - - - res\drawable-normal - 1 - - - - - library\lib\x86 - 1 - - - - - 1 - + 1 - - 1 - - - - - ../ - 1 - - - - - library\lib\armeabi-v7a - 1 - - - 1 - - 1 - 1 - - - res\drawable-xlarge - 1 - - - - - res\drawable-xhdpi - 1 - - + + 1 + 1 - - 1 - 1 - - - res\drawable-xxhdpi - 1 - - - - - library\lib\mips - 1 - - - - - res\drawable - 1 - - - - - Contents\MacOS - 1 - - - 1 - - - 0 - - - - - Contents\MacOS - 1 - .framework - - - 0 - - - - - res\drawable-small - 1 - - - - - ../ - 1 - - - ../ - 1 - - - - - Contents\MacOS - 1 - - - 1 - - - Contents\MacOS - 0 - - - - - classes - 1 - - - - 1 - 1 - - 1 - - - 1 - - 1 - - - 1 - - - - - res\drawable - 1 - - - - - Contents\Resources - 1 - - - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - library\lib\armeabi-v7a - 1 - - - 1 - - - 0 - - - Contents\MacOS - 1 - - - 1 - 1 @@ -438,70 +293,71 @@ 1 + + + 0 + + + 1 + + + Contents\MacOS + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\drawable-normal + 1 + + + + + res\drawable-xhdpi + 1 + + res\drawable-large 1 - - - 0 - - - 0 - - - 0 - - - Contents\MacOS - 0 - - - 0 - - - 0 - - - + 1 - + 1 1 - - - res\drawable-ldpi - 1 - - - - - res\values - 1 - - - + - 1 - - + ..\ 1 + ..\ 1 - + - res\drawable-mdpi + library\lib\armeabi-v7a 1 @@ -511,18 +367,168 @@ 1 + + + Contents + 1 + + + + + ..\ + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\values + 1 + + + + + res\drawable-small + 1 + + + + + res\drawable + 1 + + + + + 1 + + + 1 + + + 1 + + 1 + + + res\drawable + 1 + + + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + 0 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 0 + .bpl + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + + + res\drawable-mdpi + 1 + + + + + res\drawable-xlarge + 1 + + + + + res\drawable-ldpi + 1 + + + + + 0 + .dll;.bpl + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + - - - - + + + + + True @@ -535,11 +541,3 @@ - - diff --git a/samples/Components/cFFmpegIPCamSource/cFFmpegIPCamSource.res b/samples/Components/cFFmpegIPCamSource/cFFmpegIPCamSource.res index 0f3facb..5ca0e4e 100644 Binary files a/samples/Components/cFFmpegIPCamSource/cFFmpegIPCamSource.res and b/samples/Components/cFFmpegIPCamSource/cFFmpegIPCamSource.res differ diff --git a/samples/LearningOpenCV_Code/ch10_ex10_1b_Horn_Schunck.dpr b/samples/LearningOpenCV_Code/ch10_ex10_1b_Horn_Schunck.dpr new file mode 100644 index 0000000..417e2d7 --- /dev/null +++ b/samples/LearningOpenCV_Code/ch10_ex10_1b_Horn_Schunck.dpr @@ -0,0 +1,147 @@ +(* + ***************************************************************** + 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. + ******************************************************************* +*) + +// +// ch10_ex10_1b_Horn_Schunck Optical flow by the Horn-Schunck method +// +(* *************** License:************************** + Oct. 3, 2008 + Right to use this code in any way you want without warrenty, support or any guarentee of it working. + + BOOK: It would be nice if you cited it: + Learning OpenCV: Computer Vision with the OpenCV Library + by Gary Bradski and Adrian Kaehler + Published by O'Reilly Media, October 3, 2008 + + AVAILABLE AT: + http://www.amazon.com/Learning-OpenCV-Computer-Vision-Library/dp/0596516134 + Or: http://oreilly.com/catalog/9780596516130/ + ISBN-10: 0596516134 or: ISBN-13: 978-0596516130 + + OTHER OPENCV SITES: + * The source code is on sourceforge at: + http://sourceforge.net/projects/opencvlibrary/ + * The OpenCV wiki page (As of Oct 1, 2008 this is down for changing over servers, but should come back): + http://opencvlibrary.sourceforge.net/ + * An active user group is at: + http://tech.groups.yahoo.com/group/OpenCV/ + * The minutes of weekly OpenCV development meetings are at: + http://pr.willowgarage.com/wiki/OpenCV + ************************************************** *) +program ch10_ex10_1b_Horn_Schunck; + +{$APPTYPE CONSOLE} +{$POINTERMATH ON} +{$R *.res} + +uses + System.SysUtils, + ocv.core_c, + ocv.highgui_c, + ocv.core.types_c, + ocv.legacy, + uResourcePaths; + +Var + imgA, imgB, velx, vely, imgC: pIplImage; + step, x, y : Integer; + px, py : pFloat; + +begin + try + // Initialize, load two images from the file system, and + // allocate the images and other structures we will need for + // results. + + // exit if no input images + imgA := cvLoadImage(cResourceMedia + 'OpticalFlow0.jpg', 0); + imgB := cvLoadImage(cResourceMedia + 'OpticalFlow1.jpg', 0); + if (not Assigned(imgA)) or (not Assigned(imgB)) then + begin + Writeln('One of OpticalFlow0.jpg and/or OpticalFlow1.jpg didn''t load'); + Halt; + end; + + velx := cvCreateImage(cvGetSize(imgA), IPL_DEPTH_32F, 1); + vely := cvCreateImage(cvGetSize(imgA), IPL_DEPTH_32F, 1); + + imgC := cvCreateImage(cvGetSize(imgA), IPL_DEPTH_8U, 3); + + cvNamedWindow('OpticalFlow0'); + cvNamedWindow('OpticalFlow1'); + cvNamedWindow('Flow Results'); + + cvShowImage('OpticalFlow0', imgA); + cvShowImage('OpticalFlow1', imgB); + + // Call the actual Horn and Schunck algorithm + // + cvCalcOpticalFlowHS(imgA, imgB, 0, velx, vely, 0.10, cvTermCriteria(CV_TERMCRIT_ITER or CV_TERMCRIT_EPS, + imgA^.width, 1E-6)); + + // Now make some image of what we are looking at: + // + cvZero(imgC); + step := 4; + y := 0; + While y < imgC^.height do + begin + px := pFloat(velx^.imageData + y * velx^.widthStep); + py := pFloat(vely^.imageData + y * vely^.widthStep); + x := 0; + While x < imgC^.width do + begin + if (px[x] > 1) and (py[x] > 1) then + begin + cvCircle(imgC, cvPoint(x, y), 2, // + // cvScalar(100), // CVX_GRAY50 + cvScalar(255), // CVX_WHITE + -1); + cvLine(imgC, cvPoint(x, y), cvPoint(Trunc(x + px[x] / 2), Trunc(y + py[x] / 2)), CV_RGB(255, 0, 0), 1, 0); + end; + x := x + step; + end; + y := y + step; + end; + // show tracking + cvShowImage('Flow Results', imgC); + + cvWaitKey(0); + + // destroy windows + cvDestroyWindow('OpticalFlow0'); + cvDestroyWindow('OpticalFlow1'); + cvDestroyWindow('Flow Results'); + // release memory + cvReleaseImage(imgA); + cvReleaseImage(imgB); + cvReleaseImage(imgC); + + except + on E: Exception do + Writeln(E.ClassName, ': ', E.Message); + end; + +end. diff --git a/samples/LearningOpenCV_Code/ch10_ex10_1b_Horn_Schunck.dproj b/samples/LearningOpenCV_Code/ch10_ex10_1b_Horn_Schunck.dproj new file mode 100644 index 0000000..97a876a --- /dev/null +++ b/samples/LearningOpenCV_Code/ch10_ex10_1b_Horn_Schunck.dproj @@ -0,0 +1,599 @@ + + + {1D57A361-9E04-4E9E-A36C-F356EA4E7D57} + 18.1 + None + ch10_ex10_1b_Horn_Schunck.dpr + True + Debug + Win32 + 1 + Console + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + $(BDS)\bin\delphi_PROJECTICNS.icns + $(BDS)\bin\delphi_PROJECTICON.ico + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + 1049 + None + System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + ch10_ex10_1b_Horn_Schunck + .\$(Platform)\$(Config) + ..\..\bin\$(Platform) + false + false + false + false + false + + + FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;fmx;IndySystem;tethering;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapProviderClient;DbxCommonDriver;dbxcds;fmxFireDAC;CustomIPTransport;dsnap;IndyIPServer;IndyCore;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;soapserver;dsnapxml;bindcompfmx;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;ibmonitor;xmlrtl;DataSnapNativeClient;ibxpress;IndyProtocols;FireDACCommonDriver;bindcompdbx;soaprtl;bindengine;FMXTee;emsclient;FireDAC;inet;soapmidas;RESTComponents;dbexpress;IndyIPClient;$(DCC_UsePackage) + android-support-v4.dex.jar;apk-expansion.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + + + FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;fmx;IndySystem;tethering;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapProviderClient;DbxCommonDriver;dbxcds;fmxFireDAC;CustomIPTransport;dsnap;IndyIPServer;fmxase;IndyCore;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;soapserver;dsnapxml;bindcompfmx;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;ibmonitor;xmlrtl;DataSnapNativeClient;ibxpress;IndyProtocols;FireDACCommonDriver;bindcompdbx;soaprtl;bindengine;FMXTee;emsclient;FireDAC;inet;soapmidas;RESTComponents;dbexpress;IndyIPClient;$(DCC_UsePackage) + + + FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;fmx;IndySystem;tethering;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapProviderClient;DbxCommonDriver;dbxcds;fmxFireDAC;CustomIPTransport;dsnap;IndyIPServer;fmxase;IndyCore;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;soapserver;dsnapxml;bindcompfmx;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;ibmonitor;xmlrtl;DataSnapNativeClient;ibxpress;IndyProtocols;FireDACCommonDriver;bindcompdbx;soaprtl;bindengine;FMXTee;emsclient;FireDAC;inet;soapmidas;RESTComponents;dbexpress;IndyIPClient;$(DCC_UsePackage) + + + FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;fmx;IndySystem;tethering;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapProviderClient;DbxCommonDriver;dbxcds;fmxFireDAC;CustomIPTransport;dsnap;IndyIPServer;fmxase;IndyCore;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;soapserver;dsnapxml;bindcompfmx;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;ibmonitor;xmlrtl;DataSnapNativeClient;ibxpress;IndyProtocols;FireDACCommonDriver;bindcompdbx;soaprtl;bindengine;FMXTee;emsclient;FireDAC;inet;soapmidas;RESTComponents;dbexpress;IndyIPClient;$(DCC_UsePackage) + + + true + FireDACTDataDriver;FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;FireDACPgDriver;fmx;IndySystem;tethering;DBXInterBaseDriver;DataSnapClient;DataSnapServer;DataSnapCommon;DataSnapProviderClient;DbxCommonDriver;dbxcds;fmxFireDAC;DBXOracleDriver;CustomIPTransport;dsnap;IndyIPServer;fmxase;IndyCore;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;soapserver;inetdbxpress;dsnapxml;FireDACASADriver;bindcompfmx;FireDACODBCDriver;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;inetdb;ibmonitor;xmlrtl;DataSnapNativeClient;ibxpress;IndyProtocols;DBXMySQLDriver;FireDACCommonDriver;bindcompdbx;soaprtl;bindengine;FMXTee;emsclient;FireDAC;DBXInformixDriver;FireDACMSSQLDriver;DataSnapServerMidas;DBXFirebirdDriver;inet;fmxobj;FireDACMySQLDriver;soapmidas;DBXSybaseASADriver;FireDACOracleDriver;fmxdae;RESTComponents;dbexpress;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage) + + + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + 1033 + true + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + JvGlobus;JvMM;FireDACTDataDriver;JvManagedThreads;FireDACSqliteDriver;FireDACDSDriver;frxTee22;DBXSqliteDriver;FireDACPgDriver;fmx;JvDlgs;IndySystem;JvCrypt;TeeDB;tethering;vclib;DBXInterBaseDriver;DataSnapClient;DataSnapServer;DataSnapCommon;JvNet;DataSnapProviderClient;JvDotNetCtrls;DBXSybaseASEDriver;frxe22;DbxCommonDriver;vclimg;DUnitXRuntime;dbxcds;DatasnapConnectorsFreePascal;appanalytics;JvXPCtrls;vcldb;vcldsnap;fmxFireDAC;dclFFMSource220;DBXDb2Driver;DBXOracleDriver;CustomIPTransport;JvCore;vclribbon;dsnap;IndyIPServer;fmxase;vcl;IndyCore;DBXMSSQLDriver;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;CodeSiteExpressPkg;DataSnapFireDAC;FireDACDBXDriver;JvAppFrm;soapserver;JvDB;JvRuntimeDesign;tmsdXE7;inetdbxpress;dsnapxml;FireDACInfxDriver;FireDACDb2Driver;JclDeveloperTools;JvDocking;adortl;tmswizdXE7;JvWizards;FireDACASADriver;JvHMI;frx22;bindcompfmx;JvBands;FireDACODBCDriver;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;inetdb;Tee;JclContainers;DBXOdbcDriver;ibmonitor;vclFireDAC;JvCmp;JvSystem;xmlrtl;DataSnapNativeClient;svnui;ibxpress;JvControls;JvTimeFramework;IndyProtocols;DBXMySQLDriver;FireDACCommonDriver;viTimeLineDPK;bindcompdbx;soaprtl;bindengine;vclactnband;FMXTee;TeeUI;bindcompvcl;JvStdCtrls;JvCustom;Jcl;vclie;JvJans;JvPrintPreview;JvPageComps;frxDB22;FireDACADSDriver;vcltouch;emsclient;VclSmp;FireDAC;DBXInformixDriver;FireDACMSSQLDriver;Intraweb;VCLRESTComponents;DataSnapConnectors;DataSnapServerMidas;dsnapcon;DBXFirebirdDriver;tmsexdXE7;inet;fmxobj;JclVcl;JvPascalInterpreter;FireDACMySQLDriver;soapmidas;vclx;tmsxlsdXE7;svn;DBXSybaseASADriver;FireDACOracleDriver;fmxdae;RESTComponents;FireDACMSAccDriver;dbexpress;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage) + + + true + FireDACTDataDriver;FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;FireDACPgDriver;fmx;IndySystem;TeeDB;tethering;vclib;DBXInterBaseDriver;DataSnapClient;DataSnapServer;DataSnapCommon;DataSnapProviderClient;DBXSybaseASEDriver;DbxCommonDriver;vclimg;dbxcds;DatasnapConnectorsFreePascal;appanalytics;vcldb;vcldsnap;fmxFireDAC;DBXDb2Driver;DBXOracleDriver;CustomIPTransport;vclribbon;dsnap;IndyIPServer;fmxase;vcl;IndyCore;DBXMSSQLDriver;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;soapserver;tmsdXE7;inetdbxpress;dsnapxml;FireDACInfxDriver;FireDACDb2Driver;JclDeveloperTools;adortl;FireDACASADriver;bindcompfmx;FireDACODBCDriver;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;inetdb;Tee;JclContainers;DBXOdbcDriver;ibmonitor;vclFireDAC;xmlrtl;DataSnapNativeClient;ibxpress;IndyProtocols;DBXMySQLDriver;FireDACCommonDriver;bindcompdbx;soaprtl;bindengine;vclactnband;FMXTee;TeeUI;bindcompvcl;Jcl;vclie;FireDACADSDriver;vcltouch;emsclient;VclSmp;FireDAC;DBXInformixDriver;FireDACMSSQLDriver;Intraweb;VCLRESTComponents;DataSnapConnectors;DataSnapServerMidas;dsnapcon;DBXFirebirdDriver;tmsexdXE7;inet;fmxobj;JclVcl;FireDACMySQLDriver;soapmidas;vclx;DBXSybaseASADriver;FireDACOracleDriver;fmxdae;RESTComponents;FireDACMSAccDriver;dbexpress;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage) + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + None + 1033 + false + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + + MainSource + + + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + + + + Delphi.Personality.12 + Application + + + + ch10_ex10_1b_Horn_Schunck.dpr + + + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + + + + + + true + + + + + true + + + + + true + + + + + true + + + + + ch10_ex10_1b_Horn_Schunck.exe + true + + + + + 0 + .dll;.bpl + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + + + Contents\Resources + 1 + + + + + classes + 1 + + + + + Contents\MacOS + 0 + + + 1 + + + Contents\MacOS + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\drawable-xxhdpi + 1 + + + + + library\lib\mips + 1 + + + + + 1 + + + 1 + + + 0 + + + 1 + + + Contents\MacOS + 1 + + + library\lib\armeabi-v7a + 1 + + + 1 + + + + + 0 + + + Contents\MacOS + 1 + .framework + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + library\lib\armeabi + 1 + + + + + 0 + + + 1 + + + Contents\MacOS + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\drawable-normal + 1 + + + + + res\drawable-xhdpi + 1 + + + + + res\drawable-large + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + res\drawable-hdpi + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + Contents + 1 + + + + + ..\ + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\values + 1 + + + + + res\drawable-small + 1 + + + + + res\drawable + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + + + res\drawable + 1 + + + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + 0 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 0 + .bpl + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + + + res\drawable-mdpi + 1 + + + + + res\drawable-xlarge + 1 + + + + + res\drawable-ldpi + 1 + + + + + 1 + + + 1 + + + + + + + + + + + + + False + False + False + False + False + True + False + + + 12 + + + + + diff --git a/samples/LearningOpenCV_Code/ch10_ex10_1b_Horn_Schunck.res b/samples/LearningOpenCV_Code/ch10_ex10_1b_Horn_Schunck.res new file mode 100644 index 0000000..6876088 Binary files /dev/null and b/samples/LearningOpenCV_Code/ch10_ex10_1b_Horn_Schunck.res differ diff --git a/samples/LearningOpenCV_Code/ch10_ex10_2.dproj b/samples/LearningOpenCV_Code/ch10_ex10_2.dproj index a905f9c..9da27db 100644 --- a/samples/LearningOpenCV_Code/ch10_ex10_2.dproj +++ b/samples/LearningOpenCV_Code/ch10_ex10_2.dproj @@ -7,7 +7,7 @@ 1025 Console None - 18.0 + 18.1 Win32 diff --git a/samples/LearningOpenCV_Code/ch10_motempl.dpr b/samples/LearningOpenCV_Code/ch10_motempl.dpr new file mode 100644 index 0000000..6d5d167 --- /dev/null +++ b/samples/LearningOpenCV_Code/ch10_motempl.dpr @@ -0,0 +1,280 @@ +(* + ***************************************************************** + 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. + ******************************************************************* +*) + +// This is the motion template code motempl.c from the OpenCV samples/c directory. +// It's just too fun not to also include here and is described in detail in Chapter 10. +(* *************** License:************************** + Oct. 3, 2008 + Right to use this code in any way you want without warrenty, support or any guarentee of it working. + + BOOK: It would be nice if you cited it: + Learning OpenCV: Computer Vision with the OpenCV Library + by Gary Bradski and Adrian Kaehler + Published by O'Reilly Media, October 3, 2008 + + AVAILABLE AT: + http://www.amazon.com/Learning-OpenCV-Computer-Vision-Library/dp/0596516134 + Or: http://oreilly.com/catalog/9780596516130/ + ISBN-10: 0596516134 or: ISBN-13: 978-0596516130 + + OTHER OPENCV SITES: + * The source code is on sourceforge at: + http://sourceforge.net/projects/opencvlibrary/ + * The OpenCV wiki page (As of Oct 1, 2008 this is down for changing over servers, but should come back): + http://opencvlibrary.sourceforge.net/ + * An active user group is at: + http://tech.groups.yahoo.com/group/OpenCV/ + * The minutes of weekly OpenCV development meetings are at: + http://pr.willowgarage.com/wiki/OpenCV + ************************************************** +*) + +program ch10_motempl; + +{$APPTYPE CONSOLE} +{$POINTERMATH ON} +{$R *.res} + +uses + Winapi.Windows, + System.SysUtils, + System.Character, + ocv.utils, + ocv.core_c, + ocv.highgui_c, + ocv.core.types_c, + ocv.imgproc.types_c, + ocv.imgproc_c, + ocv.tracking_c, + ocv.compat; + +procedure help(); +begin + WriteLn('This one uses a video camera to demonstrate motion templates in chapter 10.'); + WriteLn(' 1 Point the camera away from you'); + WriteLn(' 2 Start the program'); + WriteLn(' 3 Wait a few seconds until the video window goes black'); + WriteLn(' 4 Move in front of the camera and watch the templates being drawn along with'); + WriteLn(' their segmented motion vectors.'); + WriteLn('Ussage: '); + WriteLn('./ch10_motempl'); +end; + +// various tracking parameters (in seconds) +const + CLOCKS_PER_SEC = 1000; + MHI_DURATION = 1; + MAX_TIME_DELTA = 0.5; + MIN_TIME_DELTA = 0.05; + // number of cyclic frame buffer used for motion detection + // (should, probably, depend on FPS) + N = 4; + +var + // ring image buffer + buf: array of pIplImage; + last: Integer = 0; + // temporary images + mhi: pIplImage = nil; // MHI + orient: pIplImage = nil; // orientation + mask: pIplImage = nil; // valid orientation mask + segmask: pIplImage = nil; // motion segmentation map + storage: pCvMemStorage = nil; // temporary storage + + // parameters: + // img - input video frame + // dst - resultant motion picture + // args - optional parameters +procedure update_mhi(img: pIplImage; dst: pIplImage; diff_threshold: Integer); +var + timestamp: double; + size: TCvSize; + i, idx1, idx2: Integer; + silh: pIplImage; + seq: pCvSeq; + comp_rect: TCvRect; + count, angle: double; + center: TCvPoint; + magnitude: double; + color: TCvScalar; +begin + timestamp := GetTickCount div CLOCKS_PER_SEC; // get current time in seconds + size := cvSize(img^.width, img^.height); // get current frame size + idx1 := last; + + // allocate images at the beginning or + // reallocate them if the frame size is changed + if (not Assigned(mhi)) or (mhi^.width <> size.width) or (mhi^.height <> size.height) then + begin + if Length(buf) = 0 then + SetLength(buf, N); + + for i := 0 to N - 1 do + begin + cvReleaseImage(buf[i]); + buf[i] := cvCreateImage(size, IPL_DEPTH_8U, 1); + cvZero(buf[i]); + end; + cvReleaseImage(mhi); + cvReleaseImage(orient); + cvReleaseImage(segmask); + cvReleaseImage(mask); + + mhi := cvCreateImage(size, IPL_DEPTH_32F, 1); + cvZero(mhi); // clear MHI at the beginning + orient := cvCreateImage(size, IPL_DEPTH_32F, 1); + segmask := cvCreateImage(size, IPL_DEPTH_32F, 1); + mask := cvCreateImage(size, IPL_DEPTH_8U, 1); + end; + + cvCvtColor(img, buf[last], CV_BGR2GRAY); // convert frame to grayscale + + idx2 := (last + 1) mod N; // index of (last - (N-1))th frame + last := idx2; + + silh := buf[idx2]; + cvAbsDiff(buf[idx1], buf[idx2], silh); // get difference between frames + + cvThreshold(silh, silh, diff_threshold, 1, CV_THRESH_BINARY); // and threshold it + cvUpdateMotionHistory(silh, mhi, timestamp, MHI_DURATION); // update MHI + + // convert MHI to blue 8u image + cvCvtScale(mhi, mask, 255. / MHI_DURATION, (MHI_DURATION - timestamp) * 255. / MHI_DURATION); + cvZero(dst); + cvCvtPlaneToPix(mask, nil, nil, nil, dst); + + // calculate motion gradient orientation and valid orientation mask + cvCalcMotionGradient(mhi, mask, orient, MAX_TIME_DELTA, MIN_TIME_DELTA, 3); + + if not Assigned(storage) then + storage := cvCreateMemStorage(0) + else + cvClearMemStorage(storage); + + // segment motion: get sequence of motion components + // segmask is marked motion components map. It is not used further + seq := cvSegmentMotion(mhi, segmask, storage, timestamp, MAX_TIME_DELTA); + + // iterate through the motion components, + // One more iteration (i == -1) corresponds to the whole image (global motion) + for i := -1 to seq^.total - 1 do + begin + + if (i < 0) then + begin // case of the whole image + comp_rect := cvRect(0, 0, size.width, size.height); + color := CV_RGB(255, 255, 255); + magnitude := 100; + end + else + begin // i-th motion component + comp_rect := pCvConnectedComp(cvGetSeqElem(seq, i))^.rect; + if (comp_rect.width + comp_rect.height) < 100 then // reject very small components + continue; + color := CV_RGB(255, 0, 0); + magnitude := 30; + end; + + // select component ROI + cvSetImageROI(silh, comp_rect); + cvSetImageROI(mhi, comp_rect); + cvSetImageROI(orient, comp_rect); + cvSetImageROI(mask, comp_rect); + + // calculate orientation + angle := cvCalcGlobalOrientation(orient, mask, mhi, timestamp, MHI_DURATION); + angle := 360.0 - angle; // adjust for images with top-left origin + + count := cvNorm(silh, nil, CV_L1, nil); // calculate number of points within silhouette ROI + + cvResetImageROI(mhi); + cvResetImageROI(orient); + cvResetImageROI(mask); + cvResetImageROI(silh); + + // check for the case of little motion + if count < (comp_rect.width * comp_rect.height * 0.05) then + continue; + + // draw a clock with arrow indicating the direction + center := cvPoint((comp_rect.x + comp_rect.width div 2), (comp_rect.y + comp_rect.height div 2)); + + cvCircle(dst, center, cvRound(magnitude * 1.2), color, 3, CV_AA, 0); + cvLine(dst, center, cvPoint(cvRound(center.x + magnitude * cos(angle * CV_PI / 180)), cvRound(center.y - magnitude * sin(angle * CV_PI / 180))), + color, 3, CV_AA, 0); + end; +end; + +Var + motion: pIplImage = nil; + capture: pCvCapture = nil; + image: pIplImage; + S:string; + +begin + try + if (ParamCount = 1)and(FileExists(ParamStr(1))) then + capture := cvCaptureFromFile(ParamStr(1).AsPAnsiChar) + else + capture := cvCaptureFromCAM(CV_CAP_ANY); + + if Assigned(capture) then + begin + help(); + cvNamedWindow('Motion', 1); + + While True do + begin + image := cvQueryFrame(capture); + if Assigned(image) then + begin + if not Assigned(motion) then + begin + motion := cvCreateImage(cvSize(image^.width, image^.height), 8, 3); + cvZero(motion); + motion^.origin := image^.origin; + end; + end; + + update_mhi(image, motion, 30); + cvShowImage('Motion', motion); + + if (cvWaitKey(10) >= 0) then + break; + end; + cvReleaseCapture(capture); + cvDestroyWindow('Motion'); + end + else + begin + WriteLn('Failed to open camera or file'); + help(); + end; + except + on E: Exception do + WriteLn(E.ClassName, ': ', E.Message); + end; + +end. diff --git a/samples/LearningOpenCV_Code/ch10_motempl.dproj b/samples/LearningOpenCV_Code/ch10_motempl.dproj new file mode 100644 index 0000000..176db86 --- /dev/null +++ b/samples/LearningOpenCV_Code/ch10_motempl.dproj @@ -0,0 +1,577 @@ + + + {ED3E255B-A19B-4471-93E4-B3E9BE884F91} + ch10_motempl.dpr + True + Debug + 1025 + Console + None + 18.1 + Win32 + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + $(BDS)\bin\delphi_PROJECTICNS.icns + $(BDS)\bin\delphi_PROJECTICON.ico + None + .\$(Platform)\$(Config) + ..\..\bin\$(Platform) + false + false + System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + 1049 + 00400000 + false + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName= + false + ch10_motempl + false + + + true + true + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + true + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + android-support-v4.dex.jar;apk-expansion.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + true + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + true + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + true + true + true + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + true + Debug + package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= + true + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + + + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_40x40.png + iPhoneAndiPad + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png + $(MSBuildProjectName) + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_76x76.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png + true + CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes= + Debug + + + iPhoneAndiPad + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_76x76.png + CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false;UIBackgroundModes= + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png + true + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png + + + 1033 + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + + + 0 + RELEASE;$(DCC_Define) + 0 + false + + + DEBUG;$(DCC_Define) + false + true + + + true + + + Debug + + + true + + + 1033 + None + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + + + + MainSource + + + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + + + + Delphi.Personality.12 + + + + + ch10_motempl.dpr + + + Microsoft Office 2000 Sample Automation Server Wrapper Components + + + + False + False + True + False + False + True + False + + + + + true + + + + + true + + + + + true + + + + + true + + + + + ch10_motempl.exe + true + + + + + + Contents\Resources + 1 + + + + + classes + 1 + + + + + Contents\MacOS + 0 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\drawable-xxhdpi + 1 + + + + + library\lib\mips + 1 + + + + + 1 + + + 1 + + + 0 + + + 1 + + + 1 + + + library\lib\armeabi-v7a + 1 + + + 1 + + + + + 0 + + + 1 + .framework + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + 1 + + + 1 + + + 1 + + + + + + library\lib\armeabi + 1 + + + + + 0 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\drawable-normal + 1 + + + + + res\drawable-xhdpi + 1 + + + + + res\drawable-large + 1 + + + + + 1 + + + 1 + + + 1 + + + + + + res\drawable-hdpi + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + + + 1 + + + 1 + + + 1 + + + + + res\values + 1 + + + + + res\drawable-small + 1 + + + + + res\drawable + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + + + res\drawable + 1 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 0 + .bpl + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + + + res\drawable-mdpi + 1 + + + + + res\drawable-xlarge + 1 + + + + + res\drawable-ldpi + 1 + + + + + 0 + .dll;.bpl + + + 1 + .dylib + + + + + + + + + + + + + 12 + + + + + diff --git a/samples/LearningOpenCV_Code/ch10_motempl.res b/samples/LearningOpenCV_Code/ch10_motempl.res new file mode 100644 index 0000000..24ae910 Binary files /dev/null and b/samples/LearningOpenCV_Code/ch10_motempl.res differ diff --git a/samples/LearningOpenCV_Code/ch13_ex13_3.dproj b/samples/LearningOpenCV_Code/ch13_ex13_3.dproj new file mode 100644 index 0000000..ef87379 --- /dev/null +++ b/samples/LearningOpenCV_Code/ch13_ex13_3.dproj @@ -0,0 +1,619 @@ + + + {FD54BCD5-7861-41CA-AEE8-B45FE852906A} + 18.1 + None + ch13_ex13_3.dpr + True + Debug + Win32 + 1 + Console + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + $(BDS)\bin\delphi_PROJECTICNS.icns + $(BDS)\bin\delphi_PROJECTICON.ico + ch13_ex13_3 + System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + 1049 + None + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + .\$(Platform)\$(Config) + ..\..\bin\$(Platform) + false + false + false + false + false + + + android-support-v4.dex.jar;apk-expansion.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + DBXInterBaseDriver;DataSnapCommon;DbxCommonDriver;dbxcds;CustomIPTransport;dsnap;IndyIPServer;IndyCore;CloudService;FmxTeeUI;FireDACIBDriver;dsnapxml;bindcompfmx;RESTBackendComponents;dbrtl;FireDACCommon;bindcomp;xmlrtl;ibxpress;FireDACCommonDriver;bindengine;soaprtl;FMXTee;inet;soapmidas;RESTComponents;dbexpress;IndyIPClient;autoupgrXE5;FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;fmx;IndySystem;tethering;DataSnapClient;DataSnapProviderClient;fmxFireDAC;IndyIPCommon;DataSnapFireDAC;FireDACDBXDriver;soapserver;emsclientfiredac;rtl;DbxClientDriver;DataSnapNativeClient;IndyProtocols;bindcompdbx;emsclient;FireDAC;$(DCC_UsePackage) + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + + + true + $(MSBuildProjectName) + DBXInterBaseDriver;DataSnapCommon;DbxCommonDriver;dbxcds;CustomIPTransport;dsnap;IndyIPServer;IndyCore;CloudService;FmxTeeUI;FireDACIBDriver;dsnapxml;bindcompfmx;RESTBackendComponents;dbrtl;FireDACCommon;bindcomp;xmlrtl;ibxpress;FireDACCommonDriver;bindengine;soaprtl;FMXTee;inet;soapmidas;RESTComponents;dbexpress;IndyIPClient;FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;fmx;IndySystem;tethering;DataSnapClient;DataSnapProviderClient;fmxFireDAC;fmxase;IndyIPCommon;DataSnapFireDAC;FireDACDBXDriver;soapserver;emsclientfiredac;rtl;DbxClientDriver;DataSnapNativeClient;IndyProtocols;bindcompdbx;emsclient;FireDAC;$(DCC_UsePackage);$(DCC_UsePackage) + Base + iPhoneAndiPad + CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false + true + true + Debug + + + true + $(MSBuildProjectName) + DBXInterBaseDriver;DataSnapCommon;DbxCommonDriver;dbxcds;CustomIPTransport;dsnap;IndyIPServer;IndyCore;CloudService;FmxTeeUI;FireDACIBDriver;dsnapxml;bindcompfmx;RESTBackendComponents;dbrtl;FireDACCommon;bindcomp;xmlrtl;ibxpress;FireDACCommonDriver;bindengine;soaprtl;FMXTee;inet;soapmidas;RESTComponents;dbexpress;IndyIPClient;FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;fmx;IndySystem;tethering;DataSnapClient;DataSnapProviderClient;fmxFireDAC;fmxase;IndyIPCommon;DataSnapFireDAC;FireDACDBXDriver;soapserver;emsclientfiredac;rtl;DbxClientDriver;DataSnapNativeClient;IndyProtocols;bindcompdbx;emsclient;FireDAC;$(DCC_UsePackage);$(DCC_UsePackage) + Base + iPhoneAndiPad + CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;CFBundleResourceSpecification=ResourceRules.plist;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;FMLocalNotificationPermission=false + true + true + Debug + + + DBXInterBaseDriver;DataSnapCommon;DbxCommonDriver;dbxcds;CustomIPTransport;dsnap;IndyIPServer;IndyCore;CloudService;FmxTeeUI;FireDACIBDriver;dsnapxml;bindcompfmx;RESTBackendComponents;dbrtl;FireDACCommon;bindcomp;xmlrtl;ibxpress;FireDACCommonDriver;bindengine;soaprtl;FMXTee;inet;soapmidas;RESTComponents;dbexpress;IndyIPClient;FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;fmx;IndySystem;tethering;DataSnapClient;DataSnapProviderClient;fmxFireDAC;fmxase;IndyIPCommon;DataSnapFireDAC;FireDACDBXDriver;soapserver;emsclientfiredac;rtl;DbxClientDriver;DataSnapNativeClient;IndyProtocols;bindcompdbx;emsclient;FireDAC;$(DCC_UsePackage) + + + true + FireDACPgDriver;DBXInterBaseDriver;DataSnapServer;DataSnapCommon;DbxCommonDriver;dbxcds;CustomIPTransport;dsnap;IndyIPServer;IndyCore;CloudService;FmxTeeUI;FireDACIBDriver;IcsFmxDXE7Run;dsnapxml;IcsCommonDXE7Run;bindcompfmx;FireDACODBCDriver;RESTBackendComponents;dbrtl;FireDACCommon;bindcomp;inetdb;xmlrtl;ibxpress;FireDACCommonDriver;bindengine;soaprtl;FMXTee;FireDACMSSQLDriver;DBXInformixDriver;DataSnapServerMidas;DBXFirebirdDriver;inet;FireDACMySQLDriver;soapmidas;DBXSybaseASADriver;RESTComponents;dbexpress;IndyIPClient;FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;fmx;IndySystem;tethering;DataSnapClient;DataSnapProviderClient;fmxFireDAC;DBXOracleDriver;fmxase;IndyIPCommon;DataSnapFireDAC;FireDACDBXDriver;soapserver;inetdbxpress;FireDACASADriver;emsclientfiredac;rtl;DbxClientDriver;DataSnapNativeClient;IndyProtocols;DBXMySQLDriver;bindcompdbx;emsclient;FireDAC;fmxobj;FireDACOracleDriver;fmxdae;DataSnapIndy10ServerTransport;$(DCC_UsePackage) + + + 1033 + true + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + cxSchedulerTreeBrowserRS20;JvGlobus;JvMM;cxGridRS20;dxFireDACServerModeRS20;JvManagedThreads;NxGridRun_dxe7;dxPScxExtCommonRS20;dxPSdxLCLnkRS20;dxSkinOffice2007SilverRS20;cxPageControlRS20;dxPSdxSpreadSheetLnkRS20;FireDACPgDriver;JvCrypt;XiButtonXE4;DBXInterBaseDriver;DataSnapServer;DataSnapCommon;JvNet;dxSkinsdxBarPainterRS20;dxSkinSharpRS20;JvDotNetCtrls;DbxCommonDriver;dxLayoutControlRS20;vclimg;dxSkinSilverRS20;NxDBGridRun_dxe7;dbxcds;dxSkinsdxNavBarPainterRS20;DatasnapConnectorsFreePascal;JvXPCtrls;NxCommonDsgn_dxe7;dxPSCoreRS20;dxSkinOffice2013LightGrayRS20;vcldb;NxSheetRun_dxe7;dxPSTeeChartRS20;dxSkinOffice2013WhiteRS20;dxSkinMcSkinRS20;CustomIPTransport;NxCollectionDsgn_dxe7;dsnap;IndyIPServer;dxSkinCoffeeRS20;dxSkinGlassOceansRS20;IndyCore;dxSkinOffice2010SilverRS20;dxComnRS20;CloudService;dxFlowChartRS20;dxSkinOffice2013DarkGrayRS20;FmxTeeUI;FireDACIBDriver;dxDBXServerModeRS20;cxTreeListdxBarPopupMenuRS20;dxSkinOffice2007PinkRS20;dxSkinSpringTimeRS20;IcsFmxDXE7Run;dxPsPrVwAdvRS20;JvDB;JvRuntimeDesign;dxPScxGridLnkRS20;dxSkiniMaginaryRS20;dxSkinDevExpressDarkStyleRS20;tmsdXE7;cxSchedulerGridRS20;dxtrmdRS20;GLScene_RunTime_VCL;dsnapxml;JclDeveloperTools;FireDACDb2Driver;NxDBGridDsgn_dxe7;dxSpreadSheetRS20;dxSkinMoneyTwinsRS20;GLSS_OpenAL_VCL;dxSkinOffice2007GreenRS20;dxPScxTLLnkRS20;IcsCommonDXE7Run;cxPivotGridOLAPRS20;dxPSdxFCLnkRS20;bindcompfmx;GLS_Computing_RunTime_VCL;FireDACODBCDriver;RESTBackendComponents;dbrtl;FireDACCommon;bindcomp;inetdb;JvPluginSystem;GLS_NGD_VCL;DBXOdbcDriver;JvCmp;vclFireDAC;JvTimeFramework;xmlrtl;cxSpreadSheetRS20;ibxpress;dxSkinOffice2007BlackRS20;dxPScxSSLnkRS20;FireDACCommonDriver;bindengine;vclactnband;soaprtl;FMXTee;dxGDIPlusRS20;bindcompvcl;Jcl;vclie;cxVerticalGridRS20;cxSchedulerRS20;dxSkinBlackRS20;FireDACMSSQLDriver;DBXInformixDriver;dxSkinSummer2008RS20;Intraweb;cxBarEditItemRS20;DataSnapServerMidas;dsnapcon;DBXFirebirdDriver;tmsexdXE7;inet;dxBarRS20;cxDataRS20;dxSkinDarkSideRS20;GLSS_BASS_VCL;JvPascalInterpreter;FireDACMySQLDriver;soapmidas;vclx;dxPScxVGridLnkRS20;dxSkinLondonLiquidSkyRS20;dxCoreRS20;DBXSybaseASADriver;RESTComponents;dxPSPrVwRibbonRS20;SGXE7;dbexpress;dxPSLnksRS20;EurekaLogCore;IndyIPClient;dxSpellCheckerRS20;dxBarExtItemsRS20;office2K;autoupgrXE5;dxdbtrRS20;FireDACSqliteDriver;FireDACDSDriver;cxSchedulerRibbonStyleEventEditorRS20;DBXSqliteDriver;ZComponent;fmx;dxSkinVS2010RS20;JvDlgs;IndySystem;frxe21;TeeDB;tethering;dxPScxPCProdRS20;dxSkinXmas2008BlueRS20;vclib;dxTabbedMDIRS20;DataSnapClient;GLS_ODE_VCL;frx21;dxmdsRS20;DataSnapProviderClient;DBXSybaseASEDriver;dxdborRS20;dxPSdxDBTVLnkRS20;MetropolisUILiveTile;dxPScxSchedulerLnkRS20;dxSkinCaramelRS20;dxSkinLiquidSkyRS20;vcldsnap;dxGaugeControlRS20;GLSS_FMOD_VCL;dxSkinDevExpressStyleRS20;fmxFireDAC;cxPivotGridChartRS20;DBXDb2Driver;DBXOracleDriver;dxSkinOffice2010BlueRS20;JvCore;dcldxSkinsCoreRS20;vclribbon;cxExportRS20;dxServerModeRS20;dxSkinscxSchedulerPainterRS20;dxSkinMetropolisDarkRS20;fmxase;vcl;DBXMSSQLDriver;IndyIPCommon;CodeSiteExpressPkg;dxSkinBlueRS20;dxSkinsdxDLPainterRS20;DataSnapFireDAC;FireDACDBXDriver;dxBarExtDBItemsRS20;JvAppFrm;soapserver;dxPSDBTeeChartRS20;dxSkinOffice2010BlackRS20;IcsVclDXE7Run;inetdbxpress;dxADOServerModeRS20;dxSkinBlueprintRS20;dxSkinFoggyRS20;dxSkinSharpPlusRS20;GLS_SDL_VCL;FireDACInfxDriver;cxPivotGridRS20;JvDocking;adortl;tmswizdXE7;JvWizards;dxRibbonRS20;FireDACASADriver;dxSkinHighContrastRS20;JvHMI;dxSkinTheAsphaltWorldRS20;JvBands;NxInspectorRun_dxe7;dxBarDBNavRS20;dxSkinscxPCPainterRS20;ZDbc;emsclientfiredac;rtl;DbxClientDriver;frxTee21;dxNavBarRS20;dxSkinMetropolisRS20;ZPlain;dxDockingRS20;Tee;JclContainers;dxSkinOffice2007BlueRS20;dxSkinsdxRibbonPainterRS20;frxDB21;dxSkinValentineRS20;JvSystem;DataSnapNativeClient;svnui;JvControls;IndyProtocols;DBXMySQLDriver;dxPScxCommonRS20;dxSkinSevenClassicRS20;viTimeLineDPK;dxSkinPumpkinRS20;bindcompdbx;TeeUI;JvJans;JvPrintPreview;JvPageComps;JvStdCtrls;JvCustom;NxCommonRun_dxe7;dxSkinDarkRoomRS20;FireDACADSDriver;vcltouch;NxInspectorDsgn_dxe7;dxSkinStardustRS20;cxEditorsRS20;ZCore;emsclient;dxorgcRS20;dxPSdxDBOCLnkRS20;VCLRESTComponents;FireDAC;VclSmp;NxGridDsgn_dxe7;dxSkinsCoreRS20;GLCg_RunTime_VCL;DataSnapConnectors;dxSkinSevenRS20;cxLibraryRS20;fmxobj;NxCollectionRun_dxe7;JclVcl;OpenCV210;dxMapControlRS20;ZParseSql;tmsxlsdXE7;svn;dxWizardControlRS20;dxSkinLilianRS20;FireDACOracleDriver;fmxdae;dxPScxPivotGridLnkRS20;dxSkinWhiteprintRS20;dxPSdxOCLnkRS20;dxThemeRS20;FireDACMSAccDriver;DataSnapIndy10ServerTransport;cxTreeListRS20;dxTileControlRS20;$(DCC_UsePackage) + + + true + cxSchedulerTreeBrowserRS20;cxGridRS20;dxFireDACServerModeRS20;NxGridRun_dxe7;dxPScxExtCommonRS20;dxPSdxLCLnkRS20;dxSkinOffice2007SilverRS20;cxPageControlRS20;dxPSdxSpreadSheetLnkRS20;FireDACPgDriver;DBXInterBaseDriver;DataSnapServer;DataSnapCommon;dxSkinsdxBarPainterRS20;dxSkinSharpRS20;DbxCommonDriver;dxLayoutControlRS20;vclimg;dxSkinSilverRS20;NxDBGridRun_dxe7;dbxcds;dxSkinsdxNavBarPainterRS20;DatasnapConnectorsFreePascal;NxCommonDsgn_dxe7;dxPSCoreRS20;dxSkinOffice2013LightGrayRS20;vcldb;NxSheetRun_dxe7;dxPSTeeChartRS20;dxSkinOffice2013WhiteRS20;dxSkinMcSkinRS20;CustomIPTransport;NxCollectionDsgn_dxe7;dsnap;IndyIPServer;dxSkinCoffeeRS20;dxSkinGlassOceansRS20;IndyCore;dxSkinOffice2010SilverRS20;dxComnRS20;CloudService;dxFlowChartRS20;dxSkinOffice2013DarkGrayRS20;FmxTeeUI;FireDACIBDriver;dxDBXServerModeRS20;cxTreeListdxBarPopupMenuRS20;dxSkinOffice2007PinkRS20;dxSkinSpringTimeRS20;IcsFmxDXE7Run;dxPsPrVwAdvRS20;dxPScxGridLnkRS20;dxSkiniMaginaryRS20;dxSkinDevExpressDarkStyleRS20;tmsdXE7;cxSchedulerGridRS20;dxtrmdRS20;dsnapxml;FireDACDb2Driver;NxDBGridDsgn_dxe7;dxSpreadSheetRS20;dxSkinMoneyTwinsRS20;dxSkinOffice2007GreenRS20;dxPScxTLLnkRS20;IcsCommonDXE7Run;cxPivotGridOLAPRS20;dxPSdxFCLnkRS20;bindcompfmx;FireDACODBCDriver;RESTBackendComponents;dbrtl;FireDACCommon;bindcomp;inetdb;DBXOdbcDriver;vclFireDAC;xmlrtl;cxSpreadSheetRS20;ibxpress;dxSkinOffice2007BlackRS20;dxPScxSSLnkRS20;FireDACCommonDriver;bindengine;vclactnband;soaprtl;FMXTee;dxGDIPlusRS20;bindcompvcl;vclie;cxVerticalGridRS20;cxSchedulerRS20;dxSkinBlackRS20;FireDACMSSQLDriver;DBXInformixDriver;dxSkinSummer2008RS20;Intraweb;cxBarEditItemRS20;DataSnapServerMidas;dsnapcon;DBXFirebirdDriver;tmsexdXE7;inet;dxBarRS20;cxDataRS20;dxSkinDarkSideRS20;FireDACMySQLDriver;soapmidas;vclx;dxPScxVGridLnkRS20;dxSkinLondonLiquidSkyRS20;dxCoreRS20;DBXSybaseASADriver;RESTComponents;dxPSPrVwRibbonRS20;dbexpress;dxPSLnksRS20;IndyIPClient;dxSpellCheckerRS20;dxBarExtItemsRS20;office2K;dxdbtrRS20;FireDACSqliteDriver;FireDACDSDriver;cxSchedulerRibbonStyleEventEditorRS20;DBXSqliteDriver;ZComponent;fmx;dxSkinVS2010RS20;IndySystem;TeeDB;tethering;dxPScxPCProdRS20;dxSkinXmas2008BlueRS20;vclib;dxTabbedMDIRS20;DataSnapClient;dxmdsRS20;DataSnapProviderClient;DBXSybaseASEDriver;dxdborRS20;dxPSdxDBTVLnkRS20;MetropolisUILiveTile;dxPScxSchedulerLnkRS20;dxSkinCaramelRS20;dxSkinLiquidSkyRS20;vcldsnap;dxGaugeControlRS20;dxSkinDevExpressStyleRS20;fmxFireDAC;cxPivotGridChartRS20;DBXDb2Driver;DBXOracleDriver;dxSkinOffice2010BlueRS20;dcldxSkinsCoreRS20;vclribbon;cxExportRS20;dxServerModeRS20;dxSkinscxSchedulerPainterRS20;dxSkinMetropolisDarkRS20;fmxase;vcl;DBXMSSQLDriver;IndyIPCommon;dxSkinBlueRS20;dxSkinsdxDLPainterRS20;DataSnapFireDAC;FireDACDBXDriver;dxBarExtDBItemsRS20;soapserver;dxPSDBTeeChartRS20;dxSkinOffice2010BlackRS20;IcsVclDXE7Run;inetdbxpress;dxADOServerModeRS20;dxSkinBlueprintRS20;dxSkinFoggyRS20;dxSkinSharpPlusRS20;FireDACInfxDriver;cxPivotGridRS20;adortl;dxRibbonRS20;FireDACASADriver;dxSkinHighContrastRS20;dxSkinTheAsphaltWorldRS20;NxInspectorRun_dxe7;dxBarDBNavRS20;dxSkinscxPCPainterRS20;ZDbc;emsclientfiredac;rtl;DbxClientDriver;dxNavBarRS20;dxSkinMetropolisRS20;ZPlain;dxDockingRS20;Tee;dxSkinOffice2007BlueRS20;dxSkinsdxRibbonPainterRS20;dxSkinValentineRS20;DataSnapNativeClient;IndyProtocols;DBXMySQLDriver;dxPScxCommonRS20;dxSkinSevenClassicRS20;dxSkinPumpkinRS20;bindcompdbx;TeeUI;NxCommonRun_dxe7;dxSkinDarkRoomRS20;FireDACADSDriver;vcltouch;NxInspectorDsgn_dxe7;dxSkinStardustRS20;cxEditorsRS20;ZCore;emsclient;dxorgcRS20;dxPSdxDBOCLnkRS20;VCLRESTComponents;FireDAC;VclSmp;NxGridDsgn_dxe7;dxSkinsCoreRS20;DataSnapConnectors;dxSkinSevenRS20;cxLibraryRS20;fmxobj;NxCollectionRun_dxe7;OpenCV210;dxMapControlRS20;ZParseSql;dxWizardControlRS20;dxSkinLilianRS20;FireDACOracleDriver;fmxdae;dxPScxPivotGridLnkRS20;dxSkinWhiteprintRS20;dxPSdxOCLnkRS20;dxThemeRS20;FireDACMSAccDriver;DataSnapIndy10ServerTransport;cxTreeListRS20;dxTileControlRS20;$(DCC_UsePackage) + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + 1033 + None + false + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + + MainSource + + + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + + + + Delphi.Personality.12 + Application + + + + ch13_ex13_3.dpr + + + Microsoft Office XP Sample Automation Server Wrapper Components + + + + + + ch13_ex13_3.exe + true + + + + + true + + + + + true + + + + + true + + + + + true + + + + + true + + + + + 0 + .dll;.bpl + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + + + Contents\Resources + 1 + + + + + classes + 1 + + + + + res\drawable-xxhdpi + 1 + + + + + Contents\MacOS + 0 + + + 1 + + + Contents\MacOS + 1 + + + + + library\lib\mips + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 0 + + + 1 + + + Contents\MacOS + 1 + + + library\lib\armeabi-v7a + 1 + + + 1 + + + + + 0 + + + Contents\MacOS + 1 + .framework + + + + + 1 + + + 1 + + + 1 + + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + library\lib\armeabi + 1 + + + + + 0 + + + 1 + + + Contents\MacOS + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\drawable-normal + 1 + + + + + res\drawable-xhdpi + 1 + + + + + res\drawable-large + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable-hdpi + 1 + + + + + Contents + 1 + + + + + ..\ + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\values + 1 + + + + + res\drawable-small + 1 + + + + + res\drawable + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + + + res\drawable + 1 + + + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + 0 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 0 + .bpl + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + + + res\drawable-mdpi + 1 + + + + + res\drawable-xlarge + 1 + + + + + res\drawable-ldpi + 1 + + + + + 1 + + + 1 + + + + + + + + + + + + + False + False + False + False + False + True + False + + + 12 + + + + + diff --git a/samples/LearningOpenCV_Code/ch8_ex8_3.dpr b/samples/LearningOpenCV_Code/ch8_ex8_3.dpr new file mode 100644 index 0000000..fe511bb --- /dev/null +++ b/samples/LearningOpenCV_Code/ch8_ex8_3.dpr @@ -0,0 +1,145 @@ +(* + ***************************************************************** + 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. + ******************************************************************* +*) + +// +// Example 8-3. Finding and drawing contours on an input image +// +// +(* *************** License:************************** + Oct. 3, 2008 + Right to use this code in any way you want without warrenty, support or any guarentee of it working. + + BOOK: It would be nice if you cited it: + Learning OpenCV: Computer Vision with the OpenCV Library + by Gary Bradski and Adrian Kaehler + Published by O'Reilly Media, October 3, 2008 + + AVAILABLE AT: + http://www.amazon.com/Learning-OpenCV-Computer-Vision-Library/dp/0596516134 + Or: http://oreilly.com/catalog/9780596516130/ + ISBN-10: 0596516134 or: ISBN-13: 978-0596516130 + + OTHER OPENCV SITES: + * The source code is on sourceforge at: + http://sourceforge.net/projects/opencvlibrary/ + * The OpenCV wiki page (As of Oct 1, 2008 this is down for changing over servers, but should come back): + http://opencvlibrary.sourceforge.net/ + * An active user group is at: + http://tech.groups.yahoo.com/group/OpenCV/ + * The minutes of weekly OpenCV development meetings are at: + http://pr.willowgarage.com/wiki/OpenCV + ************************************************** *) + +program ch8_ex8_3; + +{$APPTYPE CONSOLE} +{$POINTERMATH ON} +{$R *.res} + +uses + System.SysUtils, + ocv.core_c, + ocv.highgui_c, + ocv.core.types_c, + ocv.imgproc.types_c, + ocv.imgproc_c, + ocv.utils, + ocv.legacy, + uResourcePaths; + +const + WndName = 'ch8_ex8_3'; + +Var + img_8uc1 : pIplImage = nil; + img_edge, img_8uc3: pIplImage; + storage : pCvMemStorage; + first_contour : pCvSeq; + Nc, n, k, i : Integer; + p : pCvPoint; + c : pCvSeq; + +begin + try + // Changed this a little for safer image loading and help if not + if ParamCount = 1 then + img_8uc1 := cvLoadImage(c_str(ParamStr(1)), CV_LOAD_IMAGE_GRAYSCALE); + if not Assigned(img_8uc1) then + begin + WriteLn('Example 8_3 Drawing Contours'); + WriteLn('Call is:'); + WriteLn('ch8_ex8_3 image'); + Halt; + end; + + cvNamedWindow(WndName, 1); + + img_edge := cvCreateImage(cvGetSize(img_8uc1), 8, 1); + img_8uc3 := cvCreateImage(cvGetSize(img_8uc1), 8, 3); + cvThreshold(img_8uc1, img_edge, 128, 255, CV_THRESH_BINARY); + storage := cvCreateMemStorage(); + first_contour := nil; + Nc := cvFindContours(img_edge, storage, @first_contour, sizeof(TCvContour), CV_RETR_LIST, + // Try all four values and see what happens + CV_CHAIN_APPROX_SIMPLE, cvPoint(0, 0)); + n := 0; + WriteLn('Hit any key to draw the next contour, ESC to quit'); + WriteLn('Total Contours Detected: ', Nc); + c := first_contour; + While c <> nil do + begin + cvCvtColor(img_8uc1, img_8uc3, CV_GRAY2BGR); + cvDrawContours(img_8uc3, c, CV_RGB($FF, $00, $00), // Yarg, these are defined above, but not in the book. Oops + CV_RGB($00, $00, $FF), 0, // Try different values of max_level, and see what happens + 2, 8, // + cvPoint(0, 0)); + WriteLn('Contour ', n); + cvShowImage(WndName, img_8uc3); + WriteLn(c^.total, ' elements:'); + for i := 0 to c^.total - 1 do + begin + p := CV_GET_SEQ_ELEM(sizeof(TcvPoint), c, i); + WriteLn('(', p^.x, ',', p^.y, ')'); + end; + if cvWaitKey() = 27 then + break; + Inc(n); + c := c^.h_next + end; + WriteLn('Finished all contours. Hit key to finish'); + cvCvtColor(img_8uc1, img_8uc3, CV_GRAY2BGR); + cvShowImage(WndName, img_8uc3); + cvWaitKey(0); + cvDestroyWindow(WndName); + cvReleaseImage(img_8uc1); + cvReleaseImage(img_8uc3); + cvReleaseImage(img_edge); + + except + on E: Exception do + WriteLn(E.ClassName, ': ', E.Message); + end; + +end. diff --git a/samples/LearningOpenCV_Code/ch8_ex8_3.dproj b/samples/LearningOpenCV_Code/ch8_ex8_3.dproj new file mode 100644 index 0000000..df648a3 --- /dev/null +++ b/samples/LearningOpenCV_Code/ch8_ex8_3.dproj @@ -0,0 +1,600 @@ + + + {1D57A361-9E04-4E9E-A36C-F356EA4E7D57} + 18.1 + None + ch8_ex8_3.dpr + True + Debug + Win32 + 1 + Console + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + $(BDS)\bin\delphi_PROJECTICNS.icns + $(BDS)\bin\delphi_PROJECTICON.ico + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + 1049 + None + System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + ch8_ex8_3 + .\$(Platform)\$(Config) + ..\..\bin\$(Platform) + false + false + false + false + false + + + FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;fmx;IndySystem;tethering;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapProviderClient;DbxCommonDriver;dbxcds;fmxFireDAC;CustomIPTransport;dsnap;IndyIPServer;IndyCore;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;soapserver;dsnapxml;bindcompfmx;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;ibmonitor;xmlrtl;DataSnapNativeClient;ibxpress;IndyProtocols;FireDACCommonDriver;bindcompdbx;soaprtl;bindengine;FMXTee;emsclient;FireDAC;inet;soapmidas;RESTComponents;dbexpress;IndyIPClient;$(DCC_UsePackage) + android-support-v4.dex.jar;apk-expansion.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar + $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png + $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png + + + FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;fmx;IndySystem;tethering;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapProviderClient;DbxCommonDriver;dbxcds;fmxFireDAC;CustomIPTransport;dsnap;IndyIPServer;fmxase;IndyCore;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;soapserver;dsnapxml;bindcompfmx;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;ibmonitor;xmlrtl;DataSnapNativeClient;ibxpress;IndyProtocols;FireDACCommonDriver;bindcompdbx;soaprtl;bindengine;FMXTee;emsclient;FireDAC;inet;soapmidas;RESTComponents;dbexpress;IndyIPClient;$(DCC_UsePackage) + + + FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;fmx;IndySystem;tethering;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapProviderClient;DbxCommonDriver;dbxcds;fmxFireDAC;CustomIPTransport;dsnap;IndyIPServer;fmxase;IndyCore;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;soapserver;dsnapxml;bindcompfmx;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;ibmonitor;xmlrtl;DataSnapNativeClient;ibxpress;IndyProtocols;FireDACCommonDriver;bindcompdbx;soaprtl;bindengine;FMXTee;emsclient;FireDAC;inet;soapmidas;RESTComponents;dbexpress;IndyIPClient;$(DCC_UsePackage) + + + FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;fmx;IndySystem;tethering;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapProviderClient;DbxCommonDriver;dbxcds;fmxFireDAC;CustomIPTransport;dsnap;IndyIPServer;fmxase;IndyCore;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;soapserver;dsnapxml;bindcompfmx;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;ibmonitor;xmlrtl;DataSnapNativeClient;ibxpress;IndyProtocols;FireDACCommonDriver;bindcompdbx;soaprtl;bindengine;FMXTee;emsclient;FireDAC;inet;soapmidas;RESTComponents;dbexpress;IndyIPClient;$(DCC_UsePackage) + + + true + FireDACTDataDriver;FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;FireDACPgDriver;fmx;IndySystem;tethering;DBXInterBaseDriver;DataSnapClient;DataSnapServer;DataSnapCommon;DataSnapProviderClient;DbxCommonDriver;dbxcds;fmxFireDAC;DBXOracleDriver;CustomIPTransport;dsnap;IndyIPServer;fmxase;IndyCore;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;soapserver;inetdbxpress;dsnapxml;FireDACASADriver;bindcompfmx;FireDACODBCDriver;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;inetdb;ibmonitor;xmlrtl;DataSnapNativeClient;ibxpress;IndyProtocols;DBXMySQLDriver;FireDACCommonDriver;bindcompdbx;soaprtl;bindengine;FMXTee;emsclient;FireDAC;DBXInformixDriver;FireDACMSSQLDriver;DataSnapServerMidas;DBXFirebirdDriver;inet;fmxobj;FireDACMySQLDriver;soapmidas;DBXSybaseASADriver;FireDACOracleDriver;fmxdae;RESTComponents;dbexpress;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage) + + + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + 1033 + true + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + JvGlobus;JvMM;FireDACTDataDriver;JvManagedThreads;FireDACSqliteDriver;FireDACDSDriver;frxTee22;DBXSqliteDriver;FireDACPgDriver;fmx;JvDlgs;IndySystem;JvCrypt;TeeDB;tethering;vclib;DBXInterBaseDriver;DataSnapClient;DataSnapServer;DataSnapCommon;JvNet;DataSnapProviderClient;JvDotNetCtrls;DBXSybaseASEDriver;frxe22;DbxCommonDriver;vclimg;DUnitXRuntime;dbxcds;DatasnapConnectorsFreePascal;appanalytics;JvXPCtrls;vcldb;vcldsnap;fmxFireDAC;dclFFMSource220;DBXDb2Driver;DBXOracleDriver;CustomIPTransport;JvCore;vclribbon;dsnap;IndyIPServer;fmxase;vcl;IndyCore;DBXMSSQLDriver;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;CodeSiteExpressPkg;DataSnapFireDAC;FireDACDBXDriver;JvAppFrm;soapserver;JvDB;JvRuntimeDesign;tmsdXE7;inetdbxpress;dsnapxml;FireDACInfxDriver;FireDACDb2Driver;JclDeveloperTools;JvDocking;adortl;tmswizdXE7;JvWizards;FireDACASADriver;JvHMI;frx22;bindcompfmx;JvBands;FireDACODBCDriver;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;inetdb;Tee;JclContainers;DBXOdbcDriver;ibmonitor;vclFireDAC;JvCmp;JvSystem;xmlrtl;DataSnapNativeClient;svnui;ibxpress;JvControls;JvTimeFramework;IndyProtocols;DBXMySQLDriver;FireDACCommonDriver;viTimeLineDPK;bindcompdbx;soaprtl;bindengine;vclactnband;FMXTee;TeeUI;bindcompvcl;JvStdCtrls;JvCustom;Jcl;vclie;JvJans;JvPrintPreview;JvPageComps;frxDB22;FireDACADSDriver;vcltouch;emsclient;VclSmp;FireDAC;DBXInformixDriver;FireDACMSSQLDriver;Intraweb;VCLRESTComponents;DataSnapConnectors;DataSnapServerMidas;dsnapcon;DBXFirebirdDriver;tmsexdXE7;inet;fmxobj;JclVcl;JvPascalInterpreter;FireDACMySQLDriver;soapmidas;vclx;tmsxlsdXE7;svn;DBXSybaseASADriver;FireDACOracleDriver;fmxdae;RESTComponents;FireDACMSAccDriver;dbexpress;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage) + + + true + FireDACTDataDriver;FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;FireDACPgDriver;fmx;IndySystem;TeeDB;tethering;vclib;DBXInterBaseDriver;DataSnapClient;DataSnapServer;DataSnapCommon;DataSnapProviderClient;DBXSybaseASEDriver;DbxCommonDriver;vclimg;dbxcds;DatasnapConnectorsFreePascal;appanalytics;vcldb;vcldsnap;fmxFireDAC;DBXDb2Driver;DBXOracleDriver;CustomIPTransport;vclribbon;dsnap;IndyIPServer;fmxase;vcl;IndyCore;DBXMSSQLDriver;IndyIPCommon;CloudService;FmxTeeUI;FireDACIBDriver;DataSnapFireDAC;FireDACDBXDriver;soapserver;tmsdXE7;inetdbxpress;dsnapxml;FireDACInfxDriver;FireDACDb2Driver;JclDeveloperTools;adortl;FireDACASADriver;bindcompfmx;FireDACODBCDriver;RESTBackendComponents;emsclientfiredac;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;inetdb;Tee;JclContainers;DBXOdbcDriver;ibmonitor;vclFireDAC;xmlrtl;DataSnapNativeClient;ibxpress;IndyProtocols;DBXMySQLDriver;FireDACCommonDriver;bindcompdbx;soaprtl;bindengine;vclactnband;FMXTee;TeeUI;bindcompvcl;Jcl;vclie;FireDACADSDriver;vcltouch;emsclient;VclSmp;FireDAC;DBXInformixDriver;FireDACMSSQLDriver;Intraweb;VCLRESTComponents;DataSnapConnectors;DataSnapServerMidas;dsnapcon;DBXFirebirdDriver;tmsexdXE7;inet;fmxobj;JclVcl;FireDACMySQLDriver;soapmidas;vclx;DBXSybaseASADriver;FireDACOracleDriver;fmxdae;RESTComponents;FireDACMSAccDriver;dbexpress;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage) + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + apple.jpg + None + 1033 + false + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + + MainSource + + + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + + + + Delphi.Personality.12 + Application + + + + ch8_ex8_3.dpr + + + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + + + + + + true + + + + + true + + + + + true + + + + + true + + + + + ch8_ex8_3.exe + true + + + + + 0 + .dll;.bpl + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + + + Contents\Resources + 1 + + + + + classes + 1 + + + + + Contents\MacOS + 0 + + + 1 + + + Contents\MacOS + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\drawable-xxhdpi + 1 + + + + + library\lib\mips + 1 + + + + + 1 + + + 1 + + + 0 + + + 1 + + + Contents\MacOS + 1 + + + library\lib\armeabi-v7a + 1 + + + 1 + + + + + 0 + + + Contents\MacOS + 1 + .framework + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + library\lib\armeabi + 1 + + + + + 0 + + + 1 + + + Contents\MacOS + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\drawable-normal + 1 + + + + + res\drawable-xhdpi + 1 + + + + + res\drawable-large + 1 + + + + + 1 + + + 1 + + + 1 + + + + + ..\ + 1 + + + ..\ + 1 + + + + + res\drawable-hdpi + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + Contents + 1 + + + + + ..\ + 1 + + + + + 1 + + + 1 + + + 1 + + + + + res\values + 1 + + + + + res\drawable-small + 1 + + + + + res\drawable + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + + + res\drawable + 1 + + + + + 0 + + + 0 + + + Contents\Resources\StartUp\ + 0 + + + 0 + + + 0 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 0 + .bpl + + + 1 + .dylib + + + Contents\MacOS + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + + + res\drawable-mdpi + 1 + + + + + res\drawable-xlarge + 1 + + + + + res\drawable-ldpi + 1 + + + + + 1 + + + 1 + + + + + + + + + + + + + False + False + False + False + False + True + False + + + 12 + + + + + diff --git a/samples/LearningOpenCV_Code/ch8_ex8_3.res b/samples/LearningOpenCV_Code/ch8_ex8_3.res new file mode 100644 index 0000000..6876088 Binary files /dev/null and b/samples/LearningOpenCV_Code/ch8_ex8_3.res differ diff --git a/samples/MultiDemo/MotionDetect/MotionDetect.dpr b/samples/MultiDemo/MotionDetect/MotionDetect.dpr index 5f3a9d9..3d941d9 100644 --- a/samples/MultiDemo/MotionDetect/MotionDetect.dpr +++ b/samples/MultiDemo/MotionDetect/MotionDetect.dpr @@ -38,41 +38,40 @@ uses ocv.imgproc_c, ocv.imgproc.types_c; -// {$DEFINE RECT} // {$DEFINE RECT} //- using cvBoundingRect - work correctly -{ DEFINE RECT } // - not defined RECT - using cvMinAreaRect2 + // - not defined RECT - using cvMinAreaRect2 var - storage: pCvMemStorage = nil; - capture: pCvCapture = nil; - frame: pIplImage = nil; - frame_grey: pIplImage = nil; - difference_img: pIplImage = nil; - oldframe_grey: pIplImage = nil; - contours: pCvSeq = nil; - c: pCvSeq = nil; + storage : pCvMemStorage = nil; + capture : pCvCapture = nil; + frame : pIplImage = nil; + frame_grey : pIplImage = nil; + difference_img: pIplImage = nil; + oldframe_grey : pIplImage = nil; + contours : pCvSeq = nil; + c : pCvSeq = nil; {$IFDEF RECT} rect: TCvRect; {$ELSE} rect2d: TCvBox2D; {$ENDIF} - key: integer; + key : integer; first: boolean = true; // Óäàëåíèå ìåëêèõ êîíòóðîâ function remove_small_objects(img_in: pIplImage; size: integer): pIplImage; var - img_out: pIplImage; - s_storage: pCvMemStorage; - s_contours: pCvSeq; + img_out : pIplImage; + s_storage : pCvMemStorage; + s_contours : pCvSeq; black, white: TCvScalar; - area: double; + area : double; begin - img_out := cvCloneImage(img_in); // Êëîíèðóåì èçîáðàæåíèå - s_storage := cvCreateMemStorage(0); // Ñîçäàåì õðàíèëèùå + img_out := cvCloneImage(img_in); // Êëîíèðóåì èçîáðàæåíèå + s_storage := cvCreateMemStorage(0); // Ñîçäàåì õðàíèëèùå s_contours := nil; - black := CV_RGB(0, 0, 0); // ×åðíûé öâåò - white := CV_RGB(255, 255, 255); // Áåëûé öâåò + black := CV_RGB(0, 0, 0); // ×åðíûé öâåò + white := CV_RGB(255, 255, 255); // Áåëûé öâåò s_contours := AllocMem(SizeOf(TCvSeq)); // Èùåì êîíòóðû íà èçîáðàæåíèè cvClearMemStorage(s_storage); @@ -95,9 +94,9 @@ end; begin try - capture := cvCreateCameraCapture(0); - storage := cvCreateMemStorage(0); - frame := cvQueryFrame(capture); + capture := cvCreateCameraCapture(0); + storage := cvCreateMemStorage(0); + frame := cvQueryFrame(capture); frame_grey := cvCreateImage(cvSize(frame^.width, frame^.height), IPL_DEPTH_8U, 1); while true do @@ -109,7 +108,7 @@ begin if first then begin difference_img := cvCloneImage(frame_grey); - oldframe_grey := cvCloneImage(frame_grey); + oldframe_grey := cvCloneImage(frame_grey); cvConvertScale(frame_grey, oldframe_grey, 1.0, 0.0); first := false; end; @@ -143,7 +142,7 @@ begin cvConvertScale(frame_grey, oldframe_grey, 1.0, 0.0); cvClearMemStorage(storage); contours := nil; - c := nil; + c := nil; FreeMem(contours, SizeOf(TCvSeq)); key := cvWaitKey(33); if (key = 27) then diff --git a/samples/MultiDemo/MotionDetect/MotionDetect.dproj b/samples/MultiDemo/MotionDetect/MotionDetect.dproj index a4e9878..f8e687f 100644 --- a/samples/MultiDemo/MotionDetect/MotionDetect.dproj +++ b/samples/MultiDemo/MotionDetect/MotionDetect.dproj @@ -13,16 +13,6 @@ true - - true - Base - true - - - true - Base - true - true Base @@ -43,6 +33,16 @@ Base true + + true + Base + true + + + true + Base + true + true Base @@ -65,18 +65,6 @@ Base true - - true - Cfg_2 - true - true - - - true - Cfg_2 - true - true - true Cfg_2 @@ -95,6 +83,18 @@ true true + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + $(BDS)\bin\delphi_PROJECTICNS.icns $(BDS)\bin\delphi_PROJECTICON.ico @@ -110,16 +110,6 @@ System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) false - - 1033 - System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - - - System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - true true @@ -199,6 +189,16 @@ iPhoneAndiPad $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.png + + 1033 + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + + + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + 1033 + false RELEASE;$(DCC_Define) @@ -224,6 +224,15 @@ true false + + true + + + true + + + true + .\$(Platform)\$(Config) None @@ -238,15 +247,6 @@ 1033 CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - - true - - - true - - - true - MainSource diff --git a/source/classes/ocv.cls.types.pas b/source/classes/ocv.cls.types.pas index 369e90f..136a42a 100644 --- a/source/classes/ocv.cls.types.pas +++ b/source/classes/ocv.cls.types.pas @@ -44,10 +44,7 @@ Type function _InternalData: TOpenCVClass; end; - TStringAnsiHelper = record helper for - String - function AsPAnsiChar: PAnsiChar; - end; + implementation @@ -65,11 +62,4 @@ begin Result := FData; end; -{ TStringAnsiHelper } - -function TStringAnsiHelper.AsPAnsiChar: PAnsiChar; -begin - Result := c_str(Self); -end; - end. diff --git a/source/classes/readme.txt b/source/classes/readme.txt new file mode 100644 index 0000000..e08774f --- /dev/null +++ b/source/classes/readme.txt @@ -0,0 +1,34 @@ +objdetect.hpp + class CascadeClassifier - not fully +highgui.hpp + class VideoCapture + procedure namedWindow + procedure destroyWindow + procedure destroyAllWindows + function startWindowThread + function waitKey + procedure imshow + procedure resizeWindow + procedure moveWindow + procedure setWindowProperty + function getWindowProperty + function createTrackbar + function imread +core.hpp + class Mat + function setBreakOnError + function redirectError + procedure setNumThreads + function getNumThreads + function getThreadNum + function getTickCount + function getTickFrequency + function getCPUTickCount + function checkHardwareSupport + function getNumberOfCPUs + function fastMalloc + procedure fastFree + procedure setUseOptimized + function useOptimized +contrib.hpp + class FaceRecognizer \ No newline at end of file diff --git a/source/component/Delphi 10.1 Berlin/dclCommonOpenCV310.dproj b/source/component/Delphi 10.1 Berlin/dclCommonOpenCV310.dproj index 685a002..9fc13a6 100644 --- a/source/component/Delphi 10.1 Berlin/dclCommonOpenCV310.dproj +++ b/source/component/Delphi 10.1 Berlin/dclCommonOpenCV310.dproj @@ -207,16 +207,7 @@ true - - - 0 - .dll;.bpl - - - 1 - .dylib - - + Contents\Resources @@ -528,7 +519,16 @@ 1 - + + + 0 + .dll;.bpl + + + 1 + .dylib + + diff --git a/source/component/Delphi 10.1 Berlin/dclFFMSource310.dproj b/source/component/Delphi 10.1 Berlin/dclFFMSource310.dproj index 33e5ef3..5bf0b85 100644 --- a/source/component/Delphi 10.1 Berlin/dclFFMSource310.dproj +++ b/source/component/Delphi 10.1 Berlin/dclFFMSource310.dproj @@ -203,7 +203,16 @@ true - + + + 0 + .dll;.bpl + + + 1 + .dylib + + Contents\Resources @@ -515,16 +524,7 @@ 1 - - - 0 - .dll;.bpl - - - 1 - .dylib - - + diff --git a/source/component/Delphi 10.1 Berlin/dclFMXOpenCV310.dproj b/source/component/Delphi 10.1 Berlin/dclFMXOpenCV310.dproj index 5d03dbe..7ddda0a 100644 --- a/source/component/Delphi 10.1 Berlin/dclFMXOpenCV310.dproj +++ b/source/component/Delphi 10.1 Berlin/dclFMXOpenCV310.dproj @@ -252,7 +252,16 @@ true - + + + 0 + .dll;.bpl + + + 1 + .dylib + + Contents\Resources @@ -564,16 +573,7 @@ 1 - - - 0 - .dll;.bpl - - - 1 - .dylib - - + diff --git a/source/component/Delphi 10.1 Berlin/dclVCLOpenCV310.dproj b/source/component/Delphi 10.1 Berlin/dclVCLOpenCV310.dproj index fad5ff0..0337752 100644 --- a/source/component/Delphi 10.1 Berlin/dclVCLOpenCV310.dproj +++ b/source/component/Delphi 10.1 Berlin/dclVCLOpenCV310.dproj @@ -186,7 +186,16 @@ true - + + + 0 + .dll;.bpl + + + 1 + .dylib + + Contents\Resources @@ -498,16 +507,7 @@ 1 - - - 0 - .dll;.bpl - - - 1 - .dylib - - + diff --git a/source/ocv.calib3d_c.pas b/source/ocv.calib3d_c.pas index 2b19dbe..94174c8 100644 --- a/source/ocv.calib3d_c.pas +++ b/source/ocv.calib3d_c.pas @@ -46,9 +46,10 @@ ************************************************************************************************* *) -{$I OpenCV.inc} unit ocv.calib3d_c; +{$I OpenCV.inc} + interface uses diff --git a/source/ocv.tracking_c.pas b/source/ocv.tracking_c.pas index 82db789..ef53484 100644 --- a/source/ocv.tracking_c.pas +++ b/source/ocv.tracking_c.pas @@ -46,9 +46,10 @@ ************************************************************************************************* *) -{$I OpenCV.inc} unit ocv.tracking_c; +{$I OpenCV.inc} + interface uses ocv.core.types_c, ocv.imgproc.types_c; diff --git a/source/ocv.utils.pas b/source/ocv.utils.pas index 6a1f019..5abf1d0 100644 --- a/source/ocv.utils.pas +++ b/source/ocv.utils.pas @@ -88,6 +88,12 @@ function CropIplImage(const src: PIplImage; const roi: TCvRect): PIplImage; procedure ocvRGBToHSV(const R, G, B: byte; out _H, _S, _V: byte); procedure ocvHSVToRGB(const _H, _S, _V: byte; out _R, _G, _B: byte); +Type + TStringAnsiHelper = record helper for + String + function AsPAnsiChar: PAnsiChar; + end; + implementation uses @@ -98,6 +104,13 @@ uses {$ENDIF} ocv.core_c, System.Math; +{ TStringAnsiHelper } + +function TStringAnsiHelper.AsPAnsiChar: PAnsiChar; +begin + Result := c_str(Self); +end; + function BitmapToIplImage(const bitmap: {$IFDEF DELPHIXE2_UP}Vcl.Graphics.TBitmap{$ELSE}Graphics.TBitmap{$ENDIF}): PIplImage; Var @@ -204,10 +217,8 @@ begin for j := 0 to _Grab^.Width - 1 do begin App[_Grab^.Width * 3 * (_Grab^.Height - i - 1) + j * 3] := PByte(_Grab^.ImageData)[_Grab^.Width * (i) + j]; - App[_Grab^.Width * 3 * (_Grab^.Height - i - 1) + j * 3 + 1] := PByte(_Grab^.ImageData) - [_Grab^.Width * (i) + j]; - App[_Grab^.Width * 3 * (_Grab^.Height - i - 1) + j * 3 + 2] := PByte(_Grab^.ImageData) - [_Grab^.Width * (i) + j]; + App[_Grab^.Width * 3 * (_Grab^.Height - i - 1) + j * 3 + 1] := PByte(_Grab^.ImageData)[_Grab^.Width * (i) + j]; + App[_Grab^.Width * 3 * (_Grab^.Height - i - 1) + j * 3 + 2] := PByte(_Grab^.ImageData)[_Grab^.Width * (i) + j]; end; end; @@ -217,8 +228,7 @@ begin begin for i := 0 to _Grab^.Height - 1 do begin - CopyMemory(App + _Grab^.Width * 3 * (_Grab^.Height - i - 1), PByte(_Grab^.ImageData) + _Grab^.Width * 3 * i, - _Grab^.Width * 3); + CopyMemory(App + _Grab^.Width * 3 * (_Grab^.Height - i - 1), PByte(_Grab^.ImageData) + _Grab^.Width * 3 * i, _Grab^.Width * 3); // Êîïèðóåì ïàìÿòü end; @@ -389,8 +399,7 @@ begin if (not Assigned(img)) or (not Assigned(img^.ImageData)) then Exit(false); - isrgb := ('R' = upcase(img^.colorModel[0])) and ('G' = upcase(img^.colorModel[1])) and - ('B' = upcase(img^.colorModel[2])); + isrgb := ('R' = upcase(img^.colorModel[0])) and ('G' = upcase(img^.colorModel[1])) and ('B' = upcase(img^.colorModel[2])); isgray := 'G' = upcase(img^.colorModel[0]); if (not isgray) and (not isrgb) then @@ -429,15 +438,14 @@ begin // Stretch the image to fit the rectangle iResult := StretchDIBits(dc, rect.left, rect.top, {$IFDEF DELPHIXE2_UP}rect.Width{$ELSE}rect.Right - rect.left{$ENDIF}, -{$IFDEF DELPHIXE2_UP}rect.Height{$ELSE}rect.Bottom - rect.top{$ENDIF}, 0, 0, img^.Width, img^.Height, img^.ImageData, - _dibhdr, DIB_RGB_COLORS, SRCCOPY); +{$IFDEF DELPHIXE2_UP}rect.Height{$ELSE}rect.Bottom - rect.top{$ENDIF}, 0, 0, img^.Width, img^.Height, img^.ImageData, _dibhdr, + DIB_RGB_COLORS, SRCCOPY); Result := (iResult > 0); // and (iResult <> GDI_ERROR); end else begin // Draw without scaling - iResult := SetDIBitsToDevice(dc, rect.left, rect.top, img^.Width, img^.Height, 0, 0, 0, img^.Height, img^.ImageData, - _dibhdr, DIB_RGB_COLORS); + iResult := SetDIBitsToDevice(dc, rect.left, rect.top, img^.Width, img^.Height, 0, 0, 0, img^.Height, img^.ImageData, _dibhdr, DIB_RGB_COLORS); Result := (iResult > 0); // and (iResult <> GDI_ERROR); end; end; @@ -575,7 +583,8 @@ begin H := 2 + (B - R) / Range; 2: H := 4 + (R - G) / Range; - else H:=0; + else + H := 0; end; S := Range / rgb[MaxIndex]; V := rgb[MaxIndex];