Merge branch 'master' of github.com:Laex/Delphi-OpenCV

Conflicts:
	samples/Components/cCameraCapture/cCameraCapture.res
	samples/Components/cCameraCapture/uMainForm.dfm
	samples/Components/cFFmpegIPCamSource/cFFmpegIPCamSource.res
	source/component/Delphi20/dclOpenCV200.res
This commit is contained in:
Laentir Valetov 2014-05-23 22:23:12 +04:00
commit 492af1886f
35 changed files with 1064 additions and 157 deletions

1
.gitignore vendored
View File

@ -36,3 +36,4 @@ lib
*.rsm
*.local
*.identcache
*.cmd

BIN
Bin/Win32/SDL.dll Normal file

Binary file not shown.

BIN
Bin/Win32/avcodec-55.dll Normal file

Binary file not shown.

BIN
Bin/Win32/avdevice-55.dll Normal file

Binary file not shown.

BIN
Bin/Win32/avfilter-4.dll Normal file

Binary file not shown.

BIN
Bin/Win32/avformat-55.dll Normal file

Binary file not shown.

BIN
Bin/Win32/avutil-52.dll Normal file

Binary file not shown.

BIN
Bin/Win32/ffplay.exe Normal file

Binary file not shown.

BIN
Bin/Win32/postproc-52.dll Normal file

Binary file not shown.

BIN
Bin/Win32/swresample-0.dll Normal file

Binary file not shown.

BIN
Bin/Win32/swscale-2.dll Normal file

Binary file not shown.

View File

