mirror of
https://github.com/Laex/Delphi-OpenCV.git
synced 2024-11-15 15:55:53 +01:00
Update core_c and fixed errors in samples CameraCalibrate
This commit is contained in:
parent
8e4fad20da
commit
017d275999
@ -126,6 +126,11 @@ type
|
|||||||
schar = ShortInt;
|
schar = ShortInt;
|
||||||
{$EXTERNALSYM schar}
|
{$EXTERNALSYM schar}
|
||||||
pschar = ^schar;
|
pschar = ^schar;
|
||||||
|
{$EXTERNALSYM pschar}
|
||||||
|
unsigned = longint;
|
||||||
|
{$EXTERNALSYM unsigned}
|
||||||
|
punsigned = ^longint;
|
||||||
|
{$EXTERNALSYM punsigned}
|
||||||
|
|
||||||
(* CvArr* is used to pass arbitrary
|
(* CvArr* is used to pass arbitrary
|
||||||
* cArray-like data structures
|
* cArray-like data structures
|
||||||
@ -599,6 +604,8 @@ const
|
|||||||
{$EXTERNALSYM CV_MAX_DIM}
|
{$EXTERNALSYM CV_MAX_DIM}
|
||||||
CV_MAX_DIM_HEAP = 1024;
|
CV_MAX_DIM_HEAP = 1024;
|
||||||
{$EXTERNALSYM CV_MAX_DIM_HEAP}
|
{$EXTERNALSYM CV_MAX_DIM_HEAP}
|
||||||
|
CV_MAX_ARR = 10;
|
||||||
|
{$EXTERNALSYM CV_MAX_ARR}
|
||||||
|
|
||||||
type
|
type
|
||||||
TCvMatNDdim = packed record
|
TCvMatNDdim = packed record
|
||||||
@ -631,64 +638,9 @@ type
|
|||||||
// #define CV_IS_MATND(mat) \
|
// #define CV_IS_MATND(mat) \
|
||||||
// (CV_IS_MATND_HDR(mat) && ((const CvMatND*)(mat))->data.ptr != NULL)
|
// (CV_IS_MATND_HDR(mat) && ((const CvMatND*)(mat))->data.ptr != NULL)
|
||||||
|
|
||||||
(* ***************************************************************************************\
|
//***************************************************************************************
|
||||||
* Multi-dimensional sparse cArray (CvSparseMat) *
|
//* Histogram *
|
||||||
*************************************************************************************** *)
|
//***************************************************************************************
|
||||||
|
|
||||||
const
|
|
||||||
CV_SPARSE_MAT_MAGIC_VAL = $42440000;
|
|
||||||
{$EXTERNALSYM CV_SPARSE_MAT_MAGIC_VAL}
|
|
||||||
CV_TYPE_NAME_SPARSE_MAT = 'opencv-sparse-matrix';
|
|
||||||
{$EXTERNALSYM CV_TYPE_NAME_SPARSE_MAT}
|
|
||||||
(*
|
|
||||||
type
|
|
||||||
CvSet = packed record;
|
|
||||||
|
|
||||||
CvSparseMat
|
|
||||||
|
|
||||||
begin
|
|
||||||
Integer cType;
|
|
||||||
CvSparseMat
|
|
||||||
|
|
||||||
begin
|
|
||||||
Integer cType;
|
|
||||||
Integer dims;
|
|
||||||
Integer * refcount;
|
|
||||||
Integer hdr_refcount;
|
|
||||||
|
|
||||||
type
|
|
||||||
CvSet * heap = packed record
|
|
||||||
end;
|
|
||||||
Pointer * hashtable;
|
|
||||||
Integer hashsize;
|
|
||||||
Integer valoffset;
|
|
||||||
Integer idxoffset;
|
|
||||||
size:
|
|
||||||
array [0 .. CV_MAX_DIM - 1] of Integer;
|
|
||||||
end;
|
|
||||||
CvSparseMat;
|
|
||||||
|
|
||||||
const
|
|
||||||
CV_IS_SPARSE_MAT_HDR(mat)((mat) <> 0 and (((CvSparseMat(mat))^.cType and CV_MAGIC_MASK)
|
|
||||||
= CV_SPARSE_MAT_MAGIC_VAL)
|
|
||||||
|
|
||||||
// >> Following declaration is a macro definition!
|
|
||||||
const CV_IS_SPARSE_MAT(mat)CV_IS_SPARSE_MAT_HDR(mat);
|
|
||||||
*)
|
|
||||||
(* *************** iteration through a sparse array **************** *)
|
|
||||||
(*
|
|
||||||
type CvSparseNode begin Cardinal hashval; CvSparseNode begin Cardinal hashval;
|
|
||||||
type CvSparseNode * next = packed record end; end; CvSparseNode;
|
|
||||||
|
|
||||||
type CvSparseMatIterator = packed record mat: ^CvSparseMat; node: ^CvSparseNode; curidx: Integer; end;
|
|
||||||
|
|
||||||
// >> Following declaration is a macro definition!
|
|
||||||
const CV_NODE_VAL(mat, node)# define CV_NODE_VAL(mat, node)((
|
|
||||||
procedure(+(mat)^.valoffset))((Integer(uchar(node) + (mat)^.idxoffset): node));
|
|
||||||
*)
|
|
||||||
(* ***************************************************************************************\
|
|
||||||
* Histogram *
|
|
||||||
*************************************************************************************** *)
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TCvHistType = Integer;
|
TCvHistType = Integer;
|
||||||
@ -827,7 +779,17 @@ type
|
|||||||
angle: Single; (* Angle between the horizontal axis *)
|
angle: Single; (* Angle between the horizontal axis *)
|
||||||
end;
|
end;
|
||||||
|
|
||||||
(* Line iterator state: *)
|
pCvNArrayIterator = ^TCvNArrayIterator;
|
||||||
|
TCvNArrayIterator = record
|
||||||
|
count: Integer; // number of arrays
|
||||||
|
dims: Integer; // number of dimensions to iterate
|
||||||
|
size: TCvSize; // maximal common linear size: { width = size, height = 1 }
|
||||||
|
ptr: Array [0 .. CV_MAX_ARR - 1] of ^uchar; // pointers to the array slices
|
||||||
|
stack: Array [0 .. CV_MAX_DIM - 1] of Integer; // for internal use
|
||||||
|
hdr: Array [0 .. CV_MAX_ARR - 1] of ^TCvMatND; //pointers to the headers of the
|
||||||
|
end;
|
||||||
|
|
||||||
|
(* Line iterator state: *)
|
||||||
type
|
type
|
||||||
TCvLineIterator = packed record
|
TCvLineIterator = packed record
|
||||||
ptr: ^uchar;
|
ptr: ^uchar;
|
||||||
@ -853,6 +815,7 @@ const
|
|||||||
(* ************************************ CvScalar **************************************** *)
|
(* ************************************ CvScalar **************************************** *)
|
||||||
|
|
||||||
type
|
type
|
||||||
|
pCvScalar = ^TCvScalar;
|
||||||
TCvScalar = packed record
|
TCvScalar = packed record
|
||||||
val: array [0 .. 3] of Double;
|
val: array [0 .. 3] of Double;
|
||||||
end;
|
end;
|
||||||
@ -976,6 +939,55 @@ const
|
|||||||
// #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;
|
||||||
|
|
||||||
|
//***************************************************************************************
|
||||||
|
//* Multi-dimensional sparse cArray (CvSparseMat) *
|
||||||
|
//***************************************************************************************
|
||||||
|
|
||||||
|
const
|
||||||
|
CV_SPARSE_MAT_MAGIC_VAL = $42440000;
|
||||||
|
{$EXTERNALSYM CV_SPARSE_MAT_MAGIC_VAL}
|
||||||
|
CV_TYPE_NAME_SPARSE_MAT = 'opencv-sparse-matrix';
|
||||||
|
{$EXTERNALSYM CV_TYPE_NAME_SPARSE_MAT}
|
||||||
|
|
||||||
|
type
|
||||||
|
pCvSparseMat = ^TCvSparseMat;
|
||||||
|
TCvSparseMat = packed record
|
||||||
|
ctype: integer;
|
||||||
|
dims: integer;
|
||||||
|
refcount: ^Integer;
|
||||||
|
hdr_refcount: integer;
|
||||||
|
heap: pCvSet;
|
||||||
|
hashtable: ^pointer;
|
||||||
|
hashsize: integer;
|
||||||
|
valoffset: integer;
|
||||||
|
idxoffset: integer;
|
||||||
|
size: array [0 .. CV_MAX_DIM - 1] of Integer;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{#define CV_IS_SPARSE_MAT_HDR(mat) \
|
||||||
|
((mat) != NULL && \
|
||||||
|
(((const CvSparseMat*)(mat))->type & CV_MAGIC_MASK) == CV_SPARSE_MAT_MAGIC_VAL)}
|
||||||
|
|
||||||
|
{#define CV_IS_SPARSE_MAT(mat) \
|
||||||
|
CV_IS_SPARSE_MAT_HDR(mat)}
|
||||||
|
|
||||||
|
// **************** iteration through a sparse array *****************
|
||||||
|
pCvSparseNode = ^TCvSparseNode;
|
||||||
|
TCvSparseNode = packed record
|
||||||
|
hashval: Cardinal;
|
||||||
|
next: pCvSparseNode;
|
||||||
|
end;
|
||||||
|
|
||||||
|
pCvSparseMatIterator = ^TCvSparseMatIterator;
|
||||||
|
TCvSparseMatIterator = packed record
|
||||||
|
mat: pCvSparseMat;
|
||||||
|
node: pCvSparseNode;
|
||||||
|
curidx: integer;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//define CV_NODE_VAL(mat,node) ((void*)((uchar*)(node) + (mat)->valoffset))
|
||||||
|
//define CV_NODE_IDX(mat,node) ((int*)((uchar*)(node) + (mat)->idxoffset))
|
||||||
|
|
||||||
(* ************************************ Graph ******************************************* *)
|
(* ************************************ Graph ******************************************* *)
|
||||||
|
|
||||||
(*
|
(*
|
||||||
|
File diff suppressed because it is too large
Load Diff
20
readme-en.txt
Normal file
20
readme-en.txt
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
Header files OpenCV 2.4.5 for Delphi XE3
|
||||||
|
========================================
|
||||||
|
|
||||||
|
Developers:
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Laentir Valetov
|
||||||
|
Email: laex@bk.ru
|
||||||
|
|
||||||
|
Mikhail Grigorev
|
||||||
|
Email: sleuthhound@gmail.com
|
||||||
|
|
||||||
|
|
||||||
|
How to install:
|
||||||
|
---------------
|
||||||
|
|
||||||
|
1. Create a directory OpenCV.
|
||||||
|
For example C:\Program Files\Embarcadero\RAD Studio\10.0\OpenCV\
|
||||||
|
2. Copy the directory bin, include and samples from the archive to the directory OpenCV.
|
||||||
|
3. Open Samples.groupproj in RAD Studio and compile example programs.
|
20
readme-ru.txt
Normal file
20
readme-ru.txt
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
Заголовочные файлы OpenCV 2.4.5 для Delphi XE3
|
||||||
|
==============================================
|
||||||
|
|
||||||
|
Разработчики:
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Лаентир Валетов
|
||||||
|
Email: laex@bk.ru
|
||||||
|
|
||||||
|
Михаил Григорьев
|
||||||
|
Email: sleuthhound@gmail.com
|
||||||
|
|
||||||
|
|
||||||
|
Инструкция по установке:
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
1. Создайте каталог OpenCV в директории RAD Studio.
|
||||||
|
Например C:\Program Files\Embarcadero\RAD Studio\10.0\OpenCV\
|
||||||
|
2. Скопируйте в каталог OpenCV директории bin, include и samples из архива.
|
||||||
|
3. Откройте Samples.groupproj в RAD Studio и скомпилируте примеры программ.
|
@ -173,7 +173,21 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if (c = 27) then
|
if (c = 27) then
|
||||||
|
begin
|
||||||
|
// îńâîáîćäŕĺě đĺńóđńű
|
||||||
|
cvReleaseImage(mapx);
|
||||||
|
cvReleaseImage(mapy);
|
||||||
|
cvReleaseImage(gray_image);
|
||||||
|
cvReleaseImage(image);
|
||||||
|
cvReleaseMat(object_points);
|
||||||
|
cvReleaseMat(image_points);
|
||||||
|
cvReleaseMat(point_counts);
|
||||||
|
cvReleaseMat(intrinsic_matrix);
|
||||||
|
cvReleaseMat(distortion_coeffs);
|
||||||
|
cvReleaseCapture(capture);
|
||||||
|
cvDestroyAllWindows;
|
||||||
Halt;
|
Halt;
|
||||||
|
end;
|
||||||
image := cvQueryFrame(capture); // Ïîëó÷àåì ñëåäóþùåå èçîáðàæåíèå
|
image := cvQueryFrame(capture); // Ïîëó÷àåì ñëåäóþùåå èçîáðàæåíèå
|
||||||
end; // ÊÎÍÅÖ ÊÎËËÅÊÖÈÎÍÈÐÎÂÀÍÈÅ ÖÈÊËÎÌ WHILE.
|
end; // ÊÎÍÅÖ ÊÎËËÅÊÖÈÎÍÈÐÎÂÀÍÈÅ ÖÈÊËÎÌ WHILE.
|
||||||
|
|
||||||
@ -286,6 +300,19 @@ begin
|
|||||||
image := cvQueryFrame(capture);
|
image := cvQueryFrame(capture);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// îńâîáîćäŕĺě đĺńóđńű
|
||||||
|
cvReleaseImage(mapx);
|
||||||
|
cvReleaseImage(mapy);
|
||||||
|
cvReleaseImage(gray_image);
|
||||||
|
cvReleaseImage(image);
|
||||||
|
cvReleaseMat(intrinsic_matrix);
|
||||||
|
cvReleaseMat(distortion_coeffs);
|
||||||
|
cvReleaseMat(object_points2);
|
||||||
|
cvReleaseMat(image_points2);
|
||||||
|
cvReleaseMat(point_counts2);
|
||||||
|
cvReleaseCapture(capture);
|
||||||
|
cvDestroyAllWindows;
|
||||||
|
|
||||||
except
|
except
|
||||||
on E: Exception do
|
on E: Exception do
|
||||||
Writeln(E.ClassName, ': ', E.Message);
|
Writeln(E.ClassName, ': ', E.Message);
|
||||||
|
Loading…
Reference in New Issue
Block a user