Add sample

LibTest
[+] cvMatchShapes
[+] cvWarpAffine
[+] cvWrapPrespective

MultiDemo
[+] HandsDetect

Signed-off-by: Laex <laex@bk.ru>
This commit is contained in:
Laex 2013-04-02 21:07:49 +04:00
parent 57110d63e1
commit 37d4e0fd1d
18 changed files with 1527 additions and 92 deletions

4
.gitignore vendored
View File

@ -17,3 +17,7 @@ __history
/bin/Result/*.avi
/bin/Result/*.xml
/bin/Result/*.png
*.drc
*.jdbg

View File

@ -458,7 +458,8 @@ const
(* Convexity defect *)
type
CvConvexityDefect = packed record
pCvConvexityDefect=^TCvConvexityDefect;
TCvConvexityDefect = packed record
start: PCvPoint; (* point of the contour where the defect begins *)
cend: PCvPoint; (* point of the contour where the defect ends *)
depth_point: PCvPoint; (* the farthest from the convex hull point within the defect *)

View File

@ -215,26 +215,41 @@ procedure cvCvtColor(const src: pIplImage; dst: pIplImage; code: Integer); cdecl
}
procedure cvResize(const src: TCvArr; dst: TCvArr; interpolation: Integer = CV_INTER_LINEAR); cdecl;
// CVAPI(procedure)cvWarpAffine(CvArr
// * src: ): CV_INTER_LINEAR): Integer; (; var dst: CvArr; var map_matrix: CvMat;
// Computes affine transform matrix for mapping src: array [0 .. I - 1] of var to dst[I]
// (I = 0 function flags CV_DEFAULT(v1: cvScalarAll(
// 0))): Integer; (; :; var)
{
/* Warps image with affine transform */
CVAPI(void) cvWarpAffine( const CvArr* src, CvArr* dst, const CvMat* map_matrix,
int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS),
CvScalar fillval CV_DEFAULT(cvScalarAll(0)) );
}
procedure cvWarpAffine(const src: pIplImage; dst: pIplImage; const map_matrix: pCvMat;
flags: Integer { = CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS }; fillval: TCvScalar { = cvScalarAll(0) } ); cdecl;
// CVAPI(CvMat)cvGetAffineTransform(CvPoint2D32f * src: );
// var dst: vPoint2D32f; var map_matrix: CvMat);
//
// (* Computes rotation_matrix matrix *)
// CVAPI(CvMat)cv2DRotationMatrix(CvPoint2D32f center, Double angle, Double scale, CvMat * map_matrix);
//
// (* Warps image with perspective (projective) transform *)
// CVAPI(
// procedure)cvWarpPerspective(Computes perspective transform matrix for mapping src: array [0 .. I -
// 1] of var to dst[I](I = 0 v1: cvScalarAll(0))): Integer; (; :; :;
// var)CVAPI(CvMat)cvGetPerspectiveTransform(CvPoint2D32f * src: ); var dst: vPoint2D32f;
// var map_matrix: CvMat);
//
{
(* Computes rotation_matrix matrix *)
CVAPI(CvMat)cv2DRotationMatrix(CvPoint2D32f center, Double angle, Double scale, CvMat * map_matrix);
}
function cv2DRotationMatrix(center: TCvPoint2D32f; angle: double; scale: double; map_matrix: pCvMat): pCvMat; cdecl;
{
/* Warps image with perspective (projective) transform */
CVAPI(void) cvWarpPerspective( const CvArr* src, CvArr* dst, const CvMat* map_matrix,
int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS),
CvScalar fillval CV_DEFAULT(cvScalarAll(0)) );
}
procedure cvWarpPerspective(const src: pIplImage; dst: pIplImage; const map_matrix: pCvMat;
flags: Integer { =CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS }; fillval: TCvScalar { =cvScalarAll(0) } ); cdecl;
{
/* Computes perspective transform matrix for mapping src[i] to dst[i] (i=0,1,2,3) */
CVAPI(CvMat*) cvGetPerspectiveTransform( const CvPoint2D32f* src,
const CvPoint2D32f* dst,
CvMat* map_matrix );
}
function cvGetPerspectiveTransform(const src: pCvPoint2D32f; const dst: pCvPoint2D32f; map_matrix: pCvMat)
: pCvMat; cdecl;
{
/* Performs generic geometric transformation using the specified coordinate maps */
CVAPI(void) cvRemap(
@ -524,25 +539,38 @@ function cvApproxPoly(
{ } eps: double;
{ } recursive: Integer = 0): PCvSeq; cdecl;
//
// (* Calculates perimeter of a contour or length of a part of contour *)
// CVAPI(Double) cvArcLength( Pointer curve,
// CvSlice slice CV_DEFAULT(CV_WHOLE_SEQ),
// function is_closed CV_DEFAULT(v1: -1)): Integer;
//
// CV_INLINE function cvContourPerimeter(v1: contour; v2: CV_WHOLE_SEQ; : ): Double;
// end;
//
//
(*
/* Calculates perimeter of a contour or length of a part of contour */
CVAPI(double) cvArcLength( const void* curve,
CvSlice slice CV_DEFAULT(CV_WHOLE_SEQ),
int is_closed CV_DEFAULT(-1));
*)
function cvArcLength(const curve: Pointer; slice: TCvSlice { = CV_WHOLE_SEQ }; is_closed: Integer { = 1 } )
: double; cdecl;
(*
CV_INLINE double cvContourPerimeter( const void* contour )
{
return cvArcLength( contour, CV_WHOLE_SEQ, 1 );
}
*)
function cvContourPerimeter(const contour: Pointer): double; inline;
// (* Calculates contour boundning rectangle (update=1) or
// just retrieves pre-calculated rectangle (update=0) *)
// CVAPI(CvRect) cvBoundingRect( CvArr* points, Integer update CV_DEFAULT(0) );
//
// (* Calculates area of a contour or contour segment *)
// CVAPI(Double) cvContourArea( CvArr* contour,
// CvSlice slice CV_DEFAULT(CV_WHOLE_SEQ),
// function oriented CV_DEFAULT(v1: 0)): Integer;
//
{
/* Calculates area of a contour or contour segment */
CVAPI(double) cvContourArea( const CvArr* contour,
CvSlice slice CV_DEFAULT(CV_WHOLE_SEQ),
int oriented CV_DEFAULT(0));
}
function cvContourArea(const contour: PCvSeq; slice: TCvSlice { = CV_WHOLE_SEQ }; oriented: Integer { = 0 } )
: double; cdecl;
// (* Finds minimum area rotated rectangle bounding a set of points *)
// CVAPI(CvBox2D) cvMinAreaRect2( CvArr* points,
// CvMemStorage* storage CV_DEFAULT(0));
@ -551,24 +579,34 @@ function cvApproxPoly(
// CVAPI(Integer) cvMinEnclosingCircle( CvArr* points,
// CvPoint2D32f* center, Single* radius );
//
// (* Compares two contours by matching their moments *)
// CVAPI(Double) cvMatchShapes( Pointer object1, Pointer object2,
// function method, function parameter CV_DEFAULT(v1: 0)): Integer;
//
// (* Calculates exact convex hull of 2d point set *)
// CVAPI(CvSeq) cvConvexHull2( CvArr* input,
// function hull_storage CV_DEFAULT(
// v1: CV_CLOCKWISE);
// return_points CV_DEFAULT(0): Integer): Integer;
//
{
/* Compares two contours by matching their moments */
CVAPI(double) cvMatchShapes( const void* object1, const void* object2,
int method, double parameter CV_DEFAULT(0));
}
function cvMatchShapes(const object1: Pointer; const object2: Pointer; method: Integer; parameter: double = 0)
: double; cdecl;
{
/* Calculates exact convex hull of 2d point set */
CVAPI(CvSeq*) cvConvexHull2( const CvArr* input,
void* hull_storage CV_DEFAULT(NULL),
int orientation CV_DEFAULT(CV_CLOCKWISE),
int return_points CV_DEFAULT(0));
}
function cvConvexHull2(const input: PCvSeq; hull_storage: Pointer = nil; orientation: Integer = CV_CLOCKWISE;
return_points: Integer = 0): PCvSeq; cdecl;
// (* Checks whether the contour is convex or not (returns 1 if convex, 0 if not) *)
// CVAPI(Integer) cvCheckContourConvexity( CvArr* contour ): Double;
//
//
// (* Finds convexity defects for the contour *)
// CVAPI(CvSeq) cvConvexityDefects( CvArr* contour, CvArr* convexhull,
// CvMemStorage* storage CV_DEFAULT(0)): Pointer;
//
{
(* Finds convexity defects for the contour *)
CVAPI(CvSeq) cvConvexityDefects( CvArr* contour, CvArr* convexhull,
CvMemStorage* storage CV_DEFAULT(0)): Pointer;
}
function cvConvexityDefects(contour: PCvSeq; convexhull: pCvSeq; storage: PCvMemStorage = nil): PCvSeq; cdecl;
// (* Fits ellipse into a set of 2d points *)
// CVAPI(CvBox2D) cvFitEllipse2( CvArr* points );
//
@ -731,7 +769,7 @@ procedure cvFloodFill(
{ } up_diff: TCvScalar { * cvScalarAll(0) * };
{ } comp: pCvConnectedComp = NIL;
{ } flags: Integer = 4;
{ } mask: PCvArr = NIL); cdecl;
{ } mask: pCvArr = NIL); cdecl;
// ****************************************************************************************
// * Feature detection *
@ -898,5 +936,20 @@ procedure cvEqualizeHist; external imgproc_Dll;
procedure cvFindCornerSubPix; external imgproc_Dll;
procedure cvInitUndistortMap; external imgproc_Dll;
procedure cvRemap; external imgproc_Dll;
function cvArcLength; external imgproc_Dll;
function cvContourPerimeter(const contour: Pointer): double; inline;
begin
Result := cvArcLength(contour, CV_WHOLE_SEQ, 1);
end;
function cvMatchShapes; external imgproc_Dll;
function cv2DRotationMatrix; external imgproc_Dll;
procedure cvWarpAffine; external imgproc_Dll;
function cvGetPerspectiveTransform; external imgproc_Dll;
procedure cvWarpPerspective; external imgproc_Dll;
function cvContourArea; external imgproc_Dll;
function cvConvexHull2; external imgproc_Dll;
function cvConvexityDefects; external imgproc_Dll;
end.

View File

@ -662,35 +662,6 @@ type
cols: Integer;
end;
// TCvMat = packed record
// cType: Integer;
// step: Integer;
// refcount: ^Integer;
// hdr_refcount: Integer;
// { * case data:integer of
// ptr: ^uchar;
// s: ^SmallInt;
// i: ^Integer;
// fl: ^Single;
// db: ^Double;
// data = CvMat;*)
//
// //{$EXTERNALSYM data }
// // {$IFDEF __cplusplus}
// (*
// union
// begin
// Integer rows;
// Integer height;);
//
// union begin Integer cols; Integer width;);
// {$ELSE}
// Integer rows;
// Integer cols;
// {$ENDIF}
// *)
// end;
(* ***************************************************************************************\
* Multi-dimensional dense cArray (CvMatND) *
*************************************************************************************** *)
@ -706,7 +677,7 @@ const
{$EXTERNALSYM CV_MAX_DIM_HEAP}
type
CvMatND = packed record
TCvMatND = packed record
cType: Integer;
dims: Integer;
refcount: ^Integer;
@ -814,11 +785,11 @@ const
type
CvHistogram = packed record
cType: Integer;
bins: ^TCvArr;
bins: pCvArr;
thresh: array [0 .. CV_MAX_DIM - 1, 0 .. 1] of Single;
(* For uniform histograms. *)
thresh2: ^Single; (* For non-uniform histograms. *)
mat: CvMatND; (* Embedded matrix header for array histograms. *)
thresh2: pSingle; (* For non-uniform histograms. *)
mat: TCvMatND; (* Embedded matrix header for array histograms. *)
end;
(* ***************************************************************************************\

View File

@ -1141,13 +1141,14 @@ function cvGetSeqElem(const seq: pCvSeq; index: Integer): pSChar; cdecl;
// The sequence can be read in forward or backward direction *)
// procedure cvStartReadSeq(var Returns current sequence reader position(currently observed sequence
// element) * )CVAPI(Integer)cvGetSeqReaderPos(CvSeqReader * reader: v1: 0)): Integer; ();
//
// (* Changes sequence reader position. It may seek to an absolute or
// to relative to the current position *)
// procedure cvSetSeqReaderPos(var Copies sequence content to A continuous piece of memory * )
// procedure cvCvtSeqToArray(CvSeq * seq: v1: 0)): Integer; (; var elements: void;
// slice CV_DEFAULT(CV_WHOLE_SEQ): CvSlice);
//
{
/* Copies sequence content to a continuous piece of memory */
CVAPI(void*) cvCvtSeqToArray( const CvSeq* seq, void* elements,
CvSlice slice CV_DEFAULT(CV_WHOLE_SEQ) );
}
function cvCvtSeqToArray(const seq: pCvSeq; elements: Pointer; slice: TCvSlice { =CV_WHOLE_SEQ } ): Pointer; cdecl;
// (* Creates sequence header for array.
// After that all the operations on sequences that do not alter the content
// can be applied to the resultant sequence *)
@ -1760,7 +1761,7 @@ function cvReadIntByName(const fs: pCvFileStorage; const map: pCvFileNode; const
CVAPI(void*) cvRead( CvFileStorage* fs, CvFileNode* node,
CvAttrList* attributes CV_DEFAULT(NULL));
}
function cvRead(fs:pCvFileStorage; node:pCvFileNode; attributes:pCvAttrList=nil): pPointer; cdecl;
function cvRead(fs: pCvFileStorage; node: pCvFileNode; attributes: pCvAttrList = nil): pPointer; cdecl;
//
// (* decodes standard or user-defined object and returns it *)
@ -2096,5 +2097,6 @@ end;
function cvGetFileNodeByName; external Core_Dll;
function cvRead; external Core_Dll;
function cvCvtSeqToArray; external Core_Dll;
end.

View File

@ -0,0 +1,197 @@
// JCL_DEBUG_EXPERT_GENERATEJDBG OFF
// JCL_DEBUG_EXPERT_INSERTJDBG OFF
// JCL_DEBUG_EXPERT_DELETEMAPFILE OFF
program cv_MatchShapes;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
Core.types_c in '..\..\..\include\ñore\Core.types_c.pas',
core_c in '..\..\..\include\ñore\core_c.pas',
highgui_c in '..\..\..\include\highgui\highgui_c.pas',
imgproc.types_c in '..\..\..\include\imgproc\imgproc.types_c.pas',
imgproc_c in '..\..\..\include\imgproc\imgproc_c.pas',
uLibName in '..\..\..\include\uLibName.pas',
types_c in '..\..\..\include\ñore\types_c.pas';
const
const_original = 'resource\matchshapes2.jpg';
const_template= 'resource\matchshapes_template.jpg';
var
original: pIplImage = nil;
template: pIplImage = nil;
original_filename, template_filename: AnsiString;
src: pIplImage=nil;
dst: pIplImage=nil;
binI: pIplImage=nil;
binT: pIplImage=nil;
rgb: pIplImage=nil;
rgbT: pIplImage=nil;
storage: pCvMemStorage=nil;
contoursI: pCvSeq=nil;
contoursT: pCvSeq=nil;
seq0: pCvSeq=nil;
seqT: pCvSeq=nil;
seqM: pCvSeq=nil;
contoursCont: integer;
font: TCvFont;
counter: integer;
perim, match0: double;
perimT:Double=0;
matchM:Double=1000;
begin
// Ïåðâûé ïàðàìåòð óêàçûâàåò èñõîäíóþ êàðòèíêó, âòîðîé - øàáëîí ïîèñêà
if ParamCount = 2 then
begin
original_filename := ParamStr(1);
template_filename := ParamStr(2);
end
else
begin
original_filename := const_original;
template_filename := const_template;
end;
// Ïîëó÷àåì êàðòèíêó
original := cvLoadImage(pCVChar(original_filename), CV_LOAD_IMAGE_COLOR);
WriteLn(Format('[i] original image: %s', [original_filename]));
// Ïîëó÷àåì êàðòèíêó øàáëîíà
template := cvLoadImage(pCVChar(template_filename), CV_LOAD_IMAGE_COLOR);
WriteLn(Format('[i] template image: %s', [template_filename]));
// Ïîêàæåì íàøè èçîáðàæåíèÿ
cvNamedWindow('Original', CV_WINDOW_AUTOSIZE);
cvShowImage('Original', original);
cvNamedWindow('Template', CV_WINDOW_AUTOSIZE);
cvShowImage('Template', template);
// Cðàâíåíèå
WriteLn('[i] Run test cvMatchShapes()');
// Êëîíèðóåì êàðòèíêó
src := cvCloneImage(original);
// Ñîçäà¸ì îäíîêàíàëüíûå êàðòèíêè
binI := cvCreateImage(cvGetSize(src), IPL_DEPTH_8U, 1);
binT := cvCreateImage(cvGetSize(template), IPL_DEPTH_8U, 1);
// Çàâåä¸ì öâåòíûå êàðòèíêè
rgb := cvCreateImage(cvGetSize(original), IPL_DEPTH_8U, 3);
cvConvertImage(src, rgb, CV_GRAY2BGR);
rgbT := cvCreateImage(cvGetSize(template), IPL_DEPTH_8U, 3);
cvConvertImage(template, rgbT, CV_GRAY2BGR);
// Ïîëó÷àåì ãðàíèöû èçîáðàæåíèÿ è øàáëîíà
cvCanny(src, binI, 50, 200);
cvCanny(template, binT, 50, 200);
// Ïîêàçûâàåì
//cvNamedWindow('CannyI', CV_WINDOW_AUTOSIZE);
//cvShowImage('CannyI', binI);
//cvNamedWindow('CannyT', CV_WINDOW_AUTOSIZE);
//cvShowImage('CannyT', binT);
// Ñîçäàåì õðàíèëèùå
storage := nil;
storage := cvCreateMemStorage(0);
// Íàõîäèì êîíòóðû
contoursCont := cvFindContours(binI, storage, @contoursI, sizeof(TCvContour), CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE, cvPoint(0,0));
// Äëÿ îòìåòêè êîíòóðîâ
cvInitFont(@font, CV_FONT_HERSHEY_PLAIN, 1.0, 1.0);
// Íàðèñóåì êîíòóðû èçîáðàæåíèÿ
if contoursI <> nil then
begin
// Ðèñóåì êîíòóð
seq0 := contoursI;
while (seq0 <> nil) do
begin
cvDrawContours(rgb, seq0, CV_RGB(255,216,0), CV_RGB(0,0,250), 0, 1, 8, cvPoint(0,0));
seq0 := seq0.h_next;
end;
end;
// Ïîêàçûâàåì
//cvNamedWindow('Cont', CV_WINDOW_AUTOSIZE);
//cvShowImage('Cont', rgb );
cvConvertImage(src, rgb, CV_GRAY2BGR);
// Íàõîäèì êîíòóðû øàáëîíà
cvFindContours(binT, storage, @contoursT, sizeof(TCvContour), CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE, cvPoint(0,0));
if contoursT <> nil then
begin
// Íàõîäèì ñàìûé äëèííûé êîíòóð
seq0 := contoursT;
while (seq0 <> nil) do
begin
perim := cvContourPerimeter(seq0);
if perim > perimT then
begin
perimT := perim;
seqT := seq0;
end;
// Ðèñóåì
cvDrawContours(rgbT, seq0, CV_RGB(255,216,0), CV_RGB(0,0,250), 0, 1, 8, cvPoint(0,0));
seq0 := seq0.h_next;
end;
end;
// Ïîêàæåì êîíòóð øàáëîíà
cvDrawContours(rgbT, seqT, CV_RGB(52,201,36), CV_RGB(36,201,197), 0, 2, 8, cvPoint(0,0));
//cvNamedWindow('ContT', CV_WINDOW_AUTOSIZE);
//cvShowImage('ContT', rgbT);
// Îáõîäèì êîíòóðû èçîáðàæåíèÿ
counter := 0;
if contoursI <> nil then
begin
// Ïîèñê ëó÷øåãî ñîâïàäåíèÿ êîíòóðîâ ïî èõ ìîìåíòàì
seq0 := contoursI;
while (seq0 <> nil) do
begin
match0 := cvMatchShapes(seq0, seqT, CV_CONTOURS_MATCH_I3);
if match0 < matchM then
begin
matchM := match0;
seqM := seq0;
end;
Inc(counter);
WriteLn(Format('[i] %d match: %.2f', [counter, match0]));
seq0 := seq0.h_next;
end;
end;
// Ðèñóåì íàéäåííûé êîíòóð
cvDrawContours(rgb, seqM, CV_RGB(52,201,36), CV_RGB(36,201,197), 0, 2, 8, cvPoint(0,0));
cvNamedWindow('Find', CV_WINDOW_AUTOSIZE);
cvShowImage('Find', rgb);
// Æä¸ì íàæàòèÿ êëàâèøè
cvWaitKey(0);
// Îñâîáîæäàåì ðåñóðñû
cvReleaseMemStorage(storage);
cvReleaseImage(src);
cvReleaseImage(dst);
cvReleaseImage(rgb);
cvReleaseImage(rgbT);
cvReleaseImage(binI);
cvReleaseImage(binT);
// Óäàëÿåì îêíà
cvDestroyAllWindows();
// Îñâîáîæäàåì ðåñóðñû
cvReleaseImage(original);
cvReleaseImage(template);
// Óäàëÿåì âñå îêíà
cvDestroyAllWindows();
end.

View File

@ -0,0 +1,155 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{DD703319-D321-48D2-A8C7-33C4A17C8DE6}</ProjectGuid>
<MainSource>cv_MatchShapes.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>14.4</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_F>false</DCC_F>
<DCC_S>false</DCC_S>
<DCC_ExeOutput>..\..\..\bin\</DCC_ExeOutput>
<DCC_K>false</DCC_K>
<DCC_E>false</DCC_E>
<DCC_N>false</DCC_N>
<DCC_ImageBase>00400000</DCC_ImageBase>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
<Manifest_File>None</Manifest_File>
<VerInfo_Locale>1049</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=;CFBundleDisplayName=;CFBundleIdentifier=;CFBundleVersion=;CFBundlePackageType=;CFBundleSignature=;CFBundleAllowMixedLocalizations=;CFBundleExecutable=</VerInfo_Keys>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_DebugInformation>false</DCC_DebugInformation>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<Manifest_File>None</Manifest_File>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="..\..\..\include\сore\Core.types_c.pas"/>
<DCCReference Include="..\..\..\include\сore\core_c.pas"/>
<DCCReference Include="..\..\..\include\highgui\highgui_c.pas"/>
<DCCReference Include="..\..\..\include\imgproc\imgproc.types_c.pas"/>
<DCCReference Include="..\..\..\include\imgproc\imgproc_c.pas"/>
<DCCReference Include="..\..\..\include\uLibName.pas"/>
<DCCReference Include="..\..\..\include\сore\types_c.pas"/>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">cv_MatchShapes.dpr</Source>
</Source>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1049</VersionInfo>
<VersionInfo Name="CodePage">1251</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
<VersionInfoKeys Name="CFBundleName"/>
<VersionInfoKeys Name="CFBundleDisplayName"/>
<VersionInfoKeys Name="CFBundleIdentifier"/>
<VersionInfoKeys Name="CFBundleVersion"/>
<VersionInfoKeys Name="CFBundlePackageType"/>
<VersionInfoKeys Name="CFBundleSignature"/>
<VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
<VersionInfoKeys Name="CFBundleExecutable"/>
</VersionInfoKeys>
</Delphi.Personality>
<Platforms>
<Platform value="OSX32">False</Platform>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>
<!-- EurekaLog First Line
[Exception Log]
EurekaLog Version=7001
DeleteMapAfterCompile=1
Encrypt Password=""
EurekaLog Last Line -->

Binary file not shown.

View File

@ -0,0 +1,74 @@
// JCL_DEBUG_EXPERT_GENERATEJDBG OFF
// JCL_DEBUG_EXPERT_INSERTJDBG OFF
// JCL_DEBUG_EXPERT_DELETEMAPFILE OFF
program cv_WarpAffine;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
Core.types_c in '..\..\..\include\ñore\Core.types_c.pas',
core_c in '..\..\..\include\ñore\core_c.pas',
highgui_c in '..\..\..\include\highgui\highgui_c.pas',
imgproc.types_c in '..\..\..\include\imgproc\imgproc.types_c.pas',
imgproc_c in '..\..\..\include\imgproc\imgproc_c.pas',
uLibName in '..\..\..\include\uLibName.pas',
types_c in '..\..\..\include\ñore\types_c.pas';
const
filename = 'Resource\cat2.jpg';
var
src: pIplImage = nil;
dst: pIplImage = nil;
rot_mat: pCvMat = nil;
scale: double;
temp: pIplImage = nil;
center: TcvPoint2D32f;
begin
// Ïîëó÷àåì êàðòèíêó (öâåòíóþ)
src := cvLoadImage(filename, CV_LOAD_IMAGE_COLOR);
WriteLn(Format('[i] image: %s', [filename]));
// Âûâîäèì îðèãèíàë
cvNamedWindow('Original', CV_WINDOW_AUTOSIZE);
cvShowImage('Original', src);
// Ïîâîðà÷èâàåì
// Ìàòðèöà òðàíñôîðìàöèè
rot_mat := cvCreateMat(2, 3, CV_32FC1);
// Âðàùåíèå îòíîñèòåëüíî öåíòðà èçîáðàæåíèÿ
center.x := src^.width div 2;
center.y := src^.height div 2;
scale := 1;
cv2DRotationMatrix(center, 60, scale, rot_mat);
// Ñîçäàåì èçîáðàæåíèå
temp := cvCreateImage(cvSize(src^.width, src^.height), src^.depth, src^.nChannels);
// Âûïîëíÿåì âðàùåíèå
cvWarpAffine(src, temp, rot_mat, CV_INTER_LINEAR or CV_WARP_FILL_OUTLIERS, cvScalarAll(0));
// Êîïèðóåì èçîáðàæåíèå
cvCopy(temp, src);
// Îñâîáîæäàåì ðåñóðñû
cvReleaseImage(temp);
cvReleaseMat(rot_mat);
// Ïîêàçûâàåì ÷òî ïîëó÷èëîñü
cvNamedWindow('cvWarpAffine', CV_LOAD_IMAGE_GRAYSCALE);
cvShowImage('cvWarpAffine', src);
// Æä¸ì íàæàòèÿ êëàâèøè
cvWaitKey(0);
// Îñâîáîæäàåì ðåñóðñû
cvReleaseImage(src);
cvReleaseImage(dst);
cvDestroyAllWindows();
end.

View File

@ -0,0 +1,155 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{F3D470FD-11B6-4494-ADE1-BDFAC276A0A3}</ProjectGuid>
<MainSource>cv_WarpAffine.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>14.4</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_F>false</DCC_F>
<DCC_S>false</DCC_S>
<DCC_ExeOutput>..\..\..\bin\</DCC_ExeOutput>
<DCC_K>false</DCC_K>
<DCC_E>false</DCC_E>
<DCC_N>false</DCC_N>
<DCC_ImageBase>00400000</DCC_ImageBase>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
<Manifest_File>None</Manifest_File>
<VerInfo_Locale>1049</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=;CFBundleDisplayName=;CFBundleIdentifier=;CFBundleVersion=;CFBundlePackageType=;CFBundleSignature=;CFBundleAllowMixedLocalizations=;CFBundleExecutable=</VerInfo_Keys>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_DebugInformation>false</DCC_DebugInformation>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<Manifest_File>None</Manifest_File>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="..\..\..\include\сore\Core.types_c.pas"/>
<DCCReference Include="..\..\..\include\сore\core_c.pas"/>
<DCCReference Include="..\..\..\include\highgui\highgui_c.pas"/>
<DCCReference Include="..\..\..\include\imgproc\imgproc.types_c.pas"/>
<DCCReference Include="..\..\..\include\imgproc\imgproc_c.pas"/>
<DCCReference Include="..\..\..\include\uLibName.pas"/>
<DCCReference Include="..\..\..\include\сore\types_c.pas"/>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">cv_WarpAffine.dpr</Source>
</Source>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1049</VersionInfo>
<VersionInfo Name="CodePage">1251</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
<VersionInfoKeys Name="CFBundleName"/>
<VersionInfoKeys Name="CFBundleDisplayName"/>
<VersionInfoKeys Name="CFBundleIdentifier"/>
<VersionInfoKeys Name="CFBundleVersion"/>
<VersionInfoKeys Name="CFBundlePackageType"/>
<VersionInfoKeys Name="CFBundleSignature"/>
<VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
<VersionInfoKeys Name="CFBundleExecutable"/>
</VersionInfoKeys>
</Delphi.Personality>
<Platforms>
<Platform value="OSX32">False</Platform>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>
<!-- EurekaLog First Line
[Exception Log]
EurekaLog Version=7001
DeleteMapAfterCompile=1
Encrypt Password=""
EurekaLog Last Line -->

Binary file not shown.

View File

@ -0,0 +1,88 @@
// JCL_DEBUG_EXPERT_GENERATEJDBG OFF
// JCL_DEBUG_EXPERT_INSERTJDBG OFF
// JCL_DEBUG_EXPERT_DELETEMAPFILE OFF
program cv_WarpPerspective;
{$APPTYPE CONSOLE}
{$POINTERMATH ON}
{$R *.res}
uses
System.SysUtils,
Core.types_c in '..\..\..\include\ñore\Core.types_c.pas',
core_c in '..\..\..\include\ñore\core_c.pas',
highgui_c in '..\..\..\include\highgui\highgui_c.pas',
imgproc.types_c in '..\..\..\include\imgproc\imgproc.types_c.pas',
imgproc_c in '..\..\..\include\imgproc\imgproc_c.pas',
uLibName in '..\..\..\include\uLibName.pas',
types_c in '..\..\..\include\ñore\types_c.pas';
const
filename = 'resource\opencv_logo_with_text.png';
Var
src: pIplImage = nil;
dst: pIplImage = nil;
srcQuad, dstQuad: pCvPoint2D32f;
warp_matrix: pCvMat;
begin
// Ïîëó÷àåì êàðòèíêó (â ãðàäàöèÿõ ñåðîãî)
src := cvLoadImage(filename, CV_LOAD_IMAGE_GRAYSCALE);
WriteLn(Format('[i] image: %s', [filename]));
cvNamedWindow('Original', CV_WINDOW_AUTOSIZE);
cvShowImage('Original', src);
// ìàòðèöà ïðåîáðàçîâàíèÿ
warp_matrix := cvCreateMat(3, 3, CV_32FC1);
// êëîíèðóåì êàðòèíêó
dst := cvCloneImage(src);
// çàäà¸ì òî÷êè
srcQuad:=AllocMem(SizeOf(TCvPoint2D32f)*4);
dstQuad:=AllocMem(SizeOf(TCvPoint2D32f)*4);
srcQuad[0].x := 0; //src Top left
srcQuad[0].y := 0;
srcQuad[1].x := src.width - 1; //src Top right
srcQuad[1].y := 0;
srcQuad[2].x := 0; //src Bottom left
srcQuad[2].y := src.height - 1;
srcQuad[3].x := src.width - 1; //src Bot right
srcQuad[3].y := src.height - 1;
//- - - - - - - - - - - - - -//
dstQuad[0].x := src.width*0.05; //dst Top left
dstQuad[0].y := src.height*0.33;
dstQuad[1].x := src.width*0.9; //dst Top right
dstQuad[1].y := src.height*0.25;
dstQuad[2].x := src.width*0.2; //dst Bottom left
dstQuad[2].y := src.height*0.7;
dstQuad[3].x := src.width*0.8; //dst Bot right
dstQuad[3].y := src.height*0.9;
// ïîëó÷àåì ìàòðèöó ïðåîáðàçîâàíèÿ
cvGetPerspectiveTransform(srcQuad, dstQuad, warp_matrix);
// ïðåîáðàçîâàíèå ïåðñïåêòèâû
// CV_WARP_INVERSE_MAP èñïîëüçóåòñÿ îáðàòíàÿ òðàíñôîðìàöèÿ èç dst â src
// CV_WARP_FILL_OUTLIERS çàïîëíèòü âñå ïèêñåëè öåëåâîãî èçîáðàæåíèÿ (åñëè ïèêñåëè îòñóòñòâóþò íà èñõîäíîì èçîáðàæåíè èñïîëüçóþòñÿ fillval)
// fillval çíà÷åíèå äëÿ çàïîëíåíèÿ ïèêñåëåé âíå èñõîäíîãî èçîáðàæåíèÿ
cvWarpPerspective(src, dst, warp_matrix, CV_INTER_LINEAR or CV_WARP_FILL_OUTLIERS, cvScalarAll(0));
// ïîêàçûâàåì
cvNamedWindow('WarpPerspective', CV_LOAD_IMAGE_GRAYSCALE);
cvShowImage('WarpPerspective', dst);
// æä¸ì íàæàòèÿ êëàâèøè
cvWaitKey(0);
// îñâîáîæäàåì ðåñóðñû
FreeMem(srcQuad);
FreeMem(dstQuad);
cvReleaseImage(src);
cvReleaseImage(dst);
cvReleaseMat(warp_matrix);
cvDestroyAllWindows();
end.

View File

@ -0,0 +1,155 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{4042178A-998B-4DD3-8FD0-C5EFD1A63380}</ProjectGuid>
<MainSource>cv_WarpPerspective.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>14.4</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_F>false</DCC_F>
<DCC_S>false</DCC_S>
<DCC_ExeOutput>..\..\..\bin\</DCC_ExeOutput>
<DCC_K>false</DCC_K>
<DCC_E>false</DCC_E>
<DCC_N>false</DCC_N>
<DCC_ImageBase>00400000</DCC_ImageBase>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
<Manifest_File>None</Manifest_File>
<VerInfo_Locale>1049</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=;CFBundleDisplayName=;CFBundleIdentifier=;CFBundleVersion=;CFBundlePackageType=;CFBundleSignature=;CFBundleAllowMixedLocalizations=;CFBundleExecutable=</VerInfo_Keys>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_DebugInformation>false</DCC_DebugInformation>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<Manifest_File>None</Manifest_File>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="..\..\..\include\сore\Core.types_c.pas"/>
<DCCReference Include="..\..\..\include\сore\core_c.pas"/>
<DCCReference Include="..\..\..\include\highgui\highgui_c.pas"/>
<DCCReference Include="..\..\..\include\imgproc\imgproc.types_c.pas"/>
<DCCReference Include="..\..\..\include\imgproc\imgproc_c.pas"/>
<DCCReference Include="..\..\..\include\uLibName.pas"/>
<DCCReference Include="..\..\..\include\сore\types_c.pas"/>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">cv_WarpPerspective.dpr</Source>
</Source>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1049</VersionInfo>
<VersionInfo Name="CodePage">1251</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
<VersionInfoKeys Name="CFBundleName"/>
<VersionInfoKeys Name="CFBundleDisplayName"/>
<VersionInfoKeys Name="CFBundleIdentifier"/>
<VersionInfoKeys Name="CFBundleVersion"/>
<VersionInfoKeys Name="CFBundlePackageType"/>
<VersionInfoKeys Name="CFBundleSignature"/>
<VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
<VersionInfoKeys Name="CFBundleExecutable"/>
</VersionInfoKeys>
</Delphi.Personality>
<Platforms>
<Platform value="OSX32">False</Platform>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>
<!-- EurekaLog First Line
[Exception Log]
EurekaLog Version=7001
DeleteMapAfterCompile=1
Encrypt Password=""
EurekaLog Last Line -->

View File

@ -0,0 +1,343 @@
///
// Ñòûðåíî ó "Header files OpenCV 2.4.3 for Delphi XE3"
// https://code.google.com/p/opencv-delphi-new/
///
program HandsDetect;
{$APPTYPE CONSOLE}
{$POINTERMATH ON}
{$R *.res}
uses
System.SysUtils,
Core.types_c in '..\..\..\include\ñore\Core.types_c.pas',
core_c in '..\..\..\include\ñore\core_c.pas',
highgui_c in '..\..\..\include\highgui\highgui_c.pas',
imgproc.types_c in '..\..\..\include\imgproc\imgproc.types_c.pas',
imgproc_c in '..\..\..\include\imgproc\imgproc_c.pas',
uLibName in '..\..\..\include\uLibName.pas',
types_c in '..\..\..\include\ñore\types_c.pas';
const
NUM_FINGERS = 5;
NUM_DEFECTS = 8;
type
pCtx = ^TCtx;
TCtx = packed record
capture: pCvCapture; // Capture handle
image: pIplImage; // Input image
thr_image: pIplImage; // After filtering and thresholding
temp_image1: pIplImage; // Temporary image (1 channel)
temp_image3: pIplImage; // Temporary image (3 channels)
contour: pCvSeq; // Êîíòóð ðóêè
hull: pCvSeq; // Êàðêàñ êîíòóðà âûïóêëîñòè
hand_center: TCvPoint;
fingers: pCvPointArray; // Detected fingers positions
defects: pCvPointArray; // Convexity defects depth points
hull_st: pCvMemStorage;
contour_st: pCvMemStorage;
temp_st: pCvMemStorage;
defects_st: pCvMemStorage; // Õðàíèëèùå äëÿ ðåçóëüòàòà âû÷èñëåíèÿ ïîñëåäîâàòåëüíîñòè äåôåêòîâ
kernel: pIplConvKernel; // Kernel for morph operations
NUM_FINGERS: Integer;
hand_radius: Integer;
NUM_DEFECTS: Integer;
end;
var
key: Integer;
MyCtx: pCtx;
procedure InitCapture(const Ctx: pCtx);
var
width: Double;
height: Double;
begin
Ctx.capture := cvCreateCameraCapture(CV_CAP_ANY);
if not Assigned(Ctx.capture) then
begin
WriteLn('[i] Error initializing capture.');
Halt;
end;
// Óçíàåì øèðèíó è âûñîòó êàäðà
width := cvGetCaptureProperty(Ctx.capture, CV_CAP_PROP_FRAME_WIDTH);
height := cvGetCaptureProperty(Ctx.capture, CV_CAP_PROP_FRAME_HEIGHT);
// WriteLn(Format('[i] %.0f x %.0f', [width, height]));
Ctx.image := cvQueryFrame(Ctx.capture);
WriteLn('[i] Start capture.');
end;
procedure InitWindows;
begin
cvNamedWindow('output', CV_WINDOW_AUTOSIZE);
cvNamedWindow('thresholded', CV_WINDOW_AUTOSIZE);
cvMoveWindow('output', 50, 50);
cvMoveWindow('thresholded', 700, 50);
end;
procedure InitCtx(const Ctx: pCtx);
begin
// Ñîçäà¸ì îäíîêàíàëüíûå êàðòèíêè
Ctx.thr_image := cvCreateImage(cvGetSize(Ctx.image), IPL_DEPTH_8U, 1);
Ctx.temp_image1 := cvCreateImage(cvGetSize(Ctx.image), IPL_DEPTH_8U, 1);
// Ñîçäà¸ì 3-õ êàíàëüíóþ êàðòèíêó
Ctx.temp_image3 := cvCreateImage(cvGetSize(Ctx.image), IPL_DEPTH_8U, 3);
Ctx.kernel := cvCreateStructuringElementEx(9, 9, 4, 4, CV_SHAPE_RECT, nil);
// Ñîçäàåì õðàíèëèùà
Ctx.contour_st := cvCreateMemStorage(0);
Ctx.hull_st := cvCreateMemStorage(0);
Ctx.temp_st := cvCreateMemStorage(0);
Ctx.fingers := AllocMem((NUM_FINGERS + 1) * sizeof(TCvPoint));
Ctx.defects := AllocMem(NUM_DEFECTS * sizeof(TCvPoint));
end;
procedure FilterAndThreshold(const Ctx: pCtx);
begin
// Soften image
cvSmooth(Ctx.image, Ctx.temp_image3, CV_GAUSSIAN, 11, 11, 0, 0);
// Remove some impulsive noise
cvSmooth(Ctx.temp_image3, Ctx.temp_image3, CV_MEDIAN, 11, 11, 0, 0);
cvCvtColor(Ctx.temp_image3, Ctx.temp_image3, CV_BGR2HSV);
{ * Apply threshold on HSV values
* Threshold values should be customized according to environment
* }
cvInRangeS(Ctx.temp_image3, cvScalar(0, 0, 160, 0), cvScalar(255, 400, 300, 255), Ctx.thr_image);
// Apply morphological opening
cvMorphologyEx(Ctx.thr_image, Ctx.thr_image, nil, Ctx.kernel, CV_MOP_OPEN, 1);
cvSmooth(Ctx.thr_image, Ctx.thr_image, CV_GAUSSIAN, 3, 3, 0, 0);
end;
// Ïîèñê êîíòóðîâ
procedure FindContour(const Ctx: pCtx);
var
area, max_area: Double;
contours, tmp, contour: pCvSeq;
cont: pIplImage;
begin
area := 0.0;
max_area := 0.0;
contours := nil;
tmp := nil;
contour := nil;
// cvFindContours modifies input image, so make a copy
cvCopy(Ctx.thr_image, Ctx.temp_image1, nil);
// Íàõîäèì êîíòóðû
cvFindContours(Ctx.temp_image1, Ctx.temp_st, @contours, sizeof(TCvContour), CV_RETR_EXTERNAL,
CV_CHAIN_APPROX_NONE { CV_CHAIN_APPROX_SIMPLE } , cvPoint(0, 0));
// Çàâåä¸ì êàðòèíêó äëÿ êîíòóðà
cont := cvCreateImage(cvGetSize(Ctx.temp_image1), IPL_DEPTH_8U, 3);
// Select contour having greatest area
tmp := contours;
while (tmp <> nil) do
begin
area := abs(cvContourArea(tmp, CV_WHOLE_SEQ, 0));
if area > max_area then
begin
// WriteLn(Format('[i] area = %.1f', [area]));
max_area := area;
contour := tmp;
end;
// Ðèñóåì êîíòóð
cvDrawContours(cont, tmp, CV_RGB(255, 216, 0), CV_RGB(0, 0, 250), 0, 1, 8, cvPoint(0, 0));
tmp := tmp.h_next;
end;
// Approximate contour with poly-line
if contour <> nil then
begin
contour := cvApproxPoly(contour, sizeof(TCvContour), Ctx.contour_st, CV_POLY_APPROX_DP, 2, 1);
Ctx.contour := contour;
end;
// Ïîêàæåì êîíòóð
cvDrawContours(cont, contour, CV_RGB(52, 201, 36), CV_RGB(36, 201, 197), 0, 2, 8, cvPoint(0, 0));
cvNamedWindow('ContT', CV_WINDOW_AUTOSIZE);
cvShowImage('ContT', cont);
end;
procedure FindConvexHull(const Ctx: pCtx);
var
defects: pCvSeq;
defect_array: pCvConvexityDefect;
i: Integer;
d, x, y: Integer;
dist: Double;
begin
x := 0;
y := 0;
dist := 0;
Ctx.hull := nil;
if not Assigned(Ctx.contour) then
Exit;
// Âû÷èñëÿåì êàðêàñ êîíòóðà âûïóêëîñòè
Ctx.hull := cvConvexHull2(Ctx.contour, Ctx.hull_st, CV_CLOCKWISE, 0);
if Assigned(Ctx.hull) then
begin
// Âû÷èñëÿåì ïîñëåäîâàòåëüíîñòü äåôåêòîâ
defects := cvConvexityDefects(Ctx.contour, Ctx.hull, Ctx.defects_st);
if Assigned(defects) and (defects.total <> 0) then
begin
defect_array := AllocMem(defects.total * sizeof(TCvConvexityDefect));
cvCvtSeqToArray(defects, defect_array, CV_WHOLE_SEQ);
// Average depth points to get hand center
// Âû÷èñëåíèå ãëóáèíû ñðåäíåé òî÷êè, ÷òîáû ïîëó÷èòü öåíòð ðóêè
i := 0;
while (i < defects.total) and (i < NUM_DEFECTS) do
begin
x := x + defect_array[i].depth_point.x;
y := y + defect_array[i].depth_point.y;
Ctx.defects[i] := cvPoint(defect_array[i].depth_point.x, defect_array[i].depth_point.y);
Inc(i);
// WriteLn(Format('[i] x = %d, y = %d', [Ctx.defects[i].x, Ctx.defects[i].y]));
// WriteLn(Format('[i] defects.total: %d', [defects.total]));
end;
x := x div defects.total;
y := y div defects.total;
Ctx.NUM_DEFECTS := defects.total;
Ctx.hand_center := cvPoint(x, y);
// WriteLn(Format('[i] defects.total: %d', [defects.total]));
// WriteLn(Format('[i] hand_center: x = %d, y = %d', [Ctx.hand_center.x, Ctx.hand_center.y]));
// Compute hand radius as mean of distances of defects' depth point to hand center
// Âû÷èñëÿåì ðàäèóñ ðóêè
for i := 0 to defects.total - 1 do
begin
d := (x - defect_array[i].depth_point.x) * (x - defect_array[i].depth_point.x) +
(y - defect_array[i].depth_point.y) * (y - defect_array[i].depth_point.y);
dist := dist + sqrt(d);
end;
Ctx.hand_radius := Trunc(dist) div defects.total;
// WriteLn(Format('[i] hand_radius: %d', [Ctx.hand_radius]));
FreeMem(defect_array);
end;
end;
end;
procedure FindFingers(const Ctx: pCtx);
var
n, i, cx, cy, dist, dist1, dist2: Integer;
// points: pCvPoint;
points: pCvPointArray;
max_point: TCvPoint;
finger_distance: array [0 .. NUM_FINGERS + 1] of Integer;
begin
dist1 := 0;
dist2 := 0;
Ctx.NUM_FINGERS := 0;
if (not Assigned(Ctx.contour)) or (not Assigned(Ctx.hull)) then
Exit;
n := Ctx.contour.total;
points := AllocMem(n * sizeof(TCvPoint));
cvCvtSeqToArray(Ctx.contour, points, CV_WHOLE_SEQ);
{ * Fingers are detected as points where the distance to the center
* is a local maximum
* }
for i := 0 to n - 1 do
begin
cx := Ctx.hand_center.x;
cy := Ctx.hand_center.y;
dist := (cx - points[i].x) * (cx - points[i].x) + (cy - points[i].y) * (cy - points[i].y);
if (dist < dist1) and (dist1 > dist2) and (max_point.x <> 0) and (max_point.y < cvGetSize(Ctx.image).height - 10)
then
begin
finger_distance[Ctx.NUM_FINGERS] := dist;
Inc(Ctx.NUM_FINGERS);
Ctx.fingers[Ctx.NUM_FINGERS] := max_point;
if Ctx.NUM_FINGERS >= NUM_FINGERS + 1 then
Break;
end;
dist2 := dist1;
dist1 := dist;
max_point := points[i];
end;
FreeMem(points);
end;
procedure Display(const Ctx: pCtx);
var
i: Integer;
begin
if Ctx.NUM_FINGERS = NUM_FINGERS then
begin
// ifdef SHOW_HAND_CONTOUR
// cvDrawContours(ctx.image, ctx.contour, CV_RGB(0,0,255), CV_RGB(0,255,0), 0, 1, CV_AA, cvPoint(0,0));
// #endif
cvCircle(Ctx.image, Ctx.hand_center, 5, CV_RGB(255, 0, 255), 1, CV_AA, 0);
cvCircle(Ctx.image, Ctx.hand_center, Ctx.hand_radius, CV_RGB(255, 0, 0), 1, CV_AA, 0);
for i := 0 to Ctx.NUM_FINGERS - 1 do
begin
cvCircle(Ctx.image, Ctx.fingers[i], 10, CV_RGB(0, 255, 0), 3, CV_AA, 0);
cvLine(Ctx.image, Ctx.hand_center, Ctx.fingers[i], CV_RGB(255, 255, 0), 1, CV_AA, 0);
end;
for i := 0 to Ctx.NUM_DEFECTS - 1 do
cvCircle(Ctx.image, Ctx.defects[i], 2, CV_RGB(200, 200, 200), 2, CV_AA, 0);
end;
cvShowImage('output', Ctx.image);
cvShowImage('thresholded', Ctx.thr_image);
end;
procedure ClearRes(const Ctx: pCtx);
begin
// Îñâîáîæäàåì ðåñóðñû
cvReleaseCapture(Ctx.capture);
// cvReleaseImage(Ctx.image);
cvReleaseImage(Ctx.thr_image);
cvReleaseImage(Ctx.temp_image1);
cvReleaseImage(Ctx.temp_image3);
cvReleaseMemStorage(Ctx.hull_st);
cvReleaseMemStorage(Ctx.contour_st);
cvReleaseMemStorage(Ctx.defects_st);
cvReleaseMemStorage(Ctx.temp_st);
cvReleaseStructuringElement(Ctx.kernel);
FreeMem(Ctx.fingers);
FreeMem(Ctx.defects);
cvDestroyAllWindows();
end;
begin
try
MyCtx := AllocMem(sizeof(TCtx));
InitCapture(MyCtx);
InitWindows;
InitCtx(MyCtx);
while true do
begin
MyCtx.image := cvQueryFrame(MyCtx.capture);
// Ôèëüòðóåì
FilterAndThreshold(MyCtx);
// Îïðåäåëåíèå êîíòóðîâ
FindContour(MyCtx);
FindConvexHull(MyCtx);
FindFingers(MyCtx);
Display(MyCtx);
key := cvWaitKey(33);
if (key = 27) then
Break;
end;
ClearRes(MyCtx);
FreeMem(MyCtx);
except
on E: Exception do
WriteLn(E.ClassName, ': ', E.Message);
end;
end.

View File

@ -0,0 +1,189 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{D0BDA5E7-CF4F-4AF6-94B1-9F742A63259A}</ProjectGuid>
<ProjectVersion>14.4</ProjectVersion>
<FrameworkType>None</FrameworkType>
<MainSource>HandsDetect.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Release</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='OSX32' and '$(Base)'=='true') or '$(Base_OSX32)'!=''">
<Base_OSX32>true</Base_OSX32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
<Base_Win64>true</Base_Win64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
<Cfg_1_Win32>true</Cfg_1_Win32>
<CfgParent>Cfg_1</CfgParent>
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<VerInfo_Locale>1049</VerInfo_Locale>
<Manifest_File>None</Manifest_File>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
<DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
<DCC_ExeOutput>..\..\..\bin\</DCC_ExeOutput>
<DCC_E>false</DCC_E>
<DCC_N>false</DCC_N>
<DCC_S>false</DCC_S>
<DCC_F>false</DCC_F>
<DCC_K>false</DCC_K>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_OSX32)'!=''">
<DCC_UsePackage>DBXSqliteDriver;fmx;IndySystem;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapServer;DataSnapProviderClient;DbxCommonDriver;dbxcds;DBXOracleDriver;CustomIPTransport;dsnap;IndyIPServer;fmxase;IndyCore;IndyIPCommon;inetdbxpress;bindcompfmx;rtl;dbrtl;DbxClientDriver;bindcomp;inetdb;xmlrtl;IndyProtocols;DBXMySQLDriver;bindengine;soaprtl;bindcompdbx;DBXInformixDriver;DBXFirebirdDriver;inet;fmxobj;DBXSybaseASADriver;fmxdae;dbexpress;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage)</DCC_UsePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_UsePackage>JvBDE;JvGlobus;JvMM;JvManagedThreads;ZComponent;DBXSqliteDriver;fmx;IMButtonGroup;IndySystem;JvDlgs;TeeDB;JvCrypt;TimingLabBasicPkgD17;vclib;inetdbbde;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapServer;DTPEx_XE3;JvNet;DataSnapProviderClient;JvDotNetCtrls;DBXSybaseASEDriver;AudioLabBasicPkgD17;DbxCommonDriver;vclimg;dbxcds;DatasnapConnectorsFreePascal;MetropolisUILiveTile;JvXPCtrls;indy10sbridge170;vcldb;StatusBarPro_XE3;vcldsnap;DBXDb2Driver;DBXOracleDriver;CustomIPTransport;JvCore;vclribbon;dsnap;IndyIPServer;fmxase;vcl;IndyCore;IndyIPCommon;CloudService;DBXMSSQLDriver;FmxTeeUI;frxDB17;CodeSiteExpressPkg;VideoLabAdditionalPkgD17;JvAppFrm;JvDB;JvRuntimeDesign;gmail_pack;inetdbxpress;webdsnap;FMX.VideoLabBasicPkgD17;JclDeveloperTools;mxWebUpdate_xe3;JvDocking;adortl;JvWizards;madBasic_;fs17;frx17;JvHMI;bindcompfmx;JvBands;vcldbx;ZDbc;VisionLabPkgD17;rtl;dbrtl;DbxClientDriver;ZPlain;bindcomp;inetdb;JvPluginSystem;sbridge170;Tee;JclContainers;VideoLabBasicPkgD17;DBXOdbcDriver;JvCmp;madDisAsm_;JvSystem;xmlrtl;svnui;ibxpress;JvTimeFramework;JvControls;OpenWirePkgD17;AudioLabGenericBasicPkgD17;IndyProtocols;DBXMySQLDriver;MediaLabBasicPkgD17;vclactnband;bindengine;soaprtl;bindcompdbx;FMXTee;TeeUI;bindcompvcl;IMDownloader;JvStdCtrls;Jcl;vclie;JvCustom;JvJans;JvPageComps;JvPrintPreview;ZCore;vcltouch;madExcept_;K102_R;websnap;VclSmp;FMX.MediaLabBasicPkgD17;DBXInformixDriver;Intraweb;DataSnapConnectors;DCPdelphiXE3;dsnapcon;DBXFirebirdDriver;inet;fsDB17;fmxobj;SynEdit_RXE3;JclVcl;JvPascalInterpreter;ZParseSql;vclx;frxe17;svn;DBXSybaseASADriver;CoolTrayIcon_D170;fmxdae;bdertl;VirtualTreesR;SignalLabBasicPkgD17;VideoLabGenericBasicPkgD17;dbexpress;DataSnapIndy10ServerTransport;SignalLabGenericBasicPkgD17;IndyIPClient;$(DCC_UsePackage)</DCC_UsePackage>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<DCC_UsePackage>DBXSqliteDriver;fmx;IndySystem;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapServer;DataSnapProviderClient;DBXSybaseASEDriver;DbxCommonDriver;vclimg;dbxcds;vcldb;vcldsnap;DBXDb2Driver;DBXOracleDriver;CustomIPTransport;vclribbon;dsnap;IndyIPServer;fmxase;vcl;IndyCore;IndyIPCommon;DBXMSSQLDriver;inetdbxpress;webdsnap;adortl;bindcompfmx;rtl;dbrtl;DbxClientDriver;bindcomp;inetdb;DBXOdbcDriver;xmlrtl;IndyProtocols;DBXMySQLDriver;vclactnband;bindengine;soaprtl;bindcompdbx;bindcompvcl;vclie;vcltouch;websnap;VclSmp;DBXInformixDriver;dsnapcon;DBXFirebirdDriver;inet;fmxobj;SynEdit_RXE3;vclx;DBXSybaseASADriver;fmxdae;dbexpress;DataSnapIndy10ServerTransport;IndyIPClient;$(DCC_UsePackage)</DCC_UsePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_DebugDCUs>true</DCC_DebugDCUs>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
<DCC_RemoteDebug>true</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_RemoteDebug>false</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_DebugInformation>false</DCC_DebugInformation>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<DCC_DebugInformation>true</DCC_DebugInformation>
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_LocalDebugSymbols>true</DCC_LocalDebugSymbols>
<DCC_ExeOutput>..\..\..\bin</DCC_ExeOutput>
<DCC_MapFile>3</DCC_MapFile>
<DCC_DcuOutput>.\</DCC_DcuOutput>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="..\..\..\include\сore\Core.types_c.pas"/>
<DCCReference Include="..\..\..\include\сore\core_c.pas"/>
<DCCReference Include="..\..\..\include\highgui\highgui_c.pas"/>
<DCCReference Include="..\..\..\include\imgproc\imgproc.types_c.pas"/>
<DCCReference Include="..\..\..\include\imgproc\imgproc_c.pas"/>
<DCCReference Include="..\..\..\include\uLibName.pas"/>
<DCCReference Include="..\..\..\include\сore\types_c.pas"/>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1049</VersionInfo>
<VersionInfo Name="CodePage">1251</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
<VersionInfoKeys Name="CFBundleName"/>
<VersionInfoKeys Name="CFBundleDisplayName"/>
<VersionInfoKeys Name="CFBundleIdentifier"/>
<VersionInfoKeys Name="CFBundleVersion"/>
<VersionInfoKeys Name="CFBundlePackageType"/>
<VersionInfoKeys Name="CFBundleSignature"/>
<VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
<VersionInfoKeys Name="CFBundleExecutable"/>
</VersionInfoKeys>
<Source>
<Source Name="MainSource">HandsDetect.dpr</Source>
</Source>
<Excluded_Packages/>
</Delphi.Personality>
<Deployment/>
<Platforms>
<Platform value="OSX32">False</Platform>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>
<!-- EurekaLog First Line
[Exception Log]
EurekaLog Version=7001
DeleteMapAfterCompile=1
Encrypt Password=""
EurekaLog Last Line -->