@ -24,6 +24,7 @@ Unzip it to a convenient directory, thus get the following directory structure.<
Add the search path for the modules of the project in Delphi IDE (Tools-Options-Delphi Options-Library-Library path)
```
<PROJECT_ROOT>\source
<PROJECT_ROOT>\source\utils
<PROJECT_ROOT>\source\component
<PROJECT_ROOT>\resource\facedetectxml
```
@ -32,6 +33,7 @@ Additionally, you can specify the path to the library header files FFMPEG
```
<PROJECT_ROOT>\source\ffmpeg
<PROJECT_ROOT>\source\sdl
<PROJECT_ROOT>\source\opengl
```
Examples of using FFMPEG library header files are in the
```

View File

@ -9,6 +9,9 @@
<Projects Include="cMatchTemplate\cMatchTemplate.dproj">
<Dependencies/>
</Projects>
<Projects Include="cFFmpegIPCamSource\cFFmpegIPCamSource.dproj">
<Dependencies/>
</Projects>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Default.Personality.12</Borland.Personality>
@ -35,14 +38,23 @@
<Target Name="cMatchTemplate:Make">
<MSBuild Projects="cMatchTemplate\cMatchTemplate.dproj" Targets="Make"/>
</Target>
<Target Name="cFFmpegIPCamSource">
<MSBuild Projects="cFFmpegIPCamSource\cFFmpegIPCamSource.dproj"/>
</Target>
<Target Name="cFFmpegIPCamSource:Clean">
<MSBuild Projects="cFFmpegIPCamSource\cFFmpegIPCamSource.dproj" Targets="Clean"/>
</Target>
<Target Name="cFFmpegIPCamSource:Make">
<MSBuild Projects="cFFmpegIPCamSource\cFFmpegIPCamSource.dproj" Targets="Make"/>
</Target>
<Target Name="Build">
<CallTarget Targets="cCameraCapture;cMatchTemplate"/>
<CallTarget Targets="cCameraCapture;cMatchTemplate;cFFmpegIPCamSource"/>
</Target>
<Target Name="Clean">
<CallTarget Targets="cCameraCapture:Clean;cMatchTemplate:Clean"/>
<CallTarget Targets="cCameraCapture:Clean;cMatchTemplate:Clean;cFFmpegIPCamSource:Clean"/>
</Target>
<Target Name="Make">
<CallTarget Targets="cCameraCapture:Make;cMatchTemplate:Make"/>
<CallTarget Targets="cCameraCapture:Make;cMatchTemplate:Make;cFFmpegIPCamSource:Make"/>
</Target>
<Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/>
</Project>

View File

@ -5,7 +5,7 @@
<FrameworkType>VCL</FrameworkType>
<MainSource>cCameraCapture.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<Config Condition="'$(Config)'==''">Release</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>3</TargetedPlatforms>
<AppType>Application</AppType>

View File

@ -5,7 +5,7 @@
<FrameworkType>VCL</FrameworkType>
<MainSource>cFFmpegIPCamSource.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<Config Condition="'$(Config)'==''">Release</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>3</TargetedPlatforms>
<AppType>Application</AppType>

344
source/OpenCV.inc Normal file
View File

@ -0,0 +1,344 @@
{$B-}
// Check IDE version
{$IFDEF FPC}
{$DEFINE VER5P}
{$DEFINE VER6P}
{$ENDIF}
{$IFDEF VER130} { Delphi 5, C++ Builder 5 }
{$DEFINE VER5}
{$DEFINE VER5P}
{$IFDEF BCB}
{$DEFINE CB5}
{$ObjExportAll On}
{$ELSE}
{$DEFINE D5}
{$ENDIF}
{$ENDIF}
{$IFDEF VER140} { Delphi 6, C++ Builder 6 }
{$DEFINE VER6}
{$DEFINE VER5P}
{$DEFINE VER6P}
{$IFDEF BCB}
{$DEFINE CB6}
{$ObjExportAll On}
{$ELSE}
{$DEFINE D6}
{$ENDIF}
{$ENDIF}
{$IFDEF VER150} { Delphi 7 }
{$IFNDEF BCB}
{$DEFINE D7}
{$DEFINE VER7}
{$DEFINE VER5P}
{$DEFINE VER6P}
{$DEFINE VER7P}
{$ENDIF}
{$ENDIF}
{$IFDEF VER160} { Delphi 8 }
{$DEFINE D8}
{$DEFINE VER8}
{$DEFINE VER5P}
{$DEFINE VER6P}
{$DEFINE VER7P}
{$DEFINE VER8P}
{$ENDIF}
{$IFDEF VER170} { Delphi 2005 }
{$DEFINE D9}
{$DEFINE VER9}
{$DEFINE VER5P}
{$DEFINE VER6P}
{$DEFINE VER7P}
{$DEFINE VER8P}
{$DEFINE VER9P}
{$ENDIF}
{$IFDEF VER180} { Delphi 2006 }
{$IFNDEF VER185} { not Delphi 2007 Spacely}
{$DEFINE D10}
{$DEFINE VER10}
{$DEFINE VER5P}
{$DEFINE VER6P}
{$DEFINE VER7P}
{$DEFINE VER8P}
{$DEFINE VER9P}
{$DEFINE VER10P}
{$ENDIF}
{$ENDIF}
{$IFDEF VER185} { Delphi 2007 Spacely}
{$DEFINE D11}
{$ENDIF}
{$IFDEF VER190} { Delphi 2007 Highlander}
{$DEFINE D11}
{$ENDIF}
{$IFDEF D11}
{$DEFINE VER11}
{$DEFINE VER5P}
{$DEFINE VER6P}
{$DEFINE VER7P}
{$DEFINE VER8P}
{$DEFINE VER9P}
{$DEFINE VER10P}
{$DEFINE VER11P}
{$ENDIF}
{$IFDEF VER200} { Delphi 2009 }
{$DEFINE D12}
{$DEFINE VER12}
{$DEFINE VER5P}
{$DEFINE VER6P}
{$DEFINE VER7P}
{$DEFINE VER8P}
{$DEFINE VER9P}
{$DEFINE VER10P}
{$DEFINE VER11P}
{$DEFINE VER12P}
{$ENDIF}
{$IFDEF VER210} { Delphi 2010 }
{$DEFINE D14}
{$DEFINE VER14}
{$DEFINE VER5P}
{$DEFINE VER6P}
{$DEFINE VER7P}
{$DEFINE VER8P}
{$DEFINE VER9P}
{$DEFINE VER10P}
{$DEFINE VER11P}
{$DEFINE VER12P}
{$DEFINE VER14P}
{$ENDIF}
{$IFDEF VER220} { Delphi XE }
{$DEFINE D15}
{$DEFINE VER15}
{$DEFINE VER5P}
{$DEFINE VER6P}
{$DEFINE VER7P}
{$DEFINE VER8P}
{$DEFINE VER9P}
{$DEFINE VER10P}
{$DEFINE VER11P}
{$DEFINE VER12P}
{$DEFINE VER14P}
{$DEFINE VER15P}
{$ENDIF}
{$IFDEF VER230} { Delphi XE2 }
{$DEFINE D16}
{$DEFINE VER16}
{$DEFINE VER5P}
{$DEFINE VER6P}
{$DEFINE VER7P}
{$DEFINE VER8P}
{$DEFINE VER9P}
{$DEFINE VER10P}
{$DEFINE VER11P}
{$DEFINE VER12P}
{$DEFINE VER14P}
{$DEFINE VER15P}
{$DEFINE VER16P}
{$ENDIF}
{$IFDEF VER240} { Delphi XE3 }
{$DEFINE D17}
{$DEFINE VER17}
{$DEFINE VER5P}
{$DEFINE VER6P}
{$DEFINE VER7P}
{$DEFINE VER8P}
{$DEFINE VER9P}
{$DEFINE VER10P}
{$DEFINE VER11P}
{$DEFINE VER12P}
{$DEFINE VER14P}
{$DEFINE VER15P}
{$DEFINE VER16P}
{$DEFINE VER17P}
{$ENDIF}
{$IFDEF VER250} { Delphi XE4 }
{$DEFINE D18}
{$DEFINE VER18}
{$DEFINE VER5P}
{$DEFINE VER6P}
{$DEFINE VER7P}
{$DEFINE VER8P}
{$DEFINE VER9P}
{$DEFINE VER10P}
{$DEFINE VER11P}
{$DEFINE VER12P}
{$DEFINE VER14P}
{$DEFINE VER15P}
{$DEFINE VER16P}
{$DEFINE VER17P}
{$DEFINE VER18P}
{$ENDIF}
{$IFDEF VER260} { Delphi XE5 }
{$DEFINE D19}
{$DEFINE VER19}
{$DEFINE VER5P}
{$DEFINE VER6P}
{$DEFINE VER7P}
{$DEFINE VER8P}
{$DEFINE VER9P}
{$DEFINE VER10P}
{$DEFINE VER11P}
{$DEFINE VER12P}
{$DEFINE VER14P}
{$DEFINE VER15P}
{$DEFINE VER16P}
{$DEFINE VER17P}
{$DEFINE VER18P}
{$DEFINE VER19P}
{$ENDIF}
{$IFDEF VER270} { Delphi XE6 }
{$DEFINE D20}
{$DEFINE VER20}
{$DEFINE VER5P}
{$DEFINE VER6P}
{$DEFINE VER7P}
{$DEFINE VER8P}
{$DEFINE VER9P}
{$DEFINE VER10P}
{$DEFINE VER11P}
{$DEFINE VER12P}
{$DEFINE VER14P}
{$DEFINE VER15P}
{$DEFINE VER16P}
{$DEFINE VER17P}
{$DEFINE VER18P}
{$DEFINE VER19P}
{$DEFINE VER20P}
{$ENDIF}
// End IDE version
{$IFDEF CPU64}
{$DEFINE CPUX64} { assembler for x64 - Lazarus compatibility }
{$ENDIF}
{$IFDEF CPU86}
{$DEFINE CPUX86} { assembler for x86 - Lazarus compatibility }
{$ENDIF}
{$IFDEF IOS}
{$DEFINE MOBILE}
{$ENDIF}
{$IFDEF ANDROID}
{$DEFINE MOBILE}
{$ENDIF}
{$IFDEF MOBILE}
{$DEFINE PUREPASCAL}
{$ENDIF}
{$IFDEF CPUARM}
{$DEFINE PUREPASCAL}
{$ENDIF}
{$IFDEF CLR}
{$DEFINE PUREPASCAL}
{$ENDIF}
{$IFDEF FPC}
{$IFDEF IPHONESIM}
{$DEFINE PUREPASCAL}
{$ENDIF}
{$IFNDEF PUREPASCAL}
{$ASMMODE INTEL}
{$ENDIF}
{$MODE DELPHI}
{$INTERFACES COM}
{$ENDIF}
{$IFDEF WIN32}
{$DEFINE MSWINDOWS}
{$DEFINE WIN32_64}
{$ENDIF}
{$IFDEF WIN64}
{$DEFINE MSWINDOWS}
{$DEFINE WIN32_64}
{$ENDIF}
{$IFDEF CLR}
{$DEFINE MSWINDOWS}
{$ENDIF}
{$IFDEF DARWIN}
{$DEFINE MACOS}
{$ENDIF}
{$IFNDEF NOINLINE}
{$IFDEF FPC}
{$DEFINE USE_INLINE}
{$ENDIF}
{$IFDEF VER9P}
{$DEFINE USE_INLINE}
{$ENDIF}
{$ENDIF}
{$IFDEF VER7P}
{$WARN UNSAFE_TYPE OFF}
{$WARN UNSAFE_CODE OFF}
{$WARN UNSAFE_CAST OFF}
{$ENDIF}
{$IFDEF VER6P}
{$WARN SYMBOL_PLATFORM OFF}
{$WARN SYMBOL_DEPRECATED OFF}
{$WARN UNIT_PLATFORM OFF}
{$WARN UNIT_DEPRECATED OFF}
{$ENDIF}
{$IFNDEF VER6P}
// Delphi5, CBuilder5 - UTF8 functions is not implemented
{$DEFINE UTF8}
{$ENDIF}
{$IFNDEF CLR}
{$IFDEF VER7P}
{$DEFINE HAVE_COMPRESS} // ZLib build in Delphi
{$ENDIF}
{$ENDIF}
{$IFDEF CLR}
{$DEFINE IS_UNICODE}
{$ENDIF}
{$IFDEF VER12P}
{$DEFINE IS_UNICODE}
{$ENDIF}
{$IFNDEF CLR}
{$IFNDEF FPC}
{$IFNDEF PUREPASCAL}
{$IFNDEF CPUX64}
{$DEFINE UseASM} // use Assembler optimated core
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$IFDEF NEXTGEN}
{$ZEROBASEDSTRINGS OFF}
{$ENDIF}
{$IFNDEF VER16P}
{$IFNDEF CLR}
{$DEFINE EXTENDEDIS10BYTES}
{$ENDIF}
{$ENDIF}
{$IFDEF VER16}
{$IFNDEF CPUX64}
{$DEFINE EXTENDEDIS10BYTES}
{$ENDIF}
{$ENDIF}
{$DEFINE DYNAMIC_LINKING}

View File

@ -0,0 +1,45 @@
-$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
-cg
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
-H+
-W+
-M
-$M16384,1048576
-K$00400000
-N"."
-LE"c:\program files (x86)\borland\delphi7\Projects\Bpl"
-LN"."
-U"..\;..\..\;..\..\utils;..\..\..\resource\facedetectxml"
-O"..\;..\..\;..\..\utils;..\..\..\resource\facedetectxml"
-I"..\;..\..\;..\..\utils;..\..\..\resource\facedetectxml"
-R"..\;..\..\;..\..\utils;..\..\..\resource\facedetectxml"
-DRELEASE
-Z
-w-UNSAFE_TYPE
-w-UNSAFE_CODE
-w-UNSAFE_CAST

View File

@ -0,0 +1,153 @@
[FileVersion]
Version=7.0
[Compiler]
A=8
B=0
C=1
D=0
E=0
F=0
G=1
H=1
I=1
J=0
K=0
L=0
M=0
N=1
O=1
P=1
Q=0
R=0
S=0
T=0
U=0
V=1
W=0
X=1
Y=0
Z=1
ShowHints=1
ShowWarnings=1
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
NamespacePrefix=
SymbolDeprecated=1
SymbolLibrary=1
SymbolPlatform=1
UnitLibrary=1
UnitPlatform=1
UnitDeprecated=1
HResultCompat=1
HidingMember=1
HiddenVirtual=1
Garbage=1
BoundsError=1
ZeroNilCompat=1
StringConstTruncated=1
ForLoopVarVarPar=1
TypedConstVarPar=1
AsgToTypedConst=1
CaseLabelRange=1
ForVariable=1
ConstructingAbstract=1
ComparisonFalse=1
ComparisonTrue=1
ComparingSignedUnsigned=1
CombiningSignedUnsigned=1
UnsupportedConstruct=1
FileOpen=1
FileOpenUnitSrc=1
BadGlobalSymbol=1
DuplicateConstructorDestructor=1
InvalidDirective=1
PackageNoLink=1
PackageThreadVar=1
ImplicitImport=1
HPPEMITIgnored=1
NoRetVal=1
UseBeforeDef=1
ForLoopVarUndef=1
UnitNameMismatch=1
NoCFGFileFound=1
MessageDirective=1
ImplicitVariants=1
UnicodeToLocale=1
LocaleToUnicode=1
ImagebaseMultiple=1
SuspiciousTypecast=1
PrivatePropAccessor=1
UnsafeType=0
UnsafeCode=0
UnsafeCast=0
[Linker]
MapFile=0
OutputObjs=0
ConsoleApp=1
DebugInfo=0
RemoteSymbols=0
MinStackSize=16384
MaxStackSize=1048576
ImageBase=4194304
ExeDescription=OpenCV Component
[Directories]
OutputDir=
UnitOutputDir=.
PackageDLLOutputDir=
PackageDCPOutputDir=.
SearchPath=..\;..\..\;..\..\utils;..\..\..\resource\facedetectxml
Packages=
Conditionals=RELEASE
DebugSourceDirs=
UsePackages=0
[Parameters]
RunParams=
HostApplication=
Launcher=
UseLauncher=0
DebugCWD=
[Language]
ActiveLang=
ProjectLang=
RootDir=
[Version Info]
IncludeVerInfo=1
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1033
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=OpenCV Component
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=OpenCV Component
ProductVersion=1.0.0.0
[HistoryLists\hlConditionals]
Count=1
Item0=RELEASE
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
Count=4
Item0=..\;..\..\;..\..\utils;..\..\..\resource\facedetectxml
Item1=..\;..\..\;..\..\utils
Item2=..\;..\..\
Item3=..\;..\..\;..\..\include;..\..\include\calib3d;..\..\include\core;..\..\include\features2d;..\..\include\highgui;..\..\include\imgproc;..\..\include\legacy;..\..\include\ml;..\..\include\nonfree;..\..\include\objdetect;..\..\include\video
[HistoryLists\hlUnitOutputDirectory]
Count=1
Item0=.
[HistoryLists\hlDCPOutput]
Count=1
Item0=.

View File

@ -0,0 +1,40 @@
package OpenCV70;
{$R *.res}
{$ALIGN 8}
{$ASSERTIONS ON}
{$BOOLEVAL OFF}
{$DEBUGINFO OFF}
{$EXTENDEDSYNTAX ON}
{$IMPORTEDDATA ON}
{$IOCHECKS ON}
{$LOCALSYMBOLS OFF}
{$LONGSTRINGS ON}
{$OPENSTRINGS ON}
{$OPTIMIZATION ON}
{$OVERFLOWCHECKS OFF}
{$RANGECHECKS OFF}
{$REFERENCEINFO OFF}
{$SAFEDIVIDE OFF}
{$STACKFRAMES OFF}
{$TYPEDADDRESS OFF}
{$VARSTRINGCHECKS ON}
{$WRITEABLECONST OFF}
{$MINENUMSIZE 1}
{$IMAGEBASE $400000}
{$DESCRIPTION 'OpenCV Component'}
{$RUNONLY}
{$IMPLICITBUILD OFF}
{$DEFINE RELEASE}
requires
rtl,
vcl;
contains
uOCVImageOperation in '..\uOCVImageOperation.pas',
uOCVTypes in '..\uOCVTypes.pas',
uOCVSource in '..\uOCVSource.pas',
uOCVView in '..\uOCVView.pas';
end.

Binary file not shown.

View File

@ -0,0 +1,45 @@
-$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
-cg
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
-H+
-W+
-M
-$M16384,1048576
-K$00400000
-N"."
-LE"c:\program files (x86)\borland\delphi7\Projects\Bpl"
-LN"."
-U"..\;..\..\;..\..\utils"
-O"..\;..\..\;..\..\utils"
-I"..\;..\..\;..\..\utils"
-R"..\;..\..\;..\..\utils"
-DRELEASE
-Z
-w-UNSAFE_TYPE
-w-UNSAFE_CODE
-w-UNSAFE_CAST

View File

@ -0,0 +1,151 @@
[FileVersion]
Version=7.0
[Compiler]
A=8
B=0
C=1
D=0
E=0
F=0
G=1
H=1
I=1
J=0
K=0
L=0
M=0
N=1
O=1
P=1
Q=0
R=0
S=0
T=0
U=0
V=1
W=0
X=1
Y=0
Z=1
ShowHints=1
ShowWarnings=1
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
NamespacePrefix=
SymbolDeprecated=1
SymbolLibrary=1
SymbolPlatform=1
UnitLibrary=1
UnitPlatform=1
UnitDeprecated=1
HResultCompat=1
HidingMember=1
HiddenVirtual=1
Garbage=1
BoundsError=1
ZeroNilCompat=1
StringConstTruncated=1
ForLoopVarVarPar=1
TypedConstVarPar=1
AsgToTypedConst=1
CaseLabelRange=1
ForVariable=1
ConstructingAbstract=1
ComparisonFalse=1
ComparisonTrue=1
ComparingSignedUnsigned=1
CombiningSignedUnsigned=1
UnsupportedConstruct=1
FileOpen=1
FileOpenUnitSrc=1
BadGlobalSymbol=1
DuplicateConstructorDestructor=1
InvalidDirective=1
PackageNoLink=1
PackageThreadVar=1
ImplicitImport=1
HPPEMITIgnored=1
NoRetVal=1
UseBeforeDef=1
ForLoopVarUndef=1
UnitNameMismatch=1
NoCFGFileFound=1
MessageDirective=1
ImplicitVariants=1
UnicodeToLocale=1
LocaleToUnicode=1
ImagebaseMultiple=1
SuspiciousTypecast=1
PrivatePropAccessor=1
UnsafeType=0
UnsafeCode=0
UnsafeCast=0
[Linker]
MapFile=0
OutputObjs=0
ConsoleApp=1
DebugInfo=0
RemoteSymbols=0
MinStackSize=16384
MaxStackSize=1048576
ImageBase=4194304
ExeDescription=OpenCV Component
[Directories]
OutputDir=
UnitOutputDir=.
PackageDLLOutputDir=
PackageDCPOutputDir=.
SearchPath=..\;..\..\;..\..\utils
Packages=
Conditionals=RELEASE
DebugSourceDirs=
UsePackages=0
[Parameters]
RunParams=
HostApplication=
Launcher=
UseLauncher=0
DebugCWD=
[Language]
ActiveLang=
ProjectLang=
RootDir=
[Version Info]
IncludeVerInfo=1
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1033
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=OpenCV Component
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=OpenCV Component
ProductVersion=1.0.0.0
[HistoryLists\hlConditionals]
Count=1
Item0=RELEASE
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
Count=2
Item0=..\;..\..\;..\..\utils
Item1=..\;..\..\;..\..\include;..\..\include\calib3d;..\..\include\core;..\..\include\features2d;..\..\include\highgui;..\..\include\imgproc;..\..\include\legacy;..\..\include\ml;..\..\include\nonfree;..\..\include\objdetect;..\..\include\video
[HistoryLists\hlUnitOutputDirectory]
Count=1
Item0=.
[HistoryLists\hlDCPOutput]
Count=1
Item0=.

View File

@ -0,0 +1,41 @@
package dclOpenCV70;
{$R *.res}
{$R '..\OpenCV.dcr'}
{$ALIGN 8}
{$ASSERTIONS ON}
{$BOOLEVAL OFF}
{$DEBUGINFO OFF}
{$EXTENDEDSYNTAX ON}
{$IMPORTEDDATA ON}
{$IOCHECKS ON}
{$LOCALSYMBOLS OFF}
{$LONGSTRINGS ON}
{$OPENSTRINGS ON}
{$OPTIMIZATION ON}
{$OVERFLOWCHECKS OFF}
{$RANGECHECKS OFF}
{$REFERENCEINFO OFF}
{$SAFEDIVIDE OFF}
{$STACKFRAMES OFF}
{$TYPEDADDRESS OFF}
{$VARSTRINGCHECKS ON}
{$WRITEABLECONST OFF}
{$MINENUMSIZE 1}
{$IMAGEBASE $400000}
{$DESCRIPTION 'OpenCV Component'}
{$DESIGNONLY}
{$IMPLICITBUILD OFF}
{$DEFINE RELEASE}
requires
OpenCV70,
rtl,
vcl,
designide;
contains
uOCVIOProperties in '..\uOCVIOProperties.pas',
uOCVRegister in '..\uOCVRegister.pas';
end.

Binary file not shown.

View File

@ -29,7 +29,7 @@ unit uOCVImageOperation;
interface
uses
{$IFDEF VER6P}
{$IFDEF VER15P}
Winapi.Windows,
Vcl.Graphics,
System.SysUtils,
@ -47,12 +47,21 @@ uses
Types,
{$ENDIF VER5}
ZLib,
{$ENDIF VER6P}
{$ENDIF VER15P}
uOCVTypes,
ocv.objdetect_c,
ocv.core.types_c;
type
{$IFDEF VER17P} //XE3..XE6
TArrayDouble = TArray<Double>;
TArrayInteger = TArray<Integer>;
TArrayBoolean = TArray<Boolean>;
{$ELSE} // D7...XE2
TArrayDouble = Array of Double;
TArrayInteger = Array of Integer;
TArrayBoolean = Array of Boolean;
{$ENDIF}
TocvCustomImageOperation = class(TComponent)
protected
@ -60,9 +69,9 @@ type
private
FCriticalSection: TCriticalSection;
FOwner: TPersistent;
FFloatParams: TArray<Double>;
FIntParams: TArray<Integer>;
FBoolParams: TArray<Boolean>;
FFloatParams: TArrayDouble;
FIntParams: TArrayInteger;
FBoolParams: TArrayBoolean;
FOnAfterPaint: TOnOcvAfterTransform;
FOnBeforePaint: TOnOcvBeforeTransform;
protected

View File

@ -29,7 +29,7 @@ unit uOCVTypes;
interface
uses
{$IFDEF VER6P}
{$IFDEF VER15P}
System.SysUtils,
System.Classes,
System.Generics.Collections,
@ -38,10 +38,9 @@ uses
{$ELSE}
SysUtils,
Classes,
Generics,
Graphics,
{$IFNDEF VER5}Types, {$ENDIF VER5}
{$ENDIF VER6P}
{$ENDIF VER15P}
ocv.core.types_c;
Type
@ -89,7 +88,11 @@ Type
of object;
TocvRect = Type TRect;
{$IFDEF VER17P}
TocvRects = TArray<TocvRect>;
{$ELSE}
TocvRects = Array of TocvRect;
{$ENDIF}
TOnOcvHaarCascade = procedure(Sender: TObject; const IplImage: IocvImage; const HaarRects: TocvRects) of object;
TOnOcvRect = procedure(Sender: TObject; const IplImage: IocvImage; const Rect: TocvRect) of object;
@ -114,7 +117,7 @@ Type
TocvReceiverList = class(TThreadList) // <IocvDataReceiver>;
public
procedure Add(Item: IocvDataReceiver);
procedure Remove(Item: IocvDataReceiver); inline;
procedure Remove(Item: IocvDataReceiver); {$IFDEF VER9P}inline;{$ENDIF}
end;
TocvDataSource = class(TComponent, IocvDataSource)

View File

@ -83,6 +83,8 @@
// opencv\modules\core\include\opencv2\core\types_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}
@ -94,7 +96,9 @@
{$WARN UNSAFE_TYPE OFF}
{$WARN UNSAFE_CODE OFF}
{$WARN UNSAFE_CAST OFF}
{$IFDEF VER12P}
{$POINTERMATH ON}
{$ENDIF}
unit ocv.core.types_c;
@ -125,6 +129,25 @@ type
TpCVCharArray = array [0 .. 1] of pCVChar;
ppCVChar = ^TpCVCharArray;
CVChar = AnsiChar;
{$IFNDEF VER16P}
{$IFDEF CLR}
{$IFDEF VER11P}
NativeInt = size_t;
NativeUInt = size_t;
{$ELSE}
NativeInt = Integer;
NativeUInt = Cardinal;
{$ENDIF}
{$ELSE}
{$IFDEF FPC}
NativeInt = SizeInt;
NativeUInt = SizeUInt;
{$ELSE}
NativeInt = Integer;
NativeUInt = Cardinal;
{$ENDIF}
{$ENDIF}
{$ENDIF}
function strdup(const str: pCVChar): pCVChar;
function cv_stricmp(const str1, str2: pCVChar): Integer;
@ -264,7 +287,7 @@ const
// CvRNG rng = seed ? (uint64)seed : (uint64)(int64)-1;
// return rng;
// }
function cvRNG(seed: int64 = -1): TCvRNG; inline;
function cvRNG(seed: int64 = -1): TCvRNG; {$IFDEF VER9P}inline;{$ENDIF}
(****************************************************************************************\
* Image cType (IplImage) *
@ -454,14 +477,14 @@ const
{$EXTERNALSYM CV_USRTYPE1}
CV_MAT_DEPTH_MASK = (CV_DEPTH_MAX - 1);
{$EXTERNALSYM CV_MAT_DEPTH_MASK}
function CV_8UC1: Integer; inline;
function CV_8UC1: Integer; {$IFDEF VER9P}inline;{$ENDIF}
{$EXTERNALSYM CV_8UC1}
(*
CV_8UC2 = CV_MAKETYPE(CV_8U, 2);
{$EXTERNALSYM CV_8UC2}
*)
function CV_8UC3: Integer; inline;
function CV_8UC3: Integer; {$IFDEF VER9P}inline;{$ENDIF}
{$EXTERNALSYM CV_8UC3}
(*
CV_8UC4 = CV_MAKETYPE(CV_8U, 4);
@ -504,7 +527,7 @@ function CV_8UC3: Integer; inline;
// const
// CV_32SC2 = CV_MAKETYPE(CV_32S, 2);
{$EXTERNALSYM CV_32SC2}
function CV_32SC2: Integer; inline;
function CV_32SC2: Integer; {$IFDEF VER9P}inline;{$ENDIF}
(*
const
@ -523,9 +546,9 @@ function CV_32SC2: Integer; inline;
CV_32FC1 = CV_MAKETYPE(CV_32F, 1);
{$EXTERNALSYM CV_32FC1}
*)
function CV_32FC2: Integer; inline;
function CV_32FC2: Integer; {$IFDEF VER9P}inline;{$ENDIF}
{$EXTERNALSYM CV_32FC2}
function CV_32FC3: Integer; inline;
function CV_32FC3: Integer; {$IFDEF VER9P}inline;{$ENDIF}
{$EXTERNALSYM CV_32FC3}
(*
const
@ -537,11 +560,11 @@ function CV_32FC3: Integer; inline;
CV_32FC(n)CV_MAKETYPE(CV_32F, (n));
*)
function CV_64FC1: Integer; inline;
function CV_64FC1: Integer; {$IFDEF VER9P}inline;{$ENDIF}
{$EXTERNALSYM CV_64FC1}
function CV_64FC2: Integer; inline;
function CV_64FC2: Integer; {$IFDEF VER9P}inline;{$ENDIF}
{$EXTERNALSYM CV_64FC2}
function CV_64FC3: Integer; inline;
function CV_64FC3: Integer; {$IFDEF VER9P}inline;{$ENDIF}
{$EXTERNALSYM CV_64FC3}
(*
const
@ -555,7 +578,7 @@ function CV_64FC3: Integer; inline;
// * get reference to pixel at (col,row),
// for multi-channel images (col) should be multiplied by number of channels */
function CV_IMAGE_ELEM(image: pIplImage; size_elemtype, row, col: Integer): Pointer; inline;
function CV_IMAGE_ELEM(image: pIplImage; size_elemtype, row, col: Integer): Pointer; {$IFDEF VER9P}inline;{$ENDIF}
// (((elemtype*)((image)->imageData + (image)->widthStep*(row)))[(col)])
const
@ -757,7 +780,7 @@ type
z: Single;
end;
function cvPoint3D32f(const x, y, z: Double): TCvPoint3D32f; inline;
function cvPoint3D32f(const x, y, z: Double): TCvPoint3D32f; {$IFDEF VER9P}inline;{$ENDIF}
Type
TCvPoint2D64f = record
@ -991,7 +1014,7 @@ const
{$EXTERNALSYM CV_SET_ELEM_FREE_FLAG}
// Checks whether the element pointed by ptr belongs to a set or not
// #define CV_IS_SET_ELEM( ptr ) (((CvSetElem*)(ptr))->flags >= 0)
function CV_IS_SET_ELEM(ptr: Pointer): Boolean; // inline;
function CV_IS_SET_ELEM(ptr: Pointer): Boolean; // {$IFDEF VER9P}inline;{$ENDIF}
// ***************************************************************************************
// * Multi-dimensional sparse cArray (CvSparseMat) *
@ -1254,7 +1277,7 @@ const
/// / >> Following declaration is a macro definition!
// CV_IS_SEQ_CLOSED(seq)(((seq)^.flags and CV_SEQ_FLAG_CLOSED) <> 0);
function CV_IS_SEQ_CLOSED(const Seq: pCvSeq): Boolean; inline;
function CV_IS_SEQ_CLOSED(const Seq: pCvSeq): Boolean; {$IFDEF VER9P}inline;{$ENDIF}
/// / >> Following declaration is a macro definition!
// const
@ -1262,7 +1285,7 @@ function CV_IS_SEQ_CLOSED(const Seq: pCvSeq): Boolean; inline;
// Following declaration is a macro definition!
// CV_IS_SEQ_HOLE(seq)(((seq)^.flags and CV_SEQ_FLAG_HOLE) <> 0);
function CV_IS_SEQ_HOLE(const Seq: pCvSeq): Boolean; inline;
function CV_IS_SEQ_HOLE(const Seq: pCvSeq): Boolean; {$IFDEF VER9P}inline;{$ENDIF}
/// / >> Following declaration is a macro definition!
// const
@ -1346,9 +1369,11 @@ type
(seq)->first->data + (index) * sizeof(elem_type) : \
cvGetSeqElem( (CvSeq*)(seq), (index) )))
}
function CV_SEQ_ELEM(Seq: pCvSeq; const size_of_elem: Integer; index: Integer): Pointer; inline;
{$IFDEF VER15P}
function CV_SEQ_ELEM(Seq: pCvSeq; const size_of_elem: Integer; index: Integer): Pointer; {$IFDEF VER9P}inline;{$ENDIF}
{#define CV_GET_SEQ_ELEM( elem_type, seq, index ) CV_SEQ_ELEM( (seq), elem_type, (index) )}
function CV_GET_SEQ_ELEM(const size_of_elem: Integer; Seq: pCvSeq; index: Integer): Pointer; inline;
function CV_GET_SEQ_ELEM(const size_of_elem: Integer; Seq: pCvSeq; index: Integer): Pointer; {$IFDEF VER9P}inline;{$ENDIF}
{$ENDIF VER15P}
// (* Add element to sequence: *)
// // >> Following declaration is a macro definition!
@ -1363,7 +1388,7 @@ function CV_GET_SEQ_ELEM(const size_of_elem: Integer; Seq: pCvSeq; index: Intege
// Assert((writer).ptr <= (writer).block_max - SizeOf(elem));
// memcpy((writer).ptr, and (elem), SizeOf(elem)); (writer).ptr := mod +SizeOf(elem) then; end;
function CV_CAST_8U(t: Integer): uchar; inline;
function CV_CAST_8U(t: Integer): uchar; {$IFDEF VER9P}inline;{$ENDIF}
(*
/* Move reader position forward: */
@ -1376,7 +1401,7 @@ function CV_CAST_8U(t: Integer): uchar; inline;
}
*)
procedure CV_NEXT_SEQ_ELEM(const elem_size: Integer; const Reader: TCvSeqReader);
// inline;
// {$IFDEF VER9P}inline;{$ENDIF}
// (* Move reader position backward: *)
// // >> Following declaration is a macro definition!
@ -1393,7 +1418,7 @@ procedure CV_NEXT_SEQ_ELEM(const elem_size: Integer; const Reader: TCvSeqReader)
CV_NEXT_SEQ_ELEM( sizeof(elem), reader ) \
}
*)
procedure CV_READ_SEQ_ELEM(const Elem: Pointer; const Reader: TCvSeqReader; const SizeOfElem: Integer); // inline;
procedure CV_READ_SEQ_ELEM(const Elem: Pointer; const Reader: TCvSeqReader; const SizeOfElem: Integer); // {$IFDEF VER9P}inline;{$ENDIF}
// (* Read element and move read position backward: *)
@ -1582,7 +1607,7 @@ const
{$EXTERNALSYM CV_NODE_TYPE_MASK}
// >> Following declaration is a macro definition!
// CV_NODE_TYPE(flags)((flags) and CV_NODE_TYPE_MASK);
function CV_NODE_TYPE(const flags: Integer): Integer; inline;
function CV_NODE_TYPE(const flags: Integer): Integer; {$IFDEF VER9P}inline;{$ENDIF}
const
(*file node flags*)
@ -1595,14 +1620,13 @@ const
CV_NODE_NAMED = 64;
{$EXTERNALSYM CV_NODE_NAMED}
// CV_NODE_IS_INT(flags) (CV_NODE_TYPE(flags) == CV_NODE_INT)
function CV_NODE_IS_INT(const flags: Integer): Boolean; inline;
function CV_NODE_IS_INT(const flags: Integer): Boolean; {$IFDEF VER9P}inline;{$ENDIF}
// CV_NODE_IS_REAL(flags) (CV_NODE_TYPE(flags) == CV_NODE_REAL)
function CV_NODE_IS_REAL(const flags: Integer): Boolean; inline;
function CV_NODE_IS_REAL(const flags: Integer): Boolean; {$IFDEF VER9P}inline;{$ENDIF}
// const CV_NODE_IS_INT(flags)(CV_NODE_TYPE(flags) = CV_NODE_INT)
// const CV_NODE_IS_REAL(flags) (CV_NODE_TYPE(flags) = CV_NODE_REAL)
function CV_NODE_IS_STRING(const flags: Integer): Boolean;
inline
function CV_NODE_IS_STRING(const flags: Integer): Boolean; {$IFDEF VER9P}inline;{$ENDIF}
// (CV_NODE_TYPE(flags) = CV_NODE_STRING)
// const CV_NODE_IS_SEQ(flags) (CV_NODE_TYPE(flags) = CV_NODE_SEQ)
// const CV_NODE_IS_MAP(flags) (CV_NODE_TYPE(flags) = CV_NODE_MAP)
@ -1701,10 +1725,10 @@ type
(* End of file.*)
// #define CV_SWAP(a,b,t) ((t) = (a), (a) = (b), (b) = (t))
procedure CV_SWAP(var a, b, t: pIplImage); inline; overload;
procedure CV_SWAP(var a, b, t: pCvPoint2D32f); inline; overload;
procedure CV_SWAP(var a, b, t: pCvMat); inline; overload;
procedure CV_SWAP(var a, b, t: Pointer); inline; overload;
procedure CV_SWAP(var a, b, t: pIplImage); {$IFDEF VER9P}inline;{$ENDIF} overload;
procedure CV_SWAP(var a, b, t: pCvPoint2D32f); {$IFDEF VER9P}inline;{$ENDIF} overload;
procedure CV_SWAP(var a, b, t: pCvMat); {$IFDEF VER9P}inline;{$ENDIF} overload;
procedure CV_SWAP(var a, b, t: Pointer); {$IFDEF VER9P}inline;{$ENDIF} overload;
// {$IFNDEF MIN}
// {$HPPEMIT '# define MIN(a,b) ((a) > (b) ? (b) : (a))'}
@ -1716,12 +1740,12 @@ procedure CV_SWAP(var a, b, t: Pointer); inline; overload;
// // >> Following declaration is a macro definition!
// class function CV_IMIN(
//
// const a, b: Integer): Integer; inline;
// const a, b: Integer): Integer; {$IFDEF VER9P}inline;{$ENDIF}
// { ((a) xor (((a) xor (b)) and (((a) < (b)) - 1))): INT; }
// // >> Following declaration is a macro definition!
// class function CV_IMAX(
//
// const a, b: Integer): Integer; inline;
// const a, b: Integer): Integer; {$IFDEF VER9P}inline;{$ENDIF}
// { ((a) xor (((a) xor (b)) and (((a) > (b)) - 1))); }
//
// (* absolute value without jumps *)
@ -1733,17 +1757,17 @@ procedure CV_SWAP(var a, b, t: Pointer); inline; overload;
// // >> Following declaration is a macro definition!
// class function CV_CMP(
//
// const a, b: Integer): Integer; inline;
// const a, b: Integer): Integer; {$IFDEF VER9P}inline;{$ENDIF}
// { (((a) > (b)) - ((a) < (b))); }
// // >> Following declaration is a macro definition!
// class function CV_SIGN(
//
// const a: Integer): Integer; inline;
// const a: Integer): Integer; {$IFDEF VER9P}inline;{$ENDIF}
// { PCV_CMP((a), 0); }
// // CV_INLINE
// class function cvRound<T: packed record >(
//
// const v1: T): Integer; inline;
// const v1: T): Integer; {$IFDEF VER9P}inline;{$ENDIF}
// (*
// result := _mm_cvtsd_si32(T);
// {$HPPEMIT '#elif defined _MSC_VER && defined _M_IX86'}
@ -1837,12 +1861,12 @@ procedure CV_SWAP(var a, b, t: Pointer); inline; overload;
// {$EXTERNALSYM CV_TYPE_NAME_IMAGE}
// class function CV_IS_IMAGE_HDR(
//
// const img: pIplImage): Integer; inline;
// const img: pIplImage): Integer; {$IFDEF VER9P}inline;{$ENDIF}
// { ((img) <> 0 and ((IplImage(img))^.nSize = SizeOf(IplImage)) }
// // >> Following declaration is a macro definition!
// class function CV_IS_IMAGE(
//
// const img: pIplImage): Integer; inline;
// const img: pIplImage): Integer; {$IFDEF VER9P}inline;{$ENDIF}
// // (CV_IS_IMAGE_HDR(img) and ((IplImage)img)^.imageData <> 0);
// (* for storing double-precision
// floating point data in IplImage's */
@ -1856,31 +1880,31 @@ procedure CV_SWAP(var a, b, t: Pointer); inline; overload;
// // >> Following declaration is a macro definition!
// class function CV_MAT_DEPTH(
//
// const flags: Integer): Integer; inline;
// const flags: Integer): Integer; {$IFDEF VER9P}inline;{$ENDIF}
// { ((flags) and CV_MAT_DEPTH_MASK); }
// // >> Following declaration is a macro definition!
// class function CV_MAKETYPE(
//
// const depth, cn: Integer): Integer; inline;
// const depth, cn: Integer): Integer; {$IFDEF VER9P}inline;{$ENDIF}
// // (CV_MAT_DEPTH(depth) + (((cn) - 1) shl CV_CN_SHIFT));
// class function CV_MAKE_TYPE(
//
// const depth, cn: Integer): Integer; inline;
// const depth, cn: Integer): Integer; {$IFDEF VER9P}inline;{$ENDIF}
// // (CV_MAT_DEPTH(depth) + (((cn) - 1) shl CV_CN_SHIFT));
// // >> Following declaration is a macro definition!
// class function CV_8UC(
//
// const n: Integer): Integer; inline;
// const n: Integer): Integer; {$IFDEF VER9P}inline;{$ENDIF}
// // CV_MAKETYPE(CV_8U, (n));
// // >> Following declaration is a macro definition!
// class function CV_8SC(
//
// const n: Integer): Integer; inline;
// const n: Integer): Integer; {$IFDEF VER9P}inline;{$ENDIF}
// // CV_MAKETYPE(CV_8S, (n));
// // >> Following declaration is a macro definition!
// class function CV_16UC(
//
// const n: Integer): Integer; inline;
// const n: Integer): Integer; {$IFDEF VER9P}inline;{$ENDIF}
// // CV_MAKETYPE(CV_16U, (n));
// (*
// // >> Following declaration is a macro definition!
@ -1906,7 +1930,7 @@ procedure CV_SWAP(var a, b, t: Pointer); inline; overload;
//
// const CV_IS_MASK_ARR(mat)(((mat)^.cType and (CV_MAT_TYPE_MASK and ~ CV_8SC1)) = 0)
function CV_ARE_TYPES_EQ(const mat1, mat2: pCvMat): Boolean; inline;
function CV_ARE_TYPES_EQ(const mat1, mat2: pCvMat): Boolean; {$IFDEF VER9P}inline;{$ENDIF}
// const CV_ARE_CNS_EQ(mat1, mat2)((((mat1)^.cType xor (mat2)^.cType) and CV_MAT_CN_MASK) = 0)
//
@ -1967,7 +1991,7 @@ function CV_ARE_TYPES_EQ(const mat1, mat2: pCvMat): Boolean; inline;
// return CV_ELEM_SIZE1(depth)*8 | (depth == CV_8S || depth == CV_16S ||
// depth == CV_32S ? IPL_DEPTH_SIGN : 0);
// }
function cvIplDepth(_type: Integer): Integer; // inline;
function cvIplDepth(_type: Integer): Integer; // {$IFDEF VER9P}inline;{$ENDIF}
//
// (* ***************************************************************************************\
@ -2010,11 +2034,11 @@ function cvIplDepth(_type: Integer): Integer; // inline;
// (* ****************************** CvPoint and variants ********************************** *)
function CvPoint2D32f(x, y: Double): TCvPoint2D32f; inline;
function CvPoint2D32f(x, y: Double): TCvPoint2D32f; {$IFDEF VER9P}inline;{$ENDIF}
function cvPointTo32f(point: TCvPoint): TCvPoint2D32f; inline;
function cvPointTo32f(point: TCvPoint): TCvPoint2D32f; {$IFDEF VER9P}inline;{$ENDIF}
function cvPointFrom32f(point: TCvPoint2D32f): TCvPoint; inline;
function cvPointFrom32f(point: TCvPoint2D32f): TCvPoint; {$IFDEF VER9P}inline;{$ENDIF}
// CV_INLINE CvPoint3D32f CvPoint3D32f(Double x, Double y, Double z)
//
@ -2092,7 +2116,7 @@ function cvPointFrom32f(point: TCvPoint2D32f): TCvPoint; inline;
// return scalar;
// }
function cvRealScalar(val0: Double): TCvScalar; inline;
function cvRealScalar(val0: Double): TCvScalar; {$IFDEF VER9P}inline;{$ENDIF}
// (*************************************************************************************** *)
// (* Dynamic Data structures *)
@ -2114,7 +2138,7 @@ function cvRealScalar(val0: Double): TCvScalar; inline;
// (* ********************************** CvTermCriteria ************************************ *)
// (* CV_INLINE CvTermCriteria CvTermCriteria(Integer cType, Integer max_iter, Double epsilon)
function CvTermCriteria(_type: Integer; max_iter: Integer; epsilon: Double): TCvTermCriteria; inline;
function CvTermCriteria(_type: Integer; max_iter: Integer; epsilon: Double): TCvTermCriteria; {$IFDEF VER9P}inline;{$ENDIF}
(*
CV_INLINE int cvFloor( double value )
@ -2140,13 +2164,13 @@ function CvTermCriteria(_type: Integer; max_iter: Integer; epsilon: Double): TCv
#endif
}
*)
function cvFloor(value: Double): Integer; inline;
function cvScalarAll(val0123: Double): TCvScalar; inline;
function CvPoint(const x, y: Integer): TCvPoint; inline;
function CvSize(const width, height: Integer): TCvSize; inline;
function CvScalar(const val0: Double; const val1: Double = 0; const val2: Double = 0; const val3: Double = 0): TCvScalar; inline;
function cvRandInt(Var rng: TCvRNG): Cardinal; inline;
function CvRect(Const x, y, width, height: Integer): TCvRect; inline;
function cvFloor(value: Double): Integer; {$IFDEF VER9P}inline;{$ENDIF}
function cvScalarAll(val0123: Double): TCvScalar; {$IFDEF VER9P}inline;{$ENDIF}
function CvPoint(const x, y: Integer): TCvPoint; {$IFDEF VER9P}inline;{$ENDIF}
function CvSize(const width, height: Integer): TCvSize; {$IFDEF VER9P}inline;{$ENDIF}
function CvScalar(const val0: Double; const val1: Double = 0; const val2: Double = 0; const val3: Double = 0): TCvScalar; {$IFDEF VER9P}inline;{$ENDIF}
function cvRandInt(Var rng: TCvRNG): Cardinal; {$IFDEF VER9P}inline;{$ENDIF}
function CvRect(Const x, y, width, height: Integer): TCvRect; {$IFDEF VER9P}inline;{$ENDIF}
function cvRound(value: Double): Integer;
const
@ -2182,24 +2206,30 @@ function CV_MAT_TYPE(const flags: Integer): Integer;
function CV_ELEM_SIZE1(const _type: Integer): Integer;
function CV_ELEM_SIZE(const _type: Integer): Integer;
function CV_MAT_CN(const flags: Integer): Integer;
function CV_32FC1: Integer; inline;
function CV_32SC1: Integer; inline;
function CV_MAKETYPE(depth, cn: Integer): Integer; inline;
function CV_32FC1: Integer; {$IFDEF VER9P}inline;{$ENDIF}
function CV_32SC1: Integer; {$IFDEF VER9P}inline;{$ENDIF}
function CV_MAKETYPE(depth, cn: Integer): Integer; {$IFDEF VER9P}inline;{$ENDIF}
// #define CV_MAT_ELEM( mat, elemtype, row, col )
// (*(elemtype*)CV_MAT_ELEM_PTR_FAST( mat, row, col, sizeof(elemtype)))
function CV_MAT_ELEM(const mat: TCvMat; const elemsize: Integer; const row, col: Integer): Pointer; inline;
function CV_MAT_ELEM(const mat: TCvMat; const elemsize: Integer; const row, col: Integer): Pointer; {$IFDEF VER9P}inline;{$ENDIF}
// #define CV_MAT_ELEM_PTR_FAST( mat, row, col, pix_size )
// (assert( (unsigned)(row) < (unsigned)(mat).rows &&
// (unsigned)(col) < (unsigned)(mat).cols ),
// (mat).data.ptr + (size_t)(mat).step*(row) + (pix_size)*(col))
function CV_MAT_ELEM_PTR_FAST(const mat: TCvMat; const row, col, pix_size: Integer): Pointer; inline;
function CV_MAT_ELEM_PTR_FAST(const mat: TCvMat; const row, col, pix_size: Integer): Pointer; {$IFDEF VER9P}inline;{$ENDIF}
function iif(const Conditional: Boolean; const ifTrue, ifFalse: Variant): Variant; inline; overload;
function iif(const Conditional: Boolean; const ifTrue, ifFalse: Pointer): Pointer; inline; overload;
function iif(const Conditional: Boolean; const ifTrue, ifFalse: Variant): Variant; {$IFDEF VER9P}inline;{$ENDIF} overload;
function iif(const Conditional: Boolean; const ifTrue, ifFalse: Pointer): Pointer; {$IFDEF VER9P}inline;{$ENDIF} overload;
implementation
uses ocv.core_c, System.SysUtils;
uses
ocv.core_c,
{$IFDEF VER15P}
System.SysUtils;
{$ELSE}
SysUtils;
{$ENDIF VER15P}
function strdup(const str: pCVChar): pCVChar;
begin
@ -2353,7 +2383,7 @@ begin
Result := Round(value);
end;
function iif(const Conditional: Boolean; const ifTrue, ifFalse: Variant): Variant; inline; overload;
function iif(const Conditional: Boolean; const ifTrue, ifFalse: Variant): Variant; {$IFDEF VER9P}inline;{$ENDIF} overload;
begin
if Conditional then
Result := ifTrue
@ -2361,7 +2391,7 @@ begin
Result := ifFalse;
end;
function iif(const Conditional: Boolean; const ifTrue, ifFalse: Pointer): Pointer; inline; overload;
function iif(const Conditional: Boolean; const ifTrue, ifFalse: Pointer): Pointer; {$IFDEF VER9P}inline;{$ENDIF} overload;
begin
if Conditional then
Result := ifTrue
@ -2387,13 +2417,12 @@ begin
Result := CV_NODE_TYPE(flags) = CV_NODE_REAL;
end;
function CV_NODE_IS_STRING(const flags: Integer): Boolean;
inline
function CV_NODE_IS_STRING(const flags: Integer): Boolean; {$IFDEF VER9P}inline;{$ENDIF}
begin
Result := CV_NODE_TYPE(flags) = CV_NODE_STRING
end;
procedure CV_READ_SEQ_ELEM(const Elem: Pointer; const Reader: TCvSeqReader; const SizeOfElem: Integer); // inline;
procedure CV_READ_SEQ_ELEM(const Elem: Pointer; const Reader: TCvSeqReader; const SizeOfElem: Integer); // {$IFDEF VER9P}inline;{$ENDIF}
begin
// assert( (reader).seq->elem_size == sizeof(elem));
Assert(Reader.Seq^.elem_size = SizeOfElem);
@ -2403,7 +2432,7 @@ begin
CV_NEXT_SEQ_ELEM(SizeOfElem, Reader);
end;
procedure CV_NEXT_SEQ_ELEM(const elem_size: Integer; const Reader: TCvSeqReader); // inline;
procedure CV_NEXT_SEQ_ELEM(const elem_size: Integer; const Reader: TCvSeqReader); // {$IFDEF VER9P}inline;{$ENDIF}
Var
ptr: PInteger;
begin
@ -2451,7 +2480,7 @@ begin
Result.y := y;
end;
function cvPoint3D32f(const x, y, z: Double): TCvPoint3D32f; inline;
function cvPoint3D32f(const x, y, z: Double): TCvPoint3D32f; {$IFDEF VER9P}inline;{$ENDIF}
begin
Result.x := x;
Result.y := y;
@ -2485,12 +2514,6 @@ begin
Result := CV_MAKETYPE(CV_32S, 2);
end;
function CV_GET_SEQ_ELEM;
begin
{#define CV_GET_SEQ_ELEM( elem_type, seq, index ) CV_SEQ_ELEM( (seq), elem_type, (index) )}
Result := CV_SEQ_ELEM(Seq, size_of_elem, index);
end;
function CV_CAST_8U(t: Integer): uchar;
begin
if (not(t and (not 255)) <> 0) then
@ -2501,7 +2524,14 @@ begin
Result := 0;
end;
function CV_SEQ_ELEM(Seq: pCvSeq; const size_of_elem: Integer; index: Integer): Pointer; inline;
{$IFDEF VER15P}
function CV_GET_SEQ_ELEM;
begin
{#define CV_GET_SEQ_ELEM( elem_type, seq, index ) CV_SEQ_ELEM( (seq), elem_type, (index) )}
Result := CV_SEQ_ELEM(Seq, size_of_elem, index);
end;
function CV_SEQ_ELEM(Seq: pCvSeq; const size_of_elem: Integer; index: Integer): Pointer; {$IFDEF VER9P}inline;{$ENDIF}
begin
// assert(sizeof((seq)->first[0]) == sizeof(CvSeqBlock) && (seq)->elem_size == sizeof(elem_type))
Assert(Assigned(Seq^.first) and (SizeOf(Seq^.first[0]) = SizeOf(TCvSeqBlock)) and (Seq^.elem_size = size_of_elem));
@ -2513,8 +2543,9 @@ begin
// cvGetSeqElem( (CvSeq*)(seq), (index) )))
Result := cvGetSeqElem(Seq, index);
end;
{$ENDIF VER15P}
function CV_8UC1: Integer; inline;
function CV_8UC1: Integer; {$IFDEF VER9P}inline;{$ENDIF}
begin
Result := CV_MAKETYPE(CV_8U, 1);
end;
@ -2524,7 +2555,7 @@ begin
Result := CV_MAKETYPE(CV_32F, 2);
end;
function CV_32FC3: Integer; inline;
function CV_32FC3: Integer; {$IFDEF VER9P}inline;{$ENDIF}
begin
Result := CV_MAKETYPE(CV_32F, 3);
end;
@ -2539,7 +2570,7 @@ begin
Result := CV_MAKETYPE(CV_64F, 2);
end;
function CV_64FC3: Integer; inline;
function CV_64FC3: Integer; {$IFDEF VER9P}inline;{$ENDIF}
begin
Result := CV_MAKETYPE(CV_64F, 3);
end;
@ -2549,19 +2580,19 @@ begin
Result := CV_MAKETYPE(CV_8U, 3);
end;
function CV_IS_SET_ELEM(ptr: Pointer): Boolean; // inline;
function CV_IS_SET_ELEM(ptr: Pointer): Boolean; // {$IFDEF VER9P}inline;{$ENDIF}
begin
// #define CV_IS_SET_ELEM( ptr ) (((CvSetElem*)(ptr))->flags >= 0)
Result := Assigned(ptr) and (pCvSetElem(ptr)^.flags >= 0);
end;
function CV_IMAGE_ELEM(image: pIplImage; size_elemtype, row, col: Integer): Pointer; inline;
function CV_IMAGE_ELEM(image: pIplImage; size_elemtype, row, col: Integer): Pointer; {$IFDEF VER9P}inline;{$ENDIF}
begin
// (((elemtype*)((image)->imageData + (image)->widthStep*(row)))[(col)])
Result := pByte(image^.imageData) + image^.widthStep * row + col * size_elemtype;
Result := {$IFDEF D7}Pointer({$ENDIF D7}{$IFDEF VER9P}pByte{$ELSE}Integer{$ENDIF}(image^.imageData) + image^.widthStep * row + col * size_elemtype{$IFDEF D7}){$ENDIF D7};
end;
function cvRealScalar(val0: Double): TCvScalar; inline;
function cvRealScalar(val0: Double): TCvScalar; {$IFDEF VER9P}inline;{$ENDIF}
begin
Result.val[0] := val0;
Result.val[1] := 0;
@ -2569,7 +2600,7 @@ begin
Result.val[3] := 0;
end;
function cvRNG(seed: int64 = -1): TCvRNG; inline;
function cvRNG(seed: int64 = -1): TCvRNG; {$IFDEF VER9P}inline;{$ENDIF}
begin
// CvRNG rng = seed ? (uint64)seed : (uint64)(int64)-1;
Result := iif(seed > 0, seed, uint64(int64(-1)));
@ -2581,7 +2612,7 @@ begin
// 0x124489 = 1000 0100 0100 0010 0010 0001 0001 ~ array of sizeof(arr_type_elem) */
// #define CV_ELEM_SIZE1(type) \
// ((((sizeof(size_t)<<28)|0x8442211) >> CV_MAT_DEPTH(type)*4) & 15)
Result := ((((int64(SizeOf(size_t)) shl 28) or $8442211) shr (CV_MAT_DEPTH(_type) * 4)) and 15);
Result := ((((int64(SizeOf(NativeUInt)) shl 28) or $8442211) shr (CV_MAT_DEPTH(_type) * 4)) and 15);
end;
function cvIplDepth(_type: Integer): Integer;
@ -2595,17 +2626,17 @@ begin
Result := Result or IPL_DEPTH_SIGN;
end;
function CV_ARE_TYPES_EQ(const mat1, mat2: pCvMat): Boolean; inline;
function CV_ARE_TYPES_EQ(const mat1, mat2: pCvMat): Boolean; {$IFDEF VER9P}inline;{$ENDIF}
begin
Result := ((((mat1)^._type xor (mat2)^._type) and CV_MAT_TYPE_MASK) = 0);
end;
function CV_IS_SEQ_CLOSED(const Seq: pCvSeq): Boolean; inline;
function CV_IS_SEQ_CLOSED(const Seq: pCvSeq): Boolean; {$IFDEF VER9P}inline;{$ENDIF}
begin
Result := (Seq^.flags and CV_SEQ_FLAG_CLOSED) <> 0;
end;
function CV_IS_SEQ_HOLE(const Seq: pCvSeq): Boolean; inline;
function CV_IS_SEQ_HOLE(const Seq: pCvSeq): Boolean; {$IFDEF VER9P}inline;{$ENDIF}
begin
Result := (Seq^.flags and CV_SEQ_FLAG_HOLE) <> 0;
end;

View File

@ -111,7 +111,7 @@ uses
(as well as other OpenCV functions that call cvAlloc)
raises an error.
}
function cvAlloc(size: size_t): Pointer; cdecl;
function cvAlloc(size: NativeUInt): Pointer; cdecl;
{<free> wrapper.
Here and further all the memory releasing functions
@ -120,7 +120,7 @@ function cvAlloc(size: size_t): Pointer; cdecl;
Passing cPointer to 0 cPointer is Ok: nothing happens in this
}
procedure cvFree_(ptr: Pointer); cdecl;
procedure cvFree(var ptr); inline;
procedure cvFree(var ptr); {$IFDEF VER9P}inline;{$ENDIF}
{Allocates and initializes IplImage header
CVAPI(IplImage*) cvCreateImageHeader( CvSize size, int depth, int channels );
@ -273,7 +273,7 @@ function cvGetRows(const arr: pCvArr; submat: pCvMat; start_row, end_row: Intege
// {
// return cvGetRows( arr, submat, row, row + 1, 1 );
// }
function cvGetRow(const arr: pCvArr; submat: pCvMat; row: Integer): pCvMat; inline;
function cvGetRow(const arr: pCvArr; submat: pCvMat; row: Integer): pCvMat; {$IFDEF VER9P}inline;{$ENDIF}
{Selects column span of the input array: arr(:,start_col:end_col)
(end_col is not included into the span)
@ -286,7 +286,7 @@ function cvGetCols(const arr: pCvArr; submat: pCvMat; start_col, end_col: Intege
// {
// return cvGetCols( arr, submat, col, col + 1 );
// }
function cvGetCol(const arr: pCvArr; submat: pCvMat; col: Integer): pCvMat; inline;
function cvGetCol(const arr: pCvArr; submat: pCvMat; col: Integer): pCvMat; {$IFDEF VER9P}inline;{$ENDIF}
{Select a diagonal of the input array.
(diag = 0 means the main diagonal, >0 means a diagonal above the main one,
@ -328,7 +328,7 @@ function cvInitMatNDHeader(mat: pCvMatND; dims: Integer; const sizes: pInteger;
// {
// cvReleaseMat( (CvMat**)mat );
// }
procedure cvReleaseMatND(var mat: pCvMatND); inline;
procedure cvReleaseMatND(var mat: pCvMatND); {$IFDEF VER9P}inline;{$ENDIF}
{Creates a copy of CvMatND (except, may be, steps)
CVAPI(CvMatND*) cvCloneMatND( const CvMatND* mat );
@ -358,7 +358,9 @@ function cvCloneSparseMat(const mat: pCvSparseMat): pCvSparseMat; cdecl;
function cvInitSparseMatIterator(const mat: pCvSparseMat; mat_iterator: pCvSparseMatIterator): pCvSparseNode; cdecl;
// returns next sparse array node (or NULL if there is no more nodes)
function cvGetNextSparseNode(mat_iterator: pCvSparseMatIterator): pCvSparseNode; inline;
{$IFDEF VER15P}
function cvGetNextSparseNode(mat_iterator: pCvSparseMatIterator): pCvSparseNode; {$IFDEF VER9P}inline;{$ENDIF}
{$ENDIF VER15P}
// **************** matrix iterator: used for n-ary operations on dense arrays *********
const
@ -512,7 +514,7 @@ function cvGetImage(const arr: pCvArr; image_header: pIplImage): pIplImage; cdec
function cvReshapeMatND(const arr: pCvArr; sizeof_header: Integer; header: pCvArr; new_cn, new_dims: Integer; new_sizes: pInteger)
: pCvArr; cdecl;
function cvReshapeND(const arr: pCvArr; sizeof_header: Integer; header: pCvArr; new_cn, new_dims: Integer; new_sizes: pInteger)
: pCvArr; inline;
: pCvArr; {$IFDEF VER9P}inline;{$ENDIF}
{CVAPI(CvMat*) cvReshape( const pCvArr* arr, CvMat* header,
int new_cn, int new_rows CV_DEFAULT(0) );
@ -569,7 +571,7 @@ procedure cvCopy(const src: pCvArr; dst: pCvArr; const mask: pCvArr = nil); cdec
const pCvArr* mask CV_DEFAULT(NULL) );
}
procedure cvSet(arr: pCvArr; value: TCvScalar; const mask: pCvArr = nil); cdecl; overload;
procedure cvSet(mat: pCvMat; i, j: Integer; val: Single); inline; overload;
procedure cvSet(mat: pCvMat; i, j: Integer; val: Single); {$IFDEF VER9P}inline;{$ENDIF} overload;
{Clears all the array elements (sets them to 0)
CVAPI(void) cvSetZero( pCvArr* arr );
@ -618,7 +620,7 @@ procedure cvConvertScale(const src: pCvArr; dst: pCvArr; scale: double = 1; shif
// #define cvScale cvConvertScale
procedure cvScale(const src: pCvArr; dst: pCvArr; scale: double = 1; shift: double = 0); cdecl;
procedure cvCvtScale(const src: pCvArr; dst: pCvArr; scale: double = 1; shift: double = 0); cdecl;
procedure cvConvert(const src: pCvArr; dst: pCvArr); inline;
procedure cvConvert(const src: pCvArr; dst: pCvArr); {$IFDEF VER9P}inline;{$ENDIF}
{Performs linear transformation on every source array element,
stores absolute value of the result:
@ -670,7 +672,7 @@ procedure cvSub(const src1, src2: pIplImage; dst: pIplImage; const mask: pIplIma
// cvAddS( src, cvScalar( -value.val[0], -value.val[1], -value.val[2], -value.val[3]),
// dst, mask );
// }
procedure cvSubS(const src: pIplImage; value: TCvScalar; dst: pIplImage; const mask: pIplImage = nil); inline;
procedure cvSubS(const src: pIplImage; value: TCvScalar; dst: pIplImage; const mask: pIplImage = nil); {$IFDEF VER9P}inline;{$ENDIF}
{dst(mask) = value - src(mask)
CVAPI(void) cvSubRS( const pCvArr* src, CvScalar value, pCvArr* dst,
@ -699,7 +701,7 @@ procedure cvDiv(const src1, src2: pIplImage; dst: pIplImage; scale: double = 1);
#define cvAXPY( A, real_scalar, B, C ) cvScaleAdd(A, cvRealScalar(real_scalar), B, C)
}
procedure cvScaleAdd(const src1: pIplImage; scale: TCvScalar; const src2: pIplImage; dst: pIplImage); cdecl;
procedure cvAXPY(A: pIplImage; real_scalar: double; B, C: pIplImage); inline;
procedure cvAXPY(A: pIplImage; real_scalar: double; B, C: pIplImage); {$IFDEF VER9P}inline;{$ENDIF}
{dst = src1 * alpha + src2 * beta + gamma
CVAPI(void) cvAddWeighted( const pCvArr* src1, double alpha,
@ -724,7 +726,7 @@ procedure cvAnd(const src1: pIplImage; const src2: pIplImage; dst: pIplImage; ma
// CVAPI(void) cvAbsDiff( const pCvArr* src1, const pCvArr* src2, pCvArr* dst );
procedure cvAbsDiff(const src1: pCvArr; const src2: pCvArr; dst: pCvArr); cdecl;
function cvGet(const mat: pCvMat; i, j: Integer): Single; inline;
function cvGet(const mat: pCvMat; i, j: Integer): Single; {$IFDEF VER9P}inline;{$ENDIF}
procedure cvCopyImage(const src: pIplImage; dst: pIplImage; const mask: pIplImage = nil); cdecl;
procedure cvCvtPixToPlane(const src: pIplImage; dst0: pIplImage; dst1: pIplImage; dst2: pIplImage; dst3: pIplImage); cdecl;
procedure cvCvtPlaneToPix(const src0: pIplImage; const src1: pIplImage; const src2: pIplImage; const src3: pIplImage;
@ -989,7 +991,7 @@ procedure cvClearMemStorage(storage: pCvMemStorage); cdecl;
CVAPI(CvSeq*) cvCreateSeq( int seq_flags, size_t header_size,
size_t elem_size, CvMemStorage* storage );
}
function cvCreateSeq(seq_flags: Integer; header_size: size_t; elem_size: size_t; storage: pCvMemStorage): pCvSeq; cdecl;
function cvCreateSeq(seq_flags: Integer; header_size: NativeUInt; elem_size: NativeUInt; storage: pCvMemStorage): pCvSeq; cdecl;
// Removes specified sequence element
// CVAPI(void) cvSeqRemove( CvSeq* seq, int index );
@ -1061,7 +1063,7 @@ function cvSeqPartition(const seq: pCvSeq; storage: pCvMemStorage; labels: pCvSe
// ****************************************************************************************
// Following declaration is a macro definition!
function CV_RGB(const r, g, B: double): TCvScalar; inline;
function CV_RGB(const r, g, B: double): TCvScalar; {$IFDEF VER9P}inline;{$ENDIF}
const
CV_FILLED = -1;
@ -1112,7 +1114,7 @@ procedure cvEllipse(img: pIplImage; center: TCvPoint; axes: TCvSize; angle: doub
0, 360, color, thickness, line_type, shift );
}
procedure cvEllipseBox(img: pIplImage; box: TCvBox2D; color: TCvScalar; thickness: Integer = 1; line_type: Integer = 8;
shift: Integer = 0); inline;
shift: Integer = 0); {$IFDEF VER9P}inline;{$ENDIF}
{Fills convex or monotonous polygon.
CVAPI(void) cvFillConvexPoly( pCvArr* img, const CvPoint* pts, int npts, CvScalar color,
@ -1179,7 +1181,7 @@ type
procedure cvInitFont(font: pCvFont; font_face: Integer; hscale: double; vscale: double; shear: double = 0; thickness: Integer = 1;
line_type: Integer = 8); cdecl;
function cvFont(scale: double; thickness: Integer = 1): TCvFont; inline;
function cvFont(scale: double; thickness: Integer = 1): TCvFont; {$IFDEF VER9P}inline;{$ENDIF}
{CVAPI(void) cvPutText( pCvArr* img, const char* text, CvPoint org,
const CvFont* font, CvScalar color );
@ -1275,7 +1277,7 @@ function cvGetFileNodeByName(const fs: pCvFileStorage; const map: pCvFileNode; c
CV_NODE_IS_INT(node->tag) ? node->data.i :
CV_NODE_IS_REAL(node->tag) ? cvRound(node->data.f) : 0x7fffffff;
}
function cvReadInt(const node: pCvFileNode; default_value: Integer = 0): Integer; inline;
function cvReadInt(const node: pCvFileNode; default_value: Integer = 0): Integer; {$IFDEF VER9P}inline;{$ENDIF}
{CV_INLINE int cvReadIntByName( const CvFileStorage* fs, const CvFileNode* map,
const char* name, int default_value CV_DEFAULT(0) )
@ -1283,14 +1285,14 @@ function cvReadInt(const node: pCvFileNode; default_value: Integer = 0): Integer
return cvReadInt( cvGetFileNodeByName( fs, map, name ), default_value );
}
function cvReadIntByName(const fs: pCvFileStorage; const map: pCvFileNode; const name: pCvChar; default_value: Integer = 0)
: Integer; inline;
: Integer; {$IFDEF VER9P}inline;{$ENDIF}
// CV_INLINE const char* cvReadString( const CvFileNode* node,
// const char* default_value CV_DEFAULT(NULL) )
// {
// return !node ? default_value : CV_NODE_IS_STRING(node->tag) ? node->data.str.ptr : 0;
// }
function cvReadString(const node: pCvFileNode; const default_value: pCvChar = nil): pCvChar; inline;
function cvReadString(const node: pCvFileNode; const default_value: pCvChar = nil): pCvChar; {$IFDEF VER9P}inline;{$ENDIF}
// CV_INLINE const char* cvReadStringByName( const CvFileStorage* fs, const CvFileNode* map,
// const char* name, const char* default_value CV_DEFAULT(NULL) )
@ -1298,7 +1300,7 @@ function cvReadString(const node: pCvFileNode; const default_value: pCvChar = ni
// return cvReadString( cvGetFileNodeByName( fs, map, name ), default_value );
// }
function cvReadStringByName(const fs: pCvFileStorage; const map: pCvFileNode; const name: pCvChar;
const default_value: pCvChar = nil): pCvChar; inline;
const default_value: pCvChar = nil): pCvChar; {$IFDEF VER9P}inline;{$ENDIF}
{decodes standard or user-defined object and returns it
CVAPI(void*) cvRead( CvFileStorage* fs, CvFileNode* node,
@ -1334,7 +1336,7 @@ procedure cvRelease(var struct_ptr: pCvSeq); cdecl; overload;
procedure cvSave(const filename: pCvChar; const struct_ptr: Pointer; const name: pCvChar; const comment: pCvChar;
attributes: TCvAttrList); cdecl; overload;
procedure cvSave(const filename: pCvChar; const struct_ptr: Pointer; const name: pCvChar = Nil; const comment: pCvChar = Nil);
overload; inline;
overload; {$IFDEF VER9P}inline;{$ENDIF}
function cvLoad(const filename: pCvChar; memstorage: pCvMemStorage = Nil; const name: pCvChar = nil;
const real_name: ppChar = nil): Pointer; cdecl;
@ -1342,7 +1344,7 @@ function cvLoad(const filename: pCvChar; memstorage: pCvMemStorage = Nil; const
{helper functions for RNG initialization and accurate time measurement:
uses internal clock counter on x86}
function cvGetTickCount: int64; inline;
function cvGetTickCount: int64; {$IFDEF VER9P}inline;{$ENDIF}
function cvGetTickFrequency: double;
// *********************************** CPU capabilities ***********************************/
@ -1446,7 +1448,7 @@ function cvCreateMatNDHeader; external core_lib;
function cvCreateMatND; external core_lib;
function cvInitMatNDHeader; external core_lib;
procedure cvReleaseMatND(var mat: pCvMatND); inline;
procedure cvReleaseMatND(var mat: pCvMatND); {$IFDEF VER9P}inline;{$ENDIF}
begin
cvReleaseMat(pCvMat(mat));
end;
@ -1477,6 +1479,7 @@ function cvInitSparseMatIterator; external core_lib;
// return NULL;
// }
// }
{$IFDEF VER15P}
function cvGetNextSparseNode(mat_iterator: pCvSparseMatIterator): pCvSparseNode;
var
idx: Integer;
@ -1504,6 +1507,7 @@ begin
Result := nil;
end;
end;
{$ENDIF VER15P}
function cvInitNArrayIterator; external core_lib;
function cvNextNArraySlice; external core_lib;
@ -1536,7 +1540,7 @@ function cvGetImage; external core_lib;
function cvReshapeMatND; external core_lib;
function cvReshapeND(const arr: pCvArr; sizeof_header: Integer; header: pCvArr; new_cn, new_dims: Integer; new_sizes: pInteger)
: pCvArr; inline;
: pCvArr; {$IFDEF VER9P}inline;{$ENDIF}
begin
Result := cvReshapeMatND(arr, sizeof(sizeof_header), header, new_cn, new_dims, new_sizes);
end;
@ -1550,8 +1554,8 @@ procedure cvGetRawData; external core_lib;
procedure _cvGetSize(const arr: pCvArr; Var size: TCvSize); external core_lib name 'cvGetSize';
{$IFDEF CPUX86}
{$IFDEF VER16P} // XE2..XE6
{$IFDEF CPU86}
function cvGetSize(const arr: pCvArr): TCvSize; assembler;
asm
// mov eax,arr // â eax óæå õðàíèòñÿ àäðåñ arr
@ -1565,7 +1569,6 @@ asm
mov Result.height,ecx
end;
{$ELSE}
function cvGetSize(const arr: pCvArr): TCvSize; assembler;
asm
call _cvGetSize
@ -1573,11 +1576,26 @@ asm
shr rax,32
mov Result.height,eax
end;
{$ENDIF}
{$ENDIF CPU86}
{$ELSE}
function cvGetSize(const arr: pCvArr): TCvSize; assembler;
asm
// mov eax,arr // â eax óæå õðàíèòñÿ àäðåñ arr
push edx // â edx àäðåñ ïåðåìåííîé Result - ñîõðàíÿåì, ò.ê. _cvGetSize âîçâðàùàåò ðåçóëüòàò â eax:edx
push eax
call _cvGetSize
pop ecx // ÷èñòèì ñòåê
mov ecx,edx // ñîõðàíÿåì ìëàäøóþ ÷àñòü ðåçóëüòàòà _cvGetSize
pop edx // âîññòàíàâëèâàåì Result
mov Result.width,eax
mov Result.height,ecx
end;
{$ENDIF VER16P}
procedure cvCopy; external core_lib;
procedure cvSet(arr: pCvArr; value: TCvScalar; const mask: pCvArr = Nil); external core_lib;
procedure cvSet(mat: pCvMat; i, j: Integer; val: Single); inline;
procedure cvSet(mat: pCvMat; i, j: Integer; val: Single); {$IFDEF VER9P}inline;{$ENDIF}
var
type_: Integer;
ptr: puchar;
@ -1598,7 +1616,7 @@ procedure cvMerge; external core_lib;
procedure cvMixChannels; external core_lib;
procedure cvConvertScale; external core_lib;
procedure cvConvert(const src: pCvArr; dst: pCvArr); inline;
procedure cvConvert(const src: pCvArr; dst: pCvArr); {$IFDEF VER9P}inline;{$ENDIF}
begin
cvConvertScale(src, dst, 1, 0);
end;
@ -1623,7 +1641,7 @@ procedure cvDiv; external core_lib;
procedure cvScaleAdd; external core_lib;
// define cvAXPY( A, real_scalar, B, C ) cvScaleAdd(A, cvRealScalar(real_scalar), B, C)
procedure cvAXPY(A: pIplImage; real_scalar: double; B, C: pIplImage); inline;
procedure cvAXPY(A: pIplImage; real_scalar: double; B, C: pIplImage); {$IFDEF VER9P}inline;{$ENDIF}
begin
cvScaleAdd(A, cvRealScalar(real_scalar), B, C);
end;
@ -1631,13 +1649,13 @@ end;
procedure cvAddWeighted; external core_lib;
function cvDotProduct; external core_lib;
function cvAlloc(size: size_t): Pointer; external core_lib;
function cvAlloc(size: NativeUInt): Pointer; external core_lib;
procedure cvFree_(ptr: Pointer); external core_lib;
procedure cvInitFont; external core_lib;
procedure cvPutText; external core_lib;
function cvFont(scale: double; thickness: Integer = 1): TCvFont; inline;
function cvFont(scale: double; thickness: Integer = 1): TCvFont; {$IFDEF VER9P}inline;{$ENDIF}
begin
cvInitFont(@Result, CV_FONT_HERSHEY_PLAIN, scale, scale, 0, thickness, CV_AA);
end;
@ -1647,7 +1665,7 @@ procedure cvLine; external core_lib;
procedure cvCopyImage; external core_lib name 'cvCopy';
function CV_RGB(const r, g, B: double): TCvScalar; inline;
function CV_RGB(const r, g, B: double): TCvScalar; {$IFDEF VER9P}inline;{$ENDIF}
begin
Result := CvScalar(B, g, r, 0);
end;
@ -1656,7 +1674,7 @@ procedure cvSave(const filename: pCvChar; const struct_ptr: Pointer; const name:
attributes: TCvAttrList); external core_lib; overload;
procedure cvSave(const filename: pCvChar; const struct_ptr: Pointer; const name: pCvChar = Nil; const comment: pCvChar = Nil);
overload; inline;
overload; {$IFDEF VER9P}inline;{$ENDIF}
begin
cvSave(filename, struct_ptr, name, comment, ZeroCvAttrList);
end;
@ -1737,7 +1755,7 @@ end;
function cvCountNonZero; external core_lib;
function cvGet(const mat: pCvMat; i, j: Integer): Single; inline;
function cvGet(const mat: pCvMat; i, j: Integer): Single; {$IFDEF VER9P}inline;{$ENDIF}
var
type_: Integer;
ptr: puchar;
@ -1801,12 +1819,12 @@ begin
end;
function cvReadStringByName(const fs: pCvFileStorage; const map: pCvFileNode; const name: pCvChar;
const default_value: pCvChar = nil): pCvChar; inline;
const default_value: pCvChar = nil): pCvChar; {$IFDEF VER9P}inline;{$ENDIF}
begin
Result := cvReadString(cvGetFileNodeByName(fs, map, name), default_value);
end;
function cvReadString(const node: pCvFileNode; const default_value: pCvChar = nil): pCvChar; inline;
function cvReadString(const node: pCvFileNode; const default_value: pCvChar = nil): pCvChar; {$IFDEF VER9P}inline;{$ENDIF}
begin
if Assigned(node) then
begin

View File

@ -40,20 +40,28 @@
// Q&A forum: http://answers.ocv.org
// Dev zone: http://code.ocv.org
// ************************************************************************************************** *)
{$I OpenCV.inc}
{$IFDEF VER12P}
{$POINTERMATH ON}
{$ENDIF}
unit ocv.cvutils;
interface
uses
{$IFDEF VER15P}
WinApi.Windows,
Vcl.Graphics,
{$ELSE}
Windows,
Graphics,
{$ENDIF VER15P}
ocv.core.types_c;
Function hsv2rgb(hue: single): TCvScalar;
procedure IplImage2Bitmap(iplImg: PIplImage; var bitmap: Vcl.Graphics.TBitmap);
function cvImage2Bitmap(img: PIplImage): Vcl.Graphics.TBitmap;
procedure IplImage2Bitmap(iplImg: PIplImage; var bitmap: {$IFDEF VER15P}Vcl.Graphics.TBitmap{$ELSE}Graphics.TBitmap{$ENDIF VER15P});
function cvImage2Bitmap(img: PIplImage): {$IFDEF VER15P}Vcl.Graphics.TBitmap{$ELSE}Graphics.TBitmap{$ENDIF VER15P};
function ipDraw(dc: HDC; img: PIplImage; const rect: TRect; const Stretch: Boolean = true): Boolean; overload;
procedure ipDraw(const x, y: Integer; const _Grab: PIplImage; const Wnd: THandle); overload;
@ -65,16 +73,20 @@ function ifthen(const Cond: Boolean; const ValueTrue, ValueFalse: pCvArr): pCvAr
function ifthen(const Cond: Boolean; const ValueTrue, ValueFalse: string): string; overload;
function ifthen(const Cond: Boolean; const ValueTrue, ValueFalse: TCvScalar): TCvScalar; overload;
function BitmapToIplImage(const bitmap: Vcl.Graphics.TBitmap): PIplImage;
function BitmapToIplImage(const bitmap: {$IFDEF VER15P}Vcl.Graphics.TBitmap{$ELSE}Graphics.TBitmap{$ENDIF VER15P}): PIplImage;
function CropIplImage(const src: PIplImage; const roi: TCvRect): PIplImage;
implementation
uses
{$IFDEF VER15P}
System.SysUtils,
{$ELSE}
SysUtils,
{$ENDIF VER15P}
ocv.core_c;
function BitmapToIplImage(const bitmap: Vcl.Graphics.TBitmap): PIplImage;
function BitmapToIplImage(const bitmap: {$IFDEF VER15P}Vcl.Graphics.TBitmap{$ELSE}Graphics.TBitmap{$ENDIF VER15P}): PIplImage;
Var
bitmapData: PByte;
begin
@ -129,7 +141,7 @@ end;
// ---------------------------------------------------------------------------
function CreateRGBBitmap(_Grab: PIplImage): HBITMAP;
function WIDTHBYTES(bits: DWORD): DWORD; inline;
function WIDTHBYTES(bits: DWORD): DWORD; {$IFDEF VER9P}inline;{$ENDIF}
begin
Result := ((((bits) + 31) div 32) * 4);
end;
@ -236,7 +248,7 @@ End;
Arguments: iplImg: PIplImage; bitmap: TBitmap
Description: convert a IplImage to a Windows bitmap
-----------------------------------------------------------------------------}
procedure IplImage2Bitmap(iplImg: PIplImage; var bitmap: Vcl.Graphics.TBitmap);
procedure IplImage2Bitmap(iplImg: PIplImage; var bitmap: {$IFDEF VER15P}Vcl.Graphics.TBitmap{$ELSE}Graphics.TBitmap{$ENDIF VER15P});
VAR
i, j: Integer;
offset: longint;
@ -283,10 +295,10 @@ BEGIN
End
END; {IplImage2Bitmap}
function cvImage2Bitmap(img: PIplImage): Vcl.Graphics.TBitmap;
function cvImage2Bitmap(img: PIplImage): {$IFDEF VER15P}Vcl.Graphics.TBitmap{$ELSE}Graphics.TBitmap{$ENDIF VER15P};
var
// info: string;
bmp: Vcl.Graphics.TBitmap;
bmp: {$IFDEF VER15P}Vcl.Graphics.TBitmap{$ELSE}Graphics.TBitmap{$ENDIF VER15P};
deep: Integer;
i, j, K, wStep, Channels: Integer;
data: PByteArray;
@ -295,7 +307,7 @@ begin
Result := NIL;
if (img <> NIL) then
begin
bmp := Vcl.Graphics.TBitmap.Create;
bmp := {$IFDEF VER15P}Vcl.Graphics.TBitmap.Create{$ELSE}Graphics.TBitmap.Create{$ENDIF VER15P};
bmp.Width := img^.Width;
bmp.Height := img^.Height;
deep := img^.nChannels * img^.depth;

View File

@ -768,7 +768,7 @@ const
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; inline;
function CV_FOURCC(const c1, c2, c3, c4: CVChar): Integer; {$IFDEF VER9P}inline;{$ENDIF}
// CVAPI(CvVideoWriter*) cvCreateImageSequenceWriter( const char* filename,
@ -873,7 +873,7 @@ procedure cvSetMouseCallback; external highgui_lib;
procedure cvConvertImage; external highgui_lib;
procedure cvMoveWindow; external highgui_lib;
function CV_FOURCC(const c1, c2, c3, c4: CVChar): Integer; inline;
function CV_FOURCC(const c1, c2, c3, c4: CVChar): Integer; {$IFDEF VER9P}inline;{$ENDIF}
begin
Result := Integer(c1) + (Integer(c2) shl 8) + (Integer(c3) shl 16) + (Integer(c4) shl 24);
end;

View File

@ -409,7 +409,7 @@ type
*************************************************************************************** *)
type
TCvSubdiv2DEdge = size_t;
TCvSubdiv2DEdge = NativeUInt;
{ EXTERNALSYM CvSubdiv2DEdge }
pCvSubdiv2DPoint = ^TCvSubdiv2DPoint;

View File

@ -612,7 +612,7 @@ function cvArcLength(const curve: Pointer; slice: TCvSlice { = CV_WHOLE_SEQ }; i
return cvArcLength( contour, CV_WHOLE_SEQ, 1 );
}
*)
function cvContourPerimeter(const contour: Pointer): double; inline;
function cvContourPerimeter(const contour: Pointer): double; {$IFDEF VER9P}inline;{$ENDIF}
// * Calculates contour boundning rectangle (update=1) or
// just retrieves pre-calculated rectangle (update=0) */
@ -769,7 +769,7 @@ procedure cvCalcArrHist(var arr: pIplImage; hist: pCvHistogram; accumulate: Inte
// {
// cvCalcArrHist( (CvArr**)image, hist, accumulate, mask );
// }
procedure cvCalcHist(var image: pIplImage; hist: pCvHistogram; accumulate: Integer = 0; const mask: pIplImage = nil); inline;
procedure cvCalcHist(var image: pIplImage; hist: pCvHistogram; accumulate: Integer = 0; const mask: pIplImage = nil); {$IFDEF VER9P}inline;{$ENDIF}
// var mask CV_DEFAULT(0) )begin cvCalcArrHist( (CvArr*)image: vArr;
@ -1052,7 +1052,7 @@ procedure cvInitUndistortMap; external imgproc_lib;
procedure cvRemap; external imgproc_lib;
function cvArcLength; external imgproc_lib;
function cvContourPerimeter(const contour: Pointer): double; inline;
function cvContourPerimeter(const contour: Pointer): double; {$IFDEF VER9P}inline;{$ENDIF}
begin
result := cvArcLength(contour, CV_WHOLE_SEQ, 1);
end;