Package pyopencv :: Module core
[hide private]
[frames] | no frames]

Source Code for Module pyopencv.core

   1  #!/usr/bin/env python 
   2  # PyOpenCV - A Python wrapper for OpenCV 2.x using Boost.Python and NumPy 
   3   
   4  # Copyright (c) 2009, Minh-Tri Pham 
   5  # All rights reserved. 
   6   
   7  # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 
   8   
   9  #    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 
  10  #    * 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. 
  11  #    * 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. 
  12   
  13  #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. 
  14   
  15  # For further inquiries, please contact Minh-Tri Pham at pmtri80@gmail.com. 
  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  # Try to import numpy 
  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  # Try to import pyopencvext 
  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      # print("New path=",_sys_path) 
  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  # cvver.h 
  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  # cxerror.h 
  82  #============================================================================= 
  83   
  84   
  85       
  86  CV_StsOk                   =  0  # everithing is ok                 
  87  CV_StsBackTrace            = -1  # pseudo error for back trace      
  88  CV_StsError                = -2  # unknown /unspecified error       
  89  CV_StsInternal             = -3  # internal error (bad state)       
  90  CV_StsNoMem                = -4  # insufficient memory              
  91  CV_StsBadArg               = -5  # function arg/param is bad        
  92  CV_StsBadFunc              = -6  # unsupported function             
  93  CV_StsNoConv               = -7  # iter. didn't converge            
  94  CV_StsAutoTrace            = -8  # tracing                          
  95   
  96  CV_HeaderIsNull            = -9  # image header is NULL             
  97  CV_BadImageSize            = -10 # image size is invalid            
  98  CV_BadOffset               = -11 # offset is invalid                
  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 # null pointer  
 117  CV_StsVecLengthErr           = -28 # incorrect vector length  
 118  CV_StsFilterStructContentErr = -29 # incorr. filter structure content  
 119  CV_StsKernelStructContentErr = -30 # incorr. transform kernel content  
 120  CV_StsFilterOffsetErr        = -31 # incorrect filter ofset value  
 121   
 122  #extra for CV  
 123  CV_StsBadSize                = -201 # the input/output structure size is incorrect   
 124  CV_StsDivByZero              = -202 # division by zero  
 125  CV_StsInplaceNotSupported    = -203 # in-place operation is not supported  
 126  CV_StsObjectNotFound         = -204 # request can't be completed  
 127  CV_StsUnmatchedFormats       = -205 # formats of input/output arrays differ  
 128  CV_StsBadFlag                = -206 # flag is wrong or not supported    
 129  CV_StsBadPoint               = -207 # bad CvPoint   
 130  CV_StsBadMask                = -208 # bad format of mask (neither 8uC1 nor 8sC1) 
 131  CV_StsUnmatchedSizes         = -209 # sizes of input/output structures do not match  
 132  CV_StsUnsupportedFormat      = -210 # the data format/type is not supported by the function 
 133  CV_StsOutOfRange             = -211 # some of parameters are out of range  
 134  CV_StsParseError             = -212 # invalid syntax/structure of the parsed file  
 135  CV_StsNotImplemented         = -213 # the requested function/feature is not implemented  
 136  CV_StsBadMemBlock            = -214 # an allocated block has been corrupted  
 137  CV_StsAssert                 = -215 # assertion failed  
 138   
 139   
 140   
 141       
 142  #============================================================================= 
 143  # cxtypes.h 
 144  #============================================================================= 
 145   
 146   
 147       
 148  #----------------------------------------------------------------------------- 
 149  # Common macros and inline functions 
 150  #----------------------------------------------------------------------------- 
 151   
 152  CV_PI = _Math.pi 
 153  CV_LOG2 = 0.69314718055994530941723212145818 
 154   
 155       
 156  #----------------------------------------------------------------------------- 
 157  # Random number generation 
 158  #----------------------------------------------------------------------------- 
 159   
 160       
 161       
 162  #----------------------------------------------------------------------------- 
 163  # Matrix type (CvMat)  
 164  #----------------------------------------------------------------------------- 
 165   
 166  # Matrix type (CvMat) 
 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   
