Add samples:

[+] cvCreateFGDStatModel
[+] cvCreateGaussianBGModel
[+] cvCodeBook

Signed-off-by: Laex <laex@bk.ru>
This commit is contained in:
Laex 2013-04-09 21:20:50 +04:00
parent c8850ec221
commit 7c1fdb9783
14 changed files with 1348 additions and 323 deletions

3
.gitignore vendored
View File

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

View File

@ -406,16 +406,6 @@ type
type type
TCvSubdiv2DEdge = size_t; TCvSubdiv2DEdge = size_t;
{ EXTERNALSYM CvSubdiv2DEdge } { EXTERNALSYM CvSubdiv2DEdge }
// // >> Following declaration is a macro definition!
// const
// CV_QUADEDGE2D_FIELDS()Integer flags;
//
// type;
//
// type
// pt:
// array [0 .. 3] of;
// CvSubdiv2DEdge next[4] = ^UADEDGE2D_FIELDS()Integer flags;
pCvSubdiv2DPoint = ^TCvSubdiv2DPoint; pCvSubdiv2DPoint = ^TCvSubdiv2DPoint;
@ -443,20 +433,25 @@ Type
pCvSubdiv2D = ^TCvSubdiv2D; pCvSubdiv2D = ^TCvSubdiv2D;
TCvSubdiv2D = packed record TCvSubdiv2D = packed record
flags: Integer; // Miscellaneous flags. // CV_SUBDIV2D_FIELDS()
header_size: Integer; // Size of sequence header. // -CV_GRAPH_FIELDS()
h_prev: pCvSeq; // Previous sequence. // --CV_SET_FIELDS()
h_next: pCvSeq; // Next sequence. // --CV_SEQUENCE_FIELDS()
v_prev: pCvSeq; // 2nd previous sequence. // ---CV_TREE_NODE_FIELDS(CvSeq);
v_next: pCvSeq; // 2nd next sequence. flags: Integer; // * Miscellaneous flags.
total: Integer; // Total number of elements. eader_size: Integer; // * Size of sequence header.
elem_size: Integer; // Size of sequence element in bytes. h_prev: pCvSeq; // * Previous sequence.
block_max: Pointer; // Maximal bound of the last block. h_next: pCvSeq; // * Next sequence.
ptr: Pointer; // Current write pointer. v_prev: pCvSeq; // * 2nd previous sequence.
delta_elems: Integer; // Grow seq this many at a time. v_next: pCvSeq; // * 2nd next sequence.
storage: pCvMemStorage; // Where the seq is stored. total: Integer; // * Total number of elements.
free_blocks: pCvSeqBlock; // Free blocks list. elem_size: Integer; // * Size of sequence element in bytes.
first: pCvSeqBlock; // Pointer to the first sequence block. block_max: pShortInt; // * Maximal bound of the last block.
ptr: pShortInt; // * Current write pointer.
delta_elems: Integer; // * Grow seq this many at a time.
storage: pCvMemStorage; // * Where the seq is stored.
free_blocks: pCvSeqBlock; // * Free blocks list.
first: pCvSeqBlock; // * Pointer to the first sequence block.
free_elems: pCvSetElem; free_elems: pCvSetElem;
active_count: Integer; active_count: Integer;
edges: pCvSet; edges: pCvSet;

View File

