Refactoring...

Signed-off-by: Laentir Valetov <laex@bk.ru>
This commit is contained in:
Laentir Valetov 2016-07-16 11:59:08 +04:00
parent e4934141c3
commit 4530fecec1
7 changed files with 303 additions and 262 deletions

View File

@ -14,15 +14,15 @@ Files: msvcp120.dll, msvcr120.dll, msvcp120d.dll, msvcr120d.dll
(1) 32-bit in the "Delphi-OpenCV\redist\VC2013x86\"
(2) 64-bit in the "Delphi-OpenCV\redist\VC2013x64\"
```
* Shared library FFMPEG for Windows can be downloaded from [here][5]<br>
libavutil 55. 24.100 / 55. 24.100<br>
libavcodec 57. 46.100 / 57. 46.100<br>
libavformat 57. 38.100 / 57. 38.100<br>
libavdevice 57. 0.101 / 57. 0.101<br>
libavfilter 6. 46.101 / 6. 46.101<br>
libswscale 4. 1.100 / 4. 1.100<br>
libswresample 2. 1.100 / 2. 1.100<br>
libpostproc 54. 0.100 / 54. 0.100<br>
* Shared library FFMPEG for Windows can be downloaded from [here][5] (build ffmpeg-20160710-d4c8e93)<br>
libavutil 55. 28.100 / 55. 28.100<br>
libavcodec 57. 50.100 / 57. 50.100<br>
libavformat 57. 41.100 / 57. 41.100<br>
libavdevice 57. 0.102 / 57. 0.102<br>
libavfilter 6. 47.100 / 6. 47.100<br>
libswscale 4. 1.100 / 4. 1.100<br>
libswresample 2. 1.100 / 2. 1.100<br>
libpostproc 54. 0.100 / 54. 0.100<br>
```
(3) FFmpeg 32-bit Shared
(4) FFmpeg 64-bit Shared

View File

@ -75,9 +75,9 @@ procedure TestCameraCapture;
end;
const
windowName = 'Test VideoCapture'; // Name shown in the GUI window.
VK_ESCAPE = 27;
DESIRED_CAMERA_WIDTH: Integer = 800;
windowName = 'Test VideoCapture'; // Name shown in the GUI window.
VK_ESCAPE = 27;
DESIRED_CAMERA_WIDTH: Integer = 800;
DESIRED_CAMERA_HEIGHT: Integer = 600;
Var
@ -87,11 +87,15 @@ begin
V := TVideoCapture.Create;
if V.Open(CAP_ANY) then
begin
WriteLn('CAP_PROP_FRAME_WIDTH=', DESIRED_CAMERA_WIDTH, ' -> ', V.PropSet(CAP_PROP_FRAME_WIDTH, DESIRED_CAMERA_WIDTH));
WriteLn('CAP_PROP_FRAME_WIDTH=', DESIRED_CAMERA_WIDTH, ' -> ',
V.PropSet(CAP_PROP_FRAME_WIDTH, DESIRED_CAMERA_WIDTH));
// V.Prop[CAP_PROP_FRAME_WIDTH] := DESIRED_CAMERA_WIDTH;
WriteLn('CAP_PROP_FRAME_HEIGHT=', DESIRED_CAMERA_HEIGHT, ' -> ', V.PropSet(CAP_PROP_FRAME_HEIGHT, DESIRED_CAMERA_HEIGHT));
WriteLn('CAP_PROP_FRAME_HEIGHT=', DESIRED_CAMERA_HEIGHT, ' -> ',
V.PropSet(CAP_PROP_FRAME_HEIGHT, DESIRED_CAMERA_HEIGHT));
// V.Prop[CAP_PROP_FRAME_HEIGHT] := DESIRED_CAMERA_HEIGHT;
namedWindow(windowName);
WriteLn('Press <ESC> to exit');
WriteLn('Press <Space> to info');
while true do
begin
// Grab the next camera frame. Note that you can't modify camera frames.
@ -118,8 +122,8 @@ end;
procedure TestCameraCaptureFileName;
const
windowName = 'Test VideoCapture'; // Name shown in the GUI window.
VK_ESCAPE = 27;
windowName = 'Test VideoCapture'; // Name shown in the GUI window.
VK_ESCAPE = 27;
VIDEO_FILE_NAME = cResourceMedia + '768x576.avi';
Var
@ -144,7 +148,7 @@ begin
end;
// IMPORTANT: Wait for atleast 20 milliseconds, so that the image can be displayed on the screen!
if (waitKey(20) = VK_ESCAPE) then // Escape Key
break; // Quit the program!
break; // Quit the program!
end;
destroyAllWindows;
end;
@ -153,6 +157,7 @@ end;
begin
try
TestCameraCapture;
// TestCameraCaptureFileName
except
on E: Exception do
WriteLn(E.ClassName, ': ', E.Message);

View File

@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{E4C624B6-0BB7-4001-BB0D-CB99A2927E0D}</ProjectGuid>
<ProjectVersion>18.0</ProjectVersion>
<ProjectVersion>18.1</ProjectVersion>
<FrameworkType>None</FrameworkType>
<MainSource>ClassTest.dpr</MainSource>
<Base>True</Base>
@ -160,7 +160,7 @@
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k230.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Deployment Version="2">
<Deployment Version="3">
<DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule">
<Platform Name="OSX32">
<Overwrite>true</Overwrite>
@ -182,27 +182,17 @@
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="DependencyModule">
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
<DeployFile LocalName="$(BDS)\Redist\osx32\libcgsqlite3.dylib" Class="DependencyModule">
<Platform Name="OSX32">
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="ProjectiOSDeviceResourceRules">
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXResource">
@ -254,19 +244,22 @@
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Platform Name="Linux64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
@ -317,12 +310,7 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeX86File">
<Platform Name="Android">
<RemoteDir>library\lib\x86</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeX86File"/>
<DeployClass Name="iPhone_Launch320">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
@ -405,11 +393,11 @@
</DeployClass>
<DeployClass Name="ProjectiOSEntitlements">
<Platform Name="iOSDevice64">
<RemoteDir>../</RemoteDir>
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<RemoteDir>../</RemoteDir>
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
@ -433,7 +421,7 @@
</DeployClass>
<DeployClass Name="ProjectOSXEntitlements">
<Platform Name="OSX32">
<RemoteDir>../</RemoteDir>
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
@ -556,18 +544,34 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceResourceRules">
<DeployClass Name="DependencyModule">
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
</DeployClass>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>

View File