Binary file not shown.

View File

@ -123,6 +123,18 @@
<Projects Include="MultiDemo\CameraCalibrate\CameraCalibrate.dproj">
<Dependencies/>
</Projects>
<Projects Include="LibTest\cvMatchShapes\cv_MatchShapes.dproj">
<Dependencies/>
</Projects>
<Projects Include="LibTest\cvWarpAffine\cv_WarpAffine.dproj">
<Dependencies/>
</Projects>
<Projects Include="LibTest\cvWrapPrespective\cv_WarpPerspective.dproj">
<Dependencies/>
</Projects>
<Projects Include="MultiDemo\HandsDetect\HandsDetect.dproj">
<Dependencies/>
</Projects>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Default.Personality.12</Borland.Personality>
@ -491,14 +503,50 @@
<Target Name="CameraCalibrate:Make">
<MSBuild Projects="MultiDemo\CameraCalibrate\CameraCalibrate.dproj" Targets="Make"/>
</Target>
<Target Name="cv_MatchShapes">
<MSBuild Projects="LibTest\cvMatchShapes\cv_MatchShapes.dproj"/>
</Target>
<Target Name="cv_MatchShapes:Clean">
<MSBuild Projects="LibTest\cvMatchShapes\cv_MatchShapes.dproj" Targets="Clean"/>
</Target>
<Target Name="cv_MatchShapes:Make">
<MSBuild Projects="LibTest\cvMatchShapes\cv_MatchShapes.dproj" Targets="Make"/>
</Target>
<Target Name="cv_WarpAffine">
<MSBuild Projects="LibTest\cvWarpAffine\cv_WarpAffine.dproj"/>
</Target>
<Target Name="cv_WarpAffine:Clean">
<MSBuild Projects="LibTest\cvWarpAffine\cv_WarpAffine.dproj" Targets="Clean"/>
</Target>
<Target Name="cv_WarpAffine:Make">
<MSBuild Projects="LibTest\cvWarpAffine\cv_WarpAffine.dproj" Targets="Make"/>
</Target>
<Target Name="cv_WarpPerspective">
<MSBuild Projects="LibTest\cvWrapPrespective\cv_WarpPerspective.dproj"/>
</Target>
<Target Name="cv_WarpPerspective:Clean">
<MSBuild Projects="LibTest\cvWrapPrespective\cv_WarpPerspective.dproj" Targets="Clean"/>
</Target>
<Target Name="cv_WarpPerspective:Make">
<MSBuild Projects="LibTest\cvWrapPrespective\cv_WarpPerspective.dproj" Targets="Make"/>
</Target>
<Target Name="HandsDetect">
<MSBuild Projects="MultiDemo\HandsDetect\HandsDetect.dproj"/>
</Target>
<Target Name="HandsDetect:Clean">
<MSBuild Projects="MultiDemo\HandsDetect\HandsDetect.dproj" Targets="Clean"/>
</Target>
<Target Name="HandsDetect:Make">
<MSBuild Projects="MultiDemo\HandsDetect\HandsDetect.dproj" Targets="Make"/>
</Target>
<Target Name="Build">
<CallTarget Targets="cv_AddWeighted;cvSetImageROI_cvAddWeighted;cv_And;cv_Canny;cv_CopyMakeBorder;cv_CreateCameraCapture;cv_CreateTrackbar;cv_CreateVideoWriter;cv_CvtColor;cv_CvtPixToPlane;cvErode_cvDilate;cv_FindContours;cv_FloodFill;cv_GetSubRect;cv_HoughCircles;cv_HoughLines2;cv_InRangeS;cv_Laplace;cv_LoadImage;cv_LoadImage2;cv_LoadVideo;cv_MorphologyEx;cv_RandInt;cv_Resize;cv_SetImageROI;cv_SetImageROI2;cv_SetMouseCallback;cv_Smooth;cv_Sobel;cvSplit_cvMerge;cv_Save;cv_Sub;cvThreshold_cvAdaptiveThreshold;cv_Integral;HelloWorld;VideoProcessing;FaceDetect;Stereo;CameraCaptureAndFindContours;CameraCalibrate"/>
<CallTarget Targets="cv_AddWeighted;cvSetImageROI_cvAddWeighted;cv_And;cv_Canny;cv_CopyMakeBorder;cv_CreateCameraCapture;cv_CreateTrackbar;cv_CreateVideoWriter;cv_CvtColor;cv_CvtPixToPlane;cvErode_cvDilate;cv_FindContours;cv_FloodFill;cv_GetSubRect;cv_HoughCircles;cv_HoughLines2;cv_InRangeS;cv_Laplace;cv_LoadImage;cv_LoadImage2;cv_LoadVideo;cv_MorphologyEx;cv_RandInt;cv_Resize;cv_SetImageROI;cv_SetImageROI2;cv_SetMouseCallback;cv_Smooth;cv_Sobel;cvSplit_cvMerge;cv_Save;cv_Sub;cvThreshold_cvAdaptiveThreshold;cv_Integral;HelloWorld;VideoProcessing;FaceDetect;Stereo;CameraCaptureAndFindContours;CameraCalibrate;cv_MatchShapes;cv_WarpAffine;cv_WarpPerspective;HandsDetect"/>
</Target>
<Target Name="Clean">
<CallTarget Targets="cv_AddWeighted:Clean;cvSetImageROI_cvAddWeighted:Clean;cv_And:Clean;cv_Canny:Clean;cv_CopyMakeBorder:Clean;cv_CreateCameraCapture:Clean;cv_CreateTrackbar:Clean;cv_CreateVideoWriter:Clean;cv_CvtColor:Clean;cv_CvtPixToPlane:Clean;cvErode_cvDilate:Clean;cv_FindContours:Clean;cv_FloodFill:Clean;cv_GetSubRect:Clean;cv_HoughCircles:Clean;cv_HoughLines2:Clean;cv_InRangeS:Clean;cv_Laplace:Clean;cv_LoadImage:Clean;cv_LoadImage2:Clean;cv_LoadVideo:Clean;cv_MorphologyEx:Clean;cv_RandInt:Clean;cv_Resize:Clean;cv_SetImageROI:Clean;cv_SetImageROI2:Clean;cv_SetMouseCallback:Clean;cv_Smooth:Clean;cv_Sobel:Clean;cvSplit_cvMerge:Clean;cv_Save:Clean;cv_Sub:Clean;cvThreshold_cvAdaptiveThreshold:Clean;cv_Integral:Clean;HelloWorld:Clean;VideoProcessing:Clean;FaceDetect:Clean;Stereo:Clean;CameraCaptureAndFindContours:Clean;CameraCalibrate:Clean"/>
<CallTarget Targets="cv_AddWeighted:Clean;cvSetImageROI_cvAddWeighted:Clean;cv_And:Clean;cv_Canny:Clean;cv_CopyMakeBorder:Clean;cv_CreateCameraCapture:Clean;cv_CreateTrackbar:Clean;cv_CreateVideoWriter:Clean;cv_CvtColor:Clean;cv_CvtPixToPlane:Clean;cvErode_cvDilate:Clean;cv_FindContours:Clean;cv_FloodFill:Clean;cv_GetSubRect:Clean;cv_HoughCircles:Clean;cv_HoughLines2:Clean;cv_InRangeS:Clean;cv_Laplace:Clean;cv_LoadImage:Clean;cv_LoadImage2:Clean;cv_LoadVideo:Clean;cv_MorphologyEx:Clean;cv_RandInt:Clean;cv_Resize:Clean;cv_SetImageROI:Clean;cv_SetImageROI2:Clean;cv_SetMouseCallback:Clean;cv_Smooth:Clean;cv_Sobel:Clean;cvSplit_cvMerge:Clean;cv_Save:Clean;cv_Sub:Clean;cvThreshold_cvAdaptiveThreshold:Clean;cv_Integral:Clean;HelloWorld:Clean;VideoProcessing:Clean;FaceDetect:Clean;Stereo:Clean;CameraCaptureAndFindContours:Clean;CameraCalibrate:Clean;cv_MatchShapes:Clean;cv_WarpAffine:Clean;cv_WarpPerspective:Clean;HandsDetect:Clean"/>
</Target>
<Target Name="Make">
<CallTarget Targets="cv_AddWeighted:Make;cvSetImageROI_cvAddWeighted:Make;cv_And:Make;cv_Canny:Make;cv_CopyMakeBorder:Make;cv_CreateCameraCapture:Make;cv_CreateTrackbar:Make;cv_CreateVideoWriter:Make;cv_CvtColor:Make;cv_CvtPixToPlane:Make;cvErode_cvDilate:Make;cv_FindContours:Make;cv_FloodFill:Make;cv_GetSubRect:Make;cv_HoughCircles:Make;cv_HoughLines2:Make;cv_InRangeS:Make;cv_Laplace:Make;cv_LoadImage:Make;cv_LoadImage2:Make;cv_LoadVideo:Make;cv_MorphologyEx:Make;cv_RandInt:Make;cv_Resize:Make;cv_SetImageROI:Make;cv_SetImageROI2:Make;cv_SetMouseCallback:Make;cv_Smooth:Make;cv_Sobel:Make;cvSplit_cvMerge:Make;cv_Save:Make;cv_Sub:Make;cvThreshold_cvAdaptiveThreshold:Make;cv_Integral:Make;HelloWorld:Make;VideoProcessing:Make;FaceDetect:Make;Stereo:Make;CameraCaptureAndFindContours:Make;CameraCalibrate:Make"/>
<CallTarget Targets="cv_AddWeighted:Make;cvSetImageROI_cvAddWeighted:Make;cv_And:Make;cv_Canny:Make;cv_CopyMakeBorder:Make;cv_CreateCameraCapture:Make;cv_CreateTrackbar:Make;cv_CreateVideoWriter:Make;cv_CvtColor:Make;cv_CvtPixToPlane:Make;cvErode_cvDilate:Make;cv_FindContours:Make;cv_FloodFill:Make;cv_GetSubRect:Make;cv_HoughCircles:Make;cv_HoughLines2:Make;cv_InRangeS:Make;cv_Laplace:Make;cv_LoadImage:Make;cv_LoadImage2:Make;cv_LoadVideo:Make;cv_MorphologyEx:Make;cv_RandInt:Make;cv_Resize:Make;cv_SetImageROI:Make;cv_SetImageROI2:Make;cv_SetMouseCallback:Make;cv_Smooth:Make;cv_Sobel:Make;cvSplit_cvMerge:Make;cv_Save:Make;cv_Sub:Make;cvThreshold_cvAdaptiveThreshold:Make;cv_Integral:Make;HelloWorld:Make;VideoProcessing:Make;FaceDetect:Make;Stereo:Make;CameraCaptureAndFindContours:Make;CameraCalibrate:Make;cv_MatchShapes:Make;cv_WarpAffine:Make;cv_WarpPerspective:Make;HandsDetect:Make"/>
</Target>
<Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/>
</Project>