1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 """PyOpenCV - A Python wrapper for OpenCV 2.x using Boost.Python and NumPy
18
19 Copyright (c) 2009, Minh-Tri Pham
20 All rights reserved.
21
22 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
23
24 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
25 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
26 * Neither the name of pyopencv's copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
27
28 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
30 For further inquiries, please contact Minh-Tri Pham at pmtri80@gmail.com.
31 """
32
33
34 try:
35 import numpy as _NP
36 except ImportError:
37 raise ImportError("NumPy is not found in your system. Please install NumPy of version at least 1.2.0.")
38
39 if _NP.version.version < '1.2.0':
40 raise ImportError("NumPy is installed but its version is too old (%s detected). Please install NumPy of version at least 1.2.0." % _NP.version.version)
41
42
43
44 import config as _C
45 if _C.path_ext:
46 import os as _os
47 _seperator = ';' if _os.name == 'nt' else ':'
48 _old_sys_path = _os.environ['PATH']
49 _sys_path = _old_sys_path
50 import config as _C
51 for x in _C.path_ext:
52 _sys_path = x + _seperator + _sys_path
53 _os.environ['PATH'] = _sys_path
54
55 from pyopencvext import *
56 import pyopencvext as _PE
57 _os.environ['PATH'] = _old_sys_path
58 else:
59 from pyopencvext import *
60 import pyopencvext as _PE
61
62
63 import math as _Math
64 import ctypes as _CT
65
66
67
68
69
70
71 CV_MAJOR_VERSION = 2
72 CV_MINOR_VERSION = 1
73 CV_SUBMINOR_VERSION = 0
74 CV_VERSION = "2.1.0"
75
76
77
78
79
80
81
82
83
84
85
86 CV_StsOk = 0
87 CV_StsBackTrace = -1
88 CV_StsError = -2
89 CV_StsInternal = -3
90 CV_StsNoMem = -4
91 CV_StsBadArg = -5
92 CV_StsBadFunc = -6
93 CV_StsNoConv = -7
94 CV_StsAutoTrace = -8
95
96 CV_HeaderIsNull = -9
97 CV_BadImageSize = -10
98 CV_BadOffset = -11
99 CV_BadDataPtr = -12
100 CV_BadStep = -13
101 CV_BadModelOrChSeq = -14
102 CV_BadNumChannels = -15
103 CV_BadNumChannel1U = -16
104 CV_BadDepth = -17
105 CV_BadAlphaChannel = -18
106 CV_BadOrder = -19
107 CV_BadOrigin = -20
108 CV_BadAlign = -21
109 CV_BadCallBack = -22
110 CV_BadTileSize = -23
111 CV_BadCOI = -24
112 CV_BadROISize = -25
113
114 CV_MaskIsTiled = -26
115
116 CV_StsNullPtr = -27
117 CV_StsVecLengthErr = -28
118 CV_StsFilterStructContentErr = -29
119 CV_StsKernelStructContentErr = -30
120 CV_StsFilterOffsetErr = -31
121
122
123 CV_StsBadSize = -201
124 CV_StsDivByZero = -202
125 CV_StsInplaceNotSupported = -203
126 CV_StsObjectNotFound = -204
127 CV_StsUnmatchedFormats = -205
128 CV_StsBadFlag = -206
129 CV_StsBadPoint = -207
130 CV_StsBadMask = -208
131 CV_StsUnmatchedSizes = -209
132 CV_StsUnsupportedFormat = -210
133 CV_StsOutOfRange = -211
134 CV_StsParseError = -212
135 CV_StsNotImplemented = -213
136 CV_StsBadMemBlock = -214
137 CV_StsAssert = -215
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152 CV_PI = _Math.pi
153 CV_LOG2 = 0.69314718055994530941723212145818
154
155
156
157
158
159
160
161
162
163
164
165
166
167 CV_CN_MAX = 64
168 CV_CN_SHIFT = 3
169 CV_DEPTH_MAX = (1 << CV_CN_SHIFT)
170
171 CV_8U = 0
172 CV_8S = 1
173 CV_16U = 2
174 CV_16S = 3
175 CV_32S = 4
176 CV_32F = 5
177 CV_64F = 6
178 CV_USRTYPE1 = 7
179
182 CV_MAKE_TYPE = CV_MAKETYPE
183
184 CV_8UC1 = CV_MAKETYPE(CV_8U,1)
185 CV_8UC2 = CV_MAKETYPE(CV_8U,2)
186 CV_8UC3 = CV_MAKETYPE(CV_8U,3)
187 CV_8UC4 = CV_MAKETYPE(CV_8U,4)
188
189 CV_8SC1 = CV_MAKETYPE(CV_8S,1)
190 CV_8SC2 = CV_MAKETYPE(CV_8S,2)
191 CV_8SC3 = CV_MAKETYPE(CV_8S,3)
192 CV_8SC4 = CV_MAKETYPE(CV_8S,4)
193
194 CV_16UC1 = CV_MAKETYPE(CV_16U,1)
195 CV_16UC2 = CV_MAKETYPE(CV_16U,2)
196 CV_16UC3 = CV_MAKETYPE(CV_16U,3)
197 CV_16UC4 = CV_MAKETYPE(CV_16U,4)
198
199 CV_16SC1 = CV_MAKETYPE(CV_16S,1)
200 CV_16SC2 = CV_MAKETYPE(CV_16S,2)
201 CV_16SC3 = CV_MAKETYPE(CV_16S,3)
202 CV_16SC4 = CV_MAKETYPE(CV_16S,4)
203
204 CV_32SC1 = CV_MAKETYPE(CV_32S,1)
205 CV_32SC2 = CV_MAKETYPE(CV_32S,2)
206 CV_32SC3 = CV_MAKETYPE(CV_32S,3)
207 CV_32SC4 = CV_MAKETYPE(CV_32S,4)
208
209 CV_32FC1 = CV_MAKETYPE(CV_32F,1)
210 CV_32FC2 = CV_MAKETYPE(CV_32F,2)
211 CV_32FC3 = CV_MAKETYPE(CV_32F,3)
212 CV_32FC4 = CV_MAKETYPE(CV_32F,4)
213
214 CV_64FC1 = CV_MAKETYPE(CV_64F,1)
215 CV_64FC2 = CV_MAKETYPE(CV_64F,2)
216 CV_64FC3 = CV_MAKETYPE(CV_64F,3)
217 CV_64FC4 = CV_MAKETYPE(CV_64F,4)
218
219 CV_AUTOSTEP = 0x7fffffff
220 CV_WHOLE_ARR = _PE.Range( 0, 0x3fffffff )
221
222 CV_MAT_CN_MASK = ((CV_CN_MAX - 1) << CV_CN_SHIFT)
225 CV_MAT_DEPTH_MASK = (CV_DEPTH_MAX - 1)
228 CV_MAT_TYPE_MASK = (CV_DEPTH_MAX*CV_CN_MAX - 1)
231 CV_MAT_CONT_FLAG_SHIFT = 9
232 CV_MAT_CONT_FLAG = (1 << CV_MAT_CONT_FLAG_SHIFT)
235 CV_IS_CONT_MAT = CV_IS_MAT_CONT
236 CV_MAT_TEMP_FLAG_SHIFT = 10
237 CV_MAT_TEMP_FLAG = (1 << CV_MAT_TEMP_FLAG_SHIFT)
240
241 CV_MAGIC_MASK = 0xFFFF0000
242 CV_MAT_MAGIC_VAL = 0x42420000
243 CV_TYPE_NAME_MAT = "opencv-matrix"
244
245
246
247
248
249
250 CV_MATND_MAGIC_VAL = 0x42430000
251 CV_TYPE_NAME_MATND = "opencv-nd-matrix"
252
253 CV_MAX_DIM = 32
254 CV_MAX_DIM_HEAP = (1 << 16)
255
256
257
258
259
260
261 CV_SPARSE_MAT_MAGIC_VAL = 0x42440000
262 CV_TYPE_NAME_SPARSE_MAT = "opencv-sparse-matrix"
263
264
265
266
267
268
269
270 CV_TERMCRIT_ITER = 1
271 CV_TERMCRIT_NUMBER = CV_TERMCRIT_ITER
272 CV_TERMCRIT_EPS = 2
273
274 CV_WHOLE_SEQ_END_INDEX = 0x3fffffff
275 CV_WHOLE_SEQ = _PE.Range(0, CV_WHOLE_SEQ_END_INDEX)
276
277
278
280 return "CvRect(x=" + repr(self.x) + ", y=" + repr(self.y) + \
281 ", width=" + repr(self.width) + ", height=" + repr(self.height) + ")"
282 CvRect.__repr__ = _CvRect__repr__
283
284
286 return "CvSize(width=" + repr(self.width) + ", height=" + repr(self.height) + ")"
287 CvSize.__repr__ = _CvSize__repr__
288
289
292 CvScalar.__repr__ = _CvScalar__repr__
293
294
296 return "CvPoint(x=" + repr(self.x) + ", y=" + repr(self.y) + ")"
297 CvPoint.__repr__ = _CvPoint__repr__
298
299
301 return "CvPoint2D32f(x=" + repr(self.x) + ", y=" + repr(self.y) + ")"
302 CvPoint2D32f.__repr__ = _CvPoint2D32f__repr__
303
304
306 return "CvPoint2D64f(x=" + repr(self.x) + ", y=" + repr(self.y) + ")"
307 CvPoint2D64f.__repr__ = _CvPoint2D64f__repr__
308
309
311 return "CvPoint3D32f(x=" + repr(self.x) + ", y=" + repr(self.y) + ", z=" + repr(self.z) + ")"
312 CvPoint3D32f.__repr__ = _CvPoint3D32f__repr__
313
314
316 return "CvPoint3D64f(x=" + repr(self.x) + ", y=" + repr(self.y) + ", z=" + repr(self.z) + ")"
317 CvPoint3D64f.__repr__ = _CvPoint3D64f__repr__
318
319
321 return "CvBox2D(center=" + repr(self.center) + ", size=" + repr(self.size) + \
322 ", angle=" + repr(self.angle) + ")"
323 CvBox2D.__repr__ = _CvBox2D__repr__
324
325
327 return "CvTermCriteria(type=" + repr(self.type) + ", max_iter=" + repr(self.max_iter) + \
328 ", epsilon=" + repr(self.epsilon) + ")"
329 CvTermCriteria.__repr__ = _CvTermCriteria__repr__
330
331
334 CvSlice.__repr__ = _CvSlice__repr__
335
336
337
338
339
340
341 CV_STORAGE_MAGIC_VAL = 0x42890000
342
343 CV_TYPE_NAME_SEQ = "opencv-sequence"
344 CV_TYPE_NAME_SEQ_TREE = "opencv-sequence-tree"
345
346 CV_SET_ELEM_IDX_MASK = ((1 << 26) - 1)
347 CV_SET_ELEM_FREE_FLAG = (1 << (_CT.sizeof(_CT.c_int)*8-1))
348
349
351 return cast(ptr, CvSetElem_p)[0].flags >= 0
352
353 CV_TYPE_NAME_GRAPH = "opencv-graph"
354
355
356
357 CvMemStorage._ownershiplevel = 0
358
362 CvMemStorage.__del__ = _CvMemStorage__del__
363
364
365
366
367
368
369
370 CV_SEQ_MAGIC_VAL = 0x42990000
371
372
373
374 CV_SET_MAGIC_VAL = 0x42980000
375
376
377 CV_SEQ_ELTYPE_BITS = 9
378 CV_SEQ_ELTYPE_MASK = ((1 << CV_SEQ_ELTYPE_BITS) - 1)
379 CV_SEQ_ELTYPE_POINT = CV_32SC2
380 CV_SEQ_ELTYPE_CODE = CV_8UC1
381 CV_SEQ_ELTYPE_GENERIC = 0
382 CV_SEQ_ELTYPE_PTR = CV_USRTYPE1
383 CV_SEQ_ELTYPE_PPOINT = CV_SEQ_ELTYPE_PTR
384 CV_SEQ_ELTYPE_INDEX = CV_32SC1
385 CV_SEQ_ELTYPE_GRAPH_EDGE = 0
386 CV_SEQ_ELTYPE_GRAPH_VERTEX = 0
387 CV_SEQ_ELTYPE_TRIAN_ATR = 0
388 CV_SEQ_ELTYPE_CONNECTED_COMP= 0
389 CV_SEQ_ELTYPE_POINT3D = CV_32FC3
390
391 CV_SEQ_KIND_BITS = 3
392 CV_SEQ_KIND_MASK = (((1 << CV_SEQ_KIND_BITS) - 1)<<CV_SEQ_ELTYPE_BITS)
393
394
395
396 CV_SEQ_KIND_GENERIC = (0 << CV_SEQ_ELTYPE_BITS)
397 CV_SEQ_KIND_CURVE = (1 << CV_SEQ_ELTYPE_BITS)
398 CV_SEQ_KIND_BIN_TREE = (2 << CV_SEQ_ELTYPE_BITS)
399
400
401
402
403 CV_SEQ_KIND_GRAPH = (3 << CV_SEQ_ELTYPE_BITS)
404 CV_SEQ_KIND_SUBDIV2D = (4 << CV_SEQ_ELTYPE_BITS)
405
406 CV_SEQ_FLAG_SHIFT = (CV_SEQ_KIND_BITS + CV_SEQ_ELTYPE_BITS)
407
408
409 CV_SEQ_FLAG_CLOSED = (1 << CV_SEQ_FLAG_SHIFT)
410 CV_SEQ_FLAG_SIMPLE = (2 << CV_SEQ_FLAG_SHIFT)
411 CV_SEQ_FLAG_CONVEX = (4 << CV_SEQ_FLAG_SHIFT)
412 CV_SEQ_FLAG_HOLE = (8 << CV_SEQ_FLAG_SHIFT)
413
414
415 CV_GRAPH_FLAG_ORIENTED = (1 << CV_SEQ_FLAG_SHIFT)
416
417 CV_GRAPH = CV_SEQ_KIND_GRAPH
418 CV_ORIENTED_GRAPH = (CV_SEQ_KIND_GRAPH|CV_GRAPH_FLAG_ORIENTED)
419
420
421 CV_SEQ_POINT_SET = (CV_SEQ_KIND_GENERIC| CV_SEQ_ELTYPE_POINT)
422 CV_SEQ_POINT3D_SET = (CV_SEQ_KIND_GENERIC| CV_SEQ_ELTYPE_POINT3D)
423 CV_SEQ_POLYLINE = (CV_SEQ_KIND_CURVE | CV_SEQ_ELTYPE_POINT)
424 CV_SEQ_POLYGON = (CV_SEQ_FLAG_CLOSED | CV_SEQ_POLYLINE )
425 CV_SEQ_CONTOUR = CV_SEQ_POLYGON
426 CV_SEQ_SIMPLE_POLYGON = (CV_SEQ_FLAG_SIMPLE | CV_SEQ_POLYGON )
427
428
429 CV_SEQ_CHAIN = (CV_SEQ_KIND_CURVE | CV_SEQ_ELTYPE_CODE)
430 CV_SEQ_CHAIN_CONTOUR = (CV_SEQ_FLAG_CLOSED | CV_SEQ_CHAIN)
431
432
433 CV_SEQ_POLYGON_TREE = (CV_SEQ_KIND_BIN_TREE | CV_SEQ_ELTYPE_TRIAN_ATR)
434
435
436 CV_SEQ_CONNECTED_COMP = (CV_SEQ_KIND_GENERIC | CV_SEQ_ELTYPE_CONNECTED_COMP)
437
438
439 CV_SEQ_INDEX = (CV_SEQ_KIND_GENERIC | CV_SEQ_ELTYPE_INDEX)
440
441
442
443
445 result = cvGetSeqElem(seq, index)
446 return cast(result, POINTER(TYPE))
447
448
449
450
451
452
453
454 CV_STORAGE_READ = 0
455 CV_STORAGE_WRITE = 1
456 CV_STORAGE_WRITE_TEXT = CV_STORAGE_WRITE
457 CV_STORAGE_WRITE_BINARY = CV_STORAGE_WRITE
458 CV_STORAGE_APPEND = 2
459
460 CV_NODE_NONE = 0
461 CV_NODE_INT = 1
462 CV_NODE_INTEGER = CV_NODE_INT
463 CV_NODE_REAL = 2
464 CV_NODE_FLOAT = CV_NODE_REAL
465 CV_NODE_STR = 3
466 CV_NODE_STRING = CV_NODE_STR
467 CV_NODE_REF = 4
468 CV_NODE_SEQ = 5
469 CV_NODE_MAP = 6
470 CV_NODE_TYPE_MASK = 7
471
474
475
476 CV_NODE_FLOW = 8
477 CV_NODE_USER = 16
478 CV_NODE_EMPTY = 32
479 CV_NODE_NAMED = 64
480
483
486
489
492
495
498
501
504
507
510
511 CV_NODE_SEQ_SIMPLE = 256
514
515
516
517 CvFileStorage._ownershiplevel = 0
518
522 CvFileStorage.__del__ = _CvFileStorage__del__
523
524
525
526
527
528
529
530
531
532
533
534
535
536 CV_MAX_ARR = 10
537
538 CV_NO_DEPTH_CHECK = 1
539 CV_NO_CN_CHECK = 2
540 CV_NO_SIZE_CHECK = 4
541
542
543
544
545
546
547
548
549
550
551
552
553
554 CV_RAND_UNI = 0
555 CV_RAND_NORMAL = 1
556
557
558
559
560
561
562
563
564 CV_COVAR_SCRAMBLED = 0
565 CV_COVAR_NORMAL = 1
566 CV_COVAR_USE_AVG = 2
567 CV_COVAR_SCALE = 4
568 CV_COVAR_ROWS = 8
569 CV_COVAR_COLS = 16
570
571 CV_PCA_DATA_AS_ROW = 0
572 CV_PCA_DATA_AS_COL = 1
573 CV_PCA_USE_AVG = 2
574
575
576
577
578
579
580
581 CV_REDUCE_SUM = 0
582 CV_REDUCE_AVG = 1
583 CV_REDUCE_MAX = 2
584 CV_REDUCE_MIN = 3
585
586
587
588
589
590
591
592
593
594
595
596
597
598 CV_FRONT = 1
599 CV_BACK = 0
600
601
602
603 CvGraphScanner._ownershiplevel = 0
604
608 CvGraphScanner.__del__ = _CvGraphScanner__del__
609
610
611
612
613
614
615 CV_FILLED = -1
616 CV_AA = 16
617
618
621
622
623
624
625
626
627
628
629
630 CV_ErrModeLeaf = 0
631 CV_ErrModeParent = 1
632 CV_ErrModeSilent = 2
633
634
635
636
637
638
639
640
641
642
643
644
645 CV_CPU_NONE = 0
646 CV_CPU_MMX = 1
647 CV_CPU_SSE = 2
648 CV_CPU_SSE2 = 3
649 CV_CPU_SSE3 = 4
650 CV_CPU_SSSE3 = 5
651 CV_CPU_SSE4_1 = 6
652 CV_CPU_SSE4_2 = 7
653 CV_CPU_AVX = 10
654 CV_HARDWARE_MAX_FEATURE = 255
655
656
657
658
659
660
661
662
663 _str = "\n Creates a Vec4d view on an ndarray instance."
664 if Vec4d.from_ndarray.__doc__ is None:
665 Vec4d.from_ndarray.__doc__ = _str
666 else:
667 Vec4d.from_ndarray.__doc__ += _str
668
669 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec4d that shares the same data with an ndarray instance, use:\n 'Vec4d.from_ndarray(a)' or 'asVec4d(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
670 if Vec4d.__doc__ is None:
671 Vec4d.__doc__ = _str
672 else:
673 Vec4d.__doc__ += _str
674
677 Vec4d.__getitem__ = _Vec4d__getitem__
678
681 Vec4d.__setitem__ = _Vec4d__setitem__
682
684 return self.ndarray.__getslice__(*args, **kwds)
685 Vec4d.__getslice__ = _Vec4d__getslice__
686
688 return self.ndarray.__setslice__(*args, **kwds)
689 Vec4d.__setslice__ = _Vec4d__setslice__
690
693 Vec4d.__repr__ = _Vec4d__repr__
694
695 _str = "\n Creates a Vec3d view on an ndarray instance."
696 if Vec3d.from_ndarray.__doc__ is None:
697 Vec3d.from_ndarray.__doc__ = _str
698 else:
699 Vec3d.from_ndarray.__doc__ += _str
700
701 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec3d that shares the same data with an ndarray instance, use:\n 'Vec3d.from_ndarray(a)' or 'asVec3d(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
702 if Vec3d.__doc__ is None:
703 Vec3d.__doc__ = _str
704 else:
705 Vec3d.__doc__ += _str
706
709 Vec3d.__getitem__ = _Vec3d__getitem__
710
713 Vec3d.__setitem__ = _Vec3d__setitem__
714
716 return self.ndarray.__getslice__(*args, **kwds)
717 Vec3d.__getslice__ = _Vec3d__getslice__
718
720 return self.ndarray.__setslice__(*args, **kwds)
721 Vec3d.__setslice__ = _Vec3d__setslice__
722
725 Vec3d.__repr__ = _Vec3d__repr__
726
727 _str = "\n Creates a Vec2d view on an ndarray instance."
728 if Vec2d.from_ndarray.__doc__ is None:
729 Vec2d.from_ndarray.__doc__ = _str
730 else:
731 Vec2d.from_ndarray.__doc__ += _str
732
733 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec2d that shares the same data with an ndarray instance, use:\n 'Vec2d.from_ndarray(a)' or 'asVec2d(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
734 if Vec2d.__doc__ is None:
735 Vec2d.__doc__ = _str
736 else:
737 Vec2d.__doc__ += _str
738
741 Vec2d.__getitem__ = _Vec2d__getitem__
742
745 Vec2d.__setitem__ = _Vec2d__setitem__
746
748 return self.ndarray.__getslice__(*args, **kwds)
749 Vec2d.__getslice__ = _Vec2d__getslice__
750
752 return self.ndarray.__setslice__(*args, **kwds)
753 Vec2d.__setslice__ = _Vec2d__setslice__
754
757 Vec2d.__repr__ = _Vec2d__repr__
758
759 _str = "\n Creates a Vec4f view on an ndarray instance."
760 if Vec4f.from_ndarray.__doc__ is None:
761 Vec4f.from_ndarray.__doc__ = _str
762 else:
763 Vec4f.from_ndarray.__doc__ += _str
764
765 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec4f that shares the same data with an ndarray instance, use:\n 'Vec4f.from_ndarray(a)' or 'asVec4f(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
766 if Vec4f.__doc__ is None:
767 Vec4f.__doc__ = _str
768 else:
769 Vec4f.__doc__ += _str
770
773 Vec4f.__getitem__ = _Vec4f__getitem__
774
777 Vec4f.__setitem__ = _Vec4f__setitem__
778
780 return self.ndarray.__getslice__(*args, **kwds)
781 Vec4f.__getslice__ = _Vec4f__getslice__
782
784 return self.ndarray.__setslice__(*args, **kwds)
785 Vec4f.__setslice__ = _Vec4f__setslice__
786
789 Vec4f.__repr__ = _Vec4f__repr__
790
791 _str = "\n Creates a Vec3f view on an ndarray instance."
792 if Vec3f.from_ndarray.__doc__ is None:
793 Vec3f.from_ndarray.__doc__ = _str
794 else:
795 Vec3f.from_ndarray.__doc__ += _str
796
797 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec3f that shares the same data with an ndarray instance, use:\n 'Vec3f.from_ndarray(a)' or 'asVec3f(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
798 if Vec3f.__doc__ is None:
799 Vec3f.__doc__ = _str
800 else:
801 Vec3f.__doc__ += _str
802
805 Vec3f.__getitem__ = _Vec3f__getitem__
806
809 Vec3f.__setitem__ = _Vec3f__setitem__
810
812 return self.ndarray.__getslice__(*args, **kwds)
813 Vec3f.__getslice__ = _Vec3f__getslice__
814
816 return self.ndarray.__setslice__(*args, **kwds)
817 Vec3f.__setslice__ = _Vec3f__setslice__
818
821 Vec3f.__repr__ = _Vec3f__repr__
822
823 _str = "\n Creates a Vec2f view on an ndarray instance."
824 if Vec2f.from_ndarray.__doc__ is None:
825 Vec2f.from_ndarray.__doc__ = _str
826 else:
827 Vec2f.from_ndarray.__doc__ += _str
828
829 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec2f that shares the same data with an ndarray instance, use:\n 'Vec2f.from_ndarray(a)' or 'asVec2f(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
830 if Vec2f.__doc__ is None:
831 Vec2f.__doc__ = _str
832 else:
833 Vec2f.__doc__ += _str
834
837 Vec2f.__getitem__ = _Vec2f__getitem__
838
841 Vec2f.__setitem__ = _Vec2f__setitem__
842
844 return self.ndarray.__getslice__(*args, **kwds)
845 Vec2f.__getslice__ = _Vec2f__getslice__
846
848 return self.ndarray.__setslice__(*args, **kwds)
849 Vec2f.__setslice__ = _Vec2f__setslice__
850
853 Vec2f.__repr__ = _Vec2f__repr__
854
855 _str = "\n Creates a Vec4i view on an ndarray instance."
856 if Vec4i.from_ndarray.__doc__ is None:
857 Vec4i.from_ndarray.__doc__ = _str
858 else:
859 Vec4i.from_ndarray.__doc__ += _str
860
861 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec4i that shares the same data with an ndarray instance, use:\n 'Vec4i.from_ndarray(a)' or 'asVec4i(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
862 if Vec4i.__doc__ is None:
863 Vec4i.__doc__ = _str
864 else:
865 Vec4i.__doc__ += _str
866
869 Vec4i.__getitem__ = _Vec4i__getitem__
870
873 Vec4i.__setitem__ = _Vec4i__setitem__
874
876 return self.ndarray.__getslice__(*args, **kwds)
877 Vec4i.__getslice__ = _Vec4i__getslice__
878
880 return self.ndarray.__setslice__(*args, **kwds)
881 Vec4i.__setslice__ = _Vec4i__setslice__
882
885 Vec4i.__repr__ = _Vec4i__repr__
886
887 _str = "\n Creates a Vec3i view on an ndarray instance."
888 if Vec3i.from_ndarray.__doc__ is None:
889 Vec3i.from_ndarray.__doc__ = _str
890 else:
891 Vec3i.from_ndarray.__doc__ += _str
892
893 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec3i that shares the same data with an ndarray instance, use:\n 'Vec3i.from_ndarray(a)' or 'asVec3i(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
894 if Vec3i.__doc__ is None:
895 Vec3i.__doc__ = _str
896 else:
897 Vec3i.__doc__ += _str
898
901 Vec3i.__getitem__ = _Vec3i__getitem__
902
905 Vec3i.__setitem__ = _Vec3i__setitem__
906
908 return self.ndarray.__getslice__(*args, **kwds)
909 Vec3i.__getslice__ = _Vec3i__getslice__
910
912 return self.ndarray.__setslice__(*args, **kwds)
913 Vec3i.__setslice__ = _Vec3i__setslice__
914
917 Vec3i.__repr__ = _Vec3i__repr__
918
919 _str = "\n Creates a Vec2i view on an ndarray instance."
920 if Vec2i.from_ndarray.__doc__ is None:
921 Vec2i.from_ndarray.__doc__ = _str
922 else:
923 Vec2i.from_ndarray.__doc__ += _str
924
925 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec2i that shares the same data with an ndarray instance, use:\n 'Vec2i.from_ndarray(a)' or 'asVec2i(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
926 if Vec2i.__doc__ is None:
927 Vec2i.__doc__ = _str
928 else:
929 Vec2i.__doc__ += _str
930
933 Vec2i.__getitem__ = _Vec2i__getitem__
934
937 Vec2i.__setitem__ = _Vec2i__setitem__
938
940 return self.ndarray.__getslice__(*args, **kwds)
941 Vec2i.__getslice__ = _Vec2i__getslice__
942
944 return self.ndarray.__setslice__(*args, **kwds)
945 Vec2i.__setslice__ = _Vec2i__setslice__
946
949 Vec2i.__repr__ = _Vec2i__repr__
950
951 _str = "\n Creates a Vec4w view on an ndarray instance."
952 if Vec4w.from_ndarray.__doc__ is None:
953 Vec4w.from_ndarray.__doc__ = _str
954 else:
955 Vec4w.from_ndarray.__doc__ += _str
956
957 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec4w that shares the same data with an ndarray instance, use:\n 'Vec4w.from_ndarray(a)' or 'asVec4w(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
958 if Vec4w.__doc__ is None:
959 Vec4w.__doc__ = _str
960 else:
961 Vec4w.__doc__ += _str
962
965 Vec4w.__getitem__ = _Vec4w__getitem__
966
969 Vec4w.__setitem__ = _Vec4w__setitem__
970
972 return self.ndarray.__getslice__(*args, **kwds)
973 Vec4w.__getslice__ = _Vec4w__getslice__
974
976 return self.ndarray.__setslice__(*args, **kwds)
977 Vec4w.__setslice__ = _Vec4w__setslice__
978
981 Vec4w.__repr__ = _Vec4w__repr__
982
983 _str = "\n Creates a Vec3w view on an ndarray instance."
984 if Vec3w.from_ndarray.__doc__ is None:
985 Vec3w.from_ndarray.__doc__ = _str
986 else:
987 Vec3w.from_ndarray.__doc__ += _str
988
989 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec3w that shares the same data with an ndarray instance, use:\n 'Vec3w.from_ndarray(a)' or 'asVec3w(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
990 if Vec3w.__doc__ is None:
991 Vec3w.__doc__ = _str
992 else:
993 Vec3w.__doc__ += _str
994
997 Vec3w.__getitem__ = _Vec3w__getitem__
998
1001 Vec3w.__setitem__ = _Vec3w__setitem__
1002
1004 return self.ndarray.__getslice__(*args, **kwds)
1005 Vec3w.__getslice__ = _Vec3w__getslice__
1006
1008 return self.ndarray.__setslice__(*args, **kwds)
1009 Vec3w.__setslice__ = _Vec3w__setslice__
1010
1013 Vec3w.__repr__ = _Vec3w__repr__
1014
1015 _str = "\n Creates a Vec2w view on an ndarray instance."
1016 if Vec2w.from_ndarray.__doc__ is None:
1017 Vec2w.from_ndarray.__doc__ = _str
1018 else:
1019 Vec2w.from_ndarray.__doc__ += _str
1020
1021 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec2w that shares the same data with an ndarray instance, use:\n 'Vec2w.from_ndarray(a)' or 'asVec2w(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1022 if Vec2w.__doc__ is None:
1023 Vec2w.__doc__ = _str
1024 else:
1025 Vec2w.__doc__ += _str
1026
1029 Vec2w.__getitem__ = _Vec2w__getitem__
1030
1033 Vec2w.__setitem__ = _Vec2w__setitem__
1034
1036 return self.ndarray.__getslice__(*args, **kwds)
1037 Vec2w.__getslice__ = _Vec2w__getslice__
1038
1040 return self.ndarray.__setslice__(*args, **kwds)
1041 Vec2w.__setslice__ = _Vec2w__setslice__
1042
1045 Vec2w.__repr__ = _Vec2w__repr__
1046
1047 _str = "\n Creates a Vec4s view on an ndarray instance."
1048 if Vec4s.from_ndarray.__doc__ is None:
1049 Vec4s.from_ndarray.__doc__ = _str
1050 else:
1051 Vec4s.from_ndarray.__doc__ += _str
1052
1053 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec4s that shares the same data with an ndarray instance, use:\n 'Vec4s.from_ndarray(a)' or 'asVec4s(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1054 if Vec4s.__doc__ is None:
1055 Vec4s.__doc__ = _str
1056 else:
1057 Vec4s.__doc__ += _str
1058
1061 Vec4s.__getitem__ = _Vec4s__getitem__
1062
1065 Vec4s.__setitem__ = _Vec4s__setitem__
1066
1068 return self.ndarray.__getslice__(*args, **kwds)
1069 Vec4s.__getslice__ = _Vec4s__getslice__
1070
1072 return self.ndarray.__setslice__(*args, **kwds)
1073 Vec4s.__setslice__ = _Vec4s__setslice__
1074
1077 Vec4s.__repr__ = _Vec4s__repr__
1078
1079 _str = "\n Creates a Vec3s view on an ndarray instance."
1080 if Vec3s.from_ndarray.__doc__ is None:
1081 Vec3s.from_ndarray.__doc__ = _str
1082 else:
1083 Vec3s.from_ndarray.__doc__ += _str
1084
1085 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec3s that shares the same data with an ndarray instance, use:\n 'Vec3s.from_ndarray(a)' or 'asVec3s(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1086 if Vec3s.__doc__ is None:
1087 Vec3s.__doc__ = _str
1088 else:
1089 Vec3s.__doc__ += _str
1090
1093 Vec3s.__getitem__ = _Vec3s__getitem__
1094
1097 Vec3s.__setitem__ = _Vec3s__setitem__
1098
1100 return self.ndarray.__getslice__(*args, **kwds)
1101 Vec3s.__getslice__ = _Vec3s__getslice__
1102
1104 return self.ndarray.__setslice__(*args, **kwds)
1105 Vec3s.__setslice__ = _Vec3s__setslice__
1106
1109 Vec3s.__repr__ = _Vec3s__repr__
1110
1111 _str = "\n Creates a Vec2s view on an ndarray instance."
1112 if Vec2s.from_ndarray.__doc__ is None:
1113 Vec2s.from_ndarray.__doc__ = _str
1114 else:
1115 Vec2s.from_ndarray.__doc__ += _str
1116
1117 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec2s that shares the same data with an ndarray instance, use:\n 'Vec2s.from_ndarray(a)' or 'asVec2s(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1118 if Vec2s.__doc__ is None:
1119 Vec2s.__doc__ = _str
1120 else:
1121 Vec2s.__doc__ += _str
1122
1125 Vec2s.__getitem__ = _Vec2s__getitem__
1126
1129 Vec2s.__setitem__ = _Vec2s__setitem__
1130
1132 return self.ndarray.__getslice__(*args, **kwds)
1133 Vec2s.__getslice__ = _Vec2s__getslice__
1134
1136 return self.ndarray.__setslice__(*args, **kwds)
1137 Vec2s.__setslice__ = _Vec2s__setslice__
1138
1141 Vec2s.__repr__ = _Vec2s__repr__
1142
1143 _str = "\n Creates a Vec4b view on an ndarray instance."
1144 if Vec4b.from_ndarray.__doc__ is None:
1145 Vec4b.from_ndarray.__doc__ = _str
1146 else:
1147 Vec4b.from_ndarray.__doc__ += _str
1148
1149 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec4b that shares the same data with an ndarray instance, use:\n 'Vec4b.from_ndarray(a)' or 'asVec4b(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1150 if Vec4b.__doc__ is None:
1151 Vec4b.__doc__ = _str
1152 else:
1153 Vec4b.__doc__ += _str
1154
1157 Vec4b.__getitem__ = _Vec4b__getitem__
1158
1161 Vec4b.__setitem__ = _Vec4b__setitem__
1162
1164 return self.ndarray.__getslice__(*args, **kwds)
1165 Vec4b.__getslice__ = _Vec4b__getslice__
1166
1168 return self.ndarray.__setslice__(*args, **kwds)
1169 Vec4b.__setslice__ = _Vec4b__setslice__
1170
1173 Vec4b.__repr__ = _Vec4b__repr__
1174
1175 _str = "\n Creates a Vec3b view on an ndarray instance."
1176 if Vec3b.from_ndarray.__doc__ is None:
1177 Vec3b.from_ndarray.__doc__ = _str
1178 else:
1179 Vec3b.from_ndarray.__doc__ += _str
1180
1181 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec3b that shares the same data with an ndarray instance, use:\n 'Vec3b.from_ndarray(a)' or 'asVec3b(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1182 if Vec3b.__doc__ is None:
1183 Vec3b.__doc__ = _str
1184 else:
1185 Vec3b.__doc__ += _str
1186
1189 Vec3b.__getitem__ = _Vec3b__getitem__
1190
1193 Vec3b.__setitem__ = _Vec3b__setitem__
1194
1196 return self.ndarray.__getslice__(*args, **kwds)
1197 Vec3b.__getslice__ = _Vec3b__getslice__
1198
1200 return self.ndarray.__setslice__(*args, **kwds)
1201 Vec3b.__setslice__ = _Vec3b__setslice__
1202
1205 Vec3b.__repr__ = _Vec3b__repr__
1206
1207 _str = "\n Creates a Vec2b view on an ndarray instance."
1208 if Vec2b.from_ndarray.__doc__ is None:
1209 Vec2b.from_ndarray.__doc__ = _str
1210 else:
1211 Vec2b.from_ndarray.__doc__ += _str
1212
1213 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec2b that shares the same data with an ndarray instance, use:\n 'Vec2b.from_ndarray(a)' or 'asVec2b(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1214 if Vec2b.__doc__ is None:
1215 Vec2b.__doc__ = _str
1216 else:
1217 Vec2b.__doc__ += _str
1218
1221 Vec2b.__getitem__ = _Vec2b__getitem__
1222
1225 Vec2b.__setitem__ = _Vec2b__setitem__
1226
1228 return self.ndarray.__getslice__(*args, **kwds)
1229 Vec2b.__getslice__ = _Vec2b__getslice__
1230
1232 return self.ndarray.__setslice__(*args, **kwds)
1233 Vec2b.__setslice__ = _Vec2b__setslice__
1234
1237 Vec2b.__repr__ = _Vec2b__repr__
1238
1239 _str = "\n Creates a Vec6d view on an ndarray instance."
1240 if Vec6d.from_ndarray.__doc__ is None:
1241 Vec6d.from_ndarray.__doc__ = _str
1242 else:
1243 Vec6d.from_ndarray.__doc__ += _str
1244
1245 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec6d that shares the same data with an ndarray instance, use:\n 'Vec6d.from_ndarray(a)' or 'asVec6d(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1246 if Vec6d.__doc__ is None:
1247 Vec6d.__doc__ = _str
1248 else:
1249 Vec6d.__doc__ += _str
1250
1253 Vec6d.__getitem__ = _Vec6d__getitem__
1254
1257 Vec6d.__setitem__ = _Vec6d__setitem__
1258
1260 return self.ndarray.__getslice__(*args, **kwds)
1261 Vec6d.__getslice__ = _Vec6d__getslice__
1262
1264 return self.ndarray.__setslice__(*args, **kwds)
1265 Vec6d.__setslice__ = _Vec6d__setslice__
1266
1269 Vec6d.__repr__ = _Vec6d__repr__
1270
1271 _str = "\n Creates a Vec6f view on an ndarray instance."
1272 if Vec6f.from_ndarray.__doc__ is None:
1273 Vec6f.from_ndarray.__doc__ = _str
1274 else:
1275 Vec6f.from_ndarray.__doc__ += _str
1276
1277 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Vec6f that shares the same data with an ndarray instance, use:\n 'Vec6f.from_ndarray(a)' or 'asVec6f(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1278 if Vec6f.__doc__ is None:
1279 Vec6f.__doc__ = _str
1280 else:
1281 Vec6f.__doc__ += _str
1282
1285 Vec6f.__getitem__ = _Vec6f__getitem__
1286
1289 Vec6f.__setitem__ = _Vec6f__setitem__
1290
1292 return self.ndarray.__getslice__(*args, **kwds)
1293 Vec6f.__getslice__ = _Vec6f__getslice__
1294
1296 return self.ndarray.__setslice__(*args, **kwds)
1297 Vec6f.__setslice__ = _Vec6f__setslice__
1298
1301 Vec6f.__repr__ = _Vec6f__repr__
1302
1304 return "Complexd(re=" + repr(self.re) + ", im=" + repr(self.im) + ")"
1305 Complexd.__repr__ = _Complexd__repr__
1306
1308 return "Complexf(re=" + repr(self.re) + ", im=" + repr(self.im) + ")"
1309 Complexf.__repr__ = _Complexf__repr__
1310
1312 return "Point2i(x=" + repr(self.x) + ", y=" + repr(self.y) + ")"
1313 Point2i.__repr__ = _Point2i__repr__
1314
1315
1316 _str = "\n Creates a Point2i view on an ndarray instance."
1317 if Point2i.from_ndarray.__doc__ is None:
1318 Point2i.from_ndarray.__doc__ = _str
1319 else:
1320 Point2i.from_ndarray.__doc__ += _str
1321
1322 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Point2i that shares the same data with an ndarray instance, use:\n 'Point2i.from_ndarray(a)' or 'asPoint2i(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1323 if Point2i.__doc__ is None:
1324 Point2i.__doc__ = _str
1325 else:
1326 Point2i.__doc__ += _str
1327
1330 Point2i.__getitem__ = _Point2i__getitem__
1331
1334 Point2i.__setitem__ = _Point2i__setitem__
1335
1337 return self.ndarray.__getslice__(*args, **kwds)
1338 Point2i.__getslice__ = _Point2i__getslice__
1339
1341 return self.ndarray.__setslice__(*args, **kwds)
1342 Point2i.__setslice__ = _Point2i__setslice__
1343
1345 return "Point2d(x=" + repr(self.x) + ", y=" + repr(self.y) + ")"
1346 Point2d.__repr__ = _Point2d__repr__
1347
1348
1349 _str = "\n Creates a Point2d view on an ndarray instance."
1350 if Point2d.from_ndarray.__doc__ is None:
1351 Point2d.from_ndarray.__doc__ = _str
1352 else:
1353 Point2d.from_ndarray.__doc__ += _str
1354
1355 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Point2d that shares the same data with an ndarray instance, use:\n 'Point2d.from_ndarray(a)' or 'asPoint2d(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1356 if Point2d.__doc__ is None:
1357 Point2d.__doc__ = _str
1358 else:
1359 Point2d.__doc__ += _str
1360
1363 Point2d.__getitem__ = _Point2d__getitem__
1364
1367 Point2d.__setitem__ = _Point2d__setitem__
1368
1370 return self.ndarray.__getslice__(*args, **kwds)
1371 Point2d.__getslice__ = _Point2d__getslice__
1372
1374 return self.ndarray.__setslice__(*args, **kwds)
1375 Point2d.__setslice__ = _Point2d__setslice__
1376
1378 return "Point2f(x=" + repr(self.x) + ", y=" + repr(self.y) + ")"
1379 Point2f.__repr__ = _Point2f__repr__
1380
1381
1382 _str = "\n Creates a Point2f view on an ndarray instance."
1383 if Point2f.from_ndarray.__doc__ is None:
1384 Point2f.from_ndarray.__doc__ = _str
1385 else:
1386 Point2f.from_ndarray.__doc__ += _str
1387
1388 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Point2f that shares the same data with an ndarray instance, use:\n 'Point2f.from_ndarray(a)' or 'asPoint2f(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1389 if Point2f.__doc__ is None:
1390 Point2f.__doc__ = _str
1391 else:
1392 Point2f.__doc__ += _str
1393
1396 Point2f.__getitem__ = _Point2f__getitem__
1397
1400 Point2f.__setitem__ = _Point2f__setitem__
1401
1403 return self.ndarray.__getslice__(*args, **kwds)
1404 Point2f.__getslice__ = _Point2f__getslice__
1405
1407 return self.ndarray.__setslice__(*args, **kwds)
1408 Point2f.__setslice__ = _Point2f__setslice__
1409
1410 Point = Point2i
1411 asPoint = asPoint2i
1412
1413 _str = "\n Creates a Point3d view on an ndarray instance."
1414 if Point3d.from_ndarray.__doc__ is None:
1415 Point3d.from_ndarray.__doc__ = _str
1416 else:
1417 Point3d.from_ndarray.__doc__ += _str
1418
1419 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Point3d that shares the same data with an ndarray instance, use:\n 'Point3d.from_ndarray(a)' or 'asPoint3d(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1420 if Point3d.__doc__ is None:
1421 Point3d.__doc__ = _str
1422 else:
1423 Point3d.__doc__ += _str
1424
1427 Point3d.__getitem__ = _Point3d__getitem__
1428
1431 Point3d.__setitem__ = _Point3d__setitem__
1432
1434 return self.ndarray.__getslice__(*args, **kwds)
1435 Point3d.__getslice__ = _Point3d__getslice__
1436
1438 return self.ndarray.__setslice__(*args, **kwds)
1439 Point3d.__setslice__ = _Point3d__setslice__
1440
1442 return "Point3d(x=" + repr(self.x) + ", y=" + repr(self.y) + ", z=" + repr(self.z) + ")"
1443 Point3d.__repr__ = _Point3d__repr__
1444
1445
1446 _str = "\n Creates a Point3f view on an ndarray instance."
1447 if Point3f.from_ndarray.__doc__ is None:
1448 Point3f.from_ndarray.__doc__ = _str
1449 else:
1450 Point3f.from_ndarray.__doc__ += _str
1451
1452 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Point3f that shares the same data with an ndarray instance, use:\n 'Point3f.from_ndarray(a)' or 'asPoint3f(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1453 if Point3f.__doc__ is None:
1454 Point3f.__doc__ = _str
1455 else:
1456 Point3f.__doc__ += _str
1457
1460 Point3f.__getitem__ = _Point3f__getitem__
1461
1464 Point3f.__setitem__ = _Point3f__setitem__
1465
1467 return self.ndarray.__getslice__(*args, **kwds)
1468 Point3f.__getslice__ = _Point3f__getslice__
1469
1471 return self.ndarray.__setslice__(*args, **kwds)
1472 Point3f.__setslice__ = _Point3f__setslice__
1473
1475 return "Point3f(x=" + repr(self.x) + ", y=" + repr(self.y) + ", z=" + repr(self.z) + ")"
1476 Point3f.__repr__ = _Point3f__repr__
1477
1478
1479 _str = "\n Creates a Point3i view on an ndarray instance."
1480 if Point3i.from_ndarray.__doc__ is None:
1481 Point3i.from_ndarray.__doc__ = _str
1482 else:
1483 Point3i.from_ndarray.__doc__ += _str
1484
1485 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Point3i that shares the same data with an ndarray instance, use:\n 'Point3i.from_ndarray(a)' or 'asPoint3i(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1486 if Point3i.__doc__ is None:
1487 Point3i.__doc__ = _str
1488 else:
1489 Point3i.__doc__ += _str
1490
1493 Point3i.__getitem__ = _Point3i__getitem__
1494
1497 Point3i.__setitem__ = _Point3i__setitem__
1498
1500 return self.ndarray.__getslice__(*args, **kwds)
1501 Point3i.__getslice__ = _Point3i__getslice__
1502
1504 return self.ndarray.__setslice__(*args, **kwds)
1505 Point3i.__setslice__ = _Point3i__setslice__
1506
1508 return "Point3i(x=" + repr(self.x) + ", y=" + repr(self.y) + ", z=" + repr(self.z) + ")"
1509 Point3i.__repr__ = _Point3i__repr__
1510
1511
1512 _str = "\n Creates a Size2i view on an ndarray instance."
1513 if Size2i.from_ndarray.__doc__ is None:
1514 Size2i.from_ndarray.__doc__ = _str
1515 else:
1516 Size2i.from_ndarray.__doc__ += _str
1517
1518 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Size2i that shares the same data with an ndarray instance, use:\n 'Size2i.from_ndarray(a)' or 'asSize2i(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1519 if Size2i.__doc__ is None:
1520 Size2i.__doc__ = _str
1521 else:
1522 Size2i.__doc__ += _str
1523
1526 Size2i.__getitem__ = _Size2i__getitem__
1527
1530 Size2i.__setitem__ = _Size2i__setitem__
1531
1533 return self.ndarray.__getslice__(*args, **kwds)
1534 Size2i.__getslice__ = _Size2i__getslice__
1535
1537 return self.ndarray.__setslice__(*args, **kwds)
1538 Size2i.__setslice__ = _Size2i__setslice__
1539
1541 return "Size2i(width=" + repr(self.width) + ", height=" + repr(self.height) + ")"
1542 Size2i.__repr__ = _Size2i__repr__
1543
1544
1545 _str = "\n Creates a Size2d view on an ndarray instance."
1546 if Size2d.from_ndarray.__doc__ is None:
1547 Size2d.from_ndarray.__doc__ = _str
1548 else:
1549 Size2d.from_ndarray.__doc__ += _str
1550
1551 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Size2d that shares the same data with an ndarray instance, use:\n 'Size2d.from_ndarray(a)' or 'asSize2d(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1552 if Size2d.__doc__ is None:
1553 Size2d.__doc__ = _str
1554 else:
1555 Size2d.__doc__ += _str
1556
1559 Size2d.__getitem__ = _Size2d__getitem__
1560
1563 Size2d.__setitem__ = _Size2d__setitem__
1564
1566 return self.ndarray.__getslice__(*args, **kwds)
1567 Size2d.__getslice__ = _Size2d__getslice__
1568
1570 return self.ndarray.__setslice__(*args, **kwds)
1571 Size2d.__setslice__ = _Size2d__setslice__
1572
1574 return "Size2d(width=" + repr(self.width) + ", height=" + repr(self.height) + ")"
1575 Size2d.__repr__ = _Size2d__repr__
1576
1577
1578 _str = "\n Creates a Size2f view on an ndarray instance."
1579 if Size2f.from_ndarray.__doc__ is None:
1580 Size2f.from_ndarray.__doc__ = _str
1581 else:
1582 Size2f.from_ndarray.__doc__ += _str
1583
1584 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Size2f that shares the same data with an ndarray instance, use:\n 'Size2f.from_ndarray(a)' or 'asSize2f(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1585 if Size2f.__doc__ is None:
1586 Size2f.__doc__ = _str
1587 else:
1588 Size2f.__doc__ += _str
1589
1592 Size2f.__getitem__ = _Size2f__getitem__
1593
1596 Size2f.__setitem__ = _Size2f__setitem__
1597
1599 return self.ndarray.__getslice__(*args, **kwds)
1600 Size2f.__getslice__ = _Size2f__getslice__
1601
1603 return self.ndarray.__setslice__(*args, **kwds)
1604 Size2f.__setslice__ = _Size2f__setslice__
1605
1607 return "Size2f(width=" + repr(self.width) + ", height=" + repr(self.height) + ")"
1608 Size2f.__repr__ = _Size2f__repr__
1609
1610
1611 Size = Size2i
1612
1613 _str = "\n Creates a Rect view on an ndarray instance."
1614 if Rect.from_ndarray.__doc__ is None:
1615 Rect.from_ndarray.__doc__ = _str
1616 else:
1617 Rect.from_ndarray.__doc__ += _str
1618
1619 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Rect that shares the same data with an ndarray instance, use:\n 'Rect.from_ndarray(a)' or 'asRect(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1620 if Rect.__doc__ is None:
1621 Rect.__doc__ = _str
1622 else:
1623 Rect.__doc__ += _str
1624
1627 Rect.__getitem__ = _Rect__getitem__
1628
1631 Rect.__setitem__ = _Rect__setitem__
1632
1634 return self.ndarray.__getslice__(*args, **kwds)
1635 Rect.__getslice__ = _Rect__getslice__
1636
1638 return self.ndarray.__setslice__(*args, **kwds)
1639 Rect.__setslice__ = _Rect__setslice__
1640
1642 return "Rect(x=" + repr(self.x) + ", y=" + repr(self.y) + \
1643 ", width=" + repr(self.width) + ", height=" + repr(self.height) + ")"
1644 Rect.__repr__ = _Rect__repr__
1645
1646
1647 _str = "\n Creates a Rectd view on an ndarray instance."
1648 if Rectd.from_ndarray.__doc__ is None:
1649 Rectd.from_ndarray.__doc__ = _str
1650 else:
1651 Rectd.from_ndarray.__doc__ += _str
1652
1653 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Rectd that shares the same data with an ndarray instance, use:\n 'Rectd.from_ndarray(a)' or 'asRectd(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1654 if Rectd.__doc__ is None:
1655 Rectd.__doc__ = _str
1656 else:
1657 Rectd.__doc__ += _str
1658
1661 Rectd.__getitem__ = _Rectd__getitem__
1662
1665 Rectd.__setitem__ = _Rectd__setitem__
1666
1668 return self.ndarray.__getslice__(*args, **kwds)
1669 Rectd.__getslice__ = _Rectd__getslice__
1670
1672 return self.ndarray.__setslice__(*args, **kwds)
1673 Rectd.__setslice__ = _Rectd__setslice__
1674
1676 return "Rectd(x=" + repr(self.x) + ", y=" + repr(self.y) + \
1677 ", width=" + repr(self.width) + ", height=" + repr(self.height) + ")"
1678 Rectd.__repr__ = _Rectd__repr__
1679
1680
1681 _str = "\n Creates a Rectf view on an ndarray instance."
1682 if Rectf.from_ndarray.__doc__ is None:
1683 Rectf.from_ndarray.__doc__ = _str
1684 else:
1685 Rectf.from_ndarray.__doc__ += _str
1686
1687 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Rectf that shares the same data with an ndarray instance, use:\n 'Rectf.from_ndarray(a)' or 'asRectf(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1688 if Rectf.__doc__ is None:
1689 Rectf.__doc__ = _str
1690 else:
1691 Rectf.__doc__ += _str
1692
1695 Rectf.__getitem__ = _Rectf__getitem__
1696
1699 Rectf.__setitem__ = _Rectf__setitem__
1700
1702 return self.ndarray.__getslice__(*args, **kwds)
1703 Rectf.__getslice__ = _Rectf__getslice__
1704
1706 return self.ndarray.__setslice__(*args, **kwds)
1707 Rectf.__setslice__ = _Rectf__setslice__
1708
1710 return "Rectf(x=" + repr(self.x) + ", y=" + repr(self.y) + \
1711 ", width=" + repr(self.width) + ", height=" + repr(self.height) + ")"
1712 Rectf.__repr__ = _Rectf__repr__
1713
1714
1715 _str = "\n Creates a RotatedRect view on an ndarray instance."
1716 if RotatedRect.from_ndarray.__doc__ is None:
1717 RotatedRect.from_ndarray.__doc__ = _str
1718 else:
1719 RotatedRect.from_ndarray.__doc__ += _str
1720
1721 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of RotatedRect that shares the same data with an ndarray instance, use:\n 'RotatedRect.from_ndarray(a)' or 'asRotatedRect(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1722 if RotatedRect.__doc__ is None:
1723 RotatedRect.__doc__ = _str
1724 else:
1725 RotatedRect.__doc__ += _str
1726
1729 RotatedRect.__getitem__ = _RotatedRect__getitem__
1730
1733 RotatedRect.__setitem__ = _RotatedRect__setitem__
1734
1736 return self.ndarray.__getslice__(*args, **kwds)
1737 RotatedRect.__getslice__ = _RotatedRect__getslice__
1738
1740 return self.ndarray.__setslice__(*args, **kwds)
1741 RotatedRect.__setslice__ = _RotatedRect__setslice__
1742
1744 return "RotatedRect(center=" + repr(self.center) + ", size=" + repr(self.size) + \
1745 ", angle=" + repr(self.angle) + ")"
1746 RotatedRect.__repr__ = _RotatedRect__repr__
1747
1748
1749 _str = "\n Creates a Scalar view on an ndarray instance."
1750 if Scalar.from_ndarray.__doc__ is None:
1751 Scalar.from_ndarray.__doc__ = _str
1752 else:
1753 Scalar.from_ndarray.__doc__ += _str
1754
1755 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Scalar that shares the same data with an ndarray instance, use:\n 'Scalar.from_ndarray(a)' or 'asScalar(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1756 if Scalar.__doc__ is None:
1757 Scalar.__doc__ = _str
1758 else:
1759 Scalar.__doc__ += _str
1760
1763 Scalar.__getitem__ = _Scalar__getitem__
1764
1767 Scalar.__setitem__ = _Scalar__setitem__
1768
1770 return self.ndarray.__getslice__(*args, **kwds)
1771 Scalar.__getslice__ = _Scalar__getslice__
1772
1774 return self.ndarray.__setslice__(*args, **kwds)
1775 Scalar.__setslice__ = _Scalar__setslice__
1776
1779 Scalar.__repr__ = _Scalar__repr__
1780
1781 _str = "\n Creates a Range view on an ndarray instance."
1782 if Range.from_ndarray.__doc__ is None:
1783 Range.from_ndarray.__doc__ = _str
1784 else:
1785 Range.from_ndarray.__doc__ += _str
1786
1787 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Range that shares the same data with an ndarray instance, use:\n 'Range.from_ndarray(a)' or 'asRange(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1788 if Range.__doc__ is None:
1789 Range.__doc__ = _str
1790 else:
1791 Range.__doc__ += _str
1792
1795 Range.__getitem__ = _Range__getitem__
1796
1799 Range.__setitem__ = _Range__setitem__
1800
1802 return self.ndarray.__getslice__(*args, **kwds)
1803 Range.__getslice__ = _Range__getslice__
1804
1806 return self.ndarray.__setslice__(*args, **kwds)
1807 Range.__setslice__ = _Range__setslice__
1808
1810 return "Range(start=" + repr(self.start) + ", end=" + repr(self.end) + ")"
1811 Range.__repr__ = _Range__repr__
1812
1813
1814 _str = "\n Creates a Mat view on an ndarray instance."
1815 if Mat.from_ndarray.__doc__ is None:
1816 Mat.from_ndarray.__doc__ = _str
1817 else:
1818 Mat.from_ndarray.__doc__ += _str
1819
1820 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of Mat that shares the same data with an ndarray instance, use:\n 'Mat.from_ndarray(a)' or 'asMat(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1821 if Mat.__doc__ is None:
1822 Mat.__doc__ = _str
1823 else:
1824 Mat.__doc__ += _str
1825
1828 Mat.__getitem__ = _Mat__getitem__
1829
1832 Mat.__setitem__ = _Mat__setitem__
1833
1835 return self.ndarray.__getslice__(*args, **kwds)
1836 Mat.__getslice__ = _Mat__getslice__
1837
1839 return self.ndarray.__setslice__(*args, **kwds)
1840 Mat.__setslice__ = _Mat__setslice__
1841
1843 return "Mat()" if self.empty() else "Mat(rows=" + repr(self.rows) + ", cols=" + repr(self.cols) + ", nchannels=" + repr(self.channels()) + ", depth=" + repr(self.depth()) + "):\n" + repr(self.ndarray)
1844 Mat.__repr__ = _Mat__repr__
1845
1846 -def asMat(obj, force_single_channel=False):
1847 """Converts a Python object into a Mat object.
1848
1849 If 'force_single_channel' is True, the returing Mat is single-channel. Otherwise, PyOpenCV tries to return a multi-channel Mat whenever possible.
1850 """
1851
1852 if obj is None:
1853 return Mat()
1854
1855 if isinstance(obj, _NP.ndarray):
1856 out_mat = Mat.from_ndarray(obj)
1857 else:
1858 z = obj[0]
1859 if isinstance(z, int):
1860 out_mat = Mat.from_list_of_int32(obj)
1861 elif isinstance(z, float):
1862 out_mat = Mat.from_list_of_float64(obj)
1863 else:
1864 out_mat = eval("Mat.from_list_of_%s(obj)" % z.__class__.__name__)
1865
1866 if force_single_channel and out_mat.channels() != 1:
1867 return out_mat.reshape(1, out_mat.cols if out_mat.rows==1 else out_mat.rows)
1868
1869 return out_mat
1870
1872 return "RNG(state=" + repr(self.state) + ")"
1873 RNG.__repr__ = _RNG__repr__
1874
1875
1877 return "TermCriteria(type=" + repr(self.type) + ", maxCount=" + repr(self.maxCount) + \
1878 ", epsilon=" + repr(self.epsilon) + ")"
1879 TermCriteria.__repr__ = _TermCriteria__repr__
1880
1881
1882 _str = "\n Creates a MatND view on an ndarray instance."
1883 if MatND.from_ndarray.__doc__ is None:
1884 MatND.from_ndarray.__doc__ = _str
1885 else:
1886 MatND.from_ndarray.__doc__ += _str
1887
1888 _str = "\n Property 'ndarray' provides a numpy.ndarray view on the object.\n If you create a reference to 'ndarray', you must keep the object unchanged until your reference is deleted, or Python may crash!\n \n To create an instance of MatND that shares the same data with an ndarray instance, use:\n 'MatND.from_ndarray(a)' or 'asMatND(a)\n where 'a' is an ndarray instance. Similarly, to avoid a potential Python crash, you must keep the current instance unchanged until the reference is deleted."
1889 if MatND.__doc__ is None:
1890 MatND.__doc__ = _str
1891 else:
1892 MatND.__doc__ += _str
1893
1896 MatND.__getitem__ = _MatND__getitem__
1897
1900 MatND.__setitem__ = _MatND__setitem__
1901
1903 return self.ndarray.__getslice__(*args, **kwds)
1904 MatND.__getslice__ = _MatND__getslice__
1905
1907 return self.ndarray.__setslice__(*args, **kwds)
1908 MatND.__setslice__ = _MatND__setslice__
1909
1911 return "MatND(shape=" + repr(self.ndarray.shape) + ", nchannels=" + repr(self.channels()) + ", depth=" + repr(self.depth()) + "):\n" + repr(self.ndarray)
1912 MatND.__repr__ = _MatND__repr__
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926 CV_DIST_USER = -1
1927 CV_DIST_L1 = 1
1928 CV_DIST_L2 = 2
1929 CV_DIST_C = 3
1930 CV_DIST_L12 = 4
1931 CV_DIST_FAIR = 5
1932 CV_DIST_WELSCH = 6
1933 CV_DIST_HUBER = 7
1934
1935
1936
1937 CV_HAAR_MAGIC_VAL = 0x42500000
1938 CV_TYPE_NAME_HAAR = "opencv-haar-classifier"
1939 CV_HAAR_FEATURE_MAX = 3
1940
1941
1942
1943 CvContourScanner._ownershiplevel = 0
1944
1948 CvContourScanner.__del__ = _CvContourScanner__del__
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961 CV_BLUR_NO_SCALE = 0
1962 CV_BLUR = 1
1963 CV_GAUSSIAN = 2
1964 CV_MEDIAN = 3
1965 CV_BILATERAL = 4
1966
1967 CV_SCHARR = -1
1968 CV_MAX_SOBEL_KSIZE = 7
1969
1970 CV_BGR2BGRA = 0
1971 CV_RGB2RGBA = CV_BGR2BGRA
1972
1973 CV_BGRA2BGR = 1
1974 CV_RGBA2RGB = CV_BGRA2BGR
1975
1976 CV_BGR2RGBA = 2
1977 CV_RGB2BGRA = CV_BGR2RGBA
1978
1979 CV_RGBA2BGR = 3
1980 CV_BGRA2RGB = CV_RGBA2BGR
1981
1982 CV_BGR2RGB = 4
1983 CV_RGB2BGR = CV_BGR2RGB
1984
1985 CV_BGRA2RGBA = 5
1986 CV_RGBA2BGRA = CV_BGRA2RGBA
1987
1988 CV_BGR2GRAY = 6
1989 CV_RGB2GRAY = 7
1990 CV_GRAY2BGR = 8
1991 CV_GRAY2RGB = CV_GRAY2BGR
1992 CV_GRAY2BGRA = 9
1993 CV_GRAY2RGBA = CV_GRAY2BGRA
1994 CV_BGRA2GRAY = 10
1995 CV_RGBA2GRAY = 11
1996
1997 CV_BGR2BGR565 = 12
1998 CV_RGB2BGR565 = 13
1999 CV_BGR5652BGR = 14
2000 CV_BGR5652RGB = 15
2001 CV_BGRA2BGR565 = 16
2002 CV_RGBA2BGR565 = 17
2003 CV_BGR5652BGRA = 18
2004 CV_BGR5652RGBA = 19
2005
2006 CV_GRAY2BGR565 = 20
2007 CV_BGR5652GRAY = 21
2008
2009 CV_BGR2BGR555 = 22
2010 CV_RGB2BGR555 = 23
2011 CV_BGR5552BGR = 24
2012 CV_BGR5552RGB = 25
2013 CV_BGRA2BGR555 = 26
2014 CV_RGBA2BGR555 = 27
2015 CV_BGR5552BGRA = 28
2016 CV_BGR5552RGBA = 29
2017
2018 CV_GRAY2BGR555 = 30
2019 CV_BGR5552GRAY = 31
2020
2021 CV_BGR2XYZ = 32
2022 CV_RGB2XYZ = 33
2023 CV_XYZ2BGR = 34
2024 CV_XYZ2RGB = 35
2025
2026 CV_BGR2YCrCb = 36
2027 CV_RGB2YCrCb = 37
2028 CV_YCrCb2BGR = 38
2029 CV_YCrCb2RGB = 39
2030
2031 CV_BGR2HSV = 40
2032 CV_RGB2HSV = 41
2033
2034 CV_BGR2Lab = 44
2035 CV_RGB2Lab = 45
2036
2037 CV_BayerBG2BGR = 46
2038 CV_BayerGB2BGR = 47
2039 CV_BayerRG2BGR = 48
2040 CV_BayerGR2BGR = 49
2041
2042 CV_BayerBG2RGB = CV_BayerRG2BGR
2043 CV_BayerGB2RGB = CV_BayerGR2BGR
2044 CV_BayerRG2RGB = CV_BayerBG2BGR
2045 CV_BayerGR2RGB = CV_BayerGB2BGR
2046
2047 CV_BGR2Luv = 50
2048 CV_RGB2Luv = 51
2049 CV_BGR2HLS = 52
2050 CV_RGB2HLS = 53
2051
2052 CV_HSV2BGR = 54
2053 CV_HSV2RGB = 55
2054
2055 CV_Lab2BGR = 56
2056 CV_Lab2RGB = 57
2057 CV_Luv2BGR = 58
2058 CV_Luv2RGB = 59
2059 CV_HLS2BGR = 60
2060 CV_HLS2RGB = 61
2061
2062 CV_COLORCVT_MAX = 100
2063
2064 CV_WARP_FILL_OUTLIERS = 8
2065 CV_WARP_INVERSE_MAP = 16
2066
2067 CV_SHAPE_RECT = 0
2068 CV_SHAPE_CROSS = 1
2069 CV_SHAPE_ELLIPSE = 2
2070 CV_SHAPE_CUSTOM = 100
2071
2072 CV_MOP_ERODE = 0
2073 CV_MOP_DILATE = 1
2074 CV_MOP_OPEN = 2
2075 CV_MOP_CLOSE = 3
2076 CV_MOP_GRADIENT = 4
2077 CV_MOP_TOPHAT = 5
2078 CV_MOP_BLACKHAT = 6
2079
2080 CV_TM_SQDIFF = 0
2081 CV_TM_SQDIFF_NORMED = 1
2082 CV_TM_CCORR = 2
2083 CV_TM_CCORR_NORMED = 3
2084 CV_TM_CCOEFF = 4
2085 CV_TM_CCOEFF_NORMED = 5
2086
2087
2088
2089
2090 _str = "\n 'distance_func' is a Python function declared as follows:\n def distance_func((int)a, (int)b, (object)userdata) -> (float)x\n where\n 'a' : the address of a C array of C floats representing the first vector\n 'b' : the address of a C array of C floats representing the second vector\n 'userdata' : the 'userdata' parameter of cvCalcEMD2()\n 'x' : the resultant distance"
2091 if calcEMD2.__doc__ is None:
2092 calcEMD2.__doc__ = _str
2093 else:
2094 calcEMD2.__doc__ += _str
2095
2096
2097
2098
2099
2100
2101
2106 endFindContours.__doc__ = _PE._cvEndFindContours.__doc__
2107
2108
2109
2110
2111
2112
2113 CV_LKFLOW_PYR_A_READY = 1
2114 CV_LKFLOW_PYR_B_READY = 2
2115 CV_LKFLOW_INITIAL_GUESSES = 4
2116 CV_LKFLOW_GET_MIN_EIGENVALS = 8
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131 CV_POLY_APPROX_DP = 0
2132
2133 CV_CONTOURS_MATCH_I1 = 1
2134 CV_CONTOURS_MATCH_I2 = 2
2135 CV_CONTOURS_MATCH_I3 = 3
2136
2137 CV_CONTOUR_TREES_MATCH_I1 = 1
2138
2139 CV_CLOCKWISE = 1
2140 CV_COUNTER_CLOCKWISE = 2
2141
2142 CV_COMP_CORREL = 0
2143 CV_COMP_CHISQR = 1
2144 CV_COMP_INTERSECT = 2
2145 CV_COMP_BHATTACHARYYA= 3
2146
2147 CV_VALUE = 1
2148 CV_ARRAY = 2
2149
2150 CV_DIST_MASK_3 = 3
2151 CV_DIST_MASK_5 = 5
2152 CV_DIST_MASK_PRECISE = 0
2153
2154 CV_CALIB_CB_FAST_CHECK = 8
2155
2156
2157
2158
2159
2160
2161
2162
2163 CvFeatureTree._ownershiplevel = 0
2164
2168 CvFeatureTree.__del__ = _CvFeatureTree__del__
2169
2170 CvLSH._ownershiplevel = 0
2171
2175 CvLSH.__del__ = _CvLSH__del__
2176
2177
2178
2179
2180
2181
2182
2183 CvPOSITObject._ownershiplevel = 0
2184
2188 CvPOSITObject.__del__ = _CvPOSITObject__del__
2189
2190
2191
2192
2193
2194
2195
2196 CvStereoGCState._ownershiplevel = 0
2197
2201 CvStereoGCState.__del__ = _CvStereoGCState__del__
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244 CV_DOMINANT_IPAN = 1
2245
2246
2247 CV_UNDEF_SC_PARAM = 12345
2248
2249 CV_IDP_BIRCHFIELD_PARAM1 = 25
2250 CV_IDP_BIRCHFIELD_PARAM2 = 5
2251 CV_IDP_BIRCHFIELD_PARAM3 = 12
2252 CV_IDP_BIRCHFIELD_PARAM4 = 15
2253 CV_IDP_BIRCHFIELD_PARAM5 = 25
2254
2255 CV_DISPARITY_BIRCHFIELD = 0
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307 CvConDensation._ownershiplevel = 0
2308
2312 CvConDensation.__del__ = _CvConDensation__del__
2313
2314
2315
2316
2317
2318
2319
2320 YAPE = LDetector
2321
2322
2323
2324
2325
2326 CV_BLOB_MINW = 5
2327 CV_BLOB_MINH = 5
2328
2329
2330
2331
2332
2333
2334
2335 CV_LOG2PI = (1.8378770664093454835606594728112)
2336
2337 CV_COL_SAMPLE = 0
2338 CV_ROW_SAMPLE = 1
2339
2342
2343
2344 CV_VAR_NUMERICAL = 0
2345 CV_VAR_ORDERED = 0
2346 CV_VAR_CATEGORICAL = 1
2347
2348 CV_TYPE_NAME_ML_SVM = "opencv-ml-svm"
2349 CV_TYPE_NAME_ML_KNN = "opencv-ml-knn"
2350 CV_TYPE_NAME_ML_NBAYES = "opencv-ml-bayesian"
2351 CV_TYPE_NAME_ML_EM = "opencv-ml-em"
2352 CV_TYPE_NAME_ML_BOOSTING = "opencv-ml-boost-tree"
2353 CV_TYPE_NAME_ML_TREE = "opencv-ml-tree"
2354 CV_TYPE_NAME_ML_ANN_MLP = "opencv-ml-ann-mlp"
2355 CV_TYPE_NAME_ML_CNN = "opencv-ml-cnn"
2356 CV_TYPE_NAME_ML_RTREES = "opencv-ml-random-trees"
2357
2358 CV_TRAIN_ERROR = 0
2359 CV_TEST_ERROR = 1
2360
2361
2362 CV_VAR_NUMERICAL = 0
2363 CV_VAR_ORDERED = 0
2364 CV_VAR_CATEGORICAL = 1
2365
2366 CV_TYPE_NAME_ML_SVM = "opencv-ml-svm"
2367 CV_TYPE_NAME_ML_KNN = "opencv-ml-knn"
2368 CV_TYPE_NAME_ML_NBAYES = "opencv-ml-bayesian"
2369 CV_TYPE_NAME_ML_EM = "opencv-ml-em"
2370 CV_TYPE_NAME_ML_BOOSTING = "opencv-ml-boost-tree"
2371 CV_TYPE_NAME_ML_TREE = "opencv-ml-tree"
2372 CV_TYPE_NAME_ML_ANN_MLP = "opencv-ml-ann-mlp"
2373 CV_TYPE_NAME_ML_CNN = "opencv-ml-cnn"
2374 CV_TYPE_NAME_ML_RTREES = "opencv-ml-random-trees"
2375
2376 CV_TRAIN_ERROR = 0
2377 CV_TEST_ERROR = 1
2378
2379 CV_TS_CONCENTRIC_SPHERES = 0
2380
2381 CV_COUNT = 0
2382 CV_PORTION = 1
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2411 return "CvParamGrid(min_val=" + repr(self.min_val) + ", max_val=" + repr(self.max_val) + ", step=" + repr(self.step) + ")"
2412 CvParamGrid.__repr__ = _CvParamGrid__repr__
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426 CV_WINDOW_AUTOSIZE = 1
2427
2428 CV_WND_PROP_FULLSCREEN = 0
2429 CV_WND_PROP_AUTOSIZE = 1
2430 CV_WINDOW_NORMAL = 0
2431 CV_WINDOW_FULLSCREEN = 1
2432
2433
2434
2435
2436
2437
2438
2439
2440 _windows_callbacks = {}
2441
2442
2443 CV_EVENT_MOUSEMOVE = 0
2444 CV_EVENT_LBUTTONDOWN = 1
2445 CV_EVENT_RBUTTONDOWN = 2
2446 CV_EVENT_MBUTTONDOWN = 3
2447 CV_EVENT_LBUTTONUP = 4
2448 CV_EVENT_RBUTTONUP = 5
2449 CV_EVENT_MBUTTONUP = 6
2450 CV_EVENT_LBUTTONDBLCLK = 7
2451 CV_EVENT_RBUTTONDBLCLK = 8
2452 CV_EVENT_MBUTTONDBLCLK = 9
2453
2454 CV_EVENT_FLAG_LBUTTON = 1
2455 CV_EVENT_FLAG_RBUTTON = 2
2456 CV_EVENT_FLAG_MBUTTON = 4
2457 CV_EVENT_FLAG_CTRLKEY = 8
2458 CV_EVENT_FLAG_SHIFTKEY = 16
2459 CV_EVENT_FLAG_ALTKEY = 32
2460
2461 CV_LOAD_IMAGE_UNCHANGED = -1
2462 CV_LOAD_IMAGE_GRAYSCALE = 0
2463 CV_LOAD_IMAGE_COLOR = 1
2464 CV_LOAD_IMAGE_ANYDEPTH = 2
2465
2466
2467 CV_LOAD_IMAGE_ANYCOLOR = 4
2468
2469 CV_IMWRITE_JPEG_QUALITY = 1
2470 CV_IMWRITE_PNG_COMPRESSION = 16
2471 CV_IMWRITE_PXM_BINARY = 32
2472
2473 CV_CVTIMG_FLIP = 1
2474 CV_CVTIMG_SWAP_RB = 2
2475
2476 CV_CAP_ANY = 0
2477 CV_CAP_MIL = 100
2478 CV_CAP_VFW = 200
2479 CV_CAP_V4L = 200
2480 CV_CAP_V4L2 = 200
2481 CV_CAP_FIREWARE = 300
2482 CV_CAP_FIREWIRE = 300
2483 CV_CAP_IEEE1394 = 300
2484 CV_CAP_DC1394 = 300
2485 CV_CAP_CMU1394 = 300
2486 CV_CAP_STEREO = 400
2487 CV_CAP_TYZX = 400
2488 CV_TYZX_LEFT = 400
2489 CV_TYZX_RIGHT = 401
2490 CV_TYZX_COLOR = 402
2491 CV_TYZX_Z = 403
2492 CV_CAP_QT = 500
2493 CV_CAP_UNICAP = 600
2494 CV_CAP_DSHOW = 700
2495 CV_CAP_PVAPI = 800
2496
2497 CV_CAP_PROP_POS_MSEC = 0
2498 CV_CAP_PROP_POS_FRAMES = 1
2499 CV_CAP_PROP_POS_AVI_RATIO = 2
2500 CV_CAP_PROP_FRAME_WIDTH = 3
2501 CV_CAP_PROP_FRAME_HEIGHT = 4
2502 CV_CAP_PROP_FPS = 5
2503 CV_CAP_PROP_FOURCC = 6
2504 CV_CAP_PROP_FRAME_COUNT = 7
2505 CV_CAP_PROP_FORMAT = 8
2506 CV_CAP_PROP_MODE = 9
2507 CV_CAP_PROP_BRIGHTNESS =10
2508 CV_CAP_PROP_CONTRAST =11
2509 CV_CAP_PROP_SATURATION =12
2510 CV_CAP_PROP_HUE =13
2511 CV_CAP_PROP_GAIN =14
2512 CV_CAP_PROP_EXPOSURE =15
2513 CV_CAP_PROP_CONVERT_RGB =16
2514 CV_CAP_PROP_WHITE_BALANCE =17
2515 CV_CAP_PROP_RECTIFICATION =18
2516
2518 return (((ord(c1))&255) + (((ord(c2))&255)<<8) + (((ord(c3))&255)<<16) + (((ord(c4))&255)<<24))
2519
2520 CV_FOURCC_PROMPT = -1
2521 CV_FOURCC_DEFAULT = CV_FOURCC('I', 'Y', 'U', 'V')
2522
2523
2524 -def createTrackbar(trackbar_name, window_name, value, count, on_change=None, userdata=None):
2525 if not isinstance(value, _CT.c_int):
2526 value = _CT.c_int(value)
2527
2528 result, z = _PE._cvCreateTrackbar2(trackbar_name, window_name, _CT.addressof(value), count, on_change, userdata=userdata)
2529 if result:
2530 cb_key = 'tracker-' + trackbar_name
2531 _windows_callbacks.setdefault(window_name,{})[cb_key] = z
2532 return result
2533 createTrackbar.__doc__ = _PE._cvCreateTrackbar2.__doc__
2534
2535 _str = "\n 'value' is the initial position of the trackbar. Also, if 'value' is an instance of ctypes.c_int, it keeps the current position of the trackbar at any time.\n 'on_change' can be passed with None."
2536 if createTrackbar.__doc__ is None:
2537 createTrackbar.__doc__ = _str
2538 else:
2539 createTrackbar.__doc__ += _str
2540
2543 setMouseCallback.__doc__ = _PE._cvSetMouseCallback.__doc__
2544
2549 destroyWindow.__doc__ = _PE._cvDestroyWindow.__doc__
2550
2554 destroyAllWindows.__doc__ = _PE._cvDestroyAllWindows.__doc__
2555
2556
2557
2558
2559
2560
2561
2562 import atexit
2563 atexit.register(destroyAllWindows)
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579