@ -229,6 +229,6 @@ implementation
uses ffm.lib;
function av_get_channel_layout_nb_channels; external channel_layout_dll;
function av_get_channel_layout_nb_channels; external avutil_dll;
end.

View File

@ -36,7 +36,7 @@ Uses
ocv.highgui_c;
Type
cbool = bytebool;
cbool = bytebool;
TOpenCVClass = Pointer;
IOCVCommon = interface
@ -52,19 +52,19 @@ Type
IMat = interface(IOCVCommon)
['{2CFB1B8E-4D18-4C1D-839F-0AFE4213F57D}']
function elemSize(): size_t; // 0
function elemSize1(): size_t; // 1
function _type(): integer; // 2
function depth(): integer; // 3
function channels(): integer; // 4
function elemSize(): size_t; // 0
function elemSize1(): size_t; // 1
function _type(): integer; // 2
function depth(): integer; // 3
function channels(): integer; // 4
function step1(i: integer = 0): size_t; // 5
function empty(): cbool;
function total(): size_t; // 6
function total(): size_t; // 6
function flags(): integer; // 7
function dims(): integer; // 8
function rows(): integer; // 9
function cols(): integer; // 10
function data(): Pointer; // 11
function dims(): integer; // 8
function rows(): integer; // 9
function cols(): integer; // 10
function data(): Pointer; // 11
end;
TMat = class(TOCVCommon, IMat)
@ -74,19 +74,19 @@ Type
constructor Create(const _M: TOpenCVClass = nil; const NeedDestroy: boolean = True); overload;
constructor Create(const Image: pIplImage); overload;
destructor Destroy; override;
function elemSize(): size_t; // 0
function elemSize1(): size_t; // 1
function _type(): integer; // 2
function depth(): integer; // 3
function channels(): integer; // 4
function elemSize(): size_t; // 0
function elemSize1(): size_t; // 1
function _type(): integer; // 2
function depth(): integer; // 3
function channels(): integer; // 4
function step1(i: integer = 0): size_t; // 5
function empty(): cbool;
function total(): size_t; // 6
function total(): size_t; // 6
function flags(): integer; // 7
function dims(): integer; // 8
function rows(): integer; // 9
function cols(): integer; // 10
function data(): Pointer; // 11
function dims(): integer; // 8
function rows(): integer; // 9
function cols(): integer; // 10
function data(): Pointer; // 11
end;
// ---------------------------- VideoCapture --------------------------
@ -125,86 +125,87 @@ Type
const
// Camera API
CAP_ANY = 0; // autodetect
CAP_VFW = 200; // platform native
CAP_V4L = 200;
CAP_V4L2 = CAP_V4L;
CAP_FIREWARE = 300; // IEEE 1394 drivers
CAP_FIREWIRE = CAP_FIREWARE;
CAP_IEEE1394 = CAP_FIREWARE;
CAP_DC1394 = CAP_FIREWARE;
CAP_CMU1394 = CAP_FIREWARE;
CAP_QT = 500; // QuickTime
CAP_UNICAP = 600; // Unicap drivers
CAP_DSHOW = 700; // DirectShow (via videoInput)
CAP_PVAPI = 800; // PvAPI; Prosilica GigE SDK
CAP_OPENNI = 900; // OpenNI (for Kinect)
CAP_OPENNI_ASUS = 910; // OpenNI (for Asus Xtion)
CAP_ANDROID = 1000; // Android - not used
CAP_XIAPI = 1100; // XIMEA Camera API
CAP_ANY = 0; // autodetect
CAP_VFW = 200; // platform native
CAP_V4L = 200;
CAP_V4L2 = CAP_V4L;
CAP_FIREWARE = 300; // IEEE 1394 drivers
CAP_FIREWIRE = CAP_FIREWARE;
CAP_IEEE1394 = CAP_FIREWARE;
CAP_DC1394 = CAP_FIREWARE;
CAP_CMU1394 = CAP_FIREWARE;
CAP_QT = 500; // QuickTime
CAP_UNICAP = 600; // Unicap drivers
CAP_DSHOW = 700; // DirectShow (via videoInput)
CAP_PVAPI = 800; // PvAPI; Prosilica GigE SDK
CAP_OPENNI = 900; // OpenNI (for Kinect)
CAP_OPENNI_ASUS = 910; // OpenNI (for Asus Xtion)
CAP_ANDROID = 1000; // Android - not used
CAP_XIAPI = 1100; // XIMEA Camera API
CAP_AVFOUNDATION = 1200; // AVFoundation framework for iOS (OS X Lion will have the same API)
CAP_GIGANETIX = 1300; // Smartek Giganetix GigEVisionSDK
CAP_MSMF = 1400; // Microsoft Media Foundation (via videoInput)
CAP_WINRT = 1410; // Microsoft Windows Runtime using Media Foundation
CAP_INTELPERC = 1500; // Intel Perceptual Computing SDK
CAP_OPENNI2 = 1600; // OpenNI2 (for Kinect)
CAP_GIGANETIX = 1300; // Smartek Giganetix GigEVisionSDK
CAP_MSMF = 1400; // Microsoft Media Foundation (via videoInput)
CAP_WINRT = 1410; // Microsoft Windows Runtime using Media Foundation
CAP_INTELPERC = 1500; // Intel Perceptual Computing SDK
CAP_OPENNI2 = 1600; // OpenNI2 (for Kinect)
CAP_OPENNI2_ASUS = 1610; // OpenNI2 (for Asus Xtion and Occipital Structure sensors)
CAP_GPHOTO2 = 1700; // gPhoto2 connection
CAP_GPHOTO2 = 1700; // gPhoto2 connection
// generic properties (based on DC1394 properties)
CAP_PROP_POS_MSEC = 0;
CAP_PROP_POS_FRAMES = 1;
CAP_PROP_POS_AVI_RATIO = 2;
CAP_PROP_FRAME_WIDTH = 3;
CAP_PROP_FRAME_HEIGHT = 4;
CAP_PROP_FPS = 5;
CAP_PROP_FOURCC = 6;
CAP_PROP_FRAME_COUNT = 7;
CAP_PROP_FORMAT = 8;
CAP_PROP_MODE = 9;
CAP_PROP_BRIGHTNESS = 10;
CAP_PROP_CONTRAST = 11;
CAP_PROP_SATURATION = 12;
CAP_PROP_HUE = 13;
CAP_PROP_GAIN = 14;
CAP_PROP_EXPOSURE = 15;
CAP_PROP_CONVERT_RGB = 16;
CAP_PROP_POS_MSEC = 0;
CAP_PROP_POS_FRAMES = 1;
CAP_PROP_POS_AVI_RATIO = 2;
CAP_PROP_FRAME_WIDTH = 3;
CAP_PROP_FRAME_HEIGHT = 4;
CAP_PROP_FPS = 5;
CAP_PROP_FOURCC = 6;
CAP_PROP_FRAME_COUNT = 7;
CAP_PROP_FORMAT = 8;
CAP_PROP_MODE = 9;
CAP_PROP_BRIGHTNESS = 10;
CAP_PROP_CONTRAST = 11;
CAP_PROP_SATURATION = 12;
CAP_PROP_HUE = 13;
CAP_PROP_GAIN = 14;
CAP_PROP_EXPOSURE = 15;
CAP_PROP_CONVERT_RGB = 16;
CAP_PROP_WHITE_BALANCE_BLUE_U = 17;
CAP_PROP_RECTIFICATION = 18;
CAP_PROP_MONOCHROME = 19;
CAP_PROP_SHARPNESS = 20;
CAP_PROP_AUTO_EXPOSURE = 21; // DC1394: exposure control done by camera; user can adjust refernce level using this feature
CAP_PROP_GAMMA = 22;
CAP_PROP_TEMPERATURE = 23;
CAP_PROP_TRIGGER = 24;
CAP_PROP_TRIGGER_DELAY = 25;
CAP_PROP_RECTIFICATION = 18;
CAP_PROP_MONOCHROME = 19;
CAP_PROP_SHARPNESS = 20;
CAP_PROP_AUTO_EXPOSURE = 21;
// DC1394: exposure control done by camera; user can adjust refernce level using this feature
CAP_PROP_GAMMA = 22;
CAP_PROP_TEMPERATURE = 23;
CAP_PROP_TRIGGER = 24;
CAP_PROP_TRIGGER_DELAY = 25;
CAP_PROP_WHITE_BALANCE_RED_V = 26;
CAP_PROP_ZOOM = 27;
CAP_PROP_FOCUS = 28;
CAP_PROP_GUID = 29;
CAP_PROP_ISO_SPEED = 30;
CAP_PROP_BACKLIGHT = 32;
CAP_PROP_PAN = 33;
CAP_PROP_TILT = 34;
CAP_PROP_ROLL = 35;
CAP_PROP_IRIS = 36;
CAP_PROP_SETTINGS = 37;
CAP_PROP_ZOOM = 27;
CAP_PROP_FOCUS = 28;
CAP_PROP_GUID = 29;
CAP_PROP_ISO_SPEED = 30;
CAP_PROP_BACKLIGHT = 32;
CAP_PROP_PAN = 33;
CAP_PROP_TILT = 34;
CAP_PROP_ROLL = 35;
CAP_PROP_IRIS = 36;
CAP_PROP_SETTINGS = 37;
// Generic camera output modes.
// Currently; these are supported through the libv4l interface only.
CAP_MODE_BGR = 0; // BGR24 (default)
CAP_MODE_RGB = 1; // RGB24
CAP_MODE_BGR = 0; // BGR24 (default)
CAP_MODE_RGB = 1; // RGB24
CAP_MODE_GRAY = 2; // Y8
CAP_MODE_YUYV = 3; // YUYV
// DC1394 only
// modes of the controlling registers (can be: auto; manual; auto single push; absolute Latter allowed with any other mode)
// every feature can have only one mode turned on at a time
CAP_PROP_DC1394_OFF = -4; // turn the feature off (not controlled manually nor automatically)
CAP_PROP_DC1394_MODE_MANUAL = -3; // set automatically when a value of the feature is set by the user
CAP_PROP_DC1394_MODE_AUTO = -2;
CAP_PROP_DC1394_OFF = -4; // turn the feature off (not controlled manually nor automatically)
CAP_PROP_DC1394_MODE_MANUAL = -3; // set automatically when a value of the feature is set by the user
CAP_PROP_DC1394_MODE_AUTO = -2;
CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO = -1;
CAP_PROP_DC1394_MAX = 31;
CAP_PROP_DC1394_MAX = 31;
// OpenNI map generators
CAP_OPENNI_DEPTH_GENERATOR = 1 shl 31;
@ -212,43 +213,43 @@ const
CAP_OPENNI_GENERATORS_MASK = CAP_OPENNI_DEPTH_GENERATOR + CAP_OPENNI_IMAGE_GENERATOR;
// Properties of cameras available through OpenNI interfaces
CAP_PROP_OPENNI_OUTPUT_MODE = 100;
CAP_PROP_OPENNI_OUTPUT_MODE = 100;
CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101; // in mm
CAP_PROP_OPENNI_BASELINE = 102; // in mm
CAP_PROP_OPENNI_FOCAL_LENGTH = 103; // in pixels
CAP_PROP_OPENNI_REGISTRATION = 104; // flag that synchronizes the remapping depth map to image map
CAP_PROP_OPENNI_BASELINE = 102; // in mm
CAP_PROP_OPENNI_FOCAL_LENGTH = 103; // in pixels
CAP_PROP_OPENNI_REGISTRATION = 104; // flag that synchronizes the remapping depth map to image map
// by changing depth generator's view point (if the flag is "on") or
// sets this view point to its normal one (if the flag is "off").
CAP_PROP_OPENNI_REGISTRATION_ON = CAP_PROP_OPENNI_REGISTRATION;
CAP_PROP_OPENNI_REGISTRATION_ON = CAP_PROP_OPENNI_REGISTRATION;
CAP_PROP_OPENNI_APPROX_FRAME_SYNC = 105;
CAP_PROP_OPENNI_MAX_BUFFER_SIZE = 106;
CAP_PROP_OPENNI_CIRCLE_BUFFER = 107;
CAP_PROP_OPENNI_MAX_BUFFER_SIZE = 106;
CAP_PROP_OPENNI_CIRCLE_BUFFER = 107;
CAP_PROP_OPENNI_MAX_TIME_DURATION = 108;
CAP_PROP_OPENNI_GENERATOR_PRESENT = 109;
CAP_PROP_OPENNI2_SYNC = 110;
CAP_PROP_OPENNI2_MIRROR = 111;
CAP_PROP_OPENNI2_SYNC = 110;
CAP_PROP_OPENNI2_MIRROR = 111;
// OpenNI shortcats
CAP_OPENNI_IMAGE_GENERATOR_PRESENT = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT;
CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_OUTPUT_MODE;
CAP_OPENNI_DEPTH_GENERATOR_BASELINE = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_BASELINE;
CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_FOCAL_LENGTH;
CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_REGISTRATION;
CAP_OPENNI_IMAGE_GENERATOR_PRESENT = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT;
CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_OUTPUT_MODE;
CAP_OPENNI_DEPTH_GENERATOR_BASELINE = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_BASELINE;
CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_FOCAL_LENGTH;
CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_REGISTRATION;
CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION;
// OpenNI data given from depth generator
CAP_OPENNI_DEPTH_MAP = 0; // Depth values in mm (CV_16UC1)
CAP_OPENNI_POINT_CLOUD_MAP = 1; // XYZ in meters (CV_32FC3)
CAP_OPENNI_DISPARITY_MAP = 2; // Disparity in pixels (CV_8UC1)
CAP_OPENNI_DEPTH_MAP = 0; // Depth values in mm (CV_16UC1)
CAP_OPENNI_POINT_CLOUD_MAP = 1; // XYZ in meters (CV_32FC3)
CAP_OPENNI_DISPARITY_MAP = 2; // Disparity in pixels (CV_8UC1)
CAP_OPENNI_DISPARITY_MAP_32F = 3; // Disparity in pixels (CV_32FC1)
CAP_OPENNI_VALID_DEPTH_MASK = 4; // CV_8UC1
CAP_OPENNI_VALID_DEPTH_MASK = 4; // CV_8UC1
// Data given from RGB image generator
CAP_OPENNI_BGR_IMAGE = 5;
CAP_OPENNI_BGR_IMAGE = 5;
CAP_OPENNI_GRAY_IMAGE = 6;
// Supported output modes of OpenNI image generator
CAP_OPENNI_VGA_30HZ = 0;
CAP_OPENNI_VGA_30HZ = 0;
CAP_OPENNI_SXGA_15HZ = 1;
CAP_OPENNI_SXGA_30HZ = 2;
CAP_OPENNI_QVGA_30HZ = 3;
@ -258,83 +259,83 @@ const
CAP_PROP_GSTREAMER_QUEUE_LENGTH = 200; // default is 1
// PVAPI
CAP_PROP_PVAPI_MULTICASTIP = 300; // ip for anable multicast master mode. 0 for disable multicast
CAP_PROP_PVAPI_MULTICASTIP = 300; // ip for anable multicast master mode. 0 for disable multicast
CAP_PROP_PVAPI_FRAMESTARTTRIGGERMODE = 301; // FrameStartTriggerMode: Determines how a frame is initiated
CAP_PROP_PVAPI_DECIMATIONHORIZONTAL = 302; // Horizontal sub-sampling of the image
CAP_PROP_PVAPI_DECIMATIONVERTICAL = 303; // Vertical sub-sampling of the image
CAP_PROP_PVAPI_BINNINGX = 304; // Horizontal binning factor
CAP_PROP_PVAPI_BINNINGY = 305; // Vertical binning factor
CAP_PROP_PVAPI_PIXELFORMAT = 306; // Pixel format
CAP_PROP_PVAPI_DECIMATIONHORIZONTAL = 302; // Horizontal sub-sampling of the image
CAP_PROP_PVAPI_DECIMATIONVERTICAL = 303; // Vertical sub-sampling of the image
CAP_PROP_PVAPI_BINNINGX = 304; // Horizontal binning factor
CAP_PROP_PVAPI_BINNINGY = 305; // Vertical binning factor
CAP_PROP_PVAPI_PIXELFORMAT = 306; // Pixel format
// PVAPI: FrameStartTriggerMode
CAP_PVAPI_FSTRIGMODE_FREERUN = 0; // Freerun
CAP_PVAPI_FSTRIGMODE_SYNCIN1 = 1; // SyncIn1
CAP_PVAPI_FSTRIGMODE_SYNCIN2 = 2; // SyncIn2
CAP_PVAPI_FSTRIGMODE_FREERUN = 0; // Freerun
CAP_PVAPI_FSTRIGMODE_SYNCIN1 = 1; // SyncIn1
CAP_PVAPI_FSTRIGMODE_SYNCIN2 = 2; // SyncIn2
CAP_PVAPI_FSTRIGMODE_FIXEDRATE = 3; // FixedRate
CAP_PVAPI_FSTRIGMODE_SOFTWARE = 4; // Software
CAP_PVAPI_FSTRIGMODE_SOFTWARE = 4; // Software
// PVAPI: DecimationHorizontal; DecimationVertical
CAP_PVAPI_DECIMATION_OFF = 1; // Off
CAP_PVAPI_DECIMATION_2OUTOF4 = 2; // 2 out of 4 decimation
CAP_PVAPI_DECIMATION_2OUTOF8 = 4; // 2 out of 8 decimation
CAP_PVAPI_DECIMATION_OFF = 1; // Off
CAP_PVAPI_DECIMATION_2OUTOF4 = 2; // 2 out of 4 decimation
CAP_PVAPI_DECIMATION_2OUTOF8 = 4; // 2 out of 8 decimation
CAP_PVAPI_DECIMATION_2OUTOF16 = 8; // 2 out of 16 decimation
// PVAPI: PixelFormat
CAP_PVAPI_PIXELFORMAT_MONO8 = 1; // Mono8
CAP_PVAPI_PIXELFORMAT_MONO16 = 2; // Mono16
CAP_PVAPI_PIXELFORMAT_BAYER8 = 3; // Bayer8
CAP_PVAPI_PIXELFORMAT_MONO8 = 1; // Mono8
CAP_PVAPI_PIXELFORMAT_MONO16 = 2; // Mono16
CAP_PVAPI_PIXELFORMAT_BAYER8 = 3; // Bayer8
CAP_PVAPI_PIXELFORMAT_BAYER16 = 4; // Bayer16
CAP_PVAPI_PIXELFORMAT_RGB24 = 5; // Rgb24
CAP_PVAPI_PIXELFORMAT_BGR24 = 6; // Bgr24
CAP_PVAPI_PIXELFORMAT_RGBA32 = 7; // Rgba32
CAP_PVAPI_PIXELFORMAT_BGRA32 = 8; // Bgra32
CAP_PVAPI_PIXELFORMAT_RGB24 = 5; // Rgb24
CAP_PVAPI_PIXELFORMAT_BGR24 = 6; // Bgr24
CAP_PVAPI_PIXELFORMAT_RGBA32 = 7; // Rgba32
CAP_PVAPI_PIXELFORMAT_BGRA32 = 8; // Bgra32
// Properties of cameras available through XIMEA SDK interface
CAP_PROP_XI_DOWNSAMPLING = 400; // Change image resolution by binning or skipping.
CAP_PROP_XI_DATA_FORMAT = 401; // Output data format.
CAP_PROP_XI_OFFSET_X = 402; // Horizontal offset from the origin to the area of interest (in pixels).
CAP_PROP_XI_OFFSET_Y = 403; // Vertical offset from the origin to the area of interest (in pixels).
CAP_PROP_XI_TRG_SOURCE = 404; // Defines source of trigger.
CAP_PROP_XI_DATA_FORMAT = 401; // Output data format.
CAP_PROP_XI_OFFSET_X = 402; // Horizontal offset from the origin to the area of interest (in pixels).
CAP_PROP_XI_OFFSET_Y = 403; // Vertical offset from the origin to the area of interest (in pixels).
CAP_PROP_XI_TRG_SOURCE = 404; // Defines source of trigger.
CAP_PROP_XI_TRG_SOFTWARE = 405; // Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE.
CAP_PROP_XI_GPI_SELECTOR = 406; // Selects general purpose input
CAP_PROP_XI_GPI_MODE = 407; // Set general purpose input mode
CAP_PROP_XI_GPI_LEVEL = 408; // Get general purpose level
CAP_PROP_XI_GPI_MODE = 407; // Set general purpose input mode
CAP_PROP_XI_GPI_LEVEL = 408; // Get general purpose level
CAP_PROP_XI_GPO_SELECTOR = 409; // Selects general purpose output
CAP_PROP_XI_GPO_MODE = 410; // Set general purpose output mode
CAP_PROP_XI_GPO_MODE = 410; // Set general purpose output mode
CAP_PROP_XI_LED_SELECTOR = 411; // Selects camera signalling LED
CAP_PROP_XI_LED_MODE = 412; // Define camera signalling LED functionality
CAP_PROP_XI_MANUAL_WB = 413; // Calculates White Balance(must be called during acquisition)
CAP_PROP_XI_AUTO_WB = 414; // Automatic white balance
CAP_PROP_XI_AEAG = 415; // Automatic exposure/gain
CAP_PROP_XI_LED_MODE = 412; // Define camera signalling LED functionality
CAP_PROP_XI_MANUAL_WB = 413; // Calculates White Balance(must be called during acquisition)
CAP_PROP_XI_AUTO_WB = 414; // Automatic white balance
CAP_PROP_XI_AEAG = 415; // Automatic exposure/gain
CAP_PROP_XI_EXP_PRIORITY = 416; // Exposure priority (0.5 - exposure 50%; gain 50%).
CAP_PROP_XI_AE_MAX_LIMIT = 417; // Maximum limit of exposure in AEAG procedure
CAP_PROP_XI_AG_MAX_LIMIT = 418; // Maximum limit of gain in AEAG procedure
CAP_PROP_XI_AEAG_LEVEL = 419; // Average intensity of output signal AEAG should achieve(in %)
CAP_PROP_XI_TIMEOUT = 420; // Image capture timeout in milliseconds
CAP_PROP_XI_AEAG_LEVEL = 419; // Average intensity of output signal AEAG should achieve(in %)
CAP_PROP_XI_TIMEOUT = 420; // Image capture timeout in milliseconds
// Properties of cameras available through AVFOUNDATION interface
CAP_PROP_IOS_DEVICE_FOCUS = 9001;
CAP_PROP_IOS_DEVICE_EXPOSURE = 9002;
CAP_PROP_IOS_DEVICE_FLASH = 9003;
CAP_PROP_IOS_DEVICE_FOCUS = 9001;
CAP_PROP_IOS_DEVICE_EXPOSURE = 9002;
CAP_PROP_IOS_DEVICE_FLASH = 9003;
CAP_PROP_IOS_DEVICE_WHITEBALANCE = 9004;
CAP_PROP_IOS_DEVICE_TORCH = 9005;
CAP_PROP_IOS_DEVICE_TORCH = 9005;
// Properties of cameras available through Smartek Giganetix Ethernet Vision interface
// * --- Vladimir Litvinenko (litvinenko.vladimir@gmail.com) --- */
CAP_PROP_GIGA_FRAME_OFFSET_X = 10001;
CAP_PROP_GIGA_FRAME_OFFSET_Y = 10002;
CAP_PROP_GIGA_FRAME_WIDTH_MAX = 10003;
CAP_PROP_GIGA_FRAME_HEIGH_MAX = 10004;
CAP_PROP_GIGA_FRAME_OFFSET_X = 10001;
CAP_PROP_GIGA_FRAME_OFFSET_Y = 10002;
CAP_PROP_GIGA_FRAME_WIDTH_MAX = 10003;
CAP_PROP_GIGA_FRAME_HEIGH_MAX = 10004;
CAP_PROP_GIGA_FRAME_SENS_WIDTH = 10005;
CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006;
CAP_PROP_INTELPERC_PROFILE_COUNT = 11001;
CAP_PROP_INTELPERC_PROFILE_IDX = 11002;
CAP_PROP_INTELPERC_PROFILE_COUNT = 11001;
CAP_PROP_INTELPERC_PROFILE_IDX = 11002;
CAP_PROP_INTELPERC_DEPTH_LOW_CONFIDENCE_VALUE = 11003;
CAP_PROP_INTELPERC_DEPTH_SATURATION_VALUE = 11004;
CAP_PROP_INTELPERC_DEPTH_SATURATION_VALUE = 11004;
CAP_PROP_INTELPERC_DEPTH_CONFIDENCE_THRESHOLD = 11005;
CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_HORZ = 11006;
CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT = 11007;
CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_HORZ = 11006;
CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT = 11007;
// Intel PerC streams
CAP_INTELPERC_DEPTH_GENERATOR = 1 shl 29;
@ -345,36 +346,38 @@ const
// Each pixel is a 16-bit integer. The value indicates the distance from an object to the camera's XY plane or the Cartesian depth.
CAP_INTELPERC_UVDEPTH_MAP = 1;
// Each pixel contains two 32-bit floating point values in the range of 0-1; representing the mapping of depth coordinates to the color coordinates.
CAP_INTELPERC_IR_MAP = 2; // Each pixel is a 16-bit integer. The value indicates the intensity of the reflected laser beam.
CAP_INTELPERC_IR_MAP = 2;
// Each pixel is a 16-bit integer. The value indicates the intensity of the reflected laser beam.
CAP_INTELPERC_IMAGE = 3;
VIDEOWRITER_PROP_QUALITY = 1; // Quality (0..100%) of the videostream encoded
VIDEOWRITER_PROP_QUALITY = 1; // Quality (0..100%) of the videostream encoded
VIDEOWRITER_PROP_FRAMEBYTES = 2; // (Read-only): Size of just encoded video frame
// gPhoto2 properties; if propertyId is less than 0 then work on widget with that __additive inversed__ camera setting ID
// Get IDs by using CAP_PROP_GPHOTO2_WIDGET_ENUMERATE.
// @see CvCaptureCAM_GPHOTO2 for more info
CAP_PROP_GPHOTO2_PREVIEW = 17001; // Capture only preview from liveview mode.
CAP_PROP_GPHOTO2_PREVIEW = 17001; // Capture only preview from liveview mode.
CAP_PROP_GPHOTO2_WIDGET_ENUMERATE = 17002; // Readonly; returns (const char *).
CAP_PROP_GPHOTO2_RELOAD_CONFIG = 17003; // Trigger; only by set. Reload camera settings.
CAP_PROP_GPHOTO2_RELOAD_CONFIG = 17003; // Trigger; only by set. Reload camera settings.
CAP_PROP_GPHOTO2_RELOAD_ON_CHANGE = 17004; // Reload all settings on set.
CAP_PROP_GPHOTO2_COLLECT_MSGS = 17005; // Collect messages with details.
CAP_PROP_GPHOTO2_FLUSH_MSGS = 17006; // Readonly; returns (const char *).
CAP_PROP_SPEED = 17007; // Exposure speed. Can be readonly; depends on camera program.
CAP_PROP_APERTURE = 17008; // Aperture. Can be readonly; depends on camera program.
CAP_PROP_EXPOSUREPROGRAM = 17009; // Camera exposure program.
CAP_PROP_VIEWFINDER = 17010; // Enter liveview mode.
CAP_PROP_GPHOTO2_COLLECT_MSGS = 17005; // Collect messages with details.
CAP_PROP_GPHOTO2_FLUSH_MSGS = 17006; // Readonly; returns (const char *).
CAP_PROP_SPEED = 17007; // Exposure speed. Can be readonly; depends on camera program.
CAP_PROP_APERTURE = 17008; // Aperture. Can be readonly; depends on camera program.
CAP_PROP_EXPOSUREPROGRAM = 17009; // Camera exposure program.
CAP_PROP_VIEWFINDER = 17010; // Enter liveview mode.
// Flags for namedWindow
const
WINDOW_NORMAL = CV_WINDOW_NORMAL;
// the user can resize the window (no constraint) / also use to switch a fullscreen window to a normal size
WINDOW_AUTOSIZE = CV_WINDOW_AUTOSIZE; // the user cannot resize the window, the size is constrainted by the image displayed
WINDOW_AUTOSIZE = CV_WINDOW_AUTOSIZE;
// the user cannot resize the window, the size is constrainted by the image displayed
WINDOW_OPENGL = CV_WINDOW_OPENGL; // window with opengl support
WINDOW_FULLSCREEN = CV_WINDOW_FULLSCREEN; // change the window to fullscreen
WINDOW_FREERATIO = CV_WINDOW_FREERATIO; // the image expends as much as it can (no ratio constraint)
WINDOW_KEEPRATIO = CV_WINDOW_KEEPRATIO; // the ratio of the image is respected
WINDOW_FREERATIO = CV_WINDOW_FREERATIO; // the image expends as much as it can (no ratio constraint)
WINDOW_KEEPRATIO = CV_WINDOW_KEEPRATIO; // the ratio of the image is respected
// CV_EXPORTS_W void namedWindow(const String& winname, int flags = WINDOW_AUTOSIZE);
procedure namedWindow(const winname: String; const flags: integer = WINDOW_AUTOSIZE);
@ -400,8 +403,8 @@ function getWindowProperty(const winname: String; const prop_id: integer): doubl
// int* value, int count,
// TrackbarCallback onChange = 0,
// void* userdata = 0);
function createTrackbar(const trackbarname: String; const winname: String; Value: PInteger; count: integer; onChange: TCvTrackbarCallback2 = nil;
userdata: Pointer = nil): integer;
function createTrackbar(const trackbarname: String; const winname: String; Value: PInteger; count: integer;
onChange: TCvTrackbarCallback2 = nil; userdata: Pointer = nil): integer;
// CV_EXPORTS_W Mat imread( const string& filename, int flags=1 );
function imread(const FileName: string; flag: integer = 1): IMat;
// CV_EXPORTS_W cboolean imwrite( const string& filename, InputArray img, const vector<int>& params=vector<int>());
@ -440,9 +443,9 @@ Type
end;
IRect = IRect2i;
TVectorRect = TArray<IRect>;
TVectorInt = TArray<integer>;
IRect = IRect2i;
TVectorRect = TArray<IRect>;
TVectorInt = TArray<integer>;
TVectorDouble = TArray<double>;
ICascadeClassifier = interface(IOCVCommon)
@ -450,12 +453,15 @@ Type
function empty(): cbool;
function load(const FileName: String): cbool;
// function Read(const node: IFileNode): cbool;
procedure detectMultiScale(Image: IMat; Var objects: TVectorRect; scaleFactor: double { = 1.1 }; minNeighbors: integer { = 3 };
flags: integer { = 0 }; minSize: ISize { = Size() }; maxSize: ISize { = Size() } ); overload;
procedure detectMultiScale(Image: IMat; Var objects: TVectorRect; var numDetections: TVectorInt; scaleFactor: double { = 1.1 };
minNeighbors: integer { = 3 }; flags: integer { = 0 }; minSize: ISize { = Size() }; maxSize: ISize { = Size() } ); overload;
procedure detectMultiScale(Image: IMat; Var objects: TVectorRect; var rejectLevels: TVectorInt; Var levelWeights: TVectorDouble;
scaleFactor: double { = 1.1 }; minNeighbors: integer { = 3 }; flags: integer { = 0 }; minSize: ISize { = Size() }; maxSize: ISize { = Size() };
procedure detectMultiScale(Image: IMat; Var objects: TVectorRect; scaleFactor: double { = 1.1 };
minNeighbors: integer { = 3 }; flags: integer { = 0 }; minSize: ISize { = Size() };
maxSize: ISize { = Size() } ); overload;
procedure detectMultiScale(Image: IMat; Var objects: TVectorRect; var numDetections: TVectorInt;
scaleFactor: double { = 1.1 }; minNeighbors: integer { = 3 }; flags: integer { = 0 }; minSize: ISize { = Size() };
maxSize: ISize { = Size() } ); overload;
procedure detectMultiScale(Image: IMat; Var objects: TVectorRect; var rejectLevels: TVectorInt;
Var levelWeights: TVectorDouble; scaleFactor: double { = 1.1 }; minNeighbors: integer { = 3 };
flags: integer { = 0 }; minSize: ISize { = Size() }; maxSize: ISize { = Size() };
outputRejectLevels: cbool = false); overload;
function isOldFormatCascade(): cbool;
function getOriginalWindowSize(): ISize;
@ -509,8 +515,9 @@ Type
- (Python) A face detection example using cascade classifiers can be found at
opencv_source_code/samples/python2/facedetect.py
*)
procedure detectMultiScale(Image: IMat; Var objects: TVectorRect; scaleFactor: double { = 1.1 }; minNeighbors: integer { = 3 };
flags: integer { = 0 }; minSize: ISize { = Size() }; maxSize: ISize { = Size() } ); overload;
procedure detectMultiScale(Image: IMat; Var objects: TVectorRect; scaleFactor: double { = 1.1 };
minNeighbors: integer { = 3 }; flags: integer { = 0 }; minSize: ISize { = Size() };
maxSize: ISize { = Size() } ); overload;
(* * @overload
@param image Matrix of the type CV_8U containing an image where objects are detected.
@ -527,15 +534,17 @@ Type
@param minSize Minimum possible object size. Objects smaller than that are ignored.
@param maxSize Maximum possible object size. Objects larger than that are ignored.
*)
procedure detectMultiScale(Image: IMat; Var objects: TVectorRect; var numDetections: TVectorInt; scaleFactor: double { = 1.1 };
minNeighbors: integer { = 3 }; flags: integer { = 0 }; minSize: ISize { = Size() }; maxSize: ISize { = Size() } ); overload;
procedure detectMultiScale(Image: IMat; Var objects: TVectorRect; var numDetections: TVectorInt;
scaleFactor: double { = 1.1 }; minNeighbors: integer { = 3 }; flags: integer { = 0 }; minSize: ISize { = Size() };
maxSize: ISize { = Size() } ); overload;
(* * @overload
if `outputRejectLevels` is `true` returns `rejectLevels` and `levelWeights`
*)
procedure detectMultiScale(Image: IMat; Var objects: TVectorRect; var rejectLevels: TVectorInt; Var levelWeights: TVectorDouble;
scaleFactor: double { = 1.1 }; minNeighbors: integer { = 3 }; flags: integer { = 0 }; minSize: ISize { = Size() }; maxSize: ISize { = Size() };
procedure detectMultiScale(Image: IMat; Var objects: TVectorRect; var rejectLevels: TVectorInt;
Var levelWeights: TVectorDouble; scaleFactor: double { = 1.1 }; minNeighbors: integer { = 3 };
flags: integer { = 0 }; minSize: ISize { = Size() }; maxSize: ISize { = Size() };
outputRejectLevels: cbool = false); overload;
function isOldFormatCascade(): cbool;
@ -557,34 +566,39 @@ Type
implementation
Uses
ocv.core_c,
ocv.utils,
ocv.lib;
ocv.core_c, ocv.utils, ocv.lib;
// ------------------------------ Mat ------------------------------
function _CreateMat: TOpenCVClass; stdcall; external opencv_classes_lib name '_CreateMat@0';
function _GetMatData(const e: TOpenCVClass; index: integer; param: integer = 0): integer; stdcall; external opencv_classes_lib name '_GetMatData@12';
function _GetMatData(const e: TOpenCVClass; index: integer; param: integer = 0): integer; stdcall;
external opencv_classes_lib name '_GetMatData@12';
function _MatEmpty(const e: TOpenCVClass): cbool; stdcall; external opencv_classes_lib name '_MatEmpty@4';
function _CreateMatFromImage(const Image: pIplImage): TOpenCVClass; stdcall; external opencv_classes_lib name '_CreateMatFromImage@4';
function _CreateMatFromImage(const Image: pIplImage): TOpenCVClass; stdcall;
external opencv_classes_lib name '_CreateMatFromImage@4';
procedure _DestroyMat(const M: TOpenCVClass); stdcall; external opencv_classes_lib name '_DestroyMat@4';
// ------------------------------ VideoCapture ------------------------------
function _CreateVideoCapture: TOpenCVVideoCaptureClass; stdcall; external opencv_classes_lib name '_CreateVideoCapture@0';
function _CreateVideoCapture: TOpenCVVideoCaptureClass; stdcall;
external opencv_classes_lib name '_CreateVideoCapture@0';
function _VideoCaptureOpen(const e: TOpenCVVideoCaptureClass; CamNumber: integer): cbool; stdcall;
external opencv_classes_lib name '_VideoCaptureOpen@8';
function _VideoCaptureOpenFileName(const e: TOpenCVVideoCaptureClass; FileName: PAnsiChar): cbool; stdcall;
external opencv_classes_lib name '_VideoCaptureOpenFileName@8';
function _VideoCaptureisOpened(const e: TOpenCVVideoCaptureClass): cbool; stdcall; external opencv_classes_lib name '_VideoCaptureisOpened@4';
function _VideoCaptureisOpened(const e: TOpenCVVideoCaptureClass): cbool; stdcall;
external opencv_classes_lib name '_VideoCaptureisOpened@4';
function _VideoCaptureRead(const e: TOpenCVVideoCaptureClass; var M: TOpenCVClass): cbool; stdcall;
external opencv_classes_lib name '_VideoCaptureRead@8';
function _VideoCaptureSet(const e: TOpenCVVideoCaptureClass; propId: integer; Value: double): cbool; stdcall;
external opencv_classes_lib name '_VideoCaptureSet@16';
function _VideoCaptureGet(const e: TOpenCVVideoCaptureClass; propId: integer): double; stdcall; external opencv_classes_lib name '_VideoCaptureGet@8';
procedure _DestroyVideoCapture(const e: TOpenCVVideoCaptureClass); stdcall; external opencv_classes_lib name '_DestroyVideoCapture@4';
function _VideoCaptureGet(const e: TOpenCVVideoCaptureClass; propId: integer): double; stdcall;
external opencv_classes_lib name '_VideoCaptureGet@8';
procedure _DestroyVideoCapture(const e: TOpenCVVideoCaptureClass); stdcall;
external opencv_classes_lib name '_DestroyVideoCapture@4';
// ------------------------------ CascadeClassifier ------------------------------
function _CreateCascadeClassifier: TOpenCVClass; stdcall; external opencv_classes_lib name '_CreateCascadeClassifier@0';
procedure _DestroyCascadeClassifier(const CascadeClassifier: TOpenCVClass); stdcall; external opencv_classes_lib name '_DestroyCascadeClassifier@4';
procedure _DestroyCascadeClassifier(const CascadeClassifier: TOpenCVClass); stdcall;
external opencv_classes_lib name '_DestroyCascadeClassifier@4';
function _get_CascadeClassifier_empty(CascadeClassifier: TOpenCVClass): cbool; stdcall;
external opencv_classes_lib name '_get_CascadeClassifier_empty@4';
function _get_CascadeClassifier_load(CascadeClassifier: TOpenCVClass; FileName: PAnsiChar): cbool; stdcall;
@ -651,8 +665,8 @@ begin
Result := cvGetWindowProperty(winname.AsPAnsiChar, prop_id);
end;
function createTrackbar(const trackbarname: String; const winname: String; Value: PInteger; count: integer; onChange: TCvTrackbarCallback2 = nil;
userdata: Pointer = nil): integer;
function createTrackbar(const trackbarname: String; const winname: String; Value: PInteger; count: integer;
onChange: TCvTrackbarCallback2 = nil; userdata: Pointer = nil): integer;
begin
Result := cvCreateTrackbar2(trackbarname.AsPAnsiChar, winname.AsPAnsiChar, Value, count, onChange, userdata);
end;
@ -791,7 +805,9 @@ end;
function TVideoCapture.Open(const FileName: String): cbool;
begin
if Assigned(FData) then
_VideoCaptureOpenFileName(FData, FileName.AsPAnsiChar);
Result := _VideoCaptureOpenFileName(FData, FileName.AsPAnsiChar)
else
Result := false;
end;
function TVideoCapture.PropSet(const propId: integer; const Value: double): cbool;
@ -809,7 +825,7 @@ Var
_M: TOpenCVClass;
begin
Result := _VideoCaptureRead(FData, _M);
Mat := TMat.Create(_M);
Mat := TMat.Create(_M);
end;
procedure TVideoCapture.setProp(const propId: integer; const Value: double);
@ -858,24 +874,25 @@ begin
inherited;
end;
procedure TCascadeClassifier.detectMultiScale(Image: IMat; var objects: TVectorRect; var numDetections: TVectorInt; scaleFactor: double;
procedure TCascadeClassifier.detectMultiScale(Image: IMat; var objects: TVectorRect; var numDetections: TVectorInt;
scaleFactor: double; minNeighbors, flags: integer; minSize, maxSize: ISize);
begin
end;
procedure TCascadeClassifier.detectMultiScale(Image: IMat; var objects: TVectorRect; var rejectLevels: TVectorInt;
var levelWeights: TVectorDouble; scaleFactor: double; minNeighbors, flags: integer; minSize, maxSize: ISize;
outputRejectLevels: cbool);
begin
end;
procedure TCascadeClassifier.detectMultiScale(Image: IMat; var objects: TVectorRect; scaleFactor: double;
minNeighbors, flags: integer; minSize, maxSize: ISize);
begin
end;
procedure TCascadeClassifier.detectMultiScale(Image: IMat; var objects: TVectorRect; var rejectLevels: TVectorInt; var levelWeights: TVectorDouble;
scaleFactor: double; minNeighbors, flags: integer; minSize, maxSize: ISize; outputRejectLevels: cbool);
begin
end;
procedure TCascadeClassifier.detectMultiScale(Image: IMat; var objects: TVectorRect; scaleFactor: double; minNeighbors, flags: integer;
minSize, maxSize: ISize);
begin
end;
function TCascadeClassifier.empty: cbool;
begin
Result := _get_CascadeClassifier_empty(FData);
@ -893,7 +910,7 @@ end;
function TCascadeClassifier.isOldFormatCascade: cbool;
begin
Result:=_CascadeClassifier_isOldFormatCascade(FData);
Result := _CascadeClassifier_isOldFormatCascade(FData);
end;
function TCascadeClassifier.load(const FileName: String): cbool;

View File

@ -68,7 +68,7 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<TargetExt>300d.dll</TargetExt>
<TargetExt>2413d.dll</TargetExt>
<OutDir>..\..\bin\win32\</OutDir>
<IncludePath>D:\opencv3\build\include\;$(IncludePath)</IncludePath>
<LibraryPath>D:\opencv3\build\x86\vc12\lib\;$(LibraryPath)</LibraryPath>
@ -77,18 +77,18 @@
<IncludePath>D:\opencv3\build\include\;$(IncludePath)</IncludePath>
<LibraryPath>D:\opencv3\build\x86\vc12\lib\;$(LibraryPath)</LibraryPath>
<LinkIncremental>true</LinkIncremental>
<TargetExt>300d.dll</TargetExt>
<TargetExt>2413d.dll</TargetExt>
<OutDir>..\..\bin\win64\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\bin\win32\</OutDir>
<TargetExt>300.dll</TargetExt>
<TargetExt>2413.dll</TargetExt>
<IncludePath>D:\opencv3\build\include\;$(IncludePath)</IncludePath>
<LibraryPath>D:\opencv3\build\x86\vc12\lib\;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetExt>300.dll</TargetExt>
<TargetExt>2413.dll</TargetExt>
<IncludePath>D:\opencv3\build\include\;$(IncludePath)</IncludePath>
<LibraryPath>D:\opencv3\build\x86\vc12\lib\;$(LibraryPath)</LibraryPath>
<LinkIncremental>false</LinkIncremental>

View File

@ -404,6 +404,21 @@
{$DEFINE HAS_TYPES}
{$ENDIF VER300}
{$IFDEF VER310} { Delphi 10.1 }
{$DEFINE Delphi}
{$DEFINE Delphi32}
{$DEFINE Delphi4UP}
{$DEFINE Delphi5UP}
{$DEFINE Delphi6UP}
{$DEFINE Delphi7UP}
{$DEFINE Delphi8UP}
{$DEFINE Delphi9UP}
{$DEFINE Delphi10UP}
{$WARN UNSAFE_TYPE OFF} {Disable warning for unsafe types in Delphi 7}
{$DEFINE Has_Int64}
{$DEFINE HAS_TYPES}
{$ENDIF VER300}
{$IFDEF UNIX}
{$ifdef VER140} // Kylix 1 & 2
{$DEFINE KYLIX}