@ -92,6 +92,7 @@
{$WARN UNSAFE_TYPE OFF} {$WARN UNSAFE_TYPE OFF}
{$WARN UNSAFE_CODE OFF} {$WARN UNSAFE_CODE OFF}
{$WARN UNSAFE_CAST OFF} {$WARN UNSAFE_CAST OFF}
{$POINTERMATH ON}
unit legacy; unit legacy;
interface interface
@ -2976,6 +2977,7 @@ procedure cvSnakeImage(const image: pIplImage; points: pCvPointArray; length: In
type type
pCvSubdiv2DEdge = ^TCvSubdiv2DEdge; pCvSubdiv2DEdge = ^TCvSubdiv2DEdge;
TCvSubdiv2DEdge = size_t; TCvSubdiv2DEdge = size_t;
// //
// #define CV_QUADEDGE2D_FIELDS() \ // #define CV_QUADEDGE2D_FIELDS() \
@ -3106,7 +3108,7 @@ procedure cvCalcSubdivVoronoi2D(subdiv: pCvSubdiv2D); cdecl;
// { // {
// return (edge & ~3) + ((edge + rotate) & 3); // return (edge & ~3) + ((edge + rotate) & 3);
// } // }
function cvSubdiv2DRotateEdge(edge: TCvSubdiv2DEdge; rotate: Integer): TCvSubdiv2DEdge; inline; function cvSubdiv2DRotateEdge(edge: TCvSubdiv2DEdge; rotate: Integer): TCvSubdiv2DEdge; // inline;
// CV_INLINE CvSubdiv2DEdge cvSubdiv2DSymEdge( CvSubdiv2DEdge edge ) // CV_INLINE CvSubdiv2DEdge cvSubdiv2DSymEdge( CvSubdiv2DEdge edge )
// { // {
@ -3119,21 +3121,21 @@ function cvSubdiv2DRotateEdge(edge: TCvSubdiv2DEdge; rotate: Integer): TCvSubdiv
// edge = e->next[(edge + (int)type) & 3]; // edge = e->next[(edge + (int)type) & 3];
// return (edge & ~3) + ((edge + ((int)type >> 4)) & 3); // return (edge & ~3) + ((edge + ((int)type >> 4)) & 3);
// } // }
function cvSubdiv2DGetEdge(edge: TCvSubdiv2DEdge; _type: TCvNextEdgeType): TCvSubdiv2DEdge; inline; function cvSubdiv2DGetEdge(edge: TCvSubdiv2DEdge; _type: TCvNextEdgeType): TCvSubdiv2DEdge; // inline;
// CV_INLINE CvSubdiv2DPoint* cvSubdiv2DEdgeOrg( CvSubdiv2DEdge edge ) // CV_INLINE CvSubdiv2DPoint* cvSubdiv2DEdgeOrg( CvSubdiv2DEdge edge )
// { // {
// CvQuadEdge2D* e = (CvQuadEdge2D*)(edge & ~3); // CvQuadEdge2D* e = (CvQuadEdge2D*)(edge & ~3);
// return (CvSubdiv2DPoint*)e->pt[edge & 3]; // return (CvSubdiv2DPoint*)e->pt[edge & 3];
// } // }
function cvSubdiv2DEdgeOrg(edge: TCvSubdiv2DEdge): pCvSubdiv2DPoint; inline; function cvSubdiv2DEdgeOrg(edge: TCvSubdiv2DEdge): pCvSubdiv2DPoint; // inline;
// CV_INLINE CvSubdiv2DPoint* cvSubdiv2DEdgeDst( CvSubdiv2DEdge edge ) // CV_INLINE CvSubdiv2DPoint* cvSubdiv2DEdgeDst( CvSubdiv2DEdge edge )
// { // {
// CvQuadEdge2D* e = (CvQuadEdge2D*)(edge & ~3); // CvQuadEdge2D* e = (CvQuadEdge2D*)(edge & ~3);
// return (CvSubdiv2DPoint*)e->pt[(edge + 2) & 3]; // return (CvSubdiv2DPoint*)e->pt[(edge + 2) & 3];
// } // }
function cvSubdiv2DEdgeDst(edge: TCvSubdiv2DEdge): pCvSubdiv2DPoint; inline; function cvSubdiv2DEdgeDst(edge: TCvSubdiv2DEdge): pCvSubdiv2DPoint; // inline;
/// ****************************************************************************************\ /// ****************************************************************************************\
// * Additional operations on Subdivisions * // * Additional operations on Subdivisions *
@ -3309,42 +3311,55 @@ procedure cvFindStereoCorrespondenceGC(const left: pIplImage; const right: pIplI
// * IEEE Transactions on Pattern Analysis and Machine Intelligence 22(8):747-757 // * IEEE Transactions on Pattern Analysis and Machine Intelligence 22(8):747-757
// */ // */
// //
// const
// #define CV_BG_MODEL_FGD 0 CV_BG_MODEL_FGD = 0;
// #define CV_BG_MODEL_MOG 1 /* "Mixture of Gaussians". */ CV_BG_MODEL_MOG = 1; // * "Mixture of Gaussians". */
// #define CV_BG_MODEL_FGD_SIMPLE 2 CV_BG_MODEL_FGD_SIMPLE = 2;
//
// struct CvBGStatModel; Type
//
// typedef void (CV_CDECL * CvReleaseBGStatModel)( struct CvBGStatModel** bg_model ); ppCvBGStatModel = ^pCvBGStatModel;
// typedef int (CV_CDECL * CvUpdateBGStatModel)( IplImage* curr_frame, struct CvBGStatModel* bg_model, pCvBGStatModel = ^TCvBGStatModel;
// double learningRate );
// // typedef void (CV_CDECL * CvReleaseBGStatModel)( struct CvBGStatModel** bg_model );
// #define CV_BG_STAT_MODEL_FIELDS() \ TCvReleaseBGStatModel = procedure(Var bg_model: pCvBGStatModel); cdecl;
// int type; /*type of BG model*/ \ // typedef int (CV_CDECL * CvUpdateBGStatModel)( IplImage* curr_frame, struct CvBGStatModel* bg_model, double learningRate );
// CvReleaseBGStatModel release; \ TCvUpdateBGStatModel = function(curr_frame: pIplImage; bg_model: pCvBGStatModel; learningRate: double)
// CvUpdateBGStatModel update; \ : Integer; cdecl;
// IplImage* background; /*8UC3 reference background image*/ \
// IplImage* foreground; /*8UC1 foreground image*/ \ TCvBGStatModel = packed record
// IplImage** layers; /*8UC3 reference background image, can be null */ \ _type: Integer; // *type of BG model
// int layer_count; /* can be zero */ \ release: TCvReleaseBGStatModel;
// CvMemStorage* storage; /*storage for foreground_regions*/ \ update: TCvUpdateBGStatModel;
// CvSeq* foreground_regions /*foreground object contours*/ background: pIplImage; // *8UC3 reference background image
// foreground: pIplImage; // *8UC1 foreground image
// typedef struct CvBGStatModel layers: pIplImage; // *8UC3 reference background image, can be null
// { layer_count: Integer; // * can be zero
// CV_BG_STAT_MODEL_FIELDS(); storage: pCvMemStorage; // *storage for foreground_regions
// } CvBGStatModel; foreground_regions: pCvSeq; // *foreground object contours
// end;
/// /
// // #define CV_BG_STAT_MODEL_FIELDS() \
/// / Releases memory used by BGStatModel // int type; /*type of BG model*/ \
// CVAPI(void) cvReleaseBGStatModel( CvBGStatModel** bg_model ); // CvReleaseBGStatModel release; \
// // CvUpdateBGStatModel update; \
/// / Updates statistical model and returns number of found foreground regions // IplImage* background; /*8UC3 reference background image*/ \
// IplImage* foreground; /*8UC1 foreground image*/ \
// IplImage** layers; /*8UC3 reference background image, can be null */ \
// int layer_count; /* can be zero */ \
// CvMemStorage* storage; /*storage for foreground_regions*/ \
// CvSeq* foreground_regions /*foreground object contours*/
/// / Releases memory used by BGStatModel
// CVAPI(void) cvReleaseBGStatModel( CvBGStatModel** bg_model );
procedure cvReleaseBGStatModel(Var bg_model: pCvBGStatModel); cdecl;
// Updates statistical model and returns number of found foreground regions
// CVAPI(int) cvUpdateBGStatModel( IplImage* current_frame, CvBGStatModel* bg_model, // CVAPI(int) cvUpdateBGStatModel( IplImage* current_frame, CvBGStatModel* bg_model,
// double learningRate CV_DEFAULT(-1)); // double learningRate CV_DEFAULT(-1));
// function cvUpdateBGStatModel(current_frame: pIplImage; bg_model: pCvBGStatModel; learningRate: double = -1)
: Integer; cdecl;
/// / Performs FG post-processing using segmentation /// / Performs FG post-processing using segmentation
/// / (all pixels of a region will be classified as foreground if majority of pixels of the region are FG). /// / (all pixels of a region will be classified as foreground if majority of pixels of the region are FG).
/// / parameters: /// / parameters:
@ -3356,223 +3371,226 @@ procedure cvFindStereoCorrespondenceGC(const left: pIplImage; const right: pIplI
// CVAPI(int) cvChangeDetection( IplImage* prev_frame, // CVAPI(int) cvChangeDetection( IplImage* prev_frame,
// IplImage* curr_frame, // IplImage* curr_frame,
// IplImage* change_mask ); // IplImage* change_mask );
// //
/// *
// Interface of ACM MM2003 algorithm // Interface of ACM MM2003 algorithm
// */
// //
/// * Default parameters of foreground detection algorithm: */
// #define CV_BGFG_FGD_LC 128 const
// #define CV_BGFG_FGD_N1C 15 // Default parameters of foreground detection algorithm:
// #define CV_BGFG_FGD_N2C 25 CV_BGFG_FGD_LC = 128;
// CV_BGFG_FGD_N1C = 15;
// #define CV_BGFG_FGD_LCC 64 CV_BGFG_FGD_N2C = 25;
// #define CV_BGFG_FGD_N1CC 25
// #define CV_BGFG_FGD_N2CC 40 CV_BGFG_FGD_LCC = 64;
// CV_BGFG_FGD_N1CC = 25;
/// * Background reference image update parameter: */ CV_BGFG_FGD_N2CC = 40;
// #define CV_BGFG_FGD_ALPHA_1 0.1f // Background reference image update parameter: */
// CV_BGFG_FGD_ALPHA_1 = 0.1;
/// * stat model update parameter
// * 0.002f ~ 1K frame(~45sec), 0.005 ~ 18sec (if 25fps and absolutely static BG) /// * stat model update parameter
// */ // * 0.002f ~ 1K frame(~45sec), 0.005 ~ 18sec (if 25fps and absolutely static BG)
// #define CV_BGFG_FGD_ALPHA_2 0.005f // */
// CV_BGFG_FGD_ALPHA_2 = 0.005;
/// * start value for alpha parameter (to fast initiate statistic model) */
// #define CV_BGFG_FGD_ALPHA_3 0.1f // * start value for alpha parameter (to fast initiate statistic model) */
// CV_BGFG_FGD_ALPHA_3 = 0.1;
// #define CV_BGFG_FGD_DELTA 2 CV_BGFG_FGD_DELTA = 2;
// CV_BGFG_FGD_T = 0.9;
// #define CV_BGFG_FGD_T 0.9f CV_BGFG_FGD_MINAREA = 15;
// CV_BGFG_FGD_BG_UPDATE_TRESH = 0.5;
// #define CV_BGFG_FGD_MINAREA 15.f
// /// * See the above-referenced Li/Huang/Gu/Tian paper
// #define CV_BGFG_FGD_BG_UPDATE_TRESH 0.5f // * for a full description of these background-model
// // * tuning parameters.
/// * See the above-referenced Li/Huang/Gu/Tian paper // *
// * for a full description of these background-model // * Nomenclature: 'c' == "color", a three-component red/green/blue vector.
// * tuning parameters. // * We use histograms of these to model the range of
// * // * colors we've seen at a given background pixel.
// * Nomenclature: 'c' == "color", a three-component red/green/blue vector. // *
// * We use histograms of these to model the range of // * 'cc' == "color co-occurrence", a six-component vector giving
// * colors we've seen at a given background pixel. // * RGB color for both this frame and preceding frame.
// * // * We use histograms of these to model the range of
// * 'cc' == "color co-occurrence", a six-component vector giving // * color CHANGES we've seen at a given background pixel.
// * RGB color for both this frame and preceding frame. // */
// * We use histograms of these to model the range of Type
// * color CHANGES we've seen at a given background pixel. pCvFGDStatModelParams = ^TCvFGDStatModelParams;
// */
// typedef struct CvFGDStatModelParams TCvFGDStatModelParams = packed record
// { Lc: Integer; // Quantized levels per 'color' component. Power of two, typically 32, 64 or 128.
// int Lc; /* Quantized levels per 'color' component. Power of two, typically 32, 64 or 128. */ N1c: Integer; // Number of color vectors used to model normal background color variation at a given pixel.
// int N1c; /* Number of color vectors used to model normal background color variation at a given pixel. */ N2c: Integer; // Number of color vectors retained at given pixel. Must be > N1c, typically ~ 5/3 of N1c.
// int N2c; /* Number of color vectors retained at given pixel. Must be > N1c, typically ~ 5/3 of N1c. */ // Used to allow the first N1c vectors to adapt over time to changing background.
// /* Used to allow the first N1c vectors to adapt over time to changing background. */ Lcc: Integer;
// // Quantized levels per 'color co-occurrence' component. Power of two, typically 16, 32 or 64.
// int Lcc; /* Quantized levels per 'color co-occurrence' component. Power of two, typically 16, 32 or 64. */ N1cc: Integer;
// int N1cc; /* Number of color co-occurrence vectors used to model normal background color variation at a given pixel. */ // Number of color co-occurrence vectors used to model normal background color variation at a given pixel.
// int N2cc; /* Number of color co-occurrence vectors retained at given pixel. Must be > N1cc, typically ~ 5/3 of N1cc. */ N2cc: Integer;
// /* Used to allow the first N1cc vectors to adapt over time to changing background. */ // Number of color co-occurrence vectors retained at given pixel. Must be > N1cc, typically ~ 5/3 of N1cc.
// // Used to allow the first N1cc vectors to adapt over time to changing background.
// int is_obj_without_holes;/* If TRUE we ignore holes within foreground blobs. Defaults to TRUE. */ is_obj_without_holes: Integer; // If TRUE we ignore holes within foreground blobs. Defaults to TRUE.
// int perform_morphing; /* Number of erode-dilate-erode foreground-blob cleanup iterations. */ perform_morphing: Integer; // Number of erode-dilate-erode foreground-blob cleanup iterations.
// /* These erase one-pixel junk blobs and merge almost-touching blobs. Default value is 1. */ // These erase one-pixel junk blobs and merge almost-touching blobs. Default value is 1.
// alpha1: Single; // How quickly we forget old background pixel values seen. Typically set to 0.1
// float alpha1; /* How quickly we forget old background pixel values seen. Typically set to 0.1 */ alpha2: Single; // "Controls speed of feature learning". Depends on T. Typical value circa 0.005.
// float alpha2; /* "Controls speed of feature learning". Depends on T. Typical value circa 0.005. */ alpha3: Single; // Alternate to alpha2, used (e.g.) for quicker initial convergence. Typical value 0.1.
// float alpha3; /* Alternate to alpha2, used (e.g.) for quicker initial convergence. Typical value 0.1. */ delta: Single; // Affects color and color co-occurrence quantization, typically set to 2.
// T: Single;
// float delta; /* Affects color and color co-occurrence quantization, typically set to 2. */ // "A percentage value which determines when new features can be recognized as new background." (Typically 0.9).
// float T; /* "A percentage value which determines when new features can be recognized as new background." (Typically 0.9).*/ minArea: Single; // Discard foreground blobs whose bounding box is smaller than this threshold.
// float minArea; /* Discard foreground blobs whose bounding box is smaller than this threshold. */ end;
// } CvFGDStatModelParams; //
// // typedef struct CvBGPixelCStatTable
// typedef struct CvBGPixelCStatTable // {
// { // float Pv, Pvb;
// float Pv, Pvb; // uchar v[3];
// uchar v[3]; // } CvBGPixelCStatTable;
// } CvBGPixelCStatTable; //
// // typedef struct CvBGPixelCCStatTable
// typedef struct CvBGPixelCCStatTable // {
// { // float Pv, Pvb;
// float Pv, Pvb; // uchar v[6];
// uchar v[6]; // } CvBGPixelCCStatTable;
// } CvBGPixelCCStatTable; //
// // typedef struct CvBGPixelStat
// typedef struct CvBGPixelStat // {
// { // float Pbc;
// float Pbc; // float Pbcc;
// float Pbcc; // CvBGPixelCStatTable* ctable;
// CvBGPixelCStatTable* ctable; // CvBGPixelCCStatTable* cctable;
// CvBGPixelCCStatTable* cctable; // uchar is_trained_st_model;
// uchar is_trained_st_model; // uchar is_trained_dyn_model;
// uchar is_trained_dyn_model; // } CvBGPixelStat;
// } CvBGPixelStat; //
// //
// // typedef struct CvFGDStatModel
// typedef struct CvFGDStatModel // {
// { // CV_BG_STAT_MODEL_FIELDS();
// CV_BG_STAT_MODEL_FIELDS(); // CvBGPixelStat* pixel_stat;
// CvBGPixelStat* pixel_stat; // IplImage* Ftd;
// IplImage* Ftd; // IplImage* Fbd;
// IplImage* Fbd; // IplImage* prev_frame;
// IplImage* prev_frame; // CvFGDStatModelParams params;
// CvFGDStatModelParams params; // } CvFGDStatModel;
// } CvFGDStatModel;
// /// * Creates FGD model */
/// * Creates FGD model */ // CVAPI(CvBGStatModel*) cvCreateFGDStatModel( IplImage* first_frame, CvFGDStatModelParams* parameters CV_DEFAULT(NULL));
// CVAPI(CvBGStatModel*) cvCreateFGDStatModel( IplImage* first_frame, function cvCreateFGDStatModel(first_frame: pIplImage; parameters: pCvFGDStatModelParams = nil): pCvBGStatModel;
// CvFGDStatModelParams* parameters CV_DEFAULT(NULL)); cdecl
//
/// *
// Interface of Gaussian mixture algorithm // Interface of Gaussian mixture algorithm
// //
// "An improved adaptive background mixture model for real-time tracking with shadow detection" // "An improved adaptive background mixture model for real-time tracking with shadow detection"
// P. KadewTraKuPong and R. Bowden, // P. KadewTraKuPong and R. Bowden,
// Proc. 2nd European Workshp on Advanced Video-Based Surveillance Systems, 2001." // Proc. 2nd European Workshp on Advanced Video-Based Surveillance Systems, 2001."
// http://personal.ee.surrey.ac.uk/Personal/R.Bowden/publications/avbs01/avbs01.pdf // http://personal.ee.surrey.ac.uk/Personal/R.Bowden/publications/avbs01/avbs01.pdf
// */
// //
/// * Note: "MOG" == "Mixture Of Gaussians": */ /// * Note: "MOG" == "Mixture Of Gaussians": */
// const
// #define CV_BGFG_MOG_MAX_NGAUSSIANS 500 CV_BGFG_MOG_MAX_NGAUSSIANS = 500;
//
/// * default parameters of gaussian background detection algorithm */ // * default parameters of gaussian background detection algorithm */
// #define CV_BGFG_MOG_BACKGROUND_THRESHOLD 0.7 /* threshold sum of weights for background test */ CV_BGFG_MOG_BACKGROUND_THRESHOLD = 0.7; // * threshold sum of weights for background test */
// #define CV_BGFG_MOG_STD_THRESHOLD 2.5 /* lambda=2.5 is 99% */ CV_BGFG_MOG_STD_THRESHOLD = 2.5; // * lambda=2.5 is 99% */
// #define CV_BGFG_MOG_WINDOW_SIZE 200 /* Learning rate; alpha = 1/CV_GBG_WINDOW_SIZE */ CV_BGFG_MOG_WINDOW_SIZE = 200; // * Learning rate; alpha = 1/CV_GBG_WINDOW_SIZE */
// #define CV_BGFG_MOG_NGAUSSIANS 5 /* = K = number of Gaussians in mixture */ CV_BGFG_MOG_NGAUSSIANS = 5; // * = K = number of Gaussians in mixture */
// #define CV_BGFG_MOG_WEIGHT_INIT 0.05 CV_BGFG_MOG_WEIGHT_INIT = 0.05;
// #define CV_BGFG_MOG_SIGMA_INIT 30 CV_BGFG_MOG_SIGMA_INIT = 30;
// #define CV_BGFG_MOG_MINAREA 15.f CV_BGFG_MOG_MINAREA = 15;
//
// CV_BGFG_MOG_NCOLORS = 3;
// #define CV_BGFG_MOG_NCOLORS 3
// type
// typedef struct CvGaussBGStatModelParams pCvGaussBGStatModelParams = ^TCvGaussBGStatModelParams;
// {
// int win_size; /* = 1/alpha */ TCvGaussBGStatModelParams = packed record
// int n_gauss; win_size: Integer; // * = 1/alpha
// double bg_threshold, std_threshold, minArea; n_gauss: Integer;
// double weight_init, variance_init; bg_threshold, std_threshold, minArea: double;
// }CvGaussBGStatModelParams; weight_init, variance_init: double;
// end;
// typedef struct CvGaussBGValues
// { pCvGaussBGValues = ^TCvGaussBGValues;
// int match_sum;
// double weight; TCvGaussBGValues = packed record
// double variance[CV_BGFG_MOG_NCOLORS]; match_sum: Integer;
// double mean[CV_BGFG_MOG_NCOLORS]; weight: double;
// } CvGaussBGValues; variance: array [0 .. CV_BGFG_MOG_NCOLORS - 1] of double;
// mean: array [0 .. CV_BGFG_MOG_NCOLORS - 1] of double;
// typedef struct CvGaussBGPoint end;
// {
// CvGaussBGValues* g_values; pCvGaussBGPoint = ^TCvGaussBGPoint;
// } CvGaussBGPoint;
// TCvGaussBGPoint = packed record
// g_values: pCvGaussBGValues;
// typedef struct CvGaussBGModel end;
// {
// CV_BG_STAT_MODEL_FIELDS(); pCvGaussBGModel = ^TCvGaussBGModel;
// CvGaussBGStatModelParams params;
// CvGaussBGPoint* g_point; TCvGaussBGModel = packed record
// int countFrames; // CV_BG_STAT_MODEL_FIELDS();
// void* mog; _type: Integer; // type of BG model
// } CvGaussBGModel; release: TCvReleaseBGStatModel;
// update: TCvUpdateBGStatModel;
// background: pIplImage; // 8UC3 reference background image
/// * Creates Gaussian mixture background model */ foreground: pIplImage; // 8UC1 foreground image
// CVAPI(CvBGStatModel*) cvCreateGaussianBGModel( IplImage* first_frame, layers: pIplImage; // 8UC3 reference background image, can be null
// CvGaussBGStatModelParams* parameters CV_DEFAULT(NULL)); layer_count: Integer; // can be zero
// storage: pCvMemStorage; // storage for foreground_regions
// foreground_regions: pCvSeq; // foreground object contours
// typedef struct CvBGCodeBookElem params: TCvGaussBGStatModelParams;
// { g_point: pCvGaussBGPoint;
// struct CvBGCodeBookElem* next; countFrames: Integer;
// int tLastUpdate; mog: Pointer;
// int stale; end;
// uchar boxMin[3];
// uchar boxMax[3]; // * Creates Gaussian mixture background model */
// uchar learnMin[3]; // CVAPI(CvBGStatModel*) cvCreateGaussianBGModel( IplImage* first_frame, CvGaussBGStatModelParams* parameters CV_DEFAULT(NULL));
// uchar learnMax[3]; function cvCreateGaussianBGModel(first_frame: pIplImage; parameters: pCvGaussBGStatModelParams = nil)
// } CvBGCodeBookElem; : pCvBGStatModel; cdecl;
//
// typedef struct CvBGCodeBookModel type
// { pCvBGCodeBookElem = ^TCvBGCodeBookElem;
// CvSize size;
// int t; TCvBGCodeBookElem = packed record
// uchar cbBounds[3]; next: pCvBGCodeBookElem;
// uchar modMin[3]; tLastUpdate: Integer;
// uchar modMax[3]; stale: Integer;
// CvBGCodeBookElem** cbmap; boxMin: array [0 .. 2] of byte;
// CvMemStorage* storage; boxMax: array [0 .. 2] of byte;
// CvBGCodeBookElem* freeList; learnMin: array [0 .. 2] of byte;
// } CvBGCodeBookModel; learnMax: array [0 .. 2] of byte;
// end;
// CVAPI(CvBGCodeBookModel*) cvCreateBGCodeBookModel( void );
pCvBGCodeBookModel = ^TCvBGCodeBookModel;
TCvBGCodeBookModel = packed record
size: TCvSize;
T: Integer;
cbBounds: array [0 .. 2] of byte;
modMin: array [0 .. 2] of byte;
modMax: array [0 .. 2] of byte;
cbmap: pCvBGCodeBookElem;
storage: pCvMemStorage;
freeList: pCvBGCodeBookElem;
end;
// CVAPI(CvBGCodeBookModel*) cvCreateBGCodeBookModel( void );
function cvCreateBGCodeBookModel: pCvBGCodeBookModel; cdecl;
// CVAPI(void) cvReleaseBGCodeBookModel( CvBGCodeBookModel** model ); // CVAPI(void) cvReleaseBGCodeBookModel( CvBGCodeBookModel** model );
// procedure cvReleaseBGCodeBookModel(model: pCvBGCodeBookModel); cdecl;
// CVAPI(void) cvBGCodeBookUpdate( CvBGCodeBookModel* model, const CvArr* image, // CVAPI(void) cvBGCodeBookUpdate( CvBGCodeBookModel* model, const CvArr* image, CvRect roi CV_DEFAULT(cvRect(0,0,0,0)),const CvArr* mask CV_DEFAULT(0) );
// CvRect roi CV_DEFAULT(cvRect(0,0,0,0)), procedure cvBGCodeBookUpdate(model: pCvBGCodeBookModel; const image: pIplImage;
// const CvArr* mask CV_DEFAULT(0) ); roi: TCvRect { =CV_DEFAULT(cvRect(0,0,0,0)) }; const mask: pCvArr { =0 } ); cdecl;
// // CVAPI(int) cvBGCodeBookDiff( const CvBGCodeBookModel* model, const CvArr* image, CvArr* fgmask, CvRect roi CV_DEFAULT(cvRect(0,0,0,0)) );
// CVAPI(int) cvBGCodeBookDiff( const CvBGCodeBookModel* model, const CvArr* image, function cvBGCodeBookDiff(const model: pCvBGCodeBookModel; const image: pCvArr; fgmask: pCvArr;
// CvArr* fgmask, CvRect roi CV_DEFAULT(cvRect(0,0,0,0)) ); roi: TCvRect { = cvRect(0,0,0,0) } ): Integer; cdecl;
// // CVAPI(void) cvBGCodeBookClearStale( CvBGCodeBookModel* model, int staleThresh, CvRect roi CV_DEFAULT(cvRect(0,0,0,0)), const CvArr* mask CV_DEFAULT(0) );
// CVAPI(void) cvBGCodeBookClearStale( CvBGCodeBookModel* model, int staleThresh, procedure cvBGCodeBookClearStale(model: pCvBGCodeBookModel; staleThresh: Integer; roi: TCvRect { =cvRect(0,0,0,0) };
// CvRect roi CV_DEFAULT(cvRect(0,0,0,0)), const mask: pCvArr = nil ); cdecl;
// const CvArr* mask CV_DEFAULT(0) ); // CVAPI(CvSeq*) cvSegmentFGMask( CvArr *fgmask, int poly1Hull0 CV_DEFAULT(1), float perimScale CV_DEFAULT(4.f), CvMemStorage* storage CV_DEFAULT(0), CvPoint offset CV_DEFAULT(cvPoint(0,0)));
// function cvSegmentFGMask(fgmask: pCvArr; poly1Hull0: Integer { =1 }; perimScale: Single { = 4 };
// CVAPI(CvSeq*) cvSegmentFGMask( CvArr *fgmask, int poly1Hull0 CV_DEFAULT(1), storage: pCvMemStorage { =nil }; offset: TCvPoint { =cvPoint(0,0) } ): pCvSeq; cdecl;
// float perimScale CV_DEFAULT(4.f),
// CvMemStorage* storage CV_DEFAULT(0),
// CvPoint offset CV_DEFAULT(cvPoint(0,0)));
//
// #ifdef __cplusplus
// }
// #endif
//
// #endif
implementation implementation
@ -3595,7 +3613,7 @@ begin
Result := pCvSubdiv2DPoint(e^.pt[edge and 3]); Result := pCvSubdiv2DPoint(e^.pt[edge and 3]);
end; end;
function cvSubdiv2DEdgeDst(edge: TCvSubdiv2DEdge): pCvSubdiv2DPoint; inline; function cvSubdiv2DEdgeDst(edge: TCvSubdiv2DEdge): pCvSubdiv2DPoint;
Var Var
e: pCvQuadEdge2D; e: pCvQuadEdge2D;
begin begin
@ -3607,7 +3625,7 @@ end;
function cvSubdiv2DLocate; external legacy_Dll; function cvSubdiv2DLocate; external legacy_Dll;
function cvSubdiv2DGetEdge(edge: TCvSubdiv2DEdge; _type: TCvNextEdgeType): TCvSubdiv2DEdge; inline; function cvSubdiv2DGetEdge(edge: TCvSubdiv2DEdge; _type: TCvNextEdgeType): TCvSubdiv2DEdge;
Var Var
e: pCvQuadEdge2D; e: pCvQuadEdge2D;
begin begin
@ -3619,7 +3637,7 @@ begin
Result := (edge and (not 3)) + ((edge + (_type shr 4)) and 3); Result := (edge and (not 3)) + ((edge + (_type shr 4)) and 3);
end; end;
function cvSubdiv2DRotateEdge(edge: TCvSubdiv2DEdge; rotate: Integer): TCvSubdiv2DEdge; inline; function cvSubdiv2DRotateEdge(edge: TCvSubdiv2DEdge; rotate: Integer): TCvSubdiv2DEdge;
begin begin
// return (edge & ~3) + ((edge + rotate) & 3); // return (edge & ~3) + ((edge + rotate) & 3);
Result := (edge and (not 3)) + ((edge + rotate) and 3); Result := (edge and (not 3)) + ((edge + rotate) and 3);
@ -3627,5 +3645,15 @@ end;
procedure cvCalcSubdivVoronoi2D; external legacy_Dll; procedure cvCalcSubdivVoronoi2D; external legacy_Dll;
function cvSubdivDelaunay2DInsert; external legacy_Dll; function cvSubdivDelaunay2DInsert; external legacy_Dll;
function cvCreateGaussianBGModel; external legacy_Dll;
function cvUpdateBGStatModel; external legacy_Dll;
procedure cvReleaseBGStatModel; external legacy_Dll;
function cvCreateFGDStatModel; external legacy_Dll;
function cvCreateBGCodeBookModel; external legacy_Dll;
procedure cvReleaseBGCodeBookModel; external legacy_Dll;
procedure cvBGCodeBookUpdate; external legacy_Dll;
function cvBGCodeBookDiff; external legacy_Dll;
procedure cvBGCodeBookClearStale; external legacy_Dll;
function cvSegmentFGMask; external legacy_Dll;
end. end.

View File

@ -130,6 +130,9 @@ type
// TCvArr = record // TCvArr = record
// end; // end;
TVoid = record
end;
pCvArr = Pointer; pCvArr = Pointer;
TCv32suf = packed record TCv32suf = packed record
@ -777,6 +780,9 @@ type
z: Double; z: Double;
end; end;
Const
cvZeroPoint: TCvPoint = (x: 0; y: 0);
(* ******************************* CvSize's & CvBox **************************************/ *) (* ******************************* CvSize's & CvBox **************************************/ *)
type type
@ -947,7 +953,7 @@ const
{$EXTERNALSYM CV_SET_ELEM_FREE_FLAG} {$EXTERNALSYM CV_SET_ELEM_FREE_FLAG}
// Checks whether the element pointed by ptr belongs to a set or not // Checks whether the element pointed by ptr belongs to a set or not
// #define CV_IS_SET_ELEM( ptr ) (((CvSetElem*)(ptr))->flags >= 0) // #define CV_IS_SET_ELEM( ptr ) (((CvSetElem*)(ptr))->flags >= 0)
function CV_IS_SET_ELEM(ptr: Pointer): Boolean; inline; function CV_IS_SET_ELEM(ptr: Pointer): Boolean; // inline;
(* ************************************ Graph ******************************************* *) (* ************************************ Graph ******************************************* *)
@ -1267,6 +1273,8 @@ function CV_GET_SEQ_ELEM(const size_of_elem: Integer; seq: pCvSeq; index: Intege
// Assert((writer).ptr <= (writer).block_max - SizeOf(elem)); // Assert((writer).ptr <= (writer).block_max - SizeOf(elem));
// memcpy((writer).ptr, and (elem), SizeOf(elem)); (writer).ptr := mod +SizeOf(elem) then; end; // memcpy((writer).ptr, and (elem), SizeOf(elem)); (writer).ptr := mod +SizeOf(elem) then; end;
function CV_CAST_8U(t : Integer) : UCHAR; inline;
(* (*
/* Move reader position forward: */ /* Move reader position forward: */
#define CV_NEXT_SEQ_ELEM( elem_size, reader ) \ #define CV_NEXT_SEQ_ELEM( elem_size, reader ) \
@ -1277,7 +1285,7 @@ function CV_GET_SEQ_ELEM(const size_of_elem: Integer; seq: pCvSeq; index: Intege
} \ } \
} }
*) *)
procedure CV_NEXT_SEQ_ELEM(const elem_size: Integer; const Reader: TCvSeqReader); inline; procedure CV_NEXT_SEQ_ELEM(const elem_size: Integer; const Reader: TCvSeqReader); // inline;
// (* Move reader position backward: *) // (* Move reader position backward: *)
// // >> Following declaration is a macro definition! // // >> Following declaration is a macro definition!
@ -2043,7 +2051,10 @@ function cvRandInt(Var rng: TCvRNG): Cardinal; inline;
function CvRect(Const x, y, width, height: Integer): TCvRect; inline; function CvRect(Const x, y, width, height: Integer): TCvRect; inline;
function cvRound(value: Double): Integer; function cvRound(value: Double): Integer;
{ const
cvZeroRect: TCvRect = (x: 0; y: 0; width: 0; height: 0);
{
* Inline constructor. No data is allocated internally!!! * Inline constructor. No data is allocated internally!!!
* (Use together with cvCreateData, or use cvCreateMat instead to * (Use together with cvCreateData, or use cvCreateMat instead to
* get a matrix with allocated data): * get a matrix with allocated data):
@ -2062,7 +2073,7 @@ function cvRound(value: Double): Integer;
m.hdr_refcount = 0; m.hdr_refcount = 0;
return m; return m;
} }
function cvMat(rows: Integer; cols: Integer; etype: Integer; data: Pointer = nil): TCvMat; function cvMat(rows: Integer; cols: Integer; etype: Integer; data: Pointer = nil): TCvMat;
function CV_MAT_DEPTH(flags: Integer): Integer; function CV_MAT_DEPTH(flags: Integer): Integer;
function CV_MAT_TYPE(flags: Integer): Integer; function CV_MAT_TYPE(flags: Integer): Integer;
@ -2238,11 +2249,11 @@ begin
CV_NEXT_SEQ_ELEM(SizeOfElem, Reader); CV_NEXT_SEQ_ELEM(SizeOfElem, Reader);
end; end;
procedure CV_NEXT_SEQ_ELEM(const elem_size: Integer; const Reader: TCvSeqReader); inline; procedure CV_NEXT_SEQ_ELEM(const elem_size: Integer; const Reader: TCvSeqReader); // inline;
begin begin
// if( ((reader).ptr += (elem_size)) >= (reader).block_max ) // if( ((reader).ptr += (elem_size)) >= (reader).block_max )
// cvChangeSeqBlock( &(reader), 1 ); // cvChangeSeqBlock( &(reader), 1 );
if (Integer(Reader.ptr) + elem_size) < Integer(Reader.block_max) then if (Integer(Reader.ptr) + elem_size) >= Integer(Reader.block_max) then
cvChangeSeqBlock(@Reader, 1); cvChangeSeqBlock(@Reader, 1);
end; end;
@ -2315,6 +2326,16 @@ begin
Result := CV_SEQ_ELEM(seq, size_of_elem, index); Result := CV_SEQ_ELEM(seq, size_of_elem, index);
end; end;
function CV_CAST_8U(t : Integer) : UCHAR;
begin
if (not (t and (not 255)) <> 0) then
Result := t
else if t > 0 then
Result := 255
else
Result := 0;
end;
function CV_SEQ_ELEM(seq: pCvSeq; const size_of_elem: Integer; index: Integer): Pointer; inline; function CV_SEQ_ELEM(seq: pCvSeq; const size_of_elem: Integer; index: Integer): Pointer; inline;
begin begin
// assert(sizeof((seq)->first[0]) == sizeof(CvSeqBlock) && (seq)->elem_size == sizeof(elem_type)) // assert(sizeof((seq)->first[0]) == sizeof(CvSeqBlock) && (seq)->elem_size == sizeof(elem_type))
@ -2343,7 +2364,7 @@ begin
Result := CV_MAKETYPE(CV_8U, 3); Result := CV_MAKETYPE(CV_8U, 3);
end; end;
function CV_IS_SET_ELEM(ptr: Pointer): Boolean; inline; function CV_IS_SET_ELEM(ptr: Pointer): Boolean; // inline;
begin begin
// #define CV_IS_SET_ELEM( ptr ) (((CvSetElem*)(ptr))->flags >= 0) // #define CV_IS_SET_ELEM( ptr ) (((CvSetElem*)(ptr))->flags >= 0)
Result := pCvSetElem(ptr)^.flags >= 0; Result := pCvSetElem(ptr)^.flags >= 0;

View File

@ -0,0 +1,237 @@
(* /*****************************************************************
// Delphi-OpenCV Demo
// Copyright (C) 2013 Project Delphi-OpenCV
// ****************************************************************
// Contributor:
// laentir Valetov
// email:laex@bk.ru
// ****************************************************************
// You may retrieve the latest version of this file at the GitHub,
// located at git://github.com/Laex/Delphi-OpenCV.git
// ****************************************************************
// The contents of this file are used with permission, subject to
// the Mozilla Public License Version 1.1 (the "License"); you may
// not use this file except in compliance with the License. You may
// obtain a copy of the License at
// http://www.mozilla.org/MPL/MPL-1_1Final.html
//
// Software distributed under the License is distributed on an
// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
// implied. See the License for the specific language governing
// rights and limitations under the License.
******************************************************************* *)
// JCL_DEBUG_EXPERT_GENERATEJDBG OFF
// JCL_DEBUG_EXPERT_INSERTJDBG OFF
// JCL_DEBUG_EXPERT_DELETEMAPFILE OFF
program cvCodeBook;
{$APPTYPE CONSOLE}
{$POINTERMATH ON}
{$R *.res}
uses
System.SysUtils,
uLibName in '..\..\..\include\uLibName.pas',
highgui_c in '..\..\..\include\highgui\highgui_c.pas',
core_c in '..\..\..\include\ñore\core_c.pas',
Core.types_c in '..\..\..\include\ñore\Core.types_c.pas',
imgproc.types_c in '..\..\..\include\imgproc\imgproc.types_c.pas',
imgproc_c in '..\..\..\include\imgproc\imgproc_c.pas',
legacy in '..\..\..\include\legacy\legacy.pas',
calib3d in '..\..\..\include\calib3d\calib3d.pas',
imgproc in '..\..\..\include\imgproc\imgproc.pas',
haar in '..\..\..\include\objdetect\haar.pas',
objdetect in '..\..\..\include\objdetect\objdetect.pas',
tracking in '..\..\..\include\video\tracking.pas',
Core in '..\..\..\include\ñore\core.pas';
const
NCHANNELS: Integer = 3;
var
ch: array [0 .. 2] of boolean = (
true,
true,
true
);
// VARIABLES for CODEBOOK METHOD:
model: pCvBGCodeBookModel;
rawImage, yuvImage: pIplImage;
ImaskCodeBook, ImaskCodeBookCC: pIplImage;
capture: pCvCapture;
c, n, v, nframes, nframesToLearnBG: Integer;
pause: boolean;
size: TCvSize;
scalar: TCvScalar;
ptr, ptr1: pByte;
hdl: THandle;
tmp: AnsiString;
singlestep: boolean = False;
procedure help;
begin
Writeln('h - Help');
Writeln('p - Pause (', singlestep, ')');
Writeln('s - Single step (', singlestep, ')');
Writeln('r - resume (set Pause=false, SingleStep=False');
Writeln('SPACE - clear');
Writeln('y0u1v2a3b - set CODEBOOK params');
Writeln('iokl - modify max classification bounds (max bound goes higher)');
Writeln('q or ESC - quit');
Writeln('---------------------------------------');
end;
begin
try
nframes := 0;
nframesToLearnBG := 300;
pause := False;
model := cvCreateBGCodeBookModel;
model^.modMin[0] := 3;
model^.modMin[1] := 3;
model^.modMin[2] := 3;
model^.modMax[0] := 10;
model^.modMax[1] := 10;
model^.modMax[2] := 10;
model^.cbBounds[0] := 10;
model^.cbBounds[1] := 10;
model^.cbBounds[2] := 10;
pause := False;
singlestep := False;
capture := cvCreateCameraCapture(CV_CAP_ANY);
Assert(Assigned(capture));
help;
// MAIN PROCESSING LOOP:
while (true) do
begin
if (Not pause) then
begin
rawImage := cvQueryFrame(capture);
Inc(nframes);
if (rawImage = NIL) then
break;
end;
if (singlestep) then
pause := true; // ????
// First time:
if (nframes = 1) and (rawImage <> NIL) then
begin
// CODEBOOK METHOD ALLOCATION
yuvImage := cvCloneImage(rawImage);
size := cvGetSize(rawImage);
ImaskCodeBook := cvCreateImage(size, IPL_DEPTH_8U, 1);
// cvSaveImage('book.png', ImaskCodeBook);
ImaskCodeBookCC := cvCreateImage(size, IPL_DEPTH_8U, 1);
// cvSaveImage('cc.png', ImaskCodeBookCC);
scalar := cvScalar(255);
cvSet(ImaskCodeBook, scalar);
cvNamedWindow('Raw', 1);
cvNamedWindow('ForegroundCodeBook', 1);
cvNamedWindow('CodeBook_ConnectComp', 1);
cvMoveWindow('ForegroundCodeBook', 450, 50);
end;
// If we've got an rawImage and are good to go:
if (rawImage <> NIL) then
begin
// YUV For codebook method
cvCvtColor(rawImage, yuvImage, CV_BGR2YCrCb);
// This is where we build our background model
// tmp := format('yuv%d.png', [nframes]);
if ((Not pause) and ((nframes - 1) < nframesToLearnBG)) then
cvBGCodeBookUpdate(model, yuvImage, cvZeroRect, nil);
// cvSaveImage( @tmp[1], yuvImage, 0 );
if ((nframes - 1) = nframesToLearnBG) then
cvBGCodeBookClearStale(model, model^.t div 2, cvZeroRect, nil);
// Find the foreground if any
if (nframes - 1 >= nframesToLearnBG) then
begin
// Find foreground by codebook method
cvBGCodeBookDiff(model, yuvImage, ImaskCodeBook, cvZeroRect);
// This part just to visualize bounding boxes and centers if desired
cvCopy(ImaskCodeBook, ImaskCodeBookCC, NIL);
cvSegmentFGMask(ImaskCodeBookCC, 0, 0, NIL, cvZeroPoint);
end;
// Display
cvShowImage('Raw', rawImage);
cvShowImage('ForegroundCodeBook', ImaskCodeBook);
cvShowImage('CodeBook_ConnectComp', ImaskCodeBookCC);
// tmp := '1.png';
// if nframes = 1 then
// cvSaveImage( @tmp[1], ImaskCodeBookCC, 0 );
end;
// User input:
c := cvWaitKey(10);
// End processing on ESC, q or Q
if ((c = 27) or (c = Ord('q'))) then
break;
// Else check for user input
case chr(c) of
'h':
help;
'p':
pause := Not pause;
's':
begin
singlestep := Not singlestep;
pause := False;
end;
'r':
begin
pause := False;
singlestep := False;
end;
' ':
begin
cvBGCodeBookClearStale(model, 0, cvZeroRect);
nframes := 0;
end;
// CODEBOOK PARAMS
'y', '0', 'u', '1', 'v', '2', 'a', '3', 'b':
begin
ch[0] := AnsiChar(c) in ['y', '0', 'a', '3'];
ch[1] := AnsiChar(c) in ['u', '1', 'a', '3', 'b'];
ch[2] := AnsiChar(c) in ['v', '2', 'a', '3', 'b'];
Writeln(Format('CodeBook YUV Channels active: %s, %s, %s', [BoolToStr(ch[0], true), BoolToStr(ch[1], true),
BoolToStr(ch[2], true)]));
end;
'i', 'o', 'k', 'l': // modify max classification bounds (max bound goes higher)
begin
if (AnsiChar(c) in ['i', 'o']) then
ptr := @model^.modMax[0]
else
ptr := @model^.modMin[0];
for n := 0 to NCHANNELS - 1 do
begin
if (ch[n]) then
begin
ptr1 := ptr;
Inc(ptr1, n);
if (AnsiChar(c) = 'i') or (AnsiChar(c) = 'l') then
begin
v := ptr1^ + 1
end
else
v := ptr1^ - 1;
ptr1^ := CV_CAST_8U(v);
end;
Write(Format('%d,', [ptr[n]]));
end;
Writeln(Format('CodeBook %s Side', [iif((c = Ord('i')) or (c = Ord('o')), 'High', 'Low')]));
end;
end
end;
cvReleaseCapture(capture);
cvDestroyAllWindows;
except
on e: Exception do
Writeln(e.ClassName, ': ', e.Message);
end;
end.

View File

@ -0,0 +1,161 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{DB5FF8A8-8FFF-4CD9-BBFF-B2AAE1F87798}</ProjectGuid>
<MainSource>cvCodeBook.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>
<VerInfo_Locale>1049</VerInfo_Locale>
<Manifest_File>None</Manifest_File>
<DCC_ImageBase>00400000</DCC_ImageBase>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace)</DCC_Namespace>
<DCC_E>false</DCC_E>
<DCC_ExeOutput>..\..\..\bin\</DCC_ExeOutput>
<DCC_K>false</DCC_K>
<DCC_S>false</DCC_S>
<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>
<DCC_N>false</DCC_N>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_Namespace>System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<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>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<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)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_Optimize>false</DCC_Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<Manifest_File>None</Manifest_File>
<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>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="..\..\..\include\uLibName.pas"/>
<DCCReference Include="..\..\..\include\highgui\highgui_c.pas"/>
<DCCReference Include="..\..\..\include\сore\core_c.pas"/>
<DCCReference Include="..\..\..\include\сore\Core.types_c.pas"/>
<DCCReference Include="..\..\..\include\imgproc\imgproc.types_c.pas"/>
<DCCReference Include="..\..\..\include\imgproc\imgproc_c.pas"/>
<DCCReference Include="..\..\..\include\legacy\legacy.pas"/>
<DCCReference Include="..\..\..\include\calib3d\calib3d.pas"/>
<DCCReference Include="..\..\..\include\imgproc\imgproc.pas"/>
<DCCReference Include="..\..\..\include\objdetect\haar.pas"/>
<DCCReference Include="..\..\..\include\objdetect\objdetect.pas"/>
<DCCReference Include="..\..\..\include\video\tracking.pas"/>
<DCCReference Include="..\..\..\include\сore\core.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">cvCodeBook.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,109 @@
(* /*****************************************************************
// Delphi-OpenCV Demo
// Copyright (C) 2013 Project Delphi-OpenCV
// ****************************************************************
// Contributor:
// laentir Valetov
// email:laex@bk.ru
// ****************************************************************
// You may retrieve the latest version of this file at the GitHub,
// located at git://github.com/Laex/Delphi-OpenCV.git
// ****************************************************************
// The contents of this file are used with permission, subject to
// the Mozilla Public License Version 1.1 (the "License"); you may
// not use this file except in compliance with the License. You may
// obtain a copy of the License at
// http://www.mozilla.org/MPL/MPL-1_1Final.html
//
// Software distributed under the License is distributed on an
// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
// implied. See the License for the specific language governing
// rights and limitations under the License.
******************************************************************* *)
// JCL_DEBUG_EXPERT_GENERATEJDBG OFF
// JCL_DEBUG_EXPERT_INSERTJDBG OFF
// JCL_DEBUG_EXPERT_DELETEMAPFILE OFF
program cv_CreateFGDStatModel;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
uLibName in '..\..\..\include\uLibName.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',
legacy in '..\..\..\include\legacy\legacy.pas',
calib3d in '..\..\..\include\calib3d\calib3d.pas',
imgproc in '..\..\..\include\imgproc\imgproc.pas',
haar in '..\..\..\include\objdetect\haar.pas',
objdetect in '..\..\..\include\objdetect\objdetect.pas',
tracking in '..\..\..\include\video\tracking.pas',
Core.types_c in '..\..\..\include\сore\Core.types_c.pas',
core_c in '..\..\..\include\сore\core_c.pas',
Core in '..\..\..\include\сore\core.pas';
Var
k: Integer;
fr: Integer;
tmp_frame: pIplImage;
cap: PCvCapture;
update_bg_model: Boolean;
bg_model: pCvBGStatModel;
t, learningRate: double;
begin
try
update_bg_model := true;
cap := cvCreateCameraCapture(CV_CAP_ANY);
Assert(Assigned(cap));
cvNamedWindow('Original', 1);
cvNamedWindow('BG', 1);
cvNamedWindow('FG', 1);
bg_model := NIL;
fr := 1;
tmp_frame := cvQueryFrame(cap);
while tmp_frame <> NIL do
begin
cvShowImage('Original', tmp_frame);
if (bg_model = NIL) then
begin
// create BG model
bg_model := cvCreateFGDStatModel( tmp_frame);
end
else
begin
t := cvGetTickCount();
if (update_bg_model) then
learningRate := -1
else
learningRate := 0;
cvUpdateBGStatModel(tmp_frame, bg_model, learningRate);
t := cvGetTickCount - t;
Writeln(format('%d. %.1f', [fr, t / (cvGetTickFrequency * 1000.0)]));
cvShowImage('BG', bg_model^.background);
cvShowImage('FG', bg_model^.foreground);
end;
k := cvWaitKey(5);
if (k = 27) then
break;
if (k = ord(' ')) then
update_bg_model := Not update_bg_model;
tmp_frame := cvQueryFrame(cap);
Inc(fr);
end;
cvReleaseBGStatModel(bg_model);
cvReleaseCapture(cap);
cvDestroyAllWindows;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.

View File

@ -0,0 +1,161 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{89733BC5-2146-4F31-97F6-F5BA7C4DB1A7}</ProjectGuid>
<MainSource>cv_CreateFGDStatModel.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_N>false</DCC_N>
<Manifest_File>None</Manifest_File>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace)</DCC_Namespace>
<DCC_S>false</DCC_S>
<DCC_ImageBase>00400000</DCC_ImageBase>
<VerInfo_Locale>1049</VerInfo_Locale>
<DCC_F>false</DCC_F>
<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>
<DCC_ExeOutput>..\..\..\bin\</DCC_ExeOutput>
<DCC_E>false</DCC_E>
<DCC_K>false</DCC_K>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<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>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_DebugInformation>false</DCC_DebugInformation>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<Manifest_File>None</Manifest_File>
<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>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="..\..\..\include\uLibName.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\legacy\legacy.pas"/>
<DCCReference Include="..\..\..\include\calib3d\calib3d.pas"/>
<DCCReference Include="..\..\..\include\imgproc\imgproc.pas"/>
<DCCReference Include="..\..\..\include\objdetect\haar.pas"/>
<DCCReference Include="..\..\..\include\objdetect\objdetect.pas"/>
<DCCReference Include="..\..\..\include\video\tracking.pas"/>
<DCCReference Include="..\..\..\include\сore\Core.types_c.pas"/>
<DCCReference Include="..\..\..\include\сore\core_c.pas"/>
<DCCReference Include="..\..\..\include\сore\core.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_CreateFGDStatModel.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,121 @@
(* /*****************************************************************
// Delphi-OpenCV Demo
// Copyright (C) 2013 Project Delphi-OpenCV
// ****************************************************************
// Contributor:
// laentir Valetov
// email:laex@bk.ru
// ****************************************************************
// You may retrieve the latest version of this file at the GitHub,
// located at git://github.com/Laex/Delphi-OpenCV.git
// ****************************************************************
// The contents of this file are used with permission, subject to
// the Mozilla Public License Version 1.1 (the "License"); you may
// not use this file except in compliance with the License. You may
// obtain a copy of the License at
// http://www.mozilla.org/MPL/MPL-1_1Final.html
//
// Software distributed under the License is distributed on an
// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
// implied. See the License for the specific language governing
// rights and limitations under the License.
******************************************************************* *)
// JCL_DEBUG_EXPERT_GENERATEJDBG OFF
// JCL_DEBUG_EXPERT_INSERTJDBG OFF
// JCL_DEBUG_EXPERT_DELETEMAPFILE OFF
program cv_CreateGaussianBGModel;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
uLibName in '..\..\..\include\uLibName.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',
legacy in '..\..\..\include\legacy\legacy.pas',
calib3d in '..\..\..\include\calib3d\calib3d.pas',
imgproc in '..\..\..\include\imgproc\imgproc.pas',
haar in '..\..\..\include\objdetect\haar.pas',
objdetect in '..\..\..\include\objdetect\objdetect.pas',
tracking in '..\..\..\include\video\tracking.pas',
Core.types_c in '..\..\..\include\сore\Core.types_c.pas',
core_c in '..\..\..\include\сore\core_c.pas',
Core in '..\..\..\include\сore\core.pas';
Var
k: Integer;
fr: Integer;
tmp_frame: pIplImage;
cap: PCvCapture;
update_bg_model: Boolean;
bg_model: pCvBGStatModel;
t, learningRate: double;
params:TCvGaussBGStatModelParams;
begin
try
update_bg_model := true;
cap := cvCreateCameraCapture(CV_CAP_ANY);
Assert(Assigned(cap));
cvNamedWindow('Original', 1);
cvNamedWindow('BG', 1);
cvNamedWindow('FG', 1);
cvMoveWindow('BG', 670, 0);
cvMoveWindow('FG', 335, 0);
cvMoveWindow('Original', 0, 0);
params.win_size:=200;
params.n_gauss:=5; // cars:5, trees: 2/10
params.bg_threshold:=0.6; // cars: 0.7, trees: 0.9, car thief: 0.6
params.std_threshold:=3.0; // cars: 3.5, car thief: 3.0
params.minArea:=5; // cars: 25, trees: 1
params.weight_init:=0.05;
params.variance_init:=50;
bg_model := NIL;
fr := 1;
tmp_frame := cvQueryFrame(cap);
while tmp_frame <> NIL do
begin
cvShowImage('Original', tmp_frame);
if (bg_model = NIL) then
begin
// create BG model
bg_model := cvCreateGaussianBGModel(tmp_frame,@params);
end
else
begin
t := cvGetTickCount();
if (update_bg_model) then
learningRate := -1
else
learningRate := 0;
cvUpdateBGStatModel(tmp_frame, bg_model, learningRate);
t := cvGetTickCount - t;
Writeln(format('%d. %.1f', [fr, t / (cvGetTickFrequency * 1000.0)]));
cvShowImage('BG', bg_model^.background);
cvShowImage('FG', bg_model^.foreground);
end;
k := cvWaitKey(5);
if (k = 27) then
break;
if (k = ord(' ')) then
update_bg_model := Not update_bg_model;
tmp_frame := cvQueryFrame(cap);
Inc(fr);
end;
cvReleaseBGStatModel(bg_model);
cvReleaseCapture(cap);
cvDestroyAllWindows;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.

View File

@ -0,0 +1,181 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{2E9C87AF-103A-430F-9200-123DE8418CC4}</ProjectGuid>
<ProjectVersion>14.4</ProjectVersion>
<FrameworkType>None</FrameworkType>
<MainSource>cv_CreateGaussianBGModel.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</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="'$(Base)'!=''">
<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=</VerInfo_Keys>
<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>DBXInterBaseDriver;DataSnapServer;DataSnapCommon;DbxCommonDriver;dbxcds;CustomIPTransport;dsnap;IndyIPServer;IndyCore;CloudService;FmxTeeUI;AnyDAC_PhysDb2_D17;bindcompfmx;dbrtl;bindcomp;inetdb;IcsCommonDXE3Run;xmlrtl;ibxpress;bindengine;soaprtl;FMXTee;IcsFmxDXE3Run;AnyDAC_PhysADS_D17;AnyDAC_PhysIB_D17;DBXInformixDriver;DBXFirebirdDriver;inet;FFmpegFmx_DXE3;DBXSybaseASADriver;dbexpress;IndyIPClient;AnyDAC_PhysMySQL_D17;DBXSqliteDriver;fmx;IndySystem;DataSnapClient;FFmpegRtl_DXE3;DataSnapProviderClient;AnyDAC_PhysMSAcc_D17;AnyDAC_PhysSQLITE_D17;AnyDAC_ComI_D17;DBXOracleDriver;AnyDAC_PhysMSSQL_D17;AnyDAC_Comp_D17;AnyDAC_PhysODBC_D17;fmxase;AnyDAC_PhysPg_D17;IndyIPCommon;AnyDAC_PhysASA_D17;inetdbxpress;AnyDAC_PhysOracle_D17;AnyDAC_GUIxForms_D17;rtl;DbxClientDriver;IndyProtocols;DBXMySQLDriver;bindcompdbx;AnyDAC_Phys_D17;fmxobj;fmxdae;DataSnapIndy10ServerTransport;$(DCC_UsePackage)</DCC_UsePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<DCC_UsePackage>cxPivotGridChartRS17;JvGlobus;JvMM;dxSkinSevenRS17;dxSkinBlueprintRS17;JvManagedThreads;dxSkinHighContrastRS17;dxSkinOffice2007BlackRS17;dxCoreRS17;dac170;cxPageControldxBarPopupMenuRS17;dxSkinXmas2008BlueRS17;dxPSDBTeeChartRS17;GLS_ODE;JvCrypt;dxPSTeeChartRS17;dxSkinSummer2008RS17;dxPScxSchedulerLnkRS17;dxSkinBlueRS17;dxSkinDarkRoomRS17;DBXInterBaseDriver;DataSnapServer;DataSnapCommon;dxPScxTLLnkRS17;JvNet;GLScene_RunTime;officeXPrt;JvDotNetCtrls;dxRibbonRS17;DbxCommonDriver;cxDataRS17;vclimg;dxSkinsdxBarPainterRS17;dxPSdxDBTVLnkRS17;dbxcds;DatasnapConnectorsFreePascal;dxSkinMoneyTwinsRS17;JvXPCtrls;vcldb;cxExportRS17;dxPSCoreRS17;dxBarExtItemsRS17;dxGDIPlusRS17;dxNavBarRS17;CustomIPTransport;cxLibraryRS17;cxGridRS17;dxSkinOffice2010BlackRS17;dsnap;IndyIPServer;unidac170;IndyCore;dxSkinMcSkinRS17;CloudService;dxPScxCommonRS17;FmxTeeUI;frxDB17;dxSkinsdxDLPainterRS17;dxSkiniMaginaryRS17;AnyDAC_PhysDb2_D17;JvDB;JvRuntimeDesign;dxPScxVGridLnkRS17;JclDeveloperTools;unidacfmx170;dxSkinSevenClassicRS17;dxPScxExtCommonRS17;dxPScxSSLnkRS17;dxSkinLilianRS17;fs17;dxPSdxLCLnkRS17;dxSkinOffice2010BlueRS17;bindcompfmx;dclTP_LockBox3;dxSkinOffice2010SilverRS17;vcldbx;cxSchedulerGridRS17;dbrtl;bindcomp;inetdb;JvPluginSystem;dxBarRS17;IcsCommonDXE3Run;DBXOdbcDriver;dxBarDBNavRS17;JvCmp;dxSkinWhiteprintRS17;JvTimeFramework;xmlrtl;dxSkinsdxRibbonPainterRS17;ibxpress;GLSS_OpenAL;dxDockingRS17;bindengine;vclactnband;soaprtl;FMXTee;dxADOServerModeRS17;bindcompvcl;dxBarExtDBItemsRS17;PasLib;Jcl;vclie;dxPSPrVwRibbonRS17;dxSkinOffice2007PinkRS17;IcsFmxDXE3Run;cxPageControlRS17;dxSkinscxPCPainterRS17;AnyDAC_PhysADS_D17;AnyDAC_PhysIB_D17;dxmdsRS17;dxSkinTheAsphaltWorldRS17;DBXInformixDriver;Intraweb;dxPsPrVwAdvRS17;GLSS_FMOD;dxSkinSilverRS17;dxdborRS17;DBXFirebirdDriver;dsnapcon;inet;fsDB17;FFmpegFmx_DXE3;JvPascalInterpreter;vclx;dxSkinStardustRS17;cxEditorsRS17;DBXSybaseASADriver;crcontrols170;dbexpress;EurekaLogCore;IndyIPClient;JvBDE;AnyDAC_PhysMySQL_D17;cxTreeListdxBarPopupMenuRS17;dxSkinVS2010RS17;GLCg_RunTime;GLS_NGD;ZComponent;dxThemeRS17;DBXSqliteDriver;dxPScxGridLnkRS17;fmx;JvDlgs;IndySystem;TeeDB;dxSkinValentineRS17;inetdbbde;vclib;DataSnapClient;dxSkinDevExpressStyleRS17;FFmpegRtl_DXE3;DataSnapProviderClient;DBXSybaseASEDriver;cxBarEditItemRS17;AnyDAC_PhysMSAcc_D17;dxServerModeRS17;cxPivotGridOLAPRS17;cxSchedulerRS17;MetropolisUILiveTile;dxSkinPumpkinRS17;dxPSLnksRS17;AnyDAC_PhysSQLITE_D17;dxPSdxDBOCLnkRS17;cxVerticalGridRS17;dxSkinSpringTimeRS17;vcldsnap;GLS_Computing_RunTime;dacvcl170;dxSkinDevExpressDarkStyleRS17;DBXDb2Driver;AnyDAC_ComI_D17;DBXOracleDriver;dxSkinLiquidSkyRS17;JvCore;AnyDAC_PhysMSSQL_D17;vclribbon;AnyDAC_Comp_D17;cxSpreadSheetRS17;AnyDAC_PhysODBC_D17;fmxase;vcl;dxSkinOffice2007SilverRS17;AnyDAC_PhysPg_D17;CodeSiteExpressPkg;DBXMSSQLDriver;IndyIPCommon;dxPSdxOCLnkRS17;FFmpegVcl_DXE3;dcldxSkinsCoreRS17;JvAppFrm;AnyDAC_PhysASA_D17;inetdbxpress;webdsnap;IcsVclDXE3Run;dxSkinCoffeeRS17;AnyDAC_PhysOracle_D17;JvDocking;adortl;dxSkinscxSchedulerPainterRS17;JvWizards;frx17;JvHMI;dxtrmdRS17;dxPScxPCProdRS17;AnyDAC_GUIxForms_D17;JvBands;ZDbc;rtl;DbxClientDriver;dxTabbedMDIRS17;dxSkinSharpPlusRS17;dxComnRS17;ZPlain;dxSkinsCoreRS17;dxSkinLondonLiquidSkyRS17;dxdbtrRS17;JclContainers;Tee;JvSystem;dxorgcRS17;svnui;dxSkinBlackRS17;JvControls;IndyProtocols;DBXMySQLDriver;dxLayoutControlRS17;bindcompdbx;TeeUI;JvJans;JvPrintPreview;JvPageComps;JvStdCtrls;JvCustom;dxSkinOffice2007BlueRS17;dxPScxPivotGridLnkRS17;dxSpellCheckerRS17;ZCore;vcltouch;dxSkinOffice2007GreenRS17;dxSkinSharpRS17;websnap;dxSkinFoggyRS17;dxTileControlRS17;VclSmp;dxSkinDarkSideRS17;cxPivotGridRS17;DataSnapConnectors;AnyDAC_Phys_D17;dacfmx170;fmxobj;cxTreeListRS17;JclVcl;dxPSdxFCLnkRS17;dxSkinGlassOceansRS17;unidacvcl170;ZParseSql;frxe17;svn;dxFlowChartRS17;fmxdae;dxSkinsdxNavBarPainterRS17;bdertl;ExpertTools;DataSnapIndy10ServerTransport;dxDBXServerModeRS17;dxSkinCaramelRS17;$(DCC_UsePackage)</DCC_UsePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<DCC_UsePackage>cxPivotGridChartRS17;dxSkinSevenRS17;dxSkinBlueprintRS17;dxSkinHighContrastRS17;dxSkinOffice2007BlackRS17;dxCoreRS17;cxPageControldxBarPopupMenuRS17;dxSkinXmas2008BlueRS17;dxPSDBTeeChartRS17;dxPSTeeChartRS17;dxSkinSummer2008RS17;dxPScxSchedulerLnkRS17;dxSkinBlueRS17;dxSkinDarkRoomRS17;DBXInterBaseDriver;DataSnapServer;DataSnapCommon;dxPScxTLLnkRS17;officeXPrt;dxRibbonRS17;DbxCommonDriver;cxDataRS17;vclimg;dxSkinsdxBarPainterRS17;dxPSdxDBTVLnkRS17;dbxcds;DatasnapConnectorsFreePascal;dxSkinMoneyTwinsRS17;vcldb;cxExportRS17;dxPSCoreRS17;dxBarExtItemsRS17;dxGDIPlusRS17;dxNavBarRS17;CustomIPTransport;cxLibraryRS17;cxGridRS17;dxSkinOffice2010BlackRS17;dsnap;IndyIPServer;IndyCore;dxSkinMcSkinRS17;CloudService;dxPScxCommonRS17;FmxTeeUI;dxSkinsdxDLPainterRS17;dxSkiniMaginaryRS17;AnyDAC_PhysDb2_D17;dxPScxVGridLnkRS17;dxSkinSevenClassicRS17;dxPScxExtCommonRS17;dxPScxSSLnkRS17;dxSkinLilianRS17;dxPSdxLCLnkRS17;dxSkinOffice2010BlueRS17;bindcompfmx;dxSkinOffice2010SilverRS17;cxSchedulerGridRS17;dbrtl;bindcomp;inetdb;dxBarRS17;IcsCommonDXE3Run;DBXOdbcDriver;dxBarDBNavRS17;dxSkinWhiteprintRS17;xmlrtl;dxSkinsdxRibbonPainterRS17;ibxpress;dxDockingRS17;bindengine;vclactnband;soaprtl;FMXTee;dxADOServerModeRS17;bindcompvcl;dxBarExtDBItemsRS17;vclie;dxPSPrVwRibbonRS17;dxSkinOffice2007PinkRS17;IcsFmxDXE3Run;cxPageControlRS17;dxSkinscxPCPainterRS17;AnyDAC_PhysADS_D17;AnyDAC_PhysIB_D17;dxmdsRS17;dxSkinTheAsphaltWorldRS17;DBXInformixDriver;Intraweb;dxPsPrVwAdvRS17;dxSkinSilverRS17;dxdborRS17;DBXFirebirdDriver;dsnapcon;inet;vclx;dxSkinStardustRS17;cxEditorsRS17;DBXSybaseASADriver;dbexpress;IndyIPClient;AnyDAC_PhysMySQL_D17;cxTreeListdxBarPopupMenuRS17;dxSkinVS2010RS17;ZComponent;dxThemeRS17;DBXSqliteDriver;dxPScxGridLnkRS17;fmx;IndySystem;TeeDB;dxSkinValentineRS17;vclib;DataSnapClient;dxSkinDevExpressStyleRS17;DataSnapProviderClient;DBXSybaseASEDriver;cxBarEditItemRS17;AnyDAC_PhysMSAcc_D17;dxServerModeRS17;cxPivotGridOLAPRS17;cxSchedulerRS17;MetropolisUILiveTile;dxSkinPumpkinRS17;dxPSLnksRS17;AnyDAC_PhysSQLITE_D17;dxPSdxDBOCLnkRS17;cxVerticalGridRS17;dxSkinSpringTimeRS17;vcldsnap;dxSkinDevExpressDarkStyleRS17;DBXDb2Driver;AnyDAC_ComI_D17;DBXOracleDriver;dxSkinLiquidSkyRS17;AnyDAC_PhysMSSQL_D17;vclribbon;AnyDAC_Comp_D17;cxSpreadSheetRS17;AnyDAC_PhysODBC_D17;fmxase;vcl;dxSkinOffice2007SilverRS17;AnyDAC_PhysPg_D17;DBXMSSQLDriver;IndyIPCommon;dxPSdxOCLnkRS17;dcldxSkinsCoreRS17;AnyDAC_PhysASA_D17;inetdbxpress;webdsnap;IcsVclDXE3Run;dxSkinCoffeeRS17;AnyDAC_PhysOracle_D17;adortl;dxSkinscxSchedulerPainterRS17;dxtrmdRS17;dxPScxPCProdRS17;AnyDAC_GUIxForms_D17;ZDbc;rtl;DbxClientDriver;dxTabbedMDIRS17;dxSkinSharpPlusRS17;dxComnRS17;ZPlain;dxSkinsCoreRS17;dxSkinLondonLiquidSkyRS17;dxdbtrRS17;Tee;dxorgcRS17;dxSkinBlackRS17;IndyProtocols;DBXMySQLDriver;dxLayoutControlRS17;bindcompdbx;TeeUI;dxSkinOffice2007BlueRS17;dxPScxPivotGridLnkRS17;dxSpellCheckerRS17;ZCore;vcltouch;dxSkinOffice2007GreenRS17;dxSkinSharpRS17;websnap;dxSkinFoggyRS17;dxTileControlRS17;VclSmp;dxSkinDarkSideRS17;cxPivotGridRS17;DataSnapConnectors;AnyDAC_Phys_D17;fmxobj;cxTreeListRS17;dxPSdxFCLnkRS17;dxSkinGlassOceansRS17;ZParseSql;dxFlowChartRS17;fmxdae;dxSkinsdxNavBarPainterRS17;DataSnapIndy10ServerTransport;dxDBXServerModeRS17;dxSkinCaramelRS17;$(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>
<Manifest_File>None</Manifest_File>
<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>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="..\..\..\include\uLibName.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\legacy\legacy.pas"/>
<DCCReference Include="..\..\..\include\calib3d\calib3d.pas"/>
<DCCReference Include="..\..\..\include\imgproc\imgproc.pas"/>
<DCCReference Include="..\..\..\include\objdetect\haar.pas"/>
<DCCReference Include="..\..\..\include\objdetect\objdetect.pas"/>
<DCCReference Include="..\..\..\include\video\tracking.pas"/>
<DCCReference Include="..\..\..\include\сore\Core.types_c.pas"/>
<DCCReference Include="..\..\..\include\сore\core_c.pas"/>
<DCCReference Include="..\..\..\include\сore\core.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">cv_CreateGaussianBGModel.dpr</Source>
</Source>
</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
EurekaLog Last Line -->

View File

@ -120,6 +120,15 @@
<Projects Include="LibTest\cvCalcOpticalFlowPyrLK\cv_CalcOpticalFlowPyrLK.dproj"> <Projects Include="LibTest\cvCalcOpticalFlowPyrLK\cv_CalcOpticalFlowPyrLK.dproj">
<Dependencies/> <Dependencies/>
</Projects> </Projects>
<Projects Include="LibTest\cvCreateGaussianBGModel\cv_CreateGaussianBGModel.dproj">
<Dependencies/>
</Projects>
<Projects Include="LibTest\cvCreateFGDStatModel\cv_CreateFGDStatModel.dproj">
<Dependencies/>
</Projects>
<Projects Include="LibTest\cvCodeBook\cvCodeBook.dproj">
<Dependencies/>
</Projects>
<Projects Include="MultiDemo\Hello World\HelloWorld.dproj"> <Projects Include="MultiDemo\Hello World\HelloWorld.dproj">
<Dependencies/> <Dependencies/>
</Projects> </Projects>
@ -153,12 +162,6 @@
<Projects Include="MultiDemo\fback\fback_c.dproj"> <Projects Include="MultiDemo\fback\fback_c.dproj">
<Dependencies/> <Dependencies/>
</Projects> </Projects>
<Projects Include="MultiDemo\delaunay\delaunay.dproj">
<Dependencies/>
</Projects>
<Projects Include="MultiDemo\MoveDetect\MoveDetect.dproj">
<Dependencies/>
</Projects>
</ItemGroup> </ItemGroup>
<ProjectExtensions> <ProjectExtensions>
<Borland.Personality>Default.Personality.12</Borland.Personality> <Borland.Personality>Default.Personality.12</Borland.Personality>
@ -518,6 +521,33 @@
<Target Name="cv_CalcOpticalFlowPyrLK:Make"> <Target Name="cv_CalcOpticalFlowPyrLK:Make">
<MSBuild Projects="LibTest\cvCalcOpticalFlowPyrLK\cv_CalcOpticalFlowPyrLK.dproj" Targets="Make"/> <MSBuild Projects="LibTest\cvCalcOpticalFlowPyrLK\cv_CalcOpticalFlowPyrLK.dproj" Targets="Make"/>
</Target> </Target>
<Target Name="cv_CreateGaussianBGModel">
<MSBuild Projects="LibTest\cvCreateGaussianBGModel\cv_CreateGaussianBGModel.dproj"/>
</Target>
<Target Name="cv_CreateGaussianBGModel:Clean">
<MSBuild Projects="LibTest\cvCreateGaussianBGModel\cv_CreateGaussianBGModel.dproj" Targets="Clean"/>
</Target>
<Target Name="cv_CreateGaussianBGModel:Make">
<MSBuild Projects="LibTest\cvCreateGaussianBGModel\cv_CreateGaussianBGModel.dproj" Targets="Make"/>
</Target>
<Target Name="cv_CreateFGDStatModel">
<MSBuild Projects="LibTest\cvCreateFGDStatModel\cv_CreateFGDStatModel.dproj"/>
</Target>
<Target Name="cv_CreateFGDStatModel:Clean">
<MSBuild Projects="LibTest\cvCreateFGDStatModel\cv_CreateFGDStatModel.dproj" Targets="Clean"/>
</Target>
<Target Name="cv_CreateFGDStatModel:Make">
<MSBuild Projects="LibTest\cvCreateFGDStatModel\cv_CreateFGDStatModel.dproj" Targets="Make"/>
</Target>
<Target Name="cvCodeBook">
<MSBuild Projects="LibTest\cvCodeBook\cvCodeBook.dproj"/>
</Target>
<Target Name="cvCodeBook:Clean">
<MSBuild Projects="LibTest\cvCodeBook\cvCodeBook.dproj" Targets="Clean"/>
</Target>
<Target Name="cvCodeBook:Make">
<MSBuild Projects="LibTest\cvCodeBook\cvCodeBook.dproj" Targets="Make"/>
</Target>
<Target Name="HelloWorld"> <Target Name="HelloWorld">
<MSBuild Projects="MultiDemo\Hello World\HelloWorld.dproj"/> <MSBuild Projects="MultiDemo\Hello World\HelloWorld.dproj"/>
</Target> </Target>
@ -617,32 +647,14 @@
<Target Name="fback_c:Make"> <Target Name="fback_c:Make">
<MSBuild Projects="MultiDemo\fback\fback_c.dproj" Targets="Make"/> <MSBuild Projects="MultiDemo\fback\fback_c.dproj" Targets="Make"/>
</Target> </Target>
<Target Name="delaunay">
<MSBuild Projects="MultiDemo\delaunay\delaunay.dproj"/>
</Target>
<Target Name="delaunay:Clean">
<MSBuild Projects="MultiDemo\delaunay\delaunay.dproj" Targets="Clean"/>
</Target>
<Target Name="delaunay:Make">
<MSBuild Projects="MultiDemo\delaunay\delaunay.dproj" Targets="Make"/>
</Target>
<Target Name="MoveDetect">
<MSBuild Projects="MultiDemo\MoveDetect\MoveDetect.dproj"/>
</Target>
<Target Name="MoveDetect:Clean">
<MSBuild Projects="MultiDemo\MoveDetect\MoveDetect.dproj" Targets="Clean"/>
</Target>
<Target Name="MoveDetect:Make">
<MSBuild Projects="MultiDemo\MoveDetect\MoveDetect.dproj" Targets="Make"/>
</Target>
<Target Name="Build"> <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;cv_WarpPerspective;cv_MatchShapes;cv_WarpAffine;cv_SnakeImage;cv_CalcOpticalFlowPyrLK;HelloWorld;VideoProcessing;FaceDetect;Stereo;CameraCaptureAndFindContours;HandsDetect;Squares;CameraCalibrate;CameraShift;minarea;fback_c;delaunay;MoveDetect"/> <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;cv_WarpPerspective;cv_MatchShapes;cv_WarpAffine;cv_SnakeImage;cv_CalcOpticalFlowPyrLK;cv_CreateGaussianBGModel;cv_CreateFGDStatModel;cvCodeBook;HelloWorld;VideoProcessing;FaceDetect;Stereo;CameraCaptureAndFindContours;HandsDetect;Squares;CameraCalibrate;CameraShift;minarea;fback_c"/>
</Target> </Target>
<Target Name="Clean"> <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;cv_WarpPerspective:Clean;cv_MatchShapes:Clean;cv_WarpAffine:Clean;cv_SnakeImage:Clean;cv_CalcOpticalFlowPyrLK:Clean;HelloWorld:Clean;VideoProcessing:Clean;FaceDetect:Clean;Stereo:Clean;CameraCaptureAndFindContours:Clean;HandsDetect:Clean;Squares:Clean;CameraCalibrate:Clean;CameraShift:Clean;minarea:Clean;fback_c:Clean;delaunay:Clean;MoveDetect: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;cv_WarpPerspective:Clean;cv_MatchShapes:Clean;cv_WarpAffine:Clean;cv_SnakeImage:Clean;cv_CalcOpticalFlowPyrLK:Clean;cv_CreateGaussianBGModel:Clean;cv_CreateFGDStatModel:Clean;cvCodeBook:Clean;HelloWorld:Clean;VideoProcessing:Clean;FaceDetect:Clean;Stereo:Clean;CameraCaptureAndFindContours:Clean;HandsDetect:Clean;Squares:Clean;CameraCalibrate:Clean;CameraShift:Clean;minarea:Clean;fback_c:Clean"/>
</Target> </Target>
<Target Name="Make"> <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;cv_WarpPerspective:Make;cv_MatchShapes:Make;cv_WarpAffine:Make;cv_SnakeImage:Make;cv_CalcOpticalFlowPyrLK:Make;HelloWorld:Make;VideoProcessing:Make;FaceDetect:Make;Stereo:Make;CameraCaptureAndFindContours:Make;HandsDetect:Make;Squares:Make;CameraCalibrate:Make;CameraShift:Make;minarea:Make;fback_c:Make;delaunay:Make;MoveDetect: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;cv_WarpPerspective:Make;cv_MatchShapes:Make;cv_WarpAffine:Make;cv_SnakeImage:Make;cv_CalcOpticalFlowPyrLK:Make;cv_CreateGaussianBGModel:Make;cv_CreateFGDStatModel:Make;cvCodeBook:Make;HelloWorld:Make;VideoProcessing:Make;FaceDetect:Make;Stereo:Make;CameraCaptureAndFindContours:Make;HandsDetect:Make;Squares:Make;CameraCalibrate:Make;CameraShift:Make;minarea:Make;fback_c:Make"/>
</Target> </Target>
<Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/> <Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/>
</Project> </Project>