180 -def CV_MAKETYPE(depth,cn):
181 return ((depth) + (((cn)-1) << CV_CN_SHIFT))
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)
223 -def CV_MAT_CN(flags):
224 return ((((flags) & CV_MAT_CN_MASK) >> CV_CN_SHIFT) + 1)
225 CV_MAT_DEPTH_MASK = (CV_DEPTH_MAX - 1)
226 -def CV_MAT_DEPTH(flags):
227 return ((flags) & CV_MAT_DEPTH_MASK)
228 CV_MAT_TYPE_MASK = (CV_DEPTH_MAX*CV_CN_MAX - 1)
229 -def CV_MAT_TYPE(flags):
230 ((flags) & CV_MAT_TYPE_MASK)
231 CV_MAT_CONT_FLAG_SHIFT = 9 232 CV_MAT_CONT_FLAG = (1 << CV_MAT_CONT_FLAG_SHIFT)
233 -def CV_IS_MAT_CONT(flags):
234 return ((flags) & CV_MAT_CONT_FLAG)
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)
238 -def CV_IS_TEMP_MAT(flags):
239 return ((flags) & CV_MAT_TEMP_FLAG)
240 241 CV_MAGIC_MASK = 0xFFFF0000 242 CV_MAT_MAGIC_VAL = 0x42420000 243 CV_TYPE_NAME_MAT = "opencv-matrix" 244 245 246 #----------------------------------------------------------------------------- 247 # Multi-dimensional dense array (CvMatND) 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 # Multi-dimensional sparse array (CvSparseMat) 259 #----------------------------------------------------------------------------- 260 261 CV_SPARSE_MAT_MAGIC_VAL = 0x42440000 262 CV_TYPE_NAME_SPARSE_MAT = "opencv-sparse-matrix" 263 264 265 266 #----------------------------------------------------------------------------- 267 # Other supplementary data type definitions 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
279 -def _CvRect__repr__(self):
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
285 -def _CvSize__repr__(self):
286 return "CvSize(width=" + repr(self.width) + ", height=" + repr(self.height) + ")"
287 CvSize.__repr__ = _CvSize__repr__ 288 289
290 -def _CvScalar__repr__(self):
291 return "CvScalar(" + self.ndarray.__str__() + ")"
292 CvScalar.__repr__ = _CvScalar__repr__ 293 294
295 -def _CvPoint__repr__(self):
296 return "CvPoint(x=" + repr(self.x) + ", y=" + repr(self.y) + ")"
297 CvPoint.__repr__ = _CvPoint__repr__ 298 299
300 -def _CvPoint2D32f__repr__(self):
301 return "CvPoint2D32f(x=" + repr(self.x) + ", y=" + repr(self.y) + ")"
302 CvPoint2D32f.__repr__ = _CvPoint2D32f__repr__ 303 304
305 -def _CvPoint2D64f__repr__(self):
306 return "CvPoint2D64f(x=" + repr(self.x) + ", y=" + repr(self.y) + ")"
307 CvPoint2D64f.__repr__ = _CvPoint2D64f__repr__ 308 309
310 -def _CvPoint3D32f__repr__(self):
311 return "CvPoint3D32f(x=" + repr(self.x) + ", y=" + repr(self.y) + ", z=" + repr(self.z) + ")"
312 CvPoint3D32f.__repr__ = _CvPoint3D32f__repr__ 313 314
315 -def _CvPoint3D64f__repr__(self):
316 return "CvPoint3D64f(x=" + repr(self.x) + ", y=" + repr(self.y) + ", z=" + repr(self.z) + ")"
317 CvPoint3D64f.__repr__ = _CvPoint3D64f__repr__ 318 319
320 -def _CvBox2D__repr__(self):
321 return "CvBox2D(center=" + repr(self.center) + ", size=" + repr(self.size) + \ 322 ", angle=" + repr(self.angle) + ")"
323 CvBox2D.__repr__ = _CvBox2D__repr__ 324 325
326 -def _CvTermCriteria__repr__(self):
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
332 -def _CvSlice__repr__(self):
333 return "CvSlice(start=" + repr(self.start_index) + ", end=" + repr(self.end_index) + ")"
334 CvSlice.__repr__ = _CvSlice__repr__ 335 336 337 #----------------------------------------------------------------------------- 338 # Dynamic Data structures 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 # Checks whether the element pointed by ptr belongs to a set or not
350 -def CV_IS_SET_ELEM(ptr):
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
359 -def _CvMemStorage__del__(self):
360 if self._ownershiplevel==1: 361 _PE._cvReleaseMemStorage(self)
362 CvMemStorage.__del__ = _CvMemStorage__del__ 363 364 #----------------------------------------------------------------------------- 365 # Sequence types 366 #----------------------------------------------------------------------------- 367 368 #Viji Periapoilan 5/21/2007(start) 369 370 CV_SEQ_MAGIC_VAL = 0x42990000 371 372 #define CV_IS_SEQ(seq) # ((seq) != NULL && (((CvSeq*)(seq))->flags & CV_MAGIC_MASK) == CV_SEQ_MAGIC_VAL) 373 374 CV_SET_MAGIC_VAL = 0x42980000 375 #define CV_IS_SET(set) # ((set) != NULL && (((CvSeq*)(set))->flags & CV_MAGIC_MASK) == CV_SET_MAGIC_VAL) 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 #/* (x,y) */ 380 CV_SEQ_ELTYPE_CODE = CV_8UC1 #/* freeman code: 0..7 */ 381 CV_SEQ_ELTYPE_GENERIC = 0 382 CV_SEQ_ELTYPE_PTR = CV_USRTYPE1 383 CV_SEQ_ELTYPE_PPOINT = CV_SEQ_ELTYPE_PTR #/* &(x,y) */ 384 CV_SEQ_ELTYPE_INDEX = CV_32SC1 #/* #(x,y) */ 385 CV_SEQ_ELTYPE_GRAPH_EDGE = 0 #/* &next_o, &next_d, &vtx_o, &vtx_d */ 386 CV_SEQ_ELTYPE_GRAPH_VERTEX = 0 #/* first_edge, &(x,y) */ 387 CV_SEQ_ELTYPE_TRIAN_ATR = 0 #/* vertex of the binary tree */ 388 CV_SEQ_ELTYPE_CONNECTED_COMP= 0 #/* connected component */ 389 CV_SEQ_ELTYPE_POINT3D = CV_32FC3 #/* (x,y,z) */ 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 # types of sequences 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 #Viji Periapoilan 5/21/2007(end) 401 402 # types of sparse sequences (sets) 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 # flags for curves 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 # flags for graphs 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 # point sets 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 # chain-coded curves 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 # binary tree for the contour 433 CV_SEQ_POLYGON_TREE = (CV_SEQ_KIND_BIN_TREE | CV_SEQ_ELTYPE_TRIAN_ATR) 434 435 # sequence of the connected components 436 CV_SEQ_CONNECTED_COMP = (CV_SEQ_KIND_GENERIC | CV_SEQ_ELTYPE_CONNECTED_COMP) 437 438 # sequence of the integer numbers 439 CV_SEQ_INDEX = (CV_SEQ_KIND_GENERIC | CV_SEQ_ELTYPE_INDEX) 440 441 # CV_SEQ_ELTYPE( seq ) = ((seq)->flags & CV_SEQ_ELTYPE_MASK) 442 # CV_SEQ_KIND( seq ) = ((seq)->flags & CV_SEQ_KIND_MASK ) 443
444 -def CV_GET_SEQ_ELEM(TYPE, seq, index):
445 result = cvGetSeqElem(seq, index) 446 return cast(result, POINTER(TYPE))
447 448 449 450 #----------------------------------------------------------------------------- 451 # Data structures for persistence (a.k.a serialization) functionality 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 # not used 468 CV_NODE_SEQ = 5 469 CV_NODE_MAP = 6 470 CV_NODE_TYPE_MASK = 7 471
472 -def CV_NODE_TYPE(flags):
473 return flags & CV_NODE_TYPE_MASK
474 475 # file node flags 476 CV_NODE_FLOW = 8 # used only for writing structures to YAML format 477 CV_NODE_USER = 16 478 CV_NODE_EMPTY = 32 479 CV_NODE_NAMED = 64 480
481 -def CV_NODE_IS_INT(flags):
482 return CV_NODE_TYPE(flags) == CV_NODE_INT
483
484 -def CV_NODE_IS_REAL(flags):
485 return CV_NODE_TYPE(flags) == CV_NODE_REAL
486
487 -def CV_NODE_IS_STRING(flags):
488 return CV_NODE_TYPE(flags) == CV_NODE_STRING
489
490 -def CV_NODE_IS_SEQ(flags):
491 return CV_NODE_TYPE(flags) == CV_NODE_SEQ
492
493 -def CV_NODE_IS_MAP(flags):
494 return CV_NODE_TYPE(flags) == CV_NODE_MAP
495
496 -def CV_NODE_IS_COLLECTION(flags):
497 return CV_NODE_TYPE(flags) >= CV_NODE_SEQ
498
499 -def CV_NODE_IS_FLOW(flags):
500 return bool(flags & CV_NODE_FLOW)
501
502 -def CV_NODE_IS_EMPTY(flags):
503 return bool(flags & CV_NODE_EMPTY)
504
505 -def CV_NODE_IS_USER(flags):
506 return bool(flags & CV_NODE_USER)
507
508 -def CV_NODE_HAS_NAME(flags):
509 return bool(flags & CV_NODE_NAMED)
510 511 CV_NODE_SEQ_SIMPLE = 256
512 -def CV_NODE_SEQ_IS_SIMPLE(seq):
513 return bool(seq[0].flags & CV_NODE_SEQ_SIMPLE)
514 515 516 517 CvFileStorage._ownershiplevel = 0 518
519 -def _CvFileStorage__del__(self):
520 if self._ownershiplevel==1: 521 _PE._cvReleaseFileStorage(self)
522 CvFileStorage.__del__ = _CvFileStorage__del__ 523 524 #============================================================================= 525 # cxcore.h 526 #============================================================================= 527 528 529 530 #----------------------------------------------------------------------------- 531 # Array allocation, deallocation, initialization and access to elements 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 # Arithmetic, logic and comparison operations 545 #----------------------------------------------------------------------------- 546 547 548 549 #----------------------------------------------------------------------------- 550 # Math operations 551 #----------------------------------------------------------------------------- 552 553 554 CV_RAND_UNI = 0 555 CV_RAND_NORMAL = 1 556 557 558 559 #----------------------------------------------------------------------------- 560 # Matrix operations 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 # Array Statistics 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 # Discrete Linear Transforms and Related Functions 589 #----------------------------------------------------------------------------- 590 591 592 593 #----------------------------------------------------------------------------- 594 # Dynamic Data Structure 595 #----------------------------------------------------------------------------- 596 597 598 CV_FRONT = 1 599 CV_BACK = 0 600 601 602 603 CvGraphScanner._ownershiplevel = 0 604
605 -def _CvGraphScanner__del__(self):
606 if self._ownershiplevel==1: 607 _PE._cvReleaseGraphScanner(self)
608 CvGraphScanner.__del__ = _CvGraphScanner__del__ 609 610 #----------------------------------------------------------------------------- 611 # Drawing Functions 612 #----------------------------------------------------------------------------- 613 614 615 CV_FILLED = -1 616 CV_AA = 16 617 618 # Constructs a color value
619 -def CV_RGB(r, g, b):
620 return Scalar(b, g, r)
621 622 623 624 #----------------------------------------------------------------------------- 625 # System Functions 626 #----------------------------------------------------------------------------- 627 628 629 # Sets the error mode 630 CV_ErrModeLeaf = 0 631 CV_ErrModeParent = 1 632 CV_ErrModeSilent = 2 633 634 635 636 #----------------------------------------------------------------------------- 637 # Data Persistence 638 #----------------------------------------------------------------------------- 639 640 641 #----------------------------------------------------------------------------- 642 # CPU capabilities 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 # cxcore.hpp 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
675 -def _Vec4d__getitem__(self, *args, **kwds):
676 return self.ndarray.__getitem__(*args, **kwds)
677 Vec4d.__getitem__ = _Vec4d__getitem__ 678
679 -def _Vec4d__setitem__(self, *args, **kwds):
680 return self.ndarray.__setitem__(*args, **kwds)
681 Vec4d.__setitem__ = _Vec4d__setitem__ 682
683 -def _Vec4d__getslice__(self, *args, **kwds):
684 return self.ndarray.__getslice__(*args, **kwds)
685 Vec4d.__getslice__ = _Vec4d__getslice__ 686
687 -def _Vec4d__setslice__(self, *args, **kwds):
688 return self.ndarray.__setslice__(*args, **kwds)
689 Vec4d.__setslice__ = _Vec4d__setslice__ 690
691 -def _Vec4d__repr__(self):
692 return "Vec4d(" + self.ndarray.__str__() + ")"
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
707 -def _Vec3d__getitem__(self, *args, **kwds):
708 return self.ndarray.__getitem__(*args, **kwds)
709 Vec3d.__getitem__ = _Vec3d__getitem__ 710
711 -def _Vec3d__setitem__(self, *args, **kwds):
712 return self.ndarray.__setitem__(*args, **kwds)
713 Vec3d.__setitem__ = _Vec3d__setitem__ 714
715 -def _Vec3d__getslice__(self, *args, **kwds):
716 return self.ndarray.__getslice__(*args, **kwds)
717 Vec3d.__getslice__ = _Vec3d__getslice__ 718
719 -def _Vec3d__setslice__(self, *args, **kwds):
720 return self.ndarray.__setslice__(*args, **kwds)
721 Vec3d.__setslice__ = _Vec3d__setslice__ 722
723 -def _Vec3d__repr__(self):
724 return "Vec3d(" + self.ndarray.__str__() + ")"
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
739 -def _Vec2d__getitem__(self, *args, **kwds):
740 return self.ndarray.__getitem__(*args, **kwds)
741 Vec2d.__getitem__ = _Vec2d__getitem__ 742
743 -def _Vec2d__setitem__(self, *args, **kwds):
744 return self.ndarray.__setitem__(*args, **kwds)
745 Vec2d.__setitem__ = _Vec2d__setitem__ 746
747 -def _Vec2d__getslice__(self, *args, **kwds):
748 return self.ndarray.__getslice__(*args, **kwds)
749 Vec2d.__getslice__ = _Vec2d__getslice__ 750
751 -def _Vec2d__setslice__(self, *args, **kwds):
752 return self.ndarray.__setslice__(*args, **kwds)
753 Vec2d.__setslice__ = _Vec2d__setslice__ 754
755 -def _Vec2d__repr__(self):
756 return "Vec2d(" + self.ndarray.__str__() + ")"
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
771 -def _Vec4f__getitem__(self, *args, **kwds):
772 return self.ndarray.__getitem__(*args, **kwds)
773 Vec4f.__getitem__ = _Vec4f__getitem__ 774
775 -def _Vec4f__setitem__(self, *args, **kwds):
776 return self.ndarray.__setitem__(*args, **kwds)
777 Vec4f.__setitem__ = _Vec4f__setitem__ 778
779 -def _Vec4f__getslice__(self, *args, **kwds):
780 return self.ndarray.__getslice__(*args, **kwds)
781 Vec4f.__getslice__ = _Vec4f__getslice__ 782
783 -def _Vec4f__setslice__(self, *args, **kwds):
784 return self.ndarray.__setslice__(*args, **kwds)
785 Vec4f.__setslice__ = _Vec4f__setslice__ 786
787 -def _Vec4f__repr__(self):
788 return "Vec4f(" + self.ndarray.__str__() + ")"
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
803 -def _Vec3f__getitem__(self, *args, **kwds):
804 return self.ndarray.__getitem__(*args, **kwds)
805 Vec3f.__getitem__ = _Vec3f__getitem__ 806
807 -def _Vec3f__setitem__(self, *args, **kwds):
808 return self.ndarray.__setitem__(*args, **kwds)
809 Vec3f.__setitem__ = _Vec3f__setitem__ 810
811 -def _Vec3f__getslice__(self, *args, **kwds):
812 return self.ndarray.__getslice__(*args, **kwds)
813 Vec3f.__getslice__ = _Vec3f__getslice__ 814
815 -def _Vec3f__setslice__(self, *args, **kwds):
816 return self.ndarray.__setslice__(*args, **kwds)
817 Vec3f.__setslice__ = _Vec3f__setslice__ 818
819 -def _Vec3f__repr__(self):
820 return "Vec3f(" + self.ndarray.__str__() + ")"
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
835 -def _Vec2f__getitem__(self, *args, **kwds):
836 return self.ndarray.__getitem__(*args, **kwds)
837 Vec2f.__getitem__ = _Vec2f__getitem__ 838
839 -def _Vec2f__setitem__(self, *args, **kwds):
840 return self.ndarray.__setitem__(*args, **kwds)
841 Vec2f.__setitem__ = _Vec2f__setitem__ 842
843 -def _Vec2f__getslice__(self, *args, **kwds):
844 return self.ndarray.__getslice__(*args, **kwds)
845 Vec2f.__getslice__ = _Vec2f__getslice__ 846
847 -def _Vec2f__setslice__(self, *args, **kwds):
848 return self.ndarray.__setslice__(*args, **kwds)
849 Vec2f.__setslice__ = _Vec2f__setslice__ 850
851 -def _Vec2f__repr__(self):
852 return "Vec2f(" + self.ndarray.__str__() + ")"
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
867 -def _Vec4i__getitem__(self, *args, **kwds):
868 return self.ndarray.__getitem__(*args, **kwds)
869 Vec4i.__getitem__ = _Vec4i__getitem__ 870
871 -def _Vec4i__setitem__(self, *args, **kwds):
872 return self.ndarray.__setitem__(*args, **kwds)
873 Vec4i.__setitem__ = _Vec4i__setitem__ 874
875 -def _Vec4i__getslice__(self, *args, **kwds):
876 return self.ndarray.__getslice__(*args, **kwds)
877 Vec4i.__getslice__ = _Vec4i__getslice__ 878
879 -def _Vec4i__setslice__(self, *args, **kwds):
880 return self.ndarray.__setslice__(*args, **kwds)
881 Vec4i.__setslice__ = _Vec4i__setslice__ 882
883 -def _Vec4i__repr__(self):
884 return "Vec4i(" + self.ndarray.__str__() + ")"
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
899 -def _Vec3i__getitem__(self, *args, **kwds):
900 return self.ndarray.__getitem__(*args, **kwds)
901 Vec3i.__getitem__ = _Vec3i__getitem__ 902
903 -def _Vec3i__setitem__(self, *args, **kwds):
904 return self.ndarray.__setitem__(*args, **kwds)
905 Vec3i.__setitem__ = _Vec3i__setitem__ 906
907 -def _Vec3i__getslice__(self, *args, **kwds):
908 return self.ndarray.__getslice__(*args, **kwds)
909 Vec3i.__getslice__ = _Vec3i__getslice__ 910
911 -def _Vec3i__setslice__(self, *args, **kwds):
912 return self.ndarray.__setslice__(*args, **kwds)
913 Vec3i.__setslice__ = _Vec3i__setslice__ 914
915 -def _Vec3i__repr__(self):
916 return "Vec3i(" + self.ndarray.__str__() + ")"
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
931 -def _Vec2i__getitem__(self, *args, **kwds):
932 return self.ndarray.__getitem__(*args, **kwds)
933 Vec2i.__getitem__ = _Vec2i__getitem__ 934
935 -def _Vec2i__setitem__(self, *args, **kwds):
936 return self.ndarray.__setitem__(*args, **kwds)
937 Vec2i.__setitem__ = _Vec2i__setitem__ 938
939 -def _Vec2i__getslice__(self, *args, **kwds):
940 return self.ndarray.__getslice__(*args, **kwds)
941 Vec2i.__getslice__ = _Vec2i__getslice__ 942
943 -def _Vec2i__setslice__(self, *args, **kwds):
944 return self.ndarray.__setslice__(*args, **kwds)
945 Vec2i.__setslice__ = _Vec2i__setslice__ 946
947 -def _Vec2i__repr__(self):
948 return "Vec2i(" + self.ndarray.__str__() + ")"
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
963 -def _Vec4w__getitem__(self, *args, **kwds):
964 return self.ndarray.__getitem__(*args, **kwds)
965 Vec4w.__getitem__ = _Vec4w__getitem__ 966
967 -def _Vec4w__setitem__(self, *args, **kwds):
968 return self.ndarray.__setitem__(*args, **kwds)
969 Vec4w.__setitem__ = _Vec4w__setitem__ 970
971 -def _Vec4w__getslice__(self, *args, **kwds):
972 return self.ndarray.__getslice__(*args, **kwds)
973 Vec4w.__getslice__ = _Vec4w__getslice__ 974
975 -def _Vec4w__setslice__(self, *args, **kwds):
976 return self.ndarray.__setslice__(*args, **kwds)
977 Vec4w.__setslice__ = _Vec4w__setslice__ 978
979 -def _Vec4w__repr__(self):
980 return "Vec4w(" + self.ndarray.__str__() + ")"
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
995 -def _Vec3w__getitem__(self, *args, **kwds):
996 return self.ndarray.__getitem__(*args, **kwds)
997 Vec3w.__getitem__ = _Vec3w__getitem__ 998
999 -def _Vec3w__setitem__(self, *args, **kwds):
1000 return self.ndarray.__setitem__(*args, **kwds)
1001 Vec3w.__setitem__ = _Vec3w__setitem__ 1002
1003 -def _Vec3w__getslice__(self, *args, **kwds):
1004 return self.ndarray.__getslice__(*args, **kwds)
1005 Vec3w.__getslice__ = _Vec3w__getslice__ 1006
1007 -def _Vec3w__setslice__(self, *args, **kwds):
1008 return self.ndarray.__setslice__(*args, **kwds)
1009 Vec3w.__setslice__ = _Vec3w__setslice__ 1010
1011 -def _Vec3w__repr__(self):
1012 return "Vec3w(" + self.ndarray.__str__() + ")"
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
1027 -def _Vec2w__getitem__(self, *args, **kwds):
1028 return self.ndarray.__getitem__(*args, **kwds)
1029 Vec2w.__getitem__ = _Vec2w__getitem__ 1030
1031 -def _Vec2w__setitem__(self, *args, **kwds):
1032 return self.ndarray.__setitem__(*args, **kwds)
1033 Vec2w.__setitem__ = _Vec2w__setitem__ 1034
1035 -def _Vec2w__getslice__(self, *args, **kwds):
1036 return self.ndarray.__getslice__(*args, **kwds)
1037 Vec2w.__getslice__ = _Vec2w__getslice__ 1038
1039 -def _Vec2w__setslice__(self, *args, **kwds):
1040 return self.ndarray.__setslice__(*args, **kwds)
1041 Vec2w.__setslice__ = _Vec2w__setslice__ 1042
1043 -def _Vec2w__repr__(self):
1044 return "Vec2w(" + self.ndarray.__str__() + ")"
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
1059 -def _Vec4s__getitem__(self, *args, **kwds):
1060 return self.ndarray.__getitem__(*args, **kwds)
1061 Vec4s.__getitem__ = _Vec4s__getitem__ 1062
1063 -def _Vec4s__setitem__(self, *args, **kwds):
1064 return self.ndarray.__setitem__(*args, **kwds)
1065 Vec4s.__setitem__ = _Vec4s__setitem__ 1066
1067 -def _Vec4s__getslice__(self, *args, **kwds):
1068 return self.ndarray.__getslice__(*args, **kwds)
1069 Vec4s.__getslice__ = _Vec4s__getslice__ 1070
1071 -def _Vec4s__setslice__(self, *args, **kwds):
1072 return self.ndarray.__setslice__(*args, **kwds)
1073 Vec4s.__setslice__ = _Vec4s__setslice__ 1074
1075 -def _Vec4s__repr__(self):
1076 return "Vec4s(" + self.ndarray.__str__() + ")"
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
1091 -def _Vec3s__getitem__(self, *args, **kwds):
1092 return self.ndarray.__getitem__(*args, **kwds)
1093 Vec3s.__getitem__ = _Vec3s__getitem__ 1094
1095 -def _Vec3s__setitem__(self, *args, **kwds):
1096 return self.ndarray.__setitem__(*args, **kwds)
1097 Vec3s.__setitem__ = _Vec3s__setitem__ 1098
1099 -def _Vec3s__getslice__(self, *args, **kwds):
1100 return self.ndarray.__getslice__(*args, **kwds)
1101 Vec3s.__getslice__ = _Vec3s__getslice__ 1102
1103 -def _Vec3s__setslice__(self, *args, **kwds):
1104 return self.ndarray.__setslice__(*args, **kwds)
1105 Vec3s.__setslice__ = _Vec3s__setslice__ 1106
1107 -def _Vec3s__repr__(self):
1108 return "Vec3s(" + self.ndarray.__str__() + ")"
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
1123 -def _Vec2s__getitem__(self, *args, **kwds):
1124 return self.ndarray.__getitem__(*args, **kwds)
1125 Vec2s.__getitem__ = _Vec2s__getitem__ 1126
1127 -def _Vec2s__setitem__(self, *args, **kwds):
1128 return self.ndarray.__setitem__(*args, **kwds)
1129 Vec2s.__setitem__ = _Vec2s__setitem__ 1130
1131 -def _Vec2s__getslice__(self, *args, **kwds):
1132 return self.ndarray.__getslice__(*args, **kwds)
1133 Vec2s.__getslice__ = _Vec2s__getslice__ 1134
1135 -def _Vec2s__setslice__(self, *args, **kwds):
1136 return self.ndarray.__setslice__(*args, **kwds)
1137 Vec2s.__setslice__ = _Vec2s__setslice__ 1138
1139 -def _Vec2s__repr__(self):
1140 return "Vec2s(" + self.ndarray.__str__() + ")"
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
1155 -def _Vec4b__getitem__(self, *args, **kwds):
1156 return self.ndarray.__getitem__(*args, **kwds)
1157 Vec4b.__getitem__ = _Vec4b__getitem__ 1158
1159 -def _Vec4b__setitem__(self, *args, **kwds):
1160 return self.ndarray.__setitem__(*args, **kwds)
1161 Vec4b.__setitem__ = _Vec4b__setitem__ 1162
1163 -def _Vec4b__getslice__(self, *args, **kwds):
1164 return self.ndarray.__getslice__(*args, **kwds)
1165 Vec4b.__getslice__ = _Vec4b__getslice__ 1166
1167 -def _Vec4b__setslice__(self, *args, **kwds):
1168 return self.ndarray.__setslice__(*args, **kwds)
1169 Vec4b.__setslice__ = _Vec4b__setslice__ 1170
1171 -def _Vec4b__repr__(self):
1172 return "Vec4b(" + self.ndarray.__str__() + ")"
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
1187 -def _Vec3b__getitem__(self, *args, **kwds):
1188 return self.ndarray.__getitem__(*args, **kwds)
1189 Vec3b.__getitem__ = _Vec3b__getitem__ 1190
1191 -def _Vec3b__setitem__(self, *args, **kwds):
1192 return self.ndarray.__setitem__(*args, **kwds)
1193 Vec3b.__setitem__ = _Vec3b__setitem__ 1194
1195 -def _Vec3b__getslice__(self, *args, **kwds):
1196 return self.ndarray.__getslice__(*args, **kwds)
1197 Vec3b.__getslice__ = _Vec3b__getslice__ 1198
1199 -def _Vec3b__setslice__(self, *args, **kwds):
1200 return self.ndarray.__setslice__(*args, **kwds)
1201 Vec3b.__setslice__ = _Vec3b__setslice__ 1202
1203 -def _Vec3b__repr__(self):
1204 return "Vec3b(" + self.ndarray.__str__() + ")"
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
1219 -def _Vec2b__getitem__(self, *args, **kwds):
1220 return self.ndarray.__getitem__(*args, **kwds)
1221 Vec2b.__getitem__ = _Vec2b__getitem__ 1222
1223 -def _Vec2b__setitem__(self, *args, **kwds):
1224 return self.ndarray.__setitem__(*args, **kwds)
1225 Vec2b.__setitem__ = _Vec2b__setitem__ 1226
1227 -def _Vec2b__getslice__(self, *args, **kwds):
1228 return self.ndarray.__getslice__(*args, **kwds)
1229 Vec2b.__getslice__ = _Vec2b__getslice__ 1230
1231 -def _Vec2b__setslice__(self, *args, **kwds):
1232 return self.ndarray.__setslice__(*args, **kwds)
1233 Vec2b.__setslice__ = _Vec2b__setslice__ 1234
1235 -def _Vec2b__repr__(self):
1236 return "Vec2b(" + self.ndarray.__str__() + ")"
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
1251 -def _Vec6d__getitem__(self, *args, **kwds):
1252 return self.ndarray.__getitem__(*args, **kwds)
1253 Vec6d.__getitem__ = _Vec6d__getitem__ 1254
1255 -def _Vec6d__setitem__(self, *args, **kwds):
1256 return self.ndarray.__setitem__(*args, **kwds)
1257 Vec6d.__setitem__ = _Vec6d__setitem__ 1258
1259 -def _Vec6d__getslice__(self, *args, **kwds):
1260 return self.ndarray.__getslice__(*args, **kwds)
1261 Vec6d.__getslice__ = _Vec6d__getslice__ 1262
1263 -def _Vec6d__setslice__(self, *args, **kwds):
1264 return self.ndarray.__setslice__(*args, **kwds)
1265 Vec6d.__setslice__ = _Vec6d__setslice__ 1266
1267 -def _Vec6d__repr__(self):
1268 return "Vec6d(" + self.ndarray.__str__() + ")"
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
1283 -def _Vec6f__getitem__(self, *args, **kwds):
1284 return self.ndarray.__getitem__(*args, **kwds)
1285 Vec6f.__getitem__ = _Vec6f__getitem__ 1286
1287 -def _Vec6f__setitem__(self, *args, **kwds):
1288 return self.ndarray.__setitem__(*args, **kwds)
1289 Vec6f.__setitem__ = _Vec6f__setitem__ 1290
1291 -def _Vec6f__getslice__(self, *args, **kwds):
1292 return self.ndarray.__getslice__(*args, **kwds)
1293 Vec6f.__getslice__ = _Vec6f__getslice__ 1294
1295 -def _Vec6f__setslice__(self, *args, **kwds):
1296 return self.ndarray.__setslice__(*args, **kwds)
1297 Vec6f.__setslice__ = _Vec6f__setslice__ 1298
1299 -def _Vec6f__repr__(self):
1300 return "Vec6f(" + self.ndarray.__str__() + ")"
1301 Vec6f.__repr__ = _Vec6f__repr__ 1302
1303 -def _Complexd__repr__(self):
1304 return "Complexd(re=" + repr(self.re) + ", im=" + repr(self.im) + ")"
1305 Complexd.__repr__ = _Complexd__repr__ 1306
1307 -def _Complexf__repr__(self):
1308 return "Complexf(re=" + repr(self.re) + ", im=" + repr(self.im) + ")"
1309 Complexf.__repr__ = _Complexf__repr__ 1310
1311 -def _Point2i__repr__(self):
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
1328 -def _Point2i__getitem__(self, *args, **kwds):
1329 return self.ndarray.__getitem__(*args, **kwds)
1330 Point2i.__getitem__ = _Point2i__getitem__ 1331
1332 -def _Point2i__setitem__(self, *args, **kwds):
1333 return self.ndarray.__setitem__(*args, **kwds)
1334 Point2i.__setitem__ = _Point2i__setitem__ 1335
1336 -def _Point2i__getslice__(self, *args, **kwds):
1337 return self.ndarray.__getslice__(*args, **kwds)
1338 Point2i.__getslice__ = _Point2i__getslice__ 1339
1340 -def _Point2i__setslice__(self, *args, **kwds):
1341 return self.ndarray.__setslice__(*args, **kwds)
1342 Point2i.__setslice__ = _Point2i__setslice__ 1343
1344 -def _Point2d__repr__(self):
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
1361 -def _Point2d__getitem__(self, *args, **kwds):
1362 return self.ndarray.__getitem__(*args, **kwds)
1363 Point2d.__getitem__ = _Point2d__getitem__ 1364
1365 -def _Point2d__setitem__(self, *args, **kwds):
1366 return self.ndarray.__setitem__(*args, **kwds)
1367 Point2d.__setitem__ = _Point2d__setitem__ 1368
1369 -def _Point2d__getslice__(self, *args, **kwds):
1370 return self.ndarray.__getslice__(*args, **kwds)
1371 Point2d.__getslice__ = _Point2d__getslice__ 1372
1373 -def _Point2d__setslice__(self, *args, **kwds):
1374 return self.ndarray.__setslice__(*args, **kwds)
1375 Point2d.__setslice__ = _Point2d__setslice__ 1376
1377 -def _Point2f__repr__(self):
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
1394 -def _Point2f__getitem__(self, *args, **kwds):
1395 return self.ndarray.__getitem__(*args, **kwds)
1396 Point2f.__getitem__ = _Point2f__getitem__ 1397
1398 -def _Point2f__setitem__(self, *args, **kwds):
1399 return self.ndarray.__setitem__(*args, **kwds)
1400 Point2f.__setitem__ = _Point2f__setitem__ 1401
1402 -def _Point2f__getslice__(self, *args, **kwds):
1403 return self.ndarray.__getslice__(*args, **kwds)
1404 Point2f.__getslice__ = _Point2f__getslice__ 1405
1406 -def _Point2f__setslice__(self, *args, **kwds):
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
1425 -def _Point3d__getitem__(self, *args, **kwds):
1426 return self.ndarray.__getitem__(*args, **kwds)
1427 Point3d.__getitem__ = _Point3d__getitem__ 1428
1429 -def _Point3d__setitem__(self, *args, **kwds):
1430 return self.ndarray.__setitem__(*args, **kwds)
1431 Point3d.__setitem__ = _Point3d__setitem__ 1432
1433 -def _Point3d__getslice__(self, *args, **kwds):
1434 return self.ndarray.__getslice__(*args, **kwds)
1435 Point3d.__getslice__ = _Point3d__getslice__ 1436
1437 -def _Point3d__setslice__(self, *args, **kwds):
1438 return self.ndarray.__setslice__(*args, **kwds)
1439 Point3d.__setslice__ = _Point3d__setslice__ 1440
1441 -def _Point3d__repr__(self):
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
1458 -def _Point3f__getitem__(self, *args, **kwds):
1459 return self.ndarray.__getitem__(*args, **kwds)
1460 Point3f.__getitem__ = _Point3f__getitem__ 1461
1462 -def _Point3f__setitem__(self, *args, **kwds):
1463 return self.ndarray.__setitem__(*args, **kwds)
1464 Point3f.__setitem__ = _Point3f__setitem__ 1465
1466 -def _Point3f__getslice__(self, *args, **kwds):
1467 return self.ndarray.__getslice__(*args, **kwds)
1468 Point3f.__getslice__ = _Point3f__getslice__ 1469
1470 -def _Point3f__setslice__(self, *args, **kwds):
1471 return self.ndarray.__setslice__(*args, **kwds)
1472 Point3f.__setslice__ = _Point3f__setslice__ 1473
1474 -def _Point3f__repr__(self):
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
1491 -def _Point3i__getitem__(self, *args, **kwds):
1492 return self.ndarray.__getitem__(*args, **kwds)
1493 Point3i.__getitem__ = _Point3i__getitem__ 1494
1495 -def _Point3i__setitem__(self, *args, **kwds):
1496 return self.ndarray.__setitem__(*args, **kwds)
1497 Point3i.__setitem__ = _Point3i__setitem__ 1498
1499 -def _Point3i__getslice__(self, *args, **kwds):
1500 return self.ndarray.__getslice__(*args, **kwds)
1501 Point3i.__getslice__ = _Point3i__getslice__ 1502
1503 -def _Point3i__setslice__(self, *args, **kwds):
1504 return self.ndarray.__setslice__(*args, **kwds)
1505 Point3i.__setslice__ = _Point3i__setslice__ 1506
1507 -def _Point3i__repr__(self):
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
1524 -def _Size2i__getitem__(self, *args, **kwds):
1525 return self.ndarray.__getitem__(*args, **kwds)
1526 Size2i.__getitem__ = _Size2i__getitem__ 1527
1528 -def _Size2i__setitem__(self, *args, **kwds):
1529 return self.ndarray.__setitem__(*args, **kwds)
1530 Size2i.__setitem__ = _Size2i__setitem__ 1531
1532 -def _Size2i__getslice__(self, *args, **kwds):
1533 return self.ndarray.__getslice__(*args, **kwds)
1534 Size2i.__getslice__ = _Size2i__getslice__ 1535
1536 -def _Size2i__setslice__(self, *args, **kwds):
1537 return self.ndarray.__setslice__(*args, **kwds)
1538 Size2i.__setslice__ = _Size2i__setslice__ 1539
1540 -def _Size2i__repr__(self):
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
1557 -def _Size2d__getitem__(self, *args, **kwds):
1558 return self.ndarray.__getitem__(*args, **kwds)
1559 Size2d.__getitem__ = _Size2d__getitem__ 1560
1561 -def _Size2d__setitem__(self, *args, **kwds):
1562 return self.ndarray.__setitem__(*args, **kwds)
1563 Size2d.__setitem__ = _Size2d__setitem__ 1564
1565 -def _Size2d__getslice__(self, *args, **kwds):
1566 return self.ndarray.__getslice__(*args, **kwds)
1567 Size2d.__getslice__ = _Size2d__getslice__ 1568
1569 -def _Size2d__setslice__(self, *args, **kwds):
1570 return self.ndarray.__setslice__(*args, **kwds)
1571 Size2d.__setslice__ = _Size2d__setslice__ 1572
1573 -def _Size2d__repr__(self):
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
1590 -def _Size2f__getitem__(self, *args, **kwds):
1591 return self.ndarray.__getitem__(*args, **kwds)
1592 Size2f.__getitem__ = _Size2f__getitem__ 1593
1594 -def _Size2f__setitem__(self, *args, **kwds):
1595 return self.ndarray.__setitem__(*args, **kwds)
1596 Size2f.__setitem__ = _Size2f__setitem__ 1597
1598 -def _Size2f__getslice__(self, *args, **kwds):
1599 return self.ndarray.__getslice__(*args, **kwds)
1600 Size2f.__getslice__ = _Size2f__getslice__ 1601
1602 -def _Size2f__setslice__(self, *args, **kwds):
1603 return self.ndarray.__setslice__(*args, **kwds)
1604 Size2f.__setslice__ = _Size2f__setslice__ 1605
1606 -def _Size2f__repr__(self):
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
1625 -def _Rect__getitem__(self, *args, **kwds):
1626 return self.ndarray.__getitem__(*args, **kwds)
1627 Rect.__getitem__ = _Rect__getitem__ 1628
1629 -def _Rect__setitem__(self, *args, **kwds):
1630 return self.ndarray.__setitem__(*args, **kwds)
1631 Rect.__setitem__ = _Rect__setitem__ 1632
1633 -def _Rect__getslice__(self, *args, **kwds):
1634 return self.ndarray.__getslice__(*args, **kwds)
1635 Rect.__getslice__ = _Rect__getslice__ 1636
1637 -def _Rect__setslice__(self, *args, **kwds):
1638 return self.ndarray.__setslice__(*args, **kwds)
1639 Rect.__setslice__ = _Rect__setslice__ 1640
1641 -def _Rect__repr__(self):
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
1659 -def _Rectd__getitem__(self, *args, **kwds):
1660 return self.ndarray.__getitem__(*args, **kwds)
1661 Rectd.__getitem__ = _Rectd__getitem__ 1662
1663 -def _Rectd__setitem__(self, *args, **kwds):
1664 return self.ndarray.__setitem__(*args, **kwds)
1665 Rectd.__setitem__ = _Rectd__setitem__ 1666
1667 -def _Rectd__getslice__(self, *args, **kwds):
1668 return self.ndarray.__getslice__(*args, **kwds)
1669 Rectd.__getslice__ = _Rectd__getslice__ 1670
1671 -def _Rectd__setslice__(self, *args, **kwds):
1672 return self.ndarray.__setslice__(*args, **kwds)
1673 Rectd.__setslice__ = _Rectd__setslice__ 1674
1675 -def _Rectd__repr__(self):
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
1693 -def _Rectf__getitem__(self, *args, **kwds):
1694 return self.ndarray.__getitem__(*args, **kwds)
1695 Rectf.__getitem__ = _Rectf__getitem__ 1696
1697 -def _Rectf__setitem__(self, *args, **kwds):
1698 return self.ndarray.__setitem__(*args, **kwds)
1699 Rectf.__setitem__ = _Rectf__setitem__ 1700
1701 -def _Rectf__getslice__(self, *args, **kwds):
1702 return self.ndarray.__getslice__(*args, **kwds)
1703 Rectf.__getslice__ = _Rectf__getslice__ 1704
1705 -def _Rectf__setslice__(self, *args, **kwds):
1706 return self.ndarray.__setslice__(*args, **kwds)
1707 Rectf.__setslice__ = _Rectf__setslice__ 1708
1709 -def _Rectf__repr__(self):
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
1727 -def _RotatedRect__getitem__(self, *args, **kwds):
1728 return self.ndarray.__getitem__(*args, **kwds)
1729 RotatedRect.__getitem__ = _RotatedRect__getitem__ 1730
1731 -def _RotatedRect__setitem__(self, *args, **kwds):
1732 return self.ndarray.__setitem__(*args, **kwds)
1733 RotatedRect.__setitem__ = _RotatedRect__setitem__ 1734
1735 -def _RotatedRect__getslice__(self, *args, **kwds):
1736 return self.ndarray.__getslice__(*args, **kwds)
1737 RotatedRect.__getslice__ = _RotatedRect__getslice__ 1738
1739 -def _RotatedRect__setslice__(self, *args, **kwds):
1740 return self.ndarray.__setslice__(*args, **kwds)
1741 RotatedRect.__setslice__ = _RotatedRect__setslice__ 1742
1743 -def _RotatedRect__repr__(self):
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
1761 -def _Scalar__getitem__(self, *args, **kwds):
1762 return self.ndarray.__getitem__(*args, **kwds)
1763 Scalar.__getitem__ = _Scalar__getitem__ 1764
1765 -def _Scalar__setitem__(self, *args, **kwds):
1766 return self.ndarray.__setitem__(*args, **kwds)
1767 Scalar.__setitem__ = _Scalar__setitem__ 1768
1769 -def _Scalar__getslice__(self, *args, **kwds):
1770 return self.ndarray.__getslice__(*args, **kwds)
1771 Scalar.__getslice__ = _Scalar__getslice__ 1772
1773 -def _Scalar__setslice__(self, *args, **kwds):
1774 return self.ndarray.__setslice__(*args, **kwds)
1775 Scalar.__setslice__ = _Scalar__setslice__ 1776
1777 -def _Scalar__repr__(self):
1778 return "Scalar(" + self.ndarray.__str__() + ")"
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
1793 -def _Range__getitem__(self, *args, **kwds):
1794 return self.ndarray.__getitem__(*args, **kwds)
1795 Range.__getitem__ = _Range__getitem__ 1796
1797 -def _Range__setitem__(self, *args, **kwds):
1798 return self.ndarray.__setitem__(*args, **kwds)
1799 Range.__setitem__ = _Range__setitem__ 1800
1801 -def _Range__getslice__(self, *args, **kwds):
1802 return self.ndarray.__getslice__(*args, **kwds)
1803 Range.__getslice__ = _Range__getslice__ 1804
1805 -def _Range__setslice__(self, *args, **kwds):
1806 return self.ndarray.__setslice__(*args, **kwds)
1807 Range.__setslice__ = _Range__setslice__ 1808
1809 -def _Range__repr__(self):
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
1826 -def _Mat__getitem__(self, *args, **kwds):
1827 return self.ndarray.__getitem__(*args, **kwds)
1828 Mat.__getitem__ = _Mat__getitem__ 1829
1830 -def _Mat__setitem__(self, *args, **kwds):
1831 return self.ndarray.__setitem__(*args, **kwds)
1832 Mat.__setitem__ = _Mat__setitem__ 1833
1834 -def _Mat__getslice__(self, *args, **kwds):
1835 return self.ndarray.__getslice__(*args, **kwds)
1836 Mat.__getslice__ = _Mat__getslice__ 1837
1838 -def _Mat__setslice__(self, *args, **kwds):
1839 return self.ndarray.__setslice__(*args, **kwds)
1840 Mat.__setslice__ = _Mat__setslice__ 1841
1842 -def _Mat__repr__(self):
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
1871 -def _RNG__repr__(self):
1872 return "RNG(state=" + repr(self.state) + ")"
1873 RNG.__repr__ = _RNG__repr__ 1874 1875
1876 -def _TermCriteria__repr__(self):
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
1894 -def _MatND__getitem__(self, *args, **kwds):
1895 return self.ndarray.__getitem__(*args, **kwds)
1896 MatND.__getitem__ = _MatND__getitem__ 1897
1898 -def _MatND__setitem__(self, *args, **kwds):
1899 return self.ndarray.__setitem__(*args, **kwds)
1900 MatND.__setitem__ = _MatND__setitem__ 1901
1902 -def _MatND__getslice__(self, *args, **kwds):
1903 return self.ndarray.__getslice__(*args, **kwds)
1904 MatND.__getslice__ = _MatND__getslice__ 1905
1906 -def _MatND__setslice__(self, *args, **kwds):
1907 return self.ndarray.__setslice__(*args, **kwds)
1908 MatND.__setslice__ = _MatND__setslice__ 1909
1910 -def _MatND__repr__(self):
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 # cxflann.h 1916 #============================================================================= 1917 1918 1919 1920 #============================================================================= 1921 # cvtypes.h 1922 #============================================================================= 1923 1924 1925 # Defines for Distance Transform 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 # Haar-like Object Detection structures 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
1945 -def _CvContourScanner__del__(self):
1946 if self._ownershiplevel==1: 1947 _PE._cvEndFindContours(self)
1948 CvContourScanner.__del__ = _CvContourScanner__del__ 1949 1950 #============================================================================= 1951 # cv.h 1952 #============================================================================= 1953 1954 1955 1956 #----------------------------------------------------------------------------- 1957 # Image Processing 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 # Contours Retrieving 2098 #----------------------------------------------------------------------------- 2099 2100 2101
2102 -def endFindContours(scanner):
2103 z = _PE._cvEndFindContours(scanner) 2104 scanner._ownershiplevel = 0 # not owning the structure anymore 2105 return z
2106 endFindContours.__doc__ = _PE._cvEndFindContours.__doc__ 2107 2108 #----------------------------------------------------------------------------- 2109 # Motion Analysis 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 # Planar Subdivisions 2122 #----------------------------------------------------------------------------- 2123 2124 2125 2126 #----------------------------------------------------------------------------- 2127 # Contour Processing and Shape Analysis 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 # OpenCV 2.1: Equivalent C++ constant not yet available 2155 2156 2157 #----------------------------------------------------------------------------- 2158 # Feature detection 2159 #----------------------------------------------------------------------------- 2160 2161 2162 2163 CvFeatureTree._ownershiplevel = 0 2164
2165 -def _CvFeatureTree__del__(self):
2166 if self._ownershiplevel==1: 2167 _PE._cvReleaseFeatureTree(self)
2168 CvFeatureTree.__del__ = _CvFeatureTree__del__ 2169 2170 CvLSH._ownershiplevel = 0 2171
2172 -def _CvLSH__del__(self):
2173 if self._ownershiplevel==1: 2174 _PE._cvReleaseLSH(self)
2175 CvLSH.__del__ = _CvLSH__del__ 2176 2177 #----------------------------------------------------------------------------- 2178 # POSIT (POSe from ITeration) 2179 #----------------------------------------------------------------------------- 2180 2181 2182 2183 CvPOSITObject._ownershiplevel = 0 2184
2185 -def _CvPOSITObject__del__(self):
2186 if self._ownershiplevel==1: 2187 _PE._cvReleasePOSITObject(self)
2188 CvPOSITObject.__del__ = _CvPOSITObject__del__ 2189 2190 #----------------------------------------------------------------------------- 2191 # Kolmogorov-Zabin stereo-correspondence algorithm (a.k.a. KZ1) 2192 #----------------------------------------------------------------------------- 2193 2194 2195 2196 CvStereoGCState._ownershiplevel = 0 2197
2198 -def _CvStereoGCState__del__(self):
2199 if self._ownershiplevel==1: 2200 _PE._cvReleaseStereoGCState(self)
2201 CvStereoGCState.__del__ = _CvStereoGCState__del__ 2202 2203 #============================================================================= 2204 # cv.hpp 2205 #============================================================================= 2206 2207 2208 2209 #============================================================================= 2210 # cvaux.h 2211 #============================================================================= 2212 2213 2214 2215 #----------------------------------------------------------------------------- 2216 # Eigen Objects 2217 #----------------------------------------------------------------------------- 2218 2219 2220 2221 #----------------------------------------------------------------------------- 2222 # 1D/2D HMM 2223 #----------------------------------------------------------------------------- 2224 2225 2226 2227 #----------------------------------------------------------------------------- 2228 # A few functions from old stereo gesture recognition demosions 2229 #----------------------------------------------------------------------------- 2230 2231 2232 2233 #----------------------------------------------------------------------------- 2234 # Additional operations on Subdivisions 2235 #----------------------------------------------------------------------------- 2236 2237 2238 2239 #----------------------------------------------------------------------------- 2240 # More operations on sequences 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 # Contour Morphing 2261 #----------------------------------------------------------------------------- 2262 2263 2264 2265 #----------------------------------------------------------------------------- 2266 # Texture Descriptors 2267 #----------------------------------------------------------------------------- 2268 2269 2270 2271 #----------------------------------------------------------------------------- 2272 # Face eyes&mouth tracking 2273 #----------------------------------------------------------------------------- 2274 2275 2276 2277 #----------------------------------------------------------------------------- 2278 # 3D Tracker 2279 #----------------------------------------------------------------------------- 2280 2281 2282 2283 #----------------------------------------------------------------------------- 2284 # Skeletons and Linear-Contour Models 2285 #----------------------------------------------------------------------------- 2286 2287 2288 2289 #----------------------------------------------------------------------------- 2290 # Background/foreground segmentation 2291 #----------------------------------------------------------------------------- 2292 2293 2294 2295 #----------------------------------------------------------------------------- 2296 # Calibration engine 2297 #----------------------------------------------------------------------------- 2298 2299 2300 2301 #----------------------------------------------------------------------------- 2302 # Object Tracking 2303 #----------------------------------------------------------------------------- 2304 2305 2306 2307 CvConDensation._ownershiplevel = 0 2308
2309 -def _CvConDensation__del__(self):
2310 if self._ownershiplevel==1: 2311 _PE._cvReleaseConDensation(self)
2312 CvConDensation.__del__ = _CvConDensation__del__ 2313 2314 #============================================================================= 2315 # cvaux.hpp 2316 #============================================================================= 2317 2318 2319 2320 YAPE = LDetector 2321 2322 #============================================================================= 2323 # cvvidsurf.hpp 2324 #============================================================================= 2325 2326 CV_BLOB_MINW = 5 2327 CV_BLOB_MINH = 5 2328 2329 2330 2331 #============================================================================= 2332 # ml.h 2333 #============================================================================= 2334 2335 CV_LOG2PI = (1.8378770664093454835606594728112) 2336 2337 CV_COL_SAMPLE = 0 2338 CV_ROW_SAMPLE = 1 2339
2340 -def CV_IS_ROW_SAMPLE(flags):
2341 return ((flags) & CV_ROW_SAMPLE)
2342 2343 # Variable type 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 # Variable type 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 # StatModel = CvStatModel 2385 # ParamGrid = CvParamGrid 2386 # NormalBayesClassifier = CvNormalBayesClassifier 2387 # KNearest = CvKNearest 2388 # SVMParams = CvSVMParams 2389 # SVMKernel = CvSVMKernel 2390 # SVMSolver = CvSVMSolver 2391 # SVM = CvSVM 2392 # EMParams = CvEMParams 2393 # ExpectationMaximization = CvEM 2394 # DTreeParams = CvDTreeParams 2395 # TrainData = CvMLData 2396 # DecisionTree = CvDTree 2397 # ForestTree = CvForestTree 2398 # RandomTreeParams = CvRTParams 2399 # RandomTrees = CvRTrees 2400 # ERTreeTrainData = CvERTreeTrainData 2401 # ERTree = CvForestERTree 2402 # ERTrees = CvERTrees 2403 # BoostParams = CvBoostParams 2404 # BoostTree = CvBoostTree 2405 # Boost = CvBoost 2406 # ANN_MLP_TrainParams = CvANN_MLP_TrainParams 2407 # NeuralNet_MLP = CvANN_MLP 2408 2409
2410 -def _CvParamGrid__repr__(self):
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 # highgui.h 2417 #============================================================================= 2418 2419 2420 2421 #----------------------------------------------------------------------------- 2422 # Basic GUI functions 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 # Holds references to ctypes function wrappers for callbacks to keep the 2435 # Python side object alive. Keyed by window name, with a window value being 2436 # a dictionary of callbacks, keyed by "mouse" mouse callback, or "trackbar-name" 2437 # for a trackbar named "name". 2438 # 2439 # See module bottom for atexit registration to destroy windows at process exit. 2440 _windows_callbacks = {} 2441 2442 # Assigns callback for mouse events 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 # 8 bit, color or gray - deprecated, use CV_LOAD_IMAGE_ANYCOLOR 2462 CV_LOAD_IMAGE_GRAYSCALE = 0 # 8 bit, gray 2463 CV_LOAD_IMAGE_COLOR = 1 # 8 bit unless combined with CV_LOAD_IMAGE_ANYDEPTH, color 2464 CV_LOAD_IMAGE_ANYDEPTH = 2 # any depth, if specified on its own gray by itself 2465 # equivalent to CV_LOAD_IMAGE_UNCHANGED but can be modified 2466 # with CV_LOAD_IMAGE_ANYDEPTH 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 # autodetect 2477 CV_CAP_MIL = 100 # MIL proprietary drivers 2478 CV_CAP_VFW = 200 # platform native 2479 CV_CAP_V4L = 200 2480 CV_CAP_V4L2 = 200 2481 CV_CAP_FIREWARE = 300 # IEEE 1394 drivers 2482 CV_CAP_FIREWIRE = 300 # IEEE 1394 drivers 2483 CV_CAP_IEEE1394 = 300 2484 CV_CAP_DC1394 = 300 2485 CV_CAP_CMU1394 = 300 2486 CV_CAP_STEREO = 400 # TYZX proprietary drivers 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 # Quicktime 2493 CV_CAP_UNICAP = 600 # Unicap drivers 2494 CV_CAP_DSHOW = 700 # DirectShow (via videoInput) 2495 CV_CAP_PVAPI = 800 # PvAPI, Prosilica GigE SDK 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
2517 -def CV_FOURCC(c1,c2,c3,c4):
2518 return (((ord(c1))&255) + (((ord(c2))&255)<<8) + (((ord(c3))&255)<<16) + (((ord(c4))&255)<<24))
2519 2520 CV_FOURCC_PROMPT = -1 # Windows only 2521 CV_FOURCC_DEFAULT = CV_FOURCC('I', 'Y', 'U', 'V') # Linux only 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
2541 -def setMouseCallback(window_name, on_mouse, param=None):
2542 _windows_callbacks.setdefault(window_name,{})["mouse"] = _PE._cvSetMouseCallback(window_name, on_mouse, param=param)
2543 setMouseCallback.__doc__ = _PE._cvSetMouseCallback.__doc__ 2544
2545 -def destroyWindow(name):
2546 _PE._cvDestroyWindow(name) 2547 if name in _windows_callbacks: 2548 _windows_callbacks.pop(name)
2549 destroyWindow.__doc__ = _PE._cvDestroyWindow.__doc__ 2550
2551 -def destroyAllWindows():
2552 _PE._cvDestroyAllWindows() 2553 _windows_callbacks.clear()
2554 destroyAllWindows.__doc__ = _PE._cvDestroyAllWindows.__doc__ 2555 2556 2557 # Automatically destroy any remaining tracked windows at process exit, 2558 # otherwise our references to ctypes objects may be destroyed by the normal 2559 # interpreter cleanup before the highgui library cleans up fully, leaving us 2560 # exposed to exceptions. 2561 2562 import atexit 2563 atexit.register(destroyAllWindows) 2564 2565 #============================================================================= 2566 # highgui.hpp 2567 #============================================================================= 2568 2569 2570 2571 #----------------------------------------------------------------------------- 2572 # C++ Interface 2573 #----------------------------------------------------------------------------- 2574 2575 2576 #============================================================================= 2577 # sdopencv 2578 #============================================================================= 2579