2014-10-18 01:12:32 +02:00
|
|
|
(* **************************************************************************************************
|
|
|
|
Project Delphi-OpenCV
|
|
|
|
**************************************************************************************************
|
|
|
|
Contributor:
|
|
|
|
Laentir Valetov
|
|
|
|
email:laex@bk.ru
|
|
|
|
Mikhail Grigorev
|
2018-08-16 20:29:02 +02:00
|
|
|
email:sleuthhound@gmail.com
|
2014-10-18 01:12:32 +02:00
|
|
|
**************************************************************************************************
|
|
|
|
You may retrieve the latest version of this file at the GitHub,
|
|
|
|
located at git://github.com/Laex/Delphi-OpenCV.git
|
|
|
|
**************************************************************************************************
|
|
|
|
License:
|
|
|
|
The contents of this file are 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/
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
Alternatively, the contents of this file may be used under the terms of the
|
|
|
|
GNU Lesser General Public License (the "LGPL License"), in which case the
|
|
|
|
provisions of the LGPL License are applicable instead of those above.
|
|
|
|
If you wish to allow use of your version of this file only under the terms
|
|
|
|
of the LGPL License and not to allow others to use your version of this file
|
|
|
|
under the MPL, indicate your decision by deleting the provisions above and
|
|
|
|
replace them with the notice and other provisions required by the LGPL
|
|
|
|
License. If you do not delete the provisions above, a recipient may use
|
|
|
|
your version of this file under either the MPL or the LGPL License.
|
|
|
|
|
|
|
|
For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html
|
|
|
|
**************************************************************************************************
|
|
|
|
Warning: Using Delphi XE3 syntax!
|
|
|
|
**************************************************************************************************
|
|
|
|
The Initial Developer of the Original Code:
|
|
|
|
OpenCV: open source computer vision library
|
|
|
|
Homepage: http://ocv.org
|
|
|
|
Online docs: http://docs.ocv.org
|
|
|
|
Q&A forum: http://answers.ocv.org
|
|
|
|
Dev zone: http://code.ocv.org
|
|
|
|
**************************************************************************************************
|
|
|
|
Original file:
|
|
|
|
opencv\modules\imgproc\include\opencv2\imgproc\types_c.h
|
|
|
|
************************************************************************************************* *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
2016-06-05 10:12:36 +02:00
|
|
|
{$I OpenCV.inc}
|
2014-05-22 16:23:41 +02:00
|
|
|
unit ocv.imgproc.types_c;
|
2013-04-05 13:36:47 +02:00
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
2014-05-22 16:23:41 +02:00
|
|
|
ocv.core.types_c;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Connected component structure *)
|
2013-01-01 13:29:34 +01:00
|
|
|
type
|
2013-04-07 12:41:15 +02:00
|
|
|
pCvConnectedComp = ^TCvConnectedComp;
|
|
|
|
|
2014-05-21 07:14:38 +02:00
|
|
|
TCvConnectedComp = record
|
2019-09-16 13:29:05 +02:00
|
|
|
area: Double; (* area of the connected component *)
|
2014-10-18 01:12:32 +02:00
|
|
|
value: TCvScalar; (* average color of the connected component *)
|
2019-09-16 13:29:05 +02:00
|
|
|
rect: TCvRect; (* ROI of the component *)
|
2014-10-18 01:12:32 +02:00
|
|
|
contour: ^TCvSeq; (* optional component boundary *)
|
2013-01-01 13:29:34 +01:00
|
|
|
end;
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Image smooth methods *)
|
2013-01-01 13:29:34 +01:00
|
|
|
const
|
|
|
|
CV_BLUR_NO_SCALE = 0;
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_BLUR = 1;
|
|
|
|
CV_GAUSSIAN = 2;
|
|
|
|
CV_MEDIAN = 3;
|
|
|
|
CV_BILATERAL = 4;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Filters used in pyramid decomposition *)
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_GAUSSIAN_5x5 = 7;
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Special filters *)
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_SCHARR = -1;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_MAX_SOBEL_KSIZE = 7;
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Constants for color conversion *)
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_BGR2BGRA = 0;
|
|
|
|
CV_RGB2RGBA = CV_BGR2BGRA;
|
|
|
|
CV_BGRA2BGR = 1;
|
|
|
|
CV_RGBA2RGB = CV_BGRA2BGR;
|
|
|
|
CV_BGR2RGBA = 2;
|
|
|
|
CV_RGB2BGRA = CV_BGR2RGBA;
|
|
|
|
CV_RGBA2BGR = 3;
|
|
|
|
CV_BGRA2RGB = CV_RGBA2BGR;
|
|
|
|
CV_BGR2RGB = 4;
|
|
|
|
CV_RGB2BGR = CV_BGR2RGB;
|
|
|
|
CV_BGRA2RGBA = 5;
|
|
|
|
CV_RGBA2BGRA = CV_BGRA2RGBA;
|
|
|
|
CV_BGR2GRAY = 6;
|
|
|
|
CV_RGB2GRAY = 7;
|
|
|
|
CV_GRAY2BGR = 8;
|
|
|
|
CV_GRAY2RGB = CV_GRAY2BGR;
|
|
|
|
CV_GRAY2BGRA = 9;
|
|
|
|
CV_GRAY2RGBA = CV_GRAY2BGRA;
|
|
|
|
CV_BGRA2GRAY = 10;
|
|
|
|
CV_RGBA2GRAY = 11;
|
|
|
|
CV_BGR2BGR565 = 12;
|
|
|
|
CV_RGB2BGR565 = 13;
|
|
|
|
CV_BGR5652BGR = 14;
|
|
|
|
CV_BGR5652RGB = 15;
|
|
|
|
CV_BGRA2BGR565 = 16;
|
|
|
|
CV_RGBA2BGR565 = 17;
|
|
|
|
CV_BGR5652BGRA = 18;
|
|
|
|
CV_BGR5652RGBA = 19;
|
|
|
|
CV_GRAY2BGR565 = 20;
|
|
|
|
CV_BGR5652GRAY = 21;
|
|
|
|
CV_BGR2BGR555 = 22;
|
|
|
|
CV_RGB2BGR555 = 23;
|
|
|
|
CV_BGR5552BGR = 24;
|
|
|
|
CV_BGR5552RGB = 25;
|
|
|
|
CV_BGRA2BGR555 = 26;
|
|
|
|
CV_RGBA2BGR555 = 27;
|
|
|
|
CV_BGR5552BGRA = 28;
|
|
|
|
CV_BGR5552RGBA = 29;
|
|
|
|
CV_GRAY2BGR555 = 30;
|
|
|
|
CV_BGR5552GRAY = 31;
|
|
|
|
CV_BGR2XYZ = 32;
|
|
|
|
CV_RGB2XYZ = 33;
|
|
|
|
CV_XYZ2BGR = 34;
|
|
|
|
CV_XYZ2RGB = 35;
|
|
|
|
CV_BGR2YCrCb = 36;
|
|
|
|
CV_RGB2YCrCb = 37;
|
|
|
|
CV_YCrCb2BGR = 38;
|
|
|
|
CV_YCrCb2RGB = 39;
|
|
|
|
CV_BGR2HSV = 40;
|
|
|
|
CV_RGB2HSV = 41;
|
|
|
|
CV_BGR2Lab = 44;
|
|
|
|
CV_RGB2Lab = 45;
|
|
|
|
CV_BayerBG2BGR = 46;
|
|
|
|
CV_BayerGB2BGR = 47;
|
|
|
|
CV_BayerRG2BGR = 48;
|
|
|
|
CV_BayerGR2BGR = 49;
|
|
|
|
CV_BayerBG2RGB = CV_BayerRG2BGR;
|
|
|
|
CV_BayerGB2RGB = CV_BayerGR2BGR;
|
|
|
|
CV_BayerRG2RGB = CV_BayerBG2BGR;
|
|
|
|
CV_BayerGR2RGB = CV_BayerGB2BGR;
|
|
|
|
CV_BGR2Luv = 50;
|
|
|
|
CV_RGB2Luv = 51;
|
|
|
|
CV_BGR2HLS = 52;
|
|
|
|
CV_RGB2HLS = 53;
|
|
|
|
CV_HSV2BGR = 54;
|
|
|
|
CV_HSV2RGB = 55;
|
|
|
|
CV_Lab2BGR = 56;
|
|
|
|
CV_Lab2RGB = 57;
|
|
|
|
CV_Luv2BGR = 58;
|
|
|
|
CV_Luv2RGB = 59;
|
|
|
|
CV_HLS2BGR = 60;
|
|
|
|
CV_HLS2RGB = 61;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_BayerBG2BGR_VNG = 62;
|
|
|
|
CV_BayerGB2BGR_VNG = 63;
|
|
|
|
CV_BayerRG2BGR_VNG = 64;
|
|
|
|
CV_BayerGR2BGR_VNG = 65;
|
|
|
|
CV_BayerBG2RGB_VNG = CV_BayerRG2BGR_VNG;
|
|
|
|
CV_BayerGB2RGB_VNG = CV_BayerGR2BGR_VNG;
|
|
|
|
CV_BayerRG2RGB_VNG = CV_BayerBG2BGR_VNG;
|
|
|
|
CV_BayerGR2RGB_VNG = CV_BayerGB2BGR_VNG;
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_BGR2HSV_FULL = 66;
|
|
|
|
CV_RGB2HSV_FULL = 67;
|
|
|
|
CV_BGR2HLS_FULL = 68;
|
|
|
|
CV_RGB2HLS_FULL = 69;
|
|
|
|
CV_HSV2BGR_FULL = 70;
|
|
|
|
CV_HSV2RGB_FULL = 71;
|
|
|
|
CV_HLS2BGR_FULL = 72;
|
|
|
|
CV_HLS2RGB_FULL = 73;
|
|
|
|
CV_LBGR2Lab = 74;
|
|
|
|
CV_LRGB2Lab = 75;
|
|
|
|
CV_LBGR2Luv = 76;
|
|
|
|
CV_LRGB2Luv = 77;
|
|
|
|
CV_Lab2LBGR = 78;
|
|
|
|
CV_Lab2LRGB = 79;
|
|
|
|
CV_Luv2LBGR = 80;
|
|
|
|
CV_Luv2LRGB = 81;
|
|
|
|
CV_BGR2YUV = 82;
|
|
|
|
CV_RGB2YUV = 83;
|
|
|
|
CV_YUV2BGR = 84;
|
|
|
|
CV_YUV2RGB = 85;
|
|
|
|
CV_BayerBG2GRAY = 86;
|
|
|
|
CV_BayerGB2GRAY = 87;
|
|
|
|
CV_BayerRG2GRAY = 88;
|
|
|
|
CV_BayerGR2GRAY = 89;
|
2013-01-01 13:29:34 +01:00
|
|
|
// YUV 4:2:0 formats family;
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_YUV2RGB_NV12 = 90;
|
|
|
|
CV_YUV2BGR_NV12 = 91;
|
|
|
|
CV_YUV2RGB_NV21 = 92;
|
|
|
|
CV_YUV2BGR_NV21 = 93;
|
|
|
|
CV_YUV420sp2RGB = CV_YUV2RGB_NV21;
|
|
|
|
CV_YUV420sp2BGR = CV_YUV2BGR_NV21;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_YUV2RGBA_NV12 = 94;
|
|
|
|
CV_YUV2BGRA_NV12 = 95;
|
|
|
|
CV_YUV2RGBA_NV21 = 96;
|
|
|
|
CV_YUV2BGRA_NV21 = 97;
|
|
|
|
CV_YUV420sp2RGBA = CV_YUV2RGBA_NV21;
|
|
|
|
CV_YUV420sp2BGRA = CV_YUV2BGRA_NV21;
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_YUV2RGB_YV12 = 98;
|
|
|
|
CV_YUV2BGR_YV12 = 99;
|
|
|
|
CV_YUV2RGB_IYUV = 100;
|
|
|
|
CV_YUV2BGR_IYUV = 101;
|
|
|
|
CV_YUV2RGB_I420 = CV_YUV2RGB_IYUV;
|
|
|
|
CV_YUV2BGR_I420 = CV_YUV2BGR_IYUV;
|
|
|
|
CV_YUV420p2RGB = CV_YUV2RGB_YV12;
|
|
|
|
CV_YUV420p2BGR = CV_YUV2BGR_YV12;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_YUV2RGBA_YV12 = 102;
|
|
|
|
CV_YUV2BGRA_YV12 = 103;
|
|
|
|
CV_YUV2RGBA_IYUV = 104;
|
|
|
|
CV_YUV2BGRA_IYUV = 105;
|
|
|
|
CV_YUV2RGBA_I420 = CV_YUV2RGBA_IYUV;
|
|
|
|
CV_YUV2BGRA_I420 = CV_YUV2BGRA_IYUV;
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_YUV420p2RGBA = CV_YUV2RGBA_YV12;
|
|
|
|
CV_YUV420p2BGRA = CV_YUV2BGRA_YV12;
|
|
|
|
CV_YUV2GRAY_420 = 106;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_YUV2GRAY_NV21 = CV_YUV2GRAY_420;
|
|
|
|
CV_YUV2GRAY_NV12 = CV_YUV2GRAY_420;
|
|
|
|
CV_YUV2GRAY_YV12 = CV_YUV2GRAY_420;
|
|
|
|
CV_YUV2GRAY_IYUV = CV_YUV2GRAY_420;
|
|
|
|
CV_YUV2GRAY_I420 = CV_YUV2GRAY_420;
|
|
|
|
CV_YUV420sp2GRAY = CV_YUV2GRAY_420;
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_YUV420p2GRAY = CV_YUV2GRAY_420;
|
2013-01-01 13:29:34 +01:00
|
|
|
// YUV 4:2:2 formats family;
|
|
|
|
CV_YUV2RGB_UYVY = 107;
|
|
|
|
CV_YUV2BGR_UYVY = 108;
|
|
|
|
// CV_YUV2RGB_VYUY = 109;
|
|
|
|
// CV_YUV2BGR_VYUY = 110;
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_YUV2RGB_Y422 = CV_YUV2RGB_UYVY;
|
|
|
|
CV_YUV2BGR_Y422 = CV_YUV2BGR_UYVY;
|
|
|
|
CV_YUV2RGB_UYNV = CV_YUV2RGB_UYVY;
|
|
|
|
CV_YUV2BGR_UYNV = CV_YUV2BGR_UYVY;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_YUV2RGBA_UYVY = 111;
|
|
|
|
CV_YUV2BGRA_UYVY = 112;
|
|
|
|
// CV_YUV2RGBA_VYUY = 113;
|
|
|
|
// CV_YUV2BGRA_VYUY = 114;
|
|
|
|
CV_YUV2RGBA_Y422 = CV_YUV2RGBA_UYVY;
|
|
|
|
CV_YUV2BGRA_Y422 = CV_YUV2BGRA_UYVY;
|
|
|
|
CV_YUV2RGBA_UYNV = CV_YUV2RGBA_UYVY;
|
|
|
|
CV_YUV2BGRA_UYNV = CV_YUV2BGRA_UYVY;
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_YUV2RGB_YUY2 = 115;
|
|
|
|
CV_YUV2BGR_YUY2 = 116;
|
|
|
|
CV_YUV2RGB_YVYU = 117;
|
|
|
|
CV_YUV2BGR_YVYU = 118;
|
|
|
|
CV_YUV2RGB_YUYV = CV_YUV2RGB_YUY2;
|
|
|
|
CV_YUV2BGR_YUYV = CV_YUV2BGR_YUY2;
|
|
|
|
CV_YUV2RGB_YUNV = CV_YUV2RGB_YUY2;
|
|
|
|
CV_YUV2BGR_YUNV = CV_YUV2BGR_YUY2;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_YUV2RGBA_YUY2 = 119;
|
|
|
|
CV_YUV2BGRA_YUY2 = 120;
|
|
|
|
CV_YUV2RGBA_YVYU = 121;
|
|
|
|
CV_YUV2BGRA_YVYU = 122;
|
|
|
|
CV_YUV2RGBA_YUYV = CV_YUV2RGBA_YUY2;
|
|
|
|
CV_YUV2BGRA_YUYV = CV_YUV2BGRA_YUY2;
|
|
|
|
CV_YUV2RGBA_YUNV = CV_YUV2RGBA_YUY2;
|
|
|
|
CV_YUV2BGRA_YUNV = CV_YUV2BGRA_YUY2;
|
|
|
|
CV_YUV2GRAY_UYVY = 123;
|
|
|
|
CV_YUV2GRAY_YUY2 = 124;
|
|
|
|
// CV_YUV2GRAY_VYUY = CV_YUV2GRAY_UYVY;
|
|
|
|
CV_YUV2GRAY_Y422 = CV_YUV2GRAY_UYVY;
|
|
|
|
CV_YUV2GRAY_UYNV = CV_YUV2GRAY_UYVY;
|
|
|
|
CV_YUV2GRAY_YVYU = CV_YUV2GRAY_YUY2;
|
|
|
|
CV_YUV2GRAY_YUYV = CV_YUV2GRAY_YUY2;
|
|
|
|
CV_YUV2GRAY_YUNV = CV_YUV2GRAY_YUY2;
|
|
|
|
// alpha premultiplication;
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_RGBA2mRGBA = 125;
|
|
|
|
CV_mRGBA2RGBA = 126;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_COLORCVT_MAX = 127;
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Sub-pixel interpolation methods *)
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_INTER_NN = 0;
|
|
|
|
CV_INTER_LINEAR = 1;
|
|
|
|
CV_INTER_CUBIC = 2;
|
|
|
|
CV_INTER_AREA = 3;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_INTER_LANCZOS4 = 4;
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* ... and other image warping flags *)
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_WARP_FILL_OUTLIERS = 8;
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_WARP_INVERSE_MAP = 16;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Shapes of a structuring element for morphological operations *)
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_SHAPE_RECT = 0;
|
|
|
|
CV_SHAPE_CROSS = 1;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_SHAPE_ELLIPSE = 2;
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_SHAPE_CUSTOM = 100;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Morphological operations *)
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_MOP_ERODE = 0;
|
|
|
|
CV_MOP_DILATE = 1;
|
|
|
|
CV_MOP_OPEN = 2;
|
|
|
|
CV_MOP_CLOSE = 3;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_MOP_GRADIENT = 4;
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_MOP_TOPHAT = 5;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_MOP_BLACKHAT = 6;
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Spatial and central moments *)
|
2013-01-01 13:29:34 +01:00
|
|
|
type
|
2013-09-25 21:18:23 +02:00
|
|
|
pCvMoments = ^TCvMoments;
|
|
|
|
|
2014-05-21 07:14:38 +02:00
|
|
|
TCvMoments = record
|
2014-10-18 01:12:32 +02:00
|
|
|
m00, m10, m01, m20, m11, m02, m30, m21, m12, m03: Double; (* spatial moments *)
|
|
|
|
mu20, mu11, mu02, mu30, mu21, mu12, mu03: Double; (* central moments *)
|
|
|
|
inv_sqrt_m00: Double; (* m00 != 0 ? 1/sqrt(m00) : 0 *)
|
2013-01-01 13:29:34 +01:00
|
|
|
end;
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Hu invariants *)
|
2013-01-01 13:29:34 +01:00
|
|
|
type
|
2014-10-18 01:12:32 +02:00
|
|
|
pCvHuMoments = ^TCvHuMoments;
|
|
|
|
|
|
|
|
TCvHuMoments = record
|
|
|
|
hu1, hu2, hu3, hu4, hu5, hu6, hu7: Double; (* Hu invariants *)
|
2013-01-01 13:29:34 +01:00
|
|
|
end;
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Template matching methods *)
|
2013-01-01 13:29:34 +01:00
|
|
|
const
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_TM_SQDIFF = 0;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_TM_SQDIFF_NORMED = 1;
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_TM_CCORR = 2;
|
|
|
|
CV_TM_CCORR_NORMED = 3;
|
|
|
|
CV_TM_CCOEFF = 4;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_TM_CCOEFF_NORMED = 5;
|
|
|
|
|
|
|
|
type
|
2014-10-18 01:12:32 +02:00
|
|
|
TCvDistanceFunction = function(var a: Single; var b: Single; user_param: Pointer): Single; CDECL;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
|
|
const
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Contour retrieval modes *)
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_RETR_EXTERNAL = 0;
|
|
|
|
CV_RETR_LIST = 1;
|
|
|
|
CV_RETR_CCOMP = 2;
|
|
|
|
CV_RETR_TREE = 3;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_RETR_FLOODFILL = 4;
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Contour approximation methods *)
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_CHAIN_CODE = 0;
|
|
|
|
CV_CHAIN_APPROX_NONE = 1;
|
|
|
|
CV_CHAIN_APPROX_SIMPLE = 2;
|
|
|
|
CV_CHAIN_APPROX_TC89_L1 = 3;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_CHAIN_APPROX_TC89_KCOS = 4;
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_LINK_RUNS = 5;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
|
|
(*
|
|
|
|
Internal structure that is used for sequental retrieving contours from the image.
|
|
|
|
It supports both hierarchical and plane variants of Suzuki algorithm.
|
|
|
|
*)
|
|
|
|
type
|
|
|
|
// CvContourScanner = ^_CvContourScanner;
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Freeman chain reader state *)
|
|
|
|
pCvChainPtReader = ^TCvChainPtReader;
|
|
|
|
|
|
|
|
TCvChainPtReader = record
|
2013-01-01 13:29:34 +01:00
|
|
|
code: char;
|
|
|
|
pt: TCvPoint;
|
|
|
|
deltas: array [0 .. 7, 0 .. 1] of schar;
|
|
|
|
end;
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* initializes 8-element array for fast access to 3x3 neighborhood of a pixel *)
|
2013-01-01 13:29:34 +01:00
|
|
|
// CV_INIT_3X3_DELTAS(deltas, step, nch)((deltas): array [0 .. -1] of const = (nch),
|
|
|
|
// (deltas)[1] = -(step) + (nch), (deltas)[2] = -(step), (deltas)[3] = -(step) - (nch),
|
|
|
|
// (deltas)[4] = -(nch), (deltas)[5] = (step) - (nch), (deltas)[6] = (step),
|
|
|
|
// (deltas)[7] = (step) + (nch))
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* ***************************************************************************************\
|
2013-01-01 13:29:34 +01:00
|
|
|
* Planar subdivisions *
|
2014-10-18 01:12:32 +02:00
|
|
|
*************************************************************************************** *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
|
|
type
|
2017-09-11 23:15:07 +02:00
|
|
|
TCvSubdiv2DEdge = size_t;
|
2014-10-18 01:12:32 +02:00
|
|
|
{ EXTERNALSYM CvSubdiv2DEdge }
|
2013-04-07 12:41:15 +02:00
|
|
|
|
2017-09-11 23:15:07 +02:00
|
|
|
pCvSubdiv2DPoint = ^TCvSubdiv2DPoint;
|
2014-10-18 01:12:32 +02:00
|
|
|
TCvSubdiv2DPointArray = array [0 .. 0] of pCvSubdiv2DPoint;
|
|
|
|
pCvSubdiv2DPointArray = ^TCvSubdiv2DPointArray;
|
2013-04-07 12:41:15 +02:00
|
|
|
|
2014-05-21 07:14:38 +02:00
|
|
|
TCvSubdiv2DPoint = record
|
2013-04-07 12:41:15 +02:00
|
|
|
flags: Integer;
|
|
|
|
first: TCvSubdiv2DEdge;
|
|
|
|
pt: TCvPoint2D32f;
|
|
|
|
id: Integer;
|
|
|
|
end;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
|
|
const
|
|
|
|
CV_SUBDIV2D_VIRTUAL_POINT_FLAG = (1 shl 30);
|
|
|
|
{$EXTERNALSYM CV_SUBDIV2D_VIRTUAL_POINT_FLAG}
|
|
|
|
|
2013-04-07 12:41:15 +02:00
|
|
|
Type
|
|
|
|
|
|
|
|
pCvQuadEdge2D = ^TCvQuadEdge2D;
|
|
|
|
|
2014-05-21 07:14:38 +02:00
|
|
|
TCvQuadEdge2D = record
|
2013-04-07 12:41:15 +02:00
|
|
|
flags: Integer;
|
|
|
|
pt: array [0 .. 3] of pCvSubdiv2DPoint;
|
|
|
|
next: array [0 .. 3] of TCvSubdiv2DEdge;
|
|
|
|
end;
|
|
|
|
|
|
|
|
pCvSubdiv2D = ^TCvSubdiv2D;
|
|
|
|
|
2014-05-21 07:14:38 +02:00
|
|
|
TCvSubdiv2D = record
|
2013-04-09 19:20:50 +02:00
|
|
|
// CV_SUBDIV2D_FIELDS()
|
|
|
|
// -CV_GRAPH_FIELDS()
|
|
|
|
// --CV_SET_FIELDS()
|
|
|
|
// --CV_SEQUENCE_FIELDS()
|
|
|
|
// ---CV_TREE_NODE_FIELDS(CvSeq);
|
2019-09-16 13:29:05 +02:00
|
|
|
flags: Integer; // * Miscellaneous flags.
|
|
|
|
eader_size: Integer; // * Size of sequence header.
|
|
|
|
h_prev: pCvSeq; // * Previous sequence.
|
|
|
|
h_next: pCvSeq; // * Next sequence.
|
|
|
|
v_prev: pCvSeq; // * 2nd previous sequence.
|
|
|
|
v_next: pCvSeq; // * 2nd next sequence.
|
|
|
|
total: Integer; // * Total number of elements.
|
|
|
|
elem_size: Integer; // * Size of sequence element in bytes.
|
|
|
|
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.
|
2013-04-09 19:20:50 +02:00
|
|
|
free_blocks: pCvSeqBlock; // * Free blocks list.
|
2019-09-16 13:29:05 +02:00
|
|
|
first: pCvSeqBlock; // * Pointer to the first sequence block.
|
2013-04-07 12:41:15 +02:00
|
|
|
free_elems: pCvSetElem;
|
|
|
|
active_count: Integer;
|
|
|
|
edges: pCvSet;
|
|
|
|
quad_edges: Integer;
|
|
|
|
is_geometry_valid: Integer;
|
|
|
|
recent_edge: TCvSubdiv2DEdge;
|
|
|
|
topleft: TCvPoint2D32f;
|
|
|
|
bottomright: TCvPoint2D32f;
|
|
|
|
end;
|
|
|
|
|
|
|
|
const
|
2013-01-01 13:29:34 +01:00
|
|
|
// Type CvSubdiv2DPointLocation
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_PTLOC_ERROR = -2;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_PTLOC_OUTSIDE_RECT = -1;
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_PTLOC_INSIDE = 0;
|
|
|
|
CV_PTLOC_VERTEX = 1;
|
|
|
|
CV_PTLOC_ON_EDGE = 2;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
|
|
// Type CvNextEdgeType
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_NEXT_AROUND_ORG = $00;
|
|
|
|
CV_NEXT_AROUND_DST = $22;
|
|
|
|
CV_PREV_AROUND_ORG = $11;
|
|
|
|
CV_PREV_AROUND_DST = $33;
|
|
|
|
CV_NEXT_AROUND_LEFT = $13;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_NEXT_AROUND_RIGHT = $31;
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_PREV_AROUND_LEFT = $20;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_PREV_AROUND_RIGHT = $02;
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* get the next edge with the same origin point (counterwise) *)
|
2013-01-01 13:29:34 +01:00
|
|
|
// >> Following declaration is a macro definition!
|
|
|
|
// CV_SUBDIV2D_NEXT_EDGE(edge)(((CvQuadEdge2D(edge) and ~ 3))^.next: array [0 .. 2] of const);
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Contour approximation algorithms *)
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_POLY_APPROX_DP = 0;
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Shape matching methods *)
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_CONTOURS_MATCH_I1 = 1;
|
|
|
|
CV_CONTOURS_MATCH_I2 = 2;
|
|
|
|
CV_CONTOURS_MATCH_I3 = 3;
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Shape orientation *)
|
2019-09-16 13:29:05 +02:00
|
|
|
CV_CLOCKWISE = 1;
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_COUNTER_CLOCKWISE = 2;
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Convexity defect *)
|
2013-01-01 13:29:34 +01:00
|
|
|
type
|
2013-04-07 12:41:15 +02:00
|
|
|
pCvConvexityDefect = ^TCvConvexityDefect;
|
|
|
|
|
2014-05-21 07:14:38 +02:00
|
|
|
TCvConvexityDefect = record
|
2019-09-16 13:29:05 +02:00
|
|
|
start: PCvPoint; (* point of the contour where the defect begins *)
|
|
|
|
_end: PCvPoint; (* point of the contour where the defect ends *)
|
2014-10-18 01:12:32 +02:00
|
|
|
depth_point: PCvPoint; (* the farthest from the convex hull point within the defect *)
|
2019-09-16 13:29:05 +02:00
|
|
|
depth: Single; (* distance between the farthest point and the convex hull *)
|
2013-01-01 13:29:34 +01:00
|
|
|
end;
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Histogram comparison methods *)
|
2013-01-01 13:29:34 +01:00
|
|
|
const
|
|
|
|
CV_COMP_CORREL = 0;
|
|
|
|
|
|
|
|
CV_COMP_CHISQR = 1;
|
|
|
|
|
|
|
|
CV_COMP_INTERSECT = 2;
|
|
|
|
|
|
|
|
CV_COMP_BHATTACHARYYA = 3;
|
|
|
|
|
|
|
|
CV_COMP_HELLINGER = CV_COMP_BHATTACHARYYA;
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Mask size for distance transform *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
|
|
CV_DIST_MASK_3 = 3;
|
|
|
|
|
|
|
|
CV_DIST_MASK_5 = 5;
|
|
|
|
|
|
|
|
CV_DIST_MASK_PRECISE = 0;
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Content of output label array: connected components or pixels *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
|
|
CV_DIST_LABEL_CCOMP = 0;
|
|
|
|
|
|
|
|
CV_DIST_LABEL_PIXEL = 1;
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Distance types for Distance Transform and M-estimators *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
CV_DIST_USER = -1; (* User defined distance *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
CV_DIST_L1 = 1; (* distance = |x1-x2| + |y1-y2| *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
CV_DIST_L2 = 2; (* the simple euclidean distance *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
CV_DIST_C = 3; (* distance = max(|x1-x2|;|y1-y2|) *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
CV_DIST_L12 = 4; (* L1-L2 metric: distance = 2(sqrt(1+x*x/2) - 1)) *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
CV_DIST_FAIR = 5; (* distance = c^2(|x|/c-log(1+|x|/c)); c = 1.3998 *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
CV_DIST_WELSCH = 6; (* distance = c^2/2(1-exp(-(x/c)^2)); c = 2.9846 *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
CV_DIST_HUBER = 7; (* distance = |x|<c ? x^2/2 : c(|x|-c/2); c=1.345 *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Threshold types *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
CV_THRESH_BINARY = 0; (* value = value > threshold ? max_value : 0 *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
CV_THRESH_BINARY_INV = 1; (* value = value > threshold ? 0 : max_value *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
CV_THRESH_TRUNC = 2; (* value = value > threshold ? threshold : value *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
CV_THRESH_TOZERO = 3; (* value = value > threshold ? value : 0 *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
CV_THRESH_TOZERO_INV = 4; (* value = value > threshold ? 0 : value *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
|
|
CV_THRESH_MASK = 7;
|
|
|
|
|
|
|
|
CV_THRESH_OTSU = 8;
|
2014-10-18 01:12:32 +02:00
|
|
|
(* use Otsu algorithm to choose the optimal threshold value;
|
2019-09-16 13:29:05 +02:00
|
|
|
combine = the flag with one of the above CV_THRESH_* values; *)
|
|
|
|
//{$EXTERNALSYM combine}
|
|
|
|
(* Adaptive threshold methods *)
|
2013-01-01 13:29:34 +01:00
|
|
|
CV_ADAPTIVE_THRESH_MEAN_C = 0;
|
|
|
|
|
|
|
|
CV_ADAPTIVE_THRESH_GAUSSIAN_C = 1;
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* FloodFill flags *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
|
|
CV_FLOODFILL_FIXED_RANGE = (1 shl 16);
|
|
|
|
|
|
|
|
CV_FLOODFILL_MASK_ONLY = (1 shl 17);
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Canny edge detector flags *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
|
|
CV_CANNY_L2_GRADIENT = (1 shl 31);
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Variants of a Hough transform *)
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
|
|
CV_HOUGH_STANDARD = 0;
|
|
|
|
|
|
|
|
CV_HOUGH_PROBABILISTIC = 1;
|
|
|
|
|
|
|
|
CV_HOUGH_MULTI_SCALE = 2;
|
|
|
|
|
|
|
|
CV_HOUGH_GRADIENT = 3;
|
|
|
|
|
2014-10-18 01:12:32 +02:00
|
|
|
(* Fast search data structures *)
|
|
|
|
Type
|
|
|
|
pCvFeatureTree = ^TCvFeatureTree;
|
|
|
|
|
|
|
|
TCvFeatureTree = record
|
|
|
|
end;
|
|
|
|
|
|
|
|
pCvLSH = ^TCvLSH;
|
|
|
|
|
|
|
|
TCvLSH = record
|
|
|
|
end;
|
|
|
|
|
|
|
|
pCvLSHOperations = ^TCvLSHOperations;
|
|
|
|
|
|
|
|
TCvLSHOperations = record
|
|
|
|
end;
|
2013-01-01 13:29:34 +01:00
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
end.
|