diff --git a/plugins/In_one/main.py b/plugins/In_one/main.py index f8174cc..5a80598 100644 --- a/plugins/In_one/main.py +++ b/plugins/In_one/main.py @@ -1,29 +1,24 @@ -import copy as cp -from asyncio.windows_events import NULL -from concurrent.futures import thread -from copy import copy -from email.policy import default import os -import pdb from threading import Thread import numpy as np # from plugins.basic_change.main import MyDialog from rscder.gui.actions import ActionManager from rscder.plugins.basic import BasicPlugin -from PyQt5.QtWidgets import QAction, QDialog, QHBoxLayout, QVBoxLayout, QPushButton,QWidget,QLabel,QLineEdit,QPushButton,QComboBox -from PyQt5.QtGui import QIcon,QPixmap -from PyQt5.QtCore import Qt -from rscder.gui.layercombox import LayerCombox,PairLayerCombox +from PyQt5.QtWidgets import QAction, QDialog, QHBoxLayout, QVBoxLayout, QPushButton,QWidget,QLabel,QLineEdit,QPushButton,QComboBox,QDialogButtonBox +from PyQt5.QtGui import QPixmap + +from rscder.gui.layercombox import PairLayerCombox from rscder.utils.icons import IconInstance -from rscder.utils.geomath import geo2imageRC, imageRC2geo -from rscder.utils.project import Project, RasterLayer, PairLayer,ResultPointLayer,MultiBandRasterLayer +from rscder.utils.geomath import geo2imageRC +from rscder.utils.project import Project, PairLayer,ResultPointLayer,MultiBandRasterLayer from In_one.otsu import OTSU from osgeo import gdal -from plugins.In_one import pic +from In_one import pic import math from skimage.filters import rank from skimage.morphology import disk, rectangle - +from In_one.scripts.UnsupervisedCD import LSTS,CVA,ACD_ +from In_one.scripts.USCD import ACD def Meanfilter(x_size,y_size,layer:MultiBandRasterLayer): x_size = int(x_size) y_size = int(y_size) @@ -281,7 +276,7 @@ def table_layer(pth,layer,name,send_message,dict): send_message.emit('计算完成') class LockerButton(QPushButton): - def __init__(self,parent=NULL): + def __init__(self,parent=None): super(LockerButton,self).__init__(parent) m_imageLabel = QLabel(self) m_imageLabel.setFixedWidth(20) @@ -408,24 +403,30 @@ class AllInOne(QDialog): thresholdlayout.addWidget(thresholdWeight) #确认 - oklayout=QHBoxLayout() + self.ok_button = QPushButton('确定', self) self.ok_button.setIcon(IconInstance().OK) self.ok_button.clicked.connect(self.accept) + self.ok_button.setDefault(True) + self.cancel_button = QPushButton('取消', self) self.cancel_button.setIcon(IconInstance().CANCEL) self.cancel_button.clicked.connect(self.reject) - oklayout.addWidget(self.ok_button,0,alignment=Qt.AlignHCenter) - oklayout.addWidget(self.cancel_button,0,alignment=Qt.AlignHCenter) - + self.cancel_button.setDefault(False) + buttonbox=QDialogButtonBox(self) + buttonbox.addButton(self.ok_button,QDialogButtonBox.NoRole) + buttonbox.addButton(self.cancel_button,QDialogButtonBox.NoRole) + buttonbox.setCenterButtons(True) + #buttonbox.setContentsMargins(,) + totalvlayout=QVBoxLayout() totalvlayout.addLayout(layerbox) totalvlayout.addLayout(filterlayout) totalvlayout.addLayout(changelayout) totalvlayout.addLayout(thresholdlayout) - totalvlayout.addLayout(oklayout) + totalvlayout.addWidget(buttonbox) totalvlayout.addStretch() self.setLayout(totalvlayout) @@ -473,7 +474,7 @@ class AllInOne(QDialog): return p class InOnePlugin(BasicPlugin): pre={"均值滤波":Meanfilter}#可添加其他方法 - cd={'差分法':basic_cd}#可添加其他方法 + cd={'差分法':basic_cd,'LSTS':LSTS,'CVA':CVA,'ACD':ACD_}#可添加其他方法 threshold={'OTSU阈值':otsu}#可添加其他方法 @@ -487,14 +488,13 @@ class InOnePlugin(BasicPlugin): } def set_action(self): - - basic_diff_method_in_one = QAction('差分法') - # ActionManager().change_detection_menu.addAction(basic_diff_method_in_one) - ActionManager().unsupervised_menu.addAction(basic_diff_method_in_one) + + basic_diff_method_in_one = QAction(IconInstance().UNSUPERVISED, '&无监督变化检测') + ActionManager().change_detection_menu.addAction(basic_diff_method_in_one) + # ActionManager().menubar.addAction(basic_diff_method_in_one) self.basic_diff_method_in_one = basic_diff_method_in_one basic_diff_method_in_one.triggered.connect(self.run) - def run(self): myDialog=AllInOne(list(self.pre.keys()),list(self.cd.keys()),list(self.threshold.keys()),self.mainwindow) myDialog.show() @@ -521,18 +521,26 @@ class InOnePlugin(BasicPlugin): self.send_message.emit('{}图像{}'.format(preKey,w.layer_combox.layer1.name)) pth2=self.pre[preKey](w.x_size_input.text(),w.y_size_input.text(),w.layer_combox.layer2) self.send_message.emit('{}图像{}'.format(preKey,w.layer_combox.layer2.name)) - name=name+'_mean_filter' + name=name+'_'+preKey dict['预处理']=[preKey,'|'.format(pth1,pth2)] cdpth=None #变化检测 # if w.cd_select.choose==self.cd[0]: + # if w.cd_select.choose=='ACD': + # cdKey='ACD' + # self.send_message.emit('ACD计算中...') + # cdpth=os.path.join(Project().cmi_path, '{}_{}_cmi.tif'.format(w.layer_combox.layer1.layer_parent.name, int(np.random.rand() * 100000))) + # print(pth1,pth2,cdpth) + # ACD(pth1,pth2,cdpth) + # else: + # pass cdKey=w.cd_select.choose cdpth=self.cd[cdKey](pth1,pth2,w.layer_combox.layer1.layer_parent,self.send_message) - name += '_basic_cd' + name += '_'+cdKey dict['变化检测算法']=[cdKey,cdpth] - + #阈值处理 #例如手动阈值和otsu参数不同,则要做区分 thpth=None diff --git a/plugins/In_one/scripts/USCD.py b/plugins/In_one/scripts/USCD.py new file mode 100644 index 0000000..7100d50 --- /dev/null +++ b/plugins/In_one/scripts/USCD.py @@ -0,0 +1,12424 @@ +# This file was automatically generated by SWIG (http://www.swig.org). +# Version 4.0.2 +# +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. + +from sys import version_info as _swig_python_version_info +if _swig_python_version_info < (2, 7, 0): + raise RuntimeError("Python 2.7 or later required") + +# Import the low-level C/C++ module +if __package__ or "." in __name__: + from . import _USCD +else: + import _USCD + +try: + import builtins as __builtin__ +except ImportError: + import __builtin__ + +def _swig_repr(self): + try: + strthis = "proxy of " + self.this.__repr__() + except __builtin__.Exception: + strthis = "" + return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) + + +def _swig_setattr_nondynamic_instance_variable(set): + def set_instance_attr(self, name, value): + if name == "thisown": + self.this.own(value) + elif name == "this": + set(self, name, value) + elif hasattr(self, name) and isinstance(getattr(type(self), name), property): + set(self, name, value) + else: + raise AttributeError("You cannot add instance attributes to %s" % self) + return set_instance_attr + + +def _swig_setattr_nondynamic_class_variable(set): + def set_class_attr(cls, name, value): + if hasattr(cls, name) and not isinstance(getattr(cls, name), property): + set(cls, name, value) + else: + raise AttributeError("You cannot add class attributes to %s" % cls) + return set_class_attr + + +def _swig_add_metaclass(metaclass): + """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass""" + def wrapper(cls): + return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy()) + return wrapper + + +class _SwigNonDynamicMeta(type): + """Meta class to enforce nondynamic attributes (no new attributes) for a class""" + __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__) + + + +import sys as _sys +if _sys.byteorder == 'little': + _cv_numpy_endianess = '<' +else: + _cv_numpy_endianess = '>' + +_cv_numpy_typestr_map = {} +_cv_numpy_bla = {} + +CV_VERSION_MAJOR = _USCD.CV_VERSION_MAJOR +CV_VERSION_MINOR = _USCD.CV_VERSION_MINOR +CV_VERSION_REVISION = _USCD.CV_VERSION_REVISION +CV_VERSION_STATUS = _USCD.CV_VERSION_STATUS +CV_VERSION = _USCD.CV_VERSION +CV_MAJOR_VERSION = _USCD.CV_MAJOR_VERSION +CV_MINOR_VERSION = _USCD.CV_MINOR_VERSION +CV_SUBMINOR_VERSION = _USCD.CV_SUBMINOR_VERSION +class DataType_bool(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD.DataType_bool_generic_type + channels = _USCD.DataType_bool_channels + fmt = _USCD.DataType_bool_fmt + + def __init__(self): + _USCD.DataType_bool_swiginit(self, _USCD.new_DataType_bool()) + __swig_destroy__ = _USCD.delete_DataType_bool + +# Register DataType_bool in _USCD: +_USCD.DataType_bool_swigregister(DataType_bool) + +class DataType_uchar(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD.DataType_uchar_generic_type + channels = _USCD.DataType_uchar_channels + fmt = _USCD.DataType_uchar_fmt + + def __init__(self): + _USCD.DataType_uchar_swiginit(self, _USCD.new_DataType_uchar()) + __swig_destroy__ = _USCD.delete_DataType_uchar + +# Register DataType_uchar in _USCD: +_USCD.DataType_uchar_swigregister(DataType_uchar) + +class DataType_schar(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD.DataType_schar_generic_type + channels = _USCD.DataType_schar_channels + fmt = _USCD.DataType_schar_fmt + + def __init__(self): + _USCD.DataType_schar_swiginit(self, _USCD.new_DataType_schar()) + __swig_destroy__ = _USCD.delete_DataType_schar + +# Register DataType_schar in _USCD: +_USCD.DataType_schar_swigregister(DataType_schar) + +class DataType_char(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD.DataType_char_generic_type + channels = _USCD.DataType_char_channels + fmt = _USCD.DataType_char_fmt + + def __init__(self): + _USCD.DataType_char_swiginit(self, _USCD.new_DataType_char()) + __swig_destroy__ = _USCD.delete_DataType_char + +# Register DataType_char in _USCD: +_USCD.DataType_char_swigregister(DataType_char) + +class DataType_ushort(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD.DataType_ushort_generic_type + channels = _USCD.DataType_ushort_channels + fmt = _USCD.DataType_ushort_fmt + + def __init__(self): + _USCD.DataType_ushort_swiginit(self, _USCD.new_DataType_ushort()) + __swig_destroy__ = _USCD.delete_DataType_ushort + +# Register DataType_ushort in _USCD: +_USCD.DataType_ushort_swigregister(DataType_ushort) + +class DataType_short(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD.DataType_short_generic_type + channels = _USCD.DataType_short_channels + fmt = _USCD.DataType_short_fmt + + def __init__(self): + _USCD.DataType_short_swiginit(self, _USCD.new_DataType_short()) + __swig_destroy__ = _USCD.delete_DataType_short + +# Register DataType_short in _USCD: +_USCD.DataType_short_swigregister(DataType_short) + +class DataType_int(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD.DataType_int_generic_type + channels = _USCD.DataType_int_channels + fmt = _USCD.DataType_int_fmt + + def __init__(self): + _USCD.DataType_int_swiginit(self, _USCD.new_DataType_int()) + __swig_destroy__ = _USCD.delete_DataType_int + +# Register DataType_int in _USCD: +_USCD.DataType_int_swigregister(DataType_int) + +class DataType_float(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD.DataType_float_generic_type + channels = _USCD.DataType_float_channels + fmt = _USCD.DataType_float_fmt + + def __init__(self): + _USCD.DataType_float_swiginit(self, _USCD.new_DataType_float()) + __swig_destroy__ = _USCD.delete_DataType_float + +# Register DataType_float in _USCD: +_USCD.DataType_float_swigregister(DataType_float) + +class DataType_double(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD.DataType_double_generic_type + channels = _USCD.DataType_double_channels + fmt = _USCD.DataType_double_fmt + + def __init__(self): + _USCD.DataType_double_swiginit(self, _USCD.new_DataType_double()) + __swig_destroy__ = _USCD.delete_DataType_double + +# Register DataType_double in _USCD: +_USCD.DataType_double_swigregister(DataType_double) + +class Range(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self, *args): + _USCD.Range_swiginit(self, _USCD.new_Range(*args)) + + def size(self): + return _USCD.Range_size(self) + + def empty(self): + return _USCD.Range_empty(self) + + @staticmethod + def all(): + return _USCD.Range_all() + start = property(_USCD.Range_start_get, _USCD.Range_start_set) + end = property(_USCD.Range_end_get, _USCD.Range_end_set) + __swig_destroy__ = _USCD.delete_Range + +# Register Range in _USCD: +_USCD.Range_swigregister(Range) + +def Range_all(): + return _USCD.Range_all() + +class SwigPyIterator(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _USCD.delete_SwigPyIterator + + def value(self): + return _USCD.SwigPyIterator_value(self) + + def incr(self, n=1): + return _USCD.SwigPyIterator_incr(self, n) + + def decr(self, n=1): + return _USCD.SwigPyIterator_decr(self, n) + + def distance(self, x): + return _USCD.SwigPyIterator_distance(self, x) + + def equal(self, x): + return _USCD.SwigPyIterator_equal(self, x) + + def copy(self): + return _USCD.SwigPyIterator_copy(self) + + def next(self): + return _USCD.SwigPyIterator_next(self) + + def __next__(self): + return _USCD.SwigPyIterator___next__(self) + + def previous(self): + return _USCD.SwigPyIterator_previous(self) + + def advance(self, n): + return _USCD.SwigPyIterator_advance(self, n) + + def __eq__(self, x): + return _USCD.SwigPyIterator___eq__(self, x) + + def __ne__(self, x): + return _USCD.SwigPyIterator___ne__(self, x) + + def __iadd__(self, n): + return _USCD.SwigPyIterator___iadd__(self, n) + + def __isub__(self, n): + return _USCD.SwigPyIterator___isub__(self, n) + + def __add__(self, n): + return _USCD.SwigPyIterator___add__(self, n) + + def __sub__(self, *args): + return _USCD.SwigPyIterator___sub__(self, *args) + def __iter__(self): + return self + +# Register SwigPyIterator in _USCD: +_USCD.SwigPyIterator_swigregister(SwigPyIterator) + + +_array_map = {} + +class Matx_AddOp(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self): + _USCD.Matx_AddOp_swiginit(self, _USCD.new_Matx_AddOp()) + __swig_destroy__ = _USCD.delete_Matx_AddOp + +# Register Matx_AddOp in _USCD: +_USCD.Matx_AddOp_swigregister(Matx_AddOp) + +class Matx_SubOp(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self): + _USCD.Matx_SubOp_swiginit(self, _USCD.new_Matx_SubOp()) + __swig_destroy__ = _USCD.delete_Matx_SubOp + +# Register Matx_SubOp in _USCD: +_USCD.Matx_SubOp_swigregister(Matx_SubOp) + +class Matx_ScaleOp(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self): + _USCD.Matx_ScaleOp_swiginit(self, _USCD.new_Matx_ScaleOp()) + __swig_destroy__ = _USCD.delete_Matx_ScaleOp + +# Register Matx_ScaleOp in _USCD: +_USCD.Matx_ScaleOp_swigregister(Matx_ScaleOp) + +class Matx_MulOp(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self): + _USCD.Matx_MulOp_swiginit(self, _USCD.new_Matx_MulOp()) + __swig_destroy__ = _USCD.delete_Matx_MulOp + +# Register Matx_MulOp in _USCD: +_USCD.Matx_MulOp_swigregister(Matx_MulOp) + +class Matx_DivOp(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self): + _USCD.Matx_DivOp_swiginit(self, _USCD.new_Matx_DivOp()) + __swig_destroy__ = _USCD.delete_Matx_DivOp + +# Register Matx_DivOp in _USCD: +_USCD.Matx_DivOp_swigregister(Matx_DivOp) + +class Matx_MatMulOp(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self): + _USCD.Matx_MatMulOp_swiginit(self, _USCD.new_Matx_MatMulOp()) + __swig_destroy__ = _USCD.delete_Matx_MatMulOp + +# Register Matx_MatMulOp in _USCD: +_USCD.Matx_MatMulOp_swigregister(Matx_MatMulOp) + +class Matx_TOp(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self): + _USCD.Matx_TOp_swiginit(self, _USCD.new_Matx_TOp()) + __swig_destroy__ = _USCD.delete_Matx_TOp + +# Register Matx_TOp in _USCD: +_USCD.Matx_TOp_swigregister(Matx_TOp) + +class Mat(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _USCD.delete_Mat + + def row(self, y): + return _USCD.Mat_row(self, y) + + def col(self, x): + return _USCD.Mat_col(self, x) + + def rowRange(self, *args): + return _USCD.Mat_rowRange(self, *args) + + def colRange(self, *args): + return _USCD.Mat_colRange(self, *args) + + def diag(self, d=0): + return _USCD.Mat_diag(self, d) + + def clone(self): + return _USCD.Mat_clone(self) + + def assignTo(self, m, type=-1): + return _USCD.Mat_assignTo(self, m, type) + + def reshape(self, *args): + return _USCD.Mat_reshape(self, *args) + + def create(self, *args): + return _USCD.Mat_create(self, *args) + + def addref(self): + return _USCD.Mat_addref(self) + + def release(self): + return _USCD.Mat_release(self) + + def deallocate(self): + return _USCD.Mat_deallocate(self) + + def copySize(self, m): + return _USCD.Mat_copySize(self, m) + + def reserve(self, sz): + return _USCD.Mat_reserve(self, sz) + + def resize(self, *args): + return _USCD.Mat_resize(self, *args) + + def push_back_(self, elem): + return _USCD.Mat_push_back_(self, elem) + + def push_back(self, m): + return _USCD.Mat_push_back(self, m) + + def pop_back(self, nelems=1): + return _USCD.Mat_pop_back(self, nelems) + + def locateROI(self, wholeSize, ofs): + return _USCD.Mat_locateROI(self, wholeSize, ofs) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD.Mat_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD.Mat___call__(self, *args) + + def isContinuous(self): + return _USCD.Mat_isContinuous(self) + + def isSubmatrix(self): + return _USCD.Mat_isSubmatrix(self) + + def elemSize(self): + return _USCD.Mat_elemSize(self) + + def elemSize1(self): + return _USCD.Mat_elemSize1(self) + + def type(self): + return _USCD.Mat_type(self) + + def depth(self): + return _USCD.Mat_depth(self) + + def channels(self): + return _USCD.Mat_channels(self) + + def step1(self, i=0): + return _USCD.Mat_step1(self, i) + + def empty(self): + return _USCD.Mat_empty(self) + + def total(self): + return _USCD.Mat_total(self) + + def checkVector(self, elemChannels, depth=-1, requireContinuous=True): + return _USCD.Mat_checkVector(self, elemChannels, depth, requireContinuous) + + def ptr(self, *args): + return _USCD.Mat_ptr(self, *args) + MAGIC_VAL = _USCD.Mat_MAGIC_VAL + AUTO_STEP = _USCD.Mat_AUTO_STEP + CONTINUOUS_FLAG = _USCD.Mat_CONTINUOUS_FLAG + SUBMATRIX_FLAG = _USCD.Mat_SUBMATRIX_FLAG + MAGIC_MASK = _USCD.Mat_MAGIC_MASK + TYPE_MASK = _USCD.Mat_TYPE_MASK + DEPTH_MASK = _USCD.Mat_DEPTH_MASK + flags = property(_USCD.Mat_flags_get, _USCD.Mat_flags_set) + dims = property(_USCD.Mat_dims_get, _USCD.Mat_dims_set) + rows = property(_USCD.Mat_rows_get, _USCD.Mat_rows_set) + cols = property(_USCD.Mat_cols_get, _USCD.Mat_cols_set) + data = property(_USCD.Mat_data_get, _USCD.Mat_data_set) + datastart = property(_USCD.Mat_datastart_get, _USCD.Mat_datastart_set) + dataend = property(_USCD.Mat_dataend_get, _USCD.Mat_dataend_set) + datalimit = property(_USCD.Mat_datalimit_get, _USCD.Mat_datalimit_set) + + def __init__(self, *args): + _USCD.Mat_swiginit(self, _USCD.new_Mat(*args)) + + def _typestr(self): + typestr = _depthToDtype(self.depth()) + if typestr[-1] == '1': + typestr = '|' + typestr + else: + typestr = _cv_numpy_endianess + typestr + + return typestr + + + @classmethod + def __get_channels(cls, array): + if len(array.shape) == 3: + n_channel = array.shape[2] + if n_channel == 1: + raise ValueError("{} expects an one channel numpy ndarray be 2-dimensional.".format(cls)) + elif len(array.shape) == 2: + n_channel = 1 + else: + raise ValueError("{} supports only 2 or 3-dimensional numpy ndarray.".format(cls)) + + return n_channel + + + def __getattribute__(self, name): + if name == "__array_interface__": + n_channels = self.channels() + if n_channels == 1: + shape = (self.rows, self.cols) + else: + shape = (self.rows, self.cols, n_channels) + + return {"shape": shape, + "typestr": self._typestr(), + "data": (int(self.data), False)} + + else: + return object.__getattribute__(self, name) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + dtype = array.__array_interface__['typestr'] + dtype = dtype[1:] + + n_channel = cls.__get_channels(array) + + new_mat = Mat(array.shape[0], + array.shape[1], + _toCvType(dtype, n_channel), + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD.Mat___str__(self) + +# Register Mat in _USCD: +_USCD.Mat_swigregister(Mat) + +class _cv_numpy_sizeof_uint8_t(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_uint8_t_value + + def __init__(self): + _USCD._cv_numpy_sizeof_uint8_t_swiginit(self, _USCD.new__cv_numpy_sizeof_uint8_t()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_uint8_t + +# Register _cv_numpy_sizeof_uint8_t in _USCD: +_USCD._cv_numpy_sizeof_uint8_t_swigregister(_cv_numpy_sizeof_uint8_t) + + +if _cv_numpy_sizeof_uint8_t.value == 1: + _cv_numpy_typestr_map["uint8_t"] = "|" +"u" + "1" +else: + _cv_numpy_typestr_map["uint8_t"] = _cv_numpy_endianess +"u" + str(_cv_numpy_sizeof_uint8_t.value) + +class uint8_tArray(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def iterator(self): + return _USCD.uint8_tArray_iterator(self) + def __iter__(self): + return self.iterator() + + def __nonzero__(self): + return _USCD.uint8_tArray___nonzero__(self) + + def __bool__(self): + return _USCD.uint8_tArray___bool__(self) + + def __len__(self): + return _USCD.uint8_tArray___len__(self) + + def __getslice__(self, i, j): + return _USCD.uint8_tArray___getslice__(self, i, j) + + def __setslice__(self, *args): + return _USCD.uint8_tArray___setslice__(self, *args) + + def __delslice__(self, i, j): + return _USCD.uint8_tArray___delslice__(self, i, j) + + def __delitem__(self, *args): + return _USCD.uint8_tArray___delitem__(self, *args) + + def __getitem__(self, *args): + return _USCD.uint8_tArray___getitem__(self, *args) + + def __setitem__(self, *args): + return _USCD.uint8_tArray___setitem__(self, *args) + + def pop(self): + return _USCD.uint8_tArray_pop(self) + + def append(self, x): + return _USCD.uint8_tArray_append(self, x) + + def empty(self): + return _USCD.uint8_tArray_empty(self) + + def size(self): + return _USCD.uint8_tArray_size(self) + + def swap(self, v): + return _USCD.uint8_tArray_swap(self, v) + + def begin(self): + return _USCD.uint8_tArray_begin(self) + + def end(self): + return _USCD.uint8_tArray_end(self) + + def rbegin(self): + return _USCD.uint8_tArray_rbegin(self) + + def rend(self): + return _USCD.uint8_tArray_rend(self) + + def clear(self): + return _USCD.uint8_tArray_clear(self) + + def get_allocator(self): + return _USCD.uint8_tArray_get_allocator(self) + + def pop_back(self): + return _USCD.uint8_tArray_pop_back(self) + + def erase(self, *args): + return _USCD.uint8_tArray_erase(self, *args) + + def __init__(self, *args): + _USCD.uint8_tArray_swiginit(self, _USCD.new_uint8_tArray(*args)) + + def push_back(self, x): + return _USCD.uint8_tArray_push_back(self, x) + + def front(self): + return _USCD.uint8_tArray_front(self) + + def back(self): + return _USCD.uint8_tArray_back(self) + + def assign(self, n, x): + return _USCD.uint8_tArray_assign(self, n, x) + + def resize(self, *args): + return _USCD.uint8_tArray_resize(self, *args) + + def insert(self, *args): + return _USCD.uint8_tArray_insert(self, *args) + + def reserve(self, n): + return _USCD.uint8_tArray_reserve(self, n) + + def capacity(self): + return _USCD.uint8_tArray_capacity(self) + __swig_destroy__ = _USCD.delete_uint8_tArray + +# Register uint8_tArray in _USCD: +_USCD.uint8_tArray_swigregister(uint8_tArray) + + +_array_map["uint8_t"] =uint8_tArray + +class _Matx_uint8_t_2_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_uint8_t_2_1_rows + cols = _USCD._Matx_uint8_t_2_1_cols + channels = _USCD._Matx_uint8_t_2_1_channels + shortdim = _USCD._Matx_uint8_t_2_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_uint8_t_2_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_uint8_t_2_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_uint8_t_2_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_uint8_t_2_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_uint8_t_2_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_uint8_t_2_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_uint8_t_2_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_uint8_t_2_1_ddot(self, v) + + def t(self): + return _USCD._Matx_uint8_t_2_1_t(self) + + def mul(self, a): + return _USCD._Matx_uint8_t_2_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_uint8_t_2_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_uint8_t_2_1___call__(self, i, j) + val = property(_USCD._Matx_uint8_t_2_1_val_get, _USCD._Matx_uint8_t_2_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_uint8_t_2_1_swiginit(self, _USCD.new__Matx_uint8_t_2_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_uint8_t_2_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_uint8_t_2_1 + +# Register _Matx_uint8_t_2_1 in _USCD: +_USCD._Matx_uint8_t_2_1_swigregister(_Matx_uint8_t_2_1) + +def _Matx_uint8_t_2_1_all(alpha): + return _USCD._Matx_uint8_t_2_1_all(alpha) + +def _Matx_uint8_t_2_1_zeros(): + return _USCD._Matx_uint8_t_2_1_zeros() + +def _Matx_uint8_t_2_1_ones(): + return _USCD._Matx_uint8_t_2_1_ones() + +def _Matx_uint8_t_2_1_eye(): + return _USCD._Matx_uint8_t_2_1_eye() + +def _Matx_uint8_t_2_1_randu(a, b): + return _USCD._Matx_uint8_t_2_1_randu(a, b) + +def _Matx_uint8_t_2_1_randn(a, b): + return _USCD._Matx_uint8_t_2_1_randn(a, b) + + +Matx21b = _Matx_uint8_t_2_1 + +class _Vec_uint8_t_2(_Matx_uint8_t_2_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_uint8_t_2_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_uint8_t_2_all(alpha) + + def mul(self, v): + return _USCD._Vec_uint8_t_2_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_uint8_t_2___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_uint8_t_2_swiginit(self, _USCD.new__Vec_uint8_t_2(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_uint8_t_2___str__(self) + __swig_destroy__ = _USCD.delete__Vec_uint8_t_2 + +# Register _Vec_uint8_t_2 in _USCD: +_USCD._Vec_uint8_t_2_swigregister(_Vec_uint8_t_2) + +def _Vec_uint8_t_2_all(alpha): + return _USCD._Vec_uint8_t_2_all(alpha) + +class _DataType_Vec_uint8_t_2(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_uint8_t_2_generic_type + channels = _USCD._DataType_Vec_uint8_t_2_channels + fmt = _USCD._DataType_Vec_uint8_t_2_fmt + + def __init__(self): + _USCD._DataType_Vec_uint8_t_2_swiginit(self, _USCD.new__DataType_Vec_uint8_t_2()) + __swig_destroy__ = _USCD.delete__DataType_Vec_uint8_t_2 + +# Register _DataType_Vec_uint8_t_2 in _USCD: +_USCD._DataType_Vec_uint8_t_2_swigregister(_DataType_Vec_uint8_t_2) + + +Vec2b = _Vec_uint8_t_2 +DataType_Vec2b = _DataType_Vec_uint8_t_2 + +class _Matx_uint8_t_3_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_uint8_t_3_1_rows + cols = _USCD._Matx_uint8_t_3_1_cols + channels = _USCD._Matx_uint8_t_3_1_channels + shortdim = _USCD._Matx_uint8_t_3_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_uint8_t_3_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_uint8_t_3_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_uint8_t_3_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_uint8_t_3_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_uint8_t_3_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_uint8_t_3_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_uint8_t_3_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_uint8_t_3_1_ddot(self, v) + + def t(self): + return _USCD._Matx_uint8_t_3_1_t(self) + + def mul(self, a): + return _USCD._Matx_uint8_t_3_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_uint8_t_3_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_uint8_t_3_1___call__(self, i, j) + val = property(_USCD._Matx_uint8_t_3_1_val_get, _USCD._Matx_uint8_t_3_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_uint8_t_3_1_swiginit(self, _USCD.new__Matx_uint8_t_3_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_uint8_t_3_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_uint8_t_3_1 + +# Register _Matx_uint8_t_3_1 in _USCD: +_USCD._Matx_uint8_t_3_1_swigregister(_Matx_uint8_t_3_1) + +def _Matx_uint8_t_3_1_all(alpha): + return _USCD._Matx_uint8_t_3_1_all(alpha) + +def _Matx_uint8_t_3_1_zeros(): + return _USCD._Matx_uint8_t_3_1_zeros() + +def _Matx_uint8_t_3_1_ones(): + return _USCD._Matx_uint8_t_3_1_ones() + +def _Matx_uint8_t_3_1_eye(): + return _USCD._Matx_uint8_t_3_1_eye() + +def _Matx_uint8_t_3_1_randu(a, b): + return _USCD._Matx_uint8_t_3_1_randu(a, b) + +def _Matx_uint8_t_3_1_randn(a, b): + return _USCD._Matx_uint8_t_3_1_randn(a, b) + + +Matx31b = _Matx_uint8_t_3_1 + +class _Vec_uint8_t_3(_Matx_uint8_t_3_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_uint8_t_3_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_uint8_t_3_all(alpha) + + def mul(self, v): + return _USCD._Vec_uint8_t_3_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_uint8_t_3___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_uint8_t_3_swiginit(self, _USCD.new__Vec_uint8_t_3(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_uint8_t_3___str__(self) + __swig_destroy__ = _USCD.delete__Vec_uint8_t_3 + +# Register _Vec_uint8_t_3 in _USCD: +_USCD._Vec_uint8_t_3_swigregister(_Vec_uint8_t_3) + +def _Vec_uint8_t_3_all(alpha): + return _USCD._Vec_uint8_t_3_all(alpha) + +class _DataType_Vec_uint8_t_3(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_uint8_t_3_generic_type + channels = _USCD._DataType_Vec_uint8_t_3_channels + fmt = _USCD._DataType_Vec_uint8_t_3_fmt + + def __init__(self): + _USCD._DataType_Vec_uint8_t_3_swiginit(self, _USCD.new__DataType_Vec_uint8_t_3()) + __swig_destroy__ = _USCD.delete__DataType_Vec_uint8_t_3 + +# Register _DataType_Vec_uint8_t_3 in _USCD: +_USCD._DataType_Vec_uint8_t_3_swigregister(_DataType_Vec_uint8_t_3) + + +Vec3b = _Vec_uint8_t_3 +DataType_Vec3b = _DataType_Vec_uint8_t_3 + +class _Matx_uint8_t_4_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_uint8_t_4_1_rows + cols = _USCD._Matx_uint8_t_4_1_cols + channels = _USCD._Matx_uint8_t_4_1_channels + shortdim = _USCD._Matx_uint8_t_4_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_uint8_t_4_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_uint8_t_4_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_uint8_t_4_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_uint8_t_4_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_uint8_t_4_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_uint8_t_4_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_uint8_t_4_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_uint8_t_4_1_ddot(self, v) + + def t(self): + return _USCD._Matx_uint8_t_4_1_t(self) + + def mul(self, a): + return _USCD._Matx_uint8_t_4_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_uint8_t_4_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_uint8_t_4_1___call__(self, i, j) + val = property(_USCD._Matx_uint8_t_4_1_val_get, _USCD._Matx_uint8_t_4_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_uint8_t_4_1_swiginit(self, _USCD.new__Matx_uint8_t_4_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_uint8_t_4_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_uint8_t_4_1 + +# Register _Matx_uint8_t_4_1 in _USCD: +_USCD._Matx_uint8_t_4_1_swigregister(_Matx_uint8_t_4_1) + +def _Matx_uint8_t_4_1_all(alpha): + return _USCD._Matx_uint8_t_4_1_all(alpha) + +def _Matx_uint8_t_4_1_zeros(): + return _USCD._Matx_uint8_t_4_1_zeros() + +def _Matx_uint8_t_4_1_ones(): + return _USCD._Matx_uint8_t_4_1_ones() + +def _Matx_uint8_t_4_1_eye(): + return _USCD._Matx_uint8_t_4_1_eye() + +def _Matx_uint8_t_4_1_randu(a, b): + return _USCD._Matx_uint8_t_4_1_randu(a, b) + +def _Matx_uint8_t_4_1_randn(a, b): + return _USCD._Matx_uint8_t_4_1_randn(a, b) + + +Matx41b = _Matx_uint8_t_4_1 + +class _Vec_uint8_t_4(_Matx_uint8_t_4_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_uint8_t_4_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_uint8_t_4_all(alpha) + + def mul(self, v): + return _USCD._Vec_uint8_t_4_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_uint8_t_4___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_uint8_t_4_swiginit(self, _USCD.new__Vec_uint8_t_4(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_uint8_t_4___str__(self) + __swig_destroy__ = _USCD.delete__Vec_uint8_t_4 + +# Register _Vec_uint8_t_4 in _USCD: +_USCD._Vec_uint8_t_4_swigregister(_Vec_uint8_t_4) + +def _Vec_uint8_t_4_all(alpha): + return _USCD._Vec_uint8_t_4_all(alpha) + +class _DataType_Vec_uint8_t_4(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_uint8_t_4_generic_type + channels = _USCD._DataType_Vec_uint8_t_4_channels + fmt = _USCD._DataType_Vec_uint8_t_4_fmt + + def __init__(self): + _USCD._DataType_Vec_uint8_t_4_swiginit(self, _USCD.new__DataType_Vec_uint8_t_4()) + __swig_destroy__ = _USCD.delete__DataType_Vec_uint8_t_4 + +# Register _DataType_Vec_uint8_t_4 in _USCD: +_USCD._DataType_Vec_uint8_t_4_swigregister(_DataType_Vec_uint8_t_4) + + +Vec4b = _Vec_uint8_t_4 +DataType_Vec4b = _DataType_Vec_uint8_t_4 + +class _cv_numpy_sizeof_short(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_short_value + + def __init__(self): + _USCD._cv_numpy_sizeof_short_swiginit(self, _USCD.new__cv_numpy_sizeof_short()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_short + +# Register _cv_numpy_sizeof_short in _USCD: +_USCD._cv_numpy_sizeof_short_swigregister(_cv_numpy_sizeof_short) + + +if _cv_numpy_sizeof_short.value == 1: + _cv_numpy_typestr_map["short"] = "|" +"i" + "1" +else: + _cv_numpy_typestr_map["short"] = _cv_numpy_endianess +"i" + str(_cv_numpy_sizeof_short.value) + +class shortArray(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def iterator(self): + return _USCD.shortArray_iterator(self) + def __iter__(self): + return self.iterator() + + def __nonzero__(self): + return _USCD.shortArray___nonzero__(self) + + def __bool__(self): + return _USCD.shortArray___bool__(self) + + def __len__(self): + return _USCD.shortArray___len__(self) + + def __getslice__(self, i, j): + return _USCD.shortArray___getslice__(self, i, j) + + def __setslice__(self, *args): + return _USCD.shortArray___setslice__(self, *args) + + def __delslice__(self, i, j): + return _USCD.shortArray___delslice__(self, i, j) + + def __delitem__(self, *args): + return _USCD.shortArray___delitem__(self, *args) + + def __getitem__(self, *args): + return _USCD.shortArray___getitem__(self, *args) + + def __setitem__(self, *args): + return _USCD.shortArray___setitem__(self, *args) + + def pop(self): + return _USCD.shortArray_pop(self) + + def append(self, x): + return _USCD.shortArray_append(self, x) + + def empty(self): + return _USCD.shortArray_empty(self) + + def size(self): + return _USCD.shortArray_size(self) + + def swap(self, v): + return _USCD.shortArray_swap(self, v) + + def begin(self): + return _USCD.shortArray_begin(self) + + def end(self): + return _USCD.shortArray_end(self) + + def rbegin(self): + return _USCD.shortArray_rbegin(self) + + def rend(self): + return _USCD.shortArray_rend(self) + + def clear(self): + return _USCD.shortArray_clear(self) + + def get_allocator(self): + return _USCD.shortArray_get_allocator(self) + + def pop_back(self): + return _USCD.shortArray_pop_back(self) + + def erase(self, *args): + return _USCD.shortArray_erase(self, *args) + + def __init__(self, *args): + _USCD.shortArray_swiginit(self, _USCD.new_shortArray(*args)) + + def push_back(self, x): + return _USCD.shortArray_push_back(self, x) + + def front(self): + return _USCD.shortArray_front(self) + + def back(self): + return _USCD.shortArray_back(self) + + def assign(self, n, x): + return _USCD.shortArray_assign(self, n, x) + + def resize(self, *args): + return _USCD.shortArray_resize(self, *args) + + def insert(self, *args): + return _USCD.shortArray_insert(self, *args) + + def reserve(self, n): + return _USCD.shortArray_reserve(self, n) + + def capacity(self): + return _USCD.shortArray_capacity(self) + __swig_destroy__ = _USCD.delete_shortArray + +# Register shortArray in _USCD: +_USCD.shortArray_swigregister(shortArray) + + +_array_map["short"] =shortArray + +class _Matx_short_2_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_short_2_1_rows + cols = _USCD._Matx_short_2_1_cols + channels = _USCD._Matx_short_2_1_channels + shortdim = _USCD._Matx_short_2_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_short_2_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_short_2_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_short_2_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_short_2_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_short_2_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_short_2_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_short_2_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_short_2_1_ddot(self, v) + + def t(self): + return _USCD._Matx_short_2_1_t(self) + + def mul(self, a): + return _USCD._Matx_short_2_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_short_2_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_short_2_1___call__(self, i, j) + val = property(_USCD._Matx_short_2_1_val_get, _USCD._Matx_short_2_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_short_2_1_swiginit(self, _USCD.new__Matx_short_2_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_short_2_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_short_2_1 + +# Register _Matx_short_2_1 in _USCD: +_USCD._Matx_short_2_1_swigregister(_Matx_short_2_1) + +def _Matx_short_2_1_all(alpha): + return _USCD._Matx_short_2_1_all(alpha) + +def _Matx_short_2_1_zeros(): + return _USCD._Matx_short_2_1_zeros() + +def _Matx_short_2_1_ones(): + return _USCD._Matx_short_2_1_ones() + +def _Matx_short_2_1_eye(): + return _USCD._Matx_short_2_1_eye() + +def _Matx_short_2_1_randu(a, b): + return _USCD._Matx_short_2_1_randu(a, b) + +def _Matx_short_2_1_randn(a, b): + return _USCD._Matx_short_2_1_randn(a, b) + + +Matx21s = _Matx_short_2_1 + +class _Vec_short_2(_Matx_short_2_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_short_2_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_short_2_all(alpha) + + def mul(self, v): + return _USCD._Vec_short_2_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_short_2___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_short_2_swiginit(self, _USCD.new__Vec_short_2(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_short_2___str__(self) + __swig_destroy__ = _USCD.delete__Vec_short_2 + +# Register _Vec_short_2 in _USCD: +_USCD._Vec_short_2_swigregister(_Vec_short_2) + +def _Vec_short_2_all(alpha): + return _USCD._Vec_short_2_all(alpha) + +class _DataType_Vec_short_2(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_short_2_generic_type + channels = _USCD._DataType_Vec_short_2_channels + fmt = _USCD._DataType_Vec_short_2_fmt + + def __init__(self): + _USCD._DataType_Vec_short_2_swiginit(self, _USCD.new__DataType_Vec_short_2()) + __swig_destroy__ = _USCD.delete__DataType_Vec_short_2 + +# Register _DataType_Vec_short_2 in _USCD: +_USCD._DataType_Vec_short_2_swigregister(_DataType_Vec_short_2) + + +Vec2s = _Vec_short_2 +DataType_Vec2s = _DataType_Vec_short_2 + +class _Matx_short_3_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_short_3_1_rows + cols = _USCD._Matx_short_3_1_cols + channels = _USCD._Matx_short_3_1_channels + shortdim = _USCD._Matx_short_3_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_short_3_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_short_3_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_short_3_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_short_3_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_short_3_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_short_3_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_short_3_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_short_3_1_ddot(self, v) + + def t(self): + return _USCD._Matx_short_3_1_t(self) + + def mul(self, a): + return _USCD._Matx_short_3_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_short_3_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_short_3_1___call__(self, i, j) + val = property(_USCD._Matx_short_3_1_val_get, _USCD._Matx_short_3_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_short_3_1_swiginit(self, _USCD.new__Matx_short_3_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_short_3_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_short_3_1 + +# Register _Matx_short_3_1 in _USCD: +_USCD._Matx_short_3_1_swigregister(_Matx_short_3_1) + +def _Matx_short_3_1_all(alpha): + return _USCD._Matx_short_3_1_all(alpha) + +def _Matx_short_3_1_zeros(): + return _USCD._Matx_short_3_1_zeros() + +def _Matx_short_3_1_ones(): + return _USCD._Matx_short_3_1_ones() + +def _Matx_short_3_1_eye(): + return _USCD._Matx_short_3_1_eye() + +def _Matx_short_3_1_randu(a, b): + return _USCD._Matx_short_3_1_randu(a, b) + +def _Matx_short_3_1_randn(a, b): + return _USCD._Matx_short_3_1_randn(a, b) + + +Matx31s = _Matx_short_3_1 + +class _Vec_short_3(_Matx_short_3_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_short_3_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_short_3_all(alpha) + + def mul(self, v): + return _USCD._Vec_short_3_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_short_3___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_short_3_swiginit(self, _USCD.new__Vec_short_3(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_short_3___str__(self) + __swig_destroy__ = _USCD.delete__Vec_short_3 + +# Register _Vec_short_3 in _USCD: +_USCD._Vec_short_3_swigregister(_Vec_short_3) + +def _Vec_short_3_all(alpha): + return _USCD._Vec_short_3_all(alpha) + +class _DataType_Vec_short_3(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_short_3_generic_type + channels = _USCD._DataType_Vec_short_3_channels + fmt = _USCD._DataType_Vec_short_3_fmt + + def __init__(self): + _USCD._DataType_Vec_short_3_swiginit(self, _USCD.new__DataType_Vec_short_3()) + __swig_destroy__ = _USCD.delete__DataType_Vec_short_3 + +# Register _DataType_Vec_short_3 in _USCD: +_USCD._DataType_Vec_short_3_swigregister(_DataType_Vec_short_3) + + +Vec3s = _Vec_short_3 +DataType_Vec3s = _DataType_Vec_short_3 + +class _Matx_short_4_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_short_4_1_rows + cols = _USCD._Matx_short_4_1_cols + channels = _USCD._Matx_short_4_1_channels + shortdim = _USCD._Matx_short_4_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_short_4_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_short_4_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_short_4_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_short_4_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_short_4_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_short_4_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_short_4_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_short_4_1_ddot(self, v) + + def t(self): + return _USCD._Matx_short_4_1_t(self) + + def mul(self, a): + return _USCD._Matx_short_4_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_short_4_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_short_4_1___call__(self, i, j) + val = property(_USCD._Matx_short_4_1_val_get, _USCD._Matx_short_4_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_short_4_1_swiginit(self, _USCD.new__Matx_short_4_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_short_4_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_short_4_1 + +# Register _Matx_short_4_1 in _USCD: +_USCD._Matx_short_4_1_swigregister(_Matx_short_4_1) + +def _Matx_short_4_1_all(alpha): + return _USCD._Matx_short_4_1_all(alpha) + +def _Matx_short_4_1_zeros(): + return _USCD._Matx_short_4_1_zeros() + +def _Matx_short_4_1_ones(): + return _USCD._Matx_short_4_1_ones() + +def _Matx_short_4_1_eye(): + return _USCD._Matx_short_4_1_eye() + +def _Matx_short_4_1_randu(a, b): + return _USCD._Matx_short_4_1_randu(a, b) + +def _Matx_short_4_1_randn(a, b): + return _USCD._Matx_short_4_1_randn(a, b) + + +Matx41s = _Matx_short_4_1 + +class _Vec_short_4(_Matx_short_4_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_short_4_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_short_4_all(alpha) + + def mul(self, v): + return _USCD._Vec_short_4_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_short_4___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_short_4_swiginit(self, _USCD.new__Vec_short_4(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_short_4___str__(self) + __swig_destroy__ = _USCD.delete__Vec_short_4 + +# Register _Vec_short_4 in _USCD: +_USCD._Vec_short_4_swigregister(_Vec_short_4) + +def _Vec_short_4_all(alpha): + return _USCD._Vec_short_4_all(alpha) + +class _DataType_Vec_short_4(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_short_4_generic_type + channels = _USCD._DataType_Vec_short_4_channels + fmt = _USCD._DataType_Vec_short_4_fmt + + def __init__(self): + _USCD._DataType_Vec_short_4_swiginit(self, _USCD.new__DataType_Vec_short_4()) + __swig_destroy__ = _USCD.delete__DataType_Vec_short_4 + +# Register _DataType_Vec_short_4 in _USCD: +_USCD._DataType_Vec_short_4_swigregister(_DataType_Vec_short_4) + + +Vec4s = _Vec_short_4 +DataType_Vec4s = _DataType_Vec_short_4 + +class _cv_numpy_sizeof_ushort(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_ushort_value + + def __init__(self): + _USCD._cv_numpy_sizeof_ushort_swiginit(self, _USCD.new__cv_numpy_sizeof_ushort()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_ushort + +# Register _cv_numpy_sizeof_ushort in _USCD: +_USCD._cv_numpy_sizeof_ushort_swigregister(_cv_numpy_sizeof_ushort) + + +if _cv_numpy_sizeof_ushort.value == 1: + _cv_numpy_typestr_map["ushort"] = "|" +"u" + "1" +else: + _cv_numpy_typestr_map["ushort"] = _cv_numpy_endianess +"u" + str(_cv_numpy_sizeof_ushort.value) + +class ushortArray(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def iterator(self): + return _USCD.ushortArray_iterator(self) + def __iter__(self): + return self.iterator() + + def __nonzero__(self): + return _USCD.ushortArray___nonzero__(self) + + def __bool__(self): + return _USCD.ushortArray___bool__(self) + + def __len__(self): + return _USCD.ushortArray___len__(self) + + def __getslice__(self, i, j): + return _USCD.ushortArray___getslice__(self, i, j) + + def __setslice__(self, *args): + return _USCD.ushortArray___setslice__(self, *args) + + def __delslice__(self, i, j): + return _USCD.ushortArray___delslice__(self, i, j) + + def __delitem__(self, *args): + return _USCD.ushortArray___delitem__(self, *args) + + def __getitem__(self, *args): + return _USCD.ushortArray___getitem__(self, *args) + + def __setitem__(self, *args): + return _USCD.ushortArray___setitem__(self, *args) + + def pop(self): + return _USCD.ushortArray_pop(self) + + def append(self, x): + return _USCD.ushortArray_append(self, x) + + def empty(self): + return _USCD.ushortArray_empty(self) + + def size(self): + return _USCD.ushortArray_size(self) + + def swap(self, v): + return _USCD.ushortArray_swap(self, v) + + def begin(self): + return _USCD.ushortArray_begin(self) + + def end(self): + return _USCD.ushortArray_end(self) + + def rbegin(self): + return _USCD.ushortArray_rbegin(self) + + def rend(self): + return _USCD.ushortArray_rend(self) + + def clear(self): + return _USCD.ushortArray_clear(self) + + def get_allocator(self): + return _USCD.ushortArray_get_allocator(self) + + def pop_back(self): + return _USCD.ushortArray_pop_back(self) + + def erase(self, *args): + return _USCD.ushortArray_erase(self, *args) + + def __init__(self, *args): + _USCD.ushortArray_swiginit(self, _USCD.new_ushortArray(*args)) + + def push_back(self, x): + return _USCD.ushortArray_push_back(self, x) + + def front(self): + return _USCD.ushortArray_front(self) + + def back(self): + return _USCD.ushortArray_back(self) + + def assign(self, n, x): + return _USCD.ushortArray_assign(self, n, x) + + def resize(self, *args): + return _USCD.ushortArray_resize(self, *args) + + def insert(self, *args): + return _USCD.ushortArray_insert(self, *args) + + def reserve(self, n): + return _USCD.ushortArray_reserve(self, n) + + def capacity(self): + return _USCD.ushortArray_capacity(self) + __swig_destroy__ = _USCD.delete_ushortArray + +# Register ushortArray in _USCD: +_USCD.ushortArray_swigregister(ushortArray) + + +_array_map["ushort"] =ushortArray + +class _Matx_ushort_2_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_ushort_2_1_rows + cols = _USCD._Matx_ushort_2_1_cols + channels = _USCD._Matx_ushort_2_1_channels + shortdim = _USCD._Matx_ushort_2_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_ushort_2_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_ushort_2_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_ushort_2_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_ushort_2_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_ushort_2_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_ushort_2_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_ushort_2_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_ushort_2_1_ddot(self, v) + + def t(self): + return _USCD._Matx_ushort_2_1_t(self) + + def mul(self, a): + return _USCD._Matx_ushort_2_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_ushort_2_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_ushort_2_1___call__(self, i, j) + val = property(_USCD._Matx_ushort_2_1_val_get, _USCD._Matx_ushort_2_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_ushort_2_1_swiginit(self, _USCD.new__Matx_ushort_2_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_ushort_2_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_ushort_2_1 + +# Register _Matx_ushort_2_1 in _USCD: +_USCD._Matx_ushort_2_1_swigregister(_Matx_ushort_2_1) + +def _Matx_ushort_2_1_all(alpha): + return _USCD._Matx_ushort_2_1_all(alpha) + +def _Matx_ushort_2_1_zeros(): + return _USCD._Matx_ushort_2_1_zeros() + +def _Matx_ushort_2_1_ones(): + return _USCD._Matx_ushort_2_1_ones() + +def _Matx_ushort_2_1_eye(): + return _USCD._Matx_ushort_2_1_eye() + +def _Matx_ushort_2_1_randu(a, b): + return _USCD._Matx_ushort_2_1_randu(a, b) + +def _Matx_ushort_2_1_randn(a, b): + return _USCD._Matx_ushort_2_1_randn(a, b) + + +Matx21w = _Matx_ushort_2_1 + +class _Vec_ushort_2(_Matx_ushort_2_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_ushort_2_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_ushort_2_all(alpha) + + def mul(self, v): + return _USCD._Vec_ushort_2_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_ushort_2___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_ushort_2_swiginit(self, _USCD.new__Vec_ushort_2(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_ushort_2___str__(self) + __swig_destroy__ = _USCD.delete__Vec_ushort_2 + +# Register _Vec_ushort_2 in _USCD: +_USCD._Vec_ushort_2_swigregister(_Vec_ushort_2) + +def _Vec_ushort_2_all(alpha): + return _USCD._Vec_ushort_2_all(alpha) + +class _DataType_Vec_ushort_2(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_ushort_2_generic_type + channels = _USCD._DataType_Vec_ushort_2_channels + fmt = _USCD._DataType_Vec_ushort_2_fmt + + def __init__(self): + _USCD._DataType_Vec_ushort_2_swiginit(self, _USCD.new__DataType_Vec_ushort_2()) + __swig_destroy__ = _USCD.delete__DataType_Vec_ushort_2 + +# Register _DataType_Vec_ushort_2 in _USCD: +_USCD._DataType_Vec_ushort_2_swigregister(_DataType_Vec_ushort_2) + + +Vec2w = _Vec_ushort_2 +DataType_Vec2w = _DataType_Vec_ushort_2 + +class _Matx_ushort_3_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_ushort_3_1_rows + cols = _USCD._Matx_ushort_3_1_cols + channels = _USCD._Matx_ushort_3_1_channels + shortdim = _USCD._Matx_ushort_3_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_ushort_3_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_ushort_3_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_ushort_3_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_ushort_3_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_ushort_3_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_ushort_3_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_ushort_3_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_ushort_3_1_ddot(self, v) + + def t(self): + return _USCD._Matx_ushort_3_1_t(self) + + def mul(self, a): + return _USCD._Matx_ushort_3_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_ushort_3_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_ushort_3_1___call__(self, i, j) + val = property(_USCD._Matx_ushort_3_1_val_get, _USCD._Matx_ushort_3_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_ushort_3_1_swiginit(self, _USCD.new__Matx_ushort_3_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_ushort_3_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_ushort_3_1 + +# Register _Matx_ushort_3_1 in _USCD: +_USCD._Matx_ushort_3_1_swigregister(_Matx_ushort_3_1) + +def _Matx_ushort_3_1_all(alpha): + return _USCD._Matx_ushort_3_1_all(alpha) + +def _Matx_ushort_3_1_zeros(): + return _USCD._Matx_ushort_3_1_zeros() + +def _Matx_ushort_3_1_ones(): + return _USCD._Matx_ushort_3_1_ones() + +def _Matx_ushort_3_1_eye(): + return _USCD._Matx_ushort_3_1_eye() + +def _Matx_ushort_3_1_randu(a, b): + return _USCD._Matx_ushort_3_1_randu(a, b) + +def _Matx_ushort_3_1_randn(a, b): + return _USCD._Matx_ushort_3_1_randn(a, b) + + +Matx31w = _Matx_ushort_3_1 + +class _Vec_ushort_3(_Matx_ushort_3_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_ushort_3_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_ushort_3_all(alpha) + + def mul(self, v): + return _USCD._Vec_ushort_3_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_ushort_3___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_ushort_3_swiginit(self, _USCD.new__Vec_ushort_3(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_ushort_3___str__(self) + __swig_destroy__ = _USCD.delete__Vec_ushort_3 + +# Register _Vec_ushort_3 in _USCD: +_USCD._Vec_ushort_3_swigregister(_Vec_ushort_3) + +def _Vec_ushort_3_all(alpha): + return _USCD._Vec_ushort_3_all(alpha) + +class _DataType_Vec_ushort_3(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_ushort_3_generic_type + channels = _USCD._DataType_Vec_ushort_3_channels + fmt = _USCD._DataType_Vec_ushort_3_fmt + + def __init__(self): + _USCD._DataType_Vec_ushort_3_swiginit(self, _USCD.new__DataType_Vec_ushort_3()) + __swig_destroy__ = _USCD.delete__DataType_Vec_ushort_3 + +# Register _DataType_Vec_ushort_3 in _USCD: +_USCD._DataType_Vec_ushort_3_swigregister(_DataType_Vec_ushort_3) + + +Vec3w = _Vec_ushort_3 +DataType_Vec3w = _DataType_Vec_ushort_3 + +class _Matx_ushort_4_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_ushort_4_1_rows + cols = _USCD._Matx_ushort_4_1_cols + channels = _USCD._Matx_ushort_4_1_channels + shortdim = _USCD._Matx_ushort_4_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_ushort_4_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_ushort_4_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_ushort_4_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_ushort_4_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_ushort_4_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_ushort_4_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_ushort_4_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_ushort_4_1_ddot(self, v) + + def t(self): + return _USCD._Matx_ushort_4_1_t(self) + + def mul(self, a): + return _USCD._Matx_ushort_4_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_ushort_4_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_ushort_4_1___call__(self, i, j) + val = property(_USCD._Matx_ushort_4_1_val_get, _USCD._Matx_ushort_4_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_ushort_4_1_swiginit(self, _USCD.new__Matx_ushort_4_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_ushort_4_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_ushort_4_1 + +# Register _Matx_ushort_4_1 in _USCD: +_USCD._Matx_ushort_4_1_swigregister(_Matx_ushort_4_1) + +def _Matx_ushort_4_1_all(alpha): + return _USCD._Matx_ushort_4_1_all(alpha) + +def _Matx_ushort_4_1_zeros(): + return _USCD._Matx_ushort_4_1_zeros() + +def _Matx_ushort_4_1_ones(): + return _USCD._Matx_ushort_4_1_ones() + +def _Matx_ushort_4_1_eye(): + return _USCD._Matx_ushort_4_1_eye() + +def _Matx_ushort_4_1_randu(a, b): + return _USCD._Matx_ushort_4_1_randu(a, b) + +def _Matx_ushort_4_1_randn(a, b): + return _USCD._Matx_ushort_4_1_randn(a, b) + + +Matx41w = _Matx_ushort_4_1 + +class _Vec_ushort_4(_Matx_ushort_4_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_ushort_4_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_ushort_4_all(alpha) + + def mul(self, v): + return _USCD._Vec_ushort_4_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_ushort_4___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_ushort_4_swiginit(self, _USCD.new__Vec_ushort_4(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_ushort_4___str__(self) + __swig_destroy__ = _USCD.delete__Vec_ushort_4 + +# Register _Vec_ushort_4 in _USCD: +_USCD._Vec_ushort_4_swigregister(_Vec_ushort_4) + +def _Vec_ushort_4_all(alpha): + return _USCD._Vec_ushort_4_all(alpha) + +class _DataType_Vec_ushort_4(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_ushort_4_generic_type + channels = _USCD._DataType_Vec_ushort_4_channels + fmt = _USCD._DataType_Vec_ushort_4_fmt + + def __init__(self): + _USCD._DataType_Vec_ushort_4_swiginit(self, _USCD.new__DataType_Vec_ushort_4()) + __swig_destroy__ = _USCD.delete__DataType_Vec_ushort_4 + +# Register _DataType_Vec_ushort_4 in _USCD: +_USCD._DataType_Vec_ushort_4_swigregister(_DataType_Vec_ushort_4) + + +Vec4w = _Vec_ushort_4 +DataType_Vec4w = _DataType_Vec_ushort_4 + +class _cv_numpy_sizeof_int(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_int_value + + def __init__(self): + _USCD._cv_numpy_sizeof_int_swiginit(self, _USCD.new__cv_numpy_sizeof_int()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_int + +# Register _cv_numpy_sizeof_int in _USCD: +_USCD._cv_numpy_sizeof_int_swigregister(_cv_numpy_sizeof_int) + + +if _cv_numpy_sizeof_int.value == 1: + _cv_numpy_typestr_map["int"] = "|" +"i" + "1" +else: + _cv_numpy_typestr_map["int"] = _cv_numpy_endianess +"i" + str(_cv_numpy_sizeof_int.value) + +class intArray(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def iterator(self): + return _USCD.intArray_iterator(self) + def __iter__(self): + return self.iterator() + + def __nonzero__(self): + return _USCD.intArray___nonzero__(self) + + def __bool__(self): + return _USCD.intArray___bool__(self) + + def __len__(self): + return _USCD.intArray___len__(self) + + def __getslice__(self, i, j): + return _USCD.intArray___getslice__(self, i, j) + + def __setslice__(self, *args): + return _USCD.intArray___setslice__(self, *args) + + def __delslice__(self, i, j): + return _USCD.intArray___delslice__(self, i, j) + + def __delitem__(self, *args): + return _USCD.intArray___delitem__(self, *args) + + def __getitem__(self, *args): + return _USCD.intArray___getitem__(self, *args) + + def __setitem__(self, *args): + return _USCD.intArray___setitem__(self, *args) + + def pop(self): + return _USCD.intArray_pop(self) + + def append(self, x): + return _USCD.intArray_append(self, x) + + def empty(self): + return _USCD.intArray_empty(self) + + def size(self): + return _USCD.intArray_size(self) + + def swap(self, v): + return _USCD.intArray_swap(self, v) + + def begin(self): + return _USCD.intArray_begin(self) + + def end(self): + return _USCD.intArray_end(self) + + def rbegin(self): + return _USCD.intArray_rbegin(self) + + def rend(self): + return _USCD.intArray_rend(self) + + def clear(self): + return _USCD.intArray_clear(self) + + def get_allocator(self): + return _USCD.intArray_get_allocator(self) + + def pop_back(self): + return _USCD.intArray_pop_back(self) + + def erase(self, *args): + return _USCD.intArray_erase(self, *args) + + def __init__(self, *args): + _USCD.intArray_swiginit(self, _USCD.new_intArray(*args)) + + def push_back(self, x): + return _USCD.intArray_push_back(self, x) + + def front(self): + return _USCD.intArray_front(self) + + def back(self): + return _USCD.intArray_back(self) + + def assign(self, n, x): + return _USCD.intArray_assign(self, n, x) + + def resize(self, *args): + return _USCD.intArray_resize(self, *args) + + def insert(self, *args): + return _USCD.intArray_insert(self, *args) + + def reserve(self, n): + return _USCD.intArray_reserve(self, n) + + def capacity(self): + return _USCD.intArray_capacity(self) + __swig_destroy__ = _USCD.delete_intArray + +# Register intArray in _USCD: +_USCD.intArray_swigregister(intArray) + + +_array_map["int"] =intArray + +class _Matx_int_2_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_int_2_1_rows + cols = _USCD._Matx_int_2_1_cols + channels = _USCD._Matx_int_2_1_channels + shortdim = _USCD._Matx_int_2_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_int_2_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_int_2_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_int_2_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_int_2_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_int_2_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_int_2_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_int_2_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_int_2_1_ddot(self, v) + + def t(self): + return _USCD._Matx_int_2_1_t(self) + + def mul(self, a): + return _USCD._Matx_int_2_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_int_2_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_int_2_1___call__(self, i, j) + val = property(_USCD._Matx_int_2_1_val_get, _USCD._Matx_int_2_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_int_2_1_swiginit(self, _USCD.new__Matx_int_2_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_int_2_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_int_2_1 + +# Register _Matx_int_2_1 in _USCD: +_USCD._Matx_int_2_1_swigregister(_Matx_int_2_1) + +def _Matx_int_2_1_all(alpha): + return _USCD._Matx_int_2_1_all(alpha) + +def _Matx_int_2_1_zeros(): + return _USCD._Matx_int_2_1_zeros() + +def _Matx_int_2_1_ones(): + return _USCD._Matx_int_2_1_ones() + +def _Matx_int_2_1_eye(): + return _USCD._Matx_int_2_1_eye() + +def _Matx_int_2_1_randu(a, b): + return _USCD._Matx_int_2_1_randu(a, b) + +def _Matx_int_2_1_randn(a, b): + return _USCD._Matx_int_2_1_randn(a, b) + + +Matx21i = _Matx_int_2_1 + +class _Vec_int_2(_Matx_int_2_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_int_2_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_int_2_all(alpha) + + def mul(self, v): + return _USCD._Vec_int_2_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_int_2___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_int_2_swiginit(self, _USCD.new__Vec_int_2(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_int_2___str__(self) + __swig_destroy__ = _USCD.delete__Vec_int_2 + +# Register _Vec_int_2 in _USCD: +_USCD._Vec_int_2_swigregister(_Vec_int_2) + +def _Vec_int_2_all(alpha): + return _USCD._Vec_int_2_all(alpha) + +class _DataType_Vec_int_2(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_int_2_generic_type + channels = _USCD._DataType_Vec_int_2_channels + fmt = _USCD._DataType_Vec_int_2_fmt + + def __init__(self): + _USCD._DataType_Vec_int_2_swiginit(self, _USCD.new__DataType_Vec_int_2()) + __swig_destroy__ = _USCD.delete__DataType_Vec_int_2 + +# Register _DataType_Vec_int_2 in _USCD: +_USCD._DataType_Vec_int_2_swigregister(_DataType_Vec_int_2) + + +Vec2i = _Vec_int_2 +DataType_Vec2i = _DataType_Vec_int_2 + +class _Matx_int_3_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_int_3_1_rows + cols = _USCD._Matx_int_3_1_cols + channels = _USCD._Matx_int_3_1_channels + shortdim = _USCD._Matx_int_3_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_int_3_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_int_3_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_int_3_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_int_3_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_int_3_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_int_3_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_int_3_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_int_3_1_ddot(self, v) + + def t(self): + return _USCD._Matx_int_3_1_t(self) + + def mul(self, a): + return _USCD._Matx_int_3_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_int_3_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_int_3_1___call__(self, i, j) + val = property(_USCD._Matx_int_3_1_val_get, _USCD._Matx_int_3_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_int_3_1_swiginit(self, _USCD.new__Matx_int_3_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_int_3_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_int_3_1 + +# Register _Matx_int_3_1 in _USCD: +_USCD._Matx_int_3_1_swigregister(_Matx_int_3_1) + +def _Matx_int_3_1_all(alpha): + return _USCD._Matx_int_3_1_all(alpha) + +def _Matx_int_3_1_zeros(): + return _USCD._Matx_int_3_1_zeros() + +def _Matx_int_3_1_ones(): + return _USCD._Matx_int_3_1_ones() + +def _Matx_int_3_1_eye(): + return _USCD._Matx_int_3_1_eye() + +def _Matx_int_3_1_randu(a, b): + return _USCD._Matx_int_3_1_randu(a, b) + +def _Matx_int_3_1_randn(a, b): + return _USCD._Matx_int_3_1_randn(a, b) + + +Matx31i = _Matx_int_3_1 + +class _Vec_int_3(_Matx_int_3_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_int_3_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_int_3_all(alpha) + + def mul(self, v): + return _USCD._Vec_int_3_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_int_3___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_int_3_swiginit(self, _USCD.new__Vec_int_3(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_int_3___str__(self) + __swig_destroy__ = _USCD.delete__Vec_int_3 + +# Register _Vec_int_3 in _USCD: +_USCD._Vec_int_3_swigregister(_Vec_int_3) + +def _Vec_int_3_all(alpha): + return _USCD._Vec_int_3_all(alpha) + +class _DataType_Vec_int_3(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_int_3_generic_type + channels = _USCD._DataType_Vec_int_3_channels + fmt = _USCD._DataType_Vec_int_3_fmt + + def __init__(self): + _USCD._DataType_Vec_int_3_swiginit(self, _USCD.new__DataType_Vec_int_3()) + __swig_destroy__ = _USCD.delete__DataType_Vec_int_3 + +# Register _DataType_Vec_int_3 in _USCD: +_USCD._DataType_Vec_int_3_swigregister(_DataType_Vec_int_3) + + +Vec3i = _Vec_int_3 +DataType_Vec3i = _DataType_Vec_int_3 + +class _Matx_int_4_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_int_4_1_rows + cols = _USCD._Matx_int_4_1_cols + channels = _USCD._Matx_int_4_1_channels + shortdim = _USCD._Matx_int_4_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_int_4_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_int_4_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_int_4_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_int_4_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_int_4_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_int_4_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_int_4_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_int_4_1_ddot(self, v) + + def t(self): + return _USCD._Matx_int_4_1_t(self) + + def mul(self, a): + return _USCD._Matx_int_4_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_int_4_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_int_4_1___call__(self, i, j) + val = property(_USCD._Matx_int_4_1_val_get, _USCD._Matx_int_4_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_int_4_1_swiginit(self, _USCD.new__Matx_int_4_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_int_4_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_int_4_1 + +# Register _Matx_int_4_1 in _USCD: +_USCD._Matx_int_4_1_swigregister(_Matx_int_4_1) + +def _Matx_int_4_1_all(alpha): + return _USCD._Matx_int_4_1_all(alpha) + +def _Matx_int_4_1_zeros(): + return _USCD._Matx_int_4_1_zeros() + +def _Matx_int_4_1_ones(): + return _USCD._Matx_int_4_1_ones() + +def _Matx_int_4_1_eye(): + return _USCD._Matx_int_4_1_eye() + +def _Matx_int_4_1_randu(a, b): + return _USCD._Matx_int_4_1_randu(a, b) + +def _Matx_int_4_1_randn(a, b): + return _USCD._Matx_int_4_1_randn(a, b) + + +Matx41i = _Matx_int_4_1 + +class _Vec_int_4(_Matx_int_4_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_int_4_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_int_4_all(alpha) + + def mul(self, v): + return _USCD._Vec_int_4_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_int_4___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_int_4_swiginit(self, _USCD.new__Vec_int_4(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_int_4___str__(self) + __swig_destroy__ = _USCD.delete__Vec_int_4 + +# Register _Vec_int_4 in _USCD: +_USCD._Vec_int_4_swigregister(_Vec_int_4) + +def _Vec_int_4_all(alpha): + return _USCD._Vec_int_4_all(alpha) + +class _DataType_Vec_int_4(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_int_4_generic_type + channels = _USCD._DataType_Vec_int_4_channels + fmt = _USCD._DataType_Vec_int_4_fmt + + def __init__(self): + _USCD._DataType_Vec_int_4_swiginit(self, _USCD.new__DataType_Vec_int_4()) + __swig_destroy__ = _USCD.delete__DataType_Vec_int_4 + +# Register _DataType_Vec_int_4 in _USCD: +_USCD._DataType_Vec_int_4_swigregister(_DataType_Vec_int_4) + + +Vec4i = _Vec_int_4 +DataType_Vec4i = _DataType_Vec_int_4 + +class _Matx_int_6_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_int_6_1_rows + cols = _USCD._Matx_int_6_1_cols + channels = _USCD._Matx_int_6_1_channels + shortdim = _USCD._Matx_int_6_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_int_6_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_int_6_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_int_6_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_int_6_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_int_6_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_int_6_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_int_6_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_int_6_1_ddot(self, v) + + def t(self): + return _USCD._Matx_int_6_1_t(self) + + def mul(self, a): + return _USCD._Matx_int_6_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_int_6_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_int_6_1___call__(self, i, j) + val = property(_USCD._Matx_int_6_1_val_get, _USCD._Matx_int_6_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_int_6_1_swiginit(self, _USCD.new__Matx_int_6_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_int_6_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_int_6_1 + +# Register _Matx_int_6_1 in _USCD: +_USCD._Matx_int_6_1_swigregister(_Matx_int_6_1) + +def _Matx_int_6_1_all(alpha): + return _USCD._Matx_int_6_1_all(alpha) + +def _Matx_int_6_1_zeros(): + return _USCD._Matx_int_6_1_zeros() + +def _Matx_int_6_1_ones(): + return _USCD._Matx_int_6_1_ones() + +def _Matx_int_6_1_eye(): + return _USCD._Matx_int_6_1_eye() + +def _Matx_int_6_1_randu(a, b): + return _USCD._Matx_int_6_1_randu(a, b) + +def _Matx_int_6_1_randn(a, b): + return _USCD._Matx_int_6_1_randn(a, b) + + +Matx61i = _Matx_int_6_1 + +class _Vec_int_6(_Matx_int_6_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_int_6_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_int_6_all(alpha) + + def mul(self, v): + return _USCD._Vec_int_6_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_int_6___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_int_6_swiginit(self, _USCD.new__Vec_int_6(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_int_6___str__(self) + __swig_destroy__ = _USCD.delete__Vec_int_6 + +# Register _Vec_int_6 in _USCD: +_USCD._Vec_int_6_swigregister(_Vec_int_6) + +def _Vec_int_6_all(alpha): + return _USCD._Vec_int_6_all(alpha) + +class _DataType_Vec_int_6(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_int_6_generic_type + channels = _USCD._DataType_Vec_int_6_channels + fmt = _USCD._DataType_Vec_int_6_fmt + + def __init__(self): + _USCD._DataType_Vec_int_6_swiginit(self, _USCD.new__DataType_Vec_int_6()) + __swig_destroy__ = _USCD.delete__DataType_Vec_int_6 + +# Register _DataType_Vec_int_6 in _USCD: +_USCD._DataType_Vec_int_6_swigregister(_DataType_Vec_int_6) + + +Vec6i = _Vec_int_6 +DataType_Vec6i = _DataType_Vec_int_6 + +class _Matx_int_8_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_int_8_1_rows + cols = _USCD._Matx_int_8_1_cols + channels = _USCD._Matx_int_8_1_channels + shortdim = _USCD._Matx_int_8_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_int_8_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_int_8_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_int_8_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_int_8_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_int_8_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_int_8_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_int_8_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_int_8_1_ddot(self, v) + + def t(self): + return _USCD._Matx_int_8_1_t(self) + + def mul(self, a): + return _USCD._Matx_int_8_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_int_8_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_int_8_1___call__(self, i, j) + val = property(_USCD._Matx_int_8_1_val_get, _USCD._Matx_int_8_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_int_8_1_swiginit(self, _USCD.new__Matx_int_8_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_int_8_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_int_8_1 + +# Register _Matx_int_8_1 in _USCD: +_USCD._Matx_int_8_1_swigregister(_Matx_int_8_1) + +def _Matx_int_8_1_all(alpha): + return _USCD._Matx_int_8_1_all(alpha) + +def _Matx_int_8_1_zeros(): + return _USCD._Matx_int_8_1_zeros() + +def _Matx_int_8_1_ones(): + return _USCD._Matx_int_8_1_ones() + +def _Matx_int_8_1_eye(): + return _USCD._Matx_int_8_1_eye() + +def _Matx_int_8_1_randu(a, b): + return _USCD._Matx_int_8_1_randu(a, b) + +def _Matx_int_8_1_randn(a, b): + return _USCD._Matx_int_8_1_randn(a, b) + + +Matx81i = _Matx_int_8_1 + +class _Vec_int_8(_Matx_int_8_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_int_8_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_int_8_all(alpha) + + def mul(self, v): + return _USCD._Vec_int_8_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_int_8___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_int_8_swiginit(self, _USCD.new__Vec_int_8(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_int_8___str__(self) + __swig_destroy__ = _USCD.delete__Vec_int_8 + +# Register _Vec_int_8 in _USCD: +_USCD._Vec_int_8_swigregister(_Vec_int_8) + +def _Vec_int_8_all(alpha): + return _USCD._Vec_int_8_all(alpha) + +class _DataType_Vec_int_8(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_int_8_generic_type + channels = _USCD._DataType_Vec_int_8_channels + fmt = _USCD._DataType_Vec_int_8_fmt + + def __init__(self): + _USCD._DataType_Vec_int_8_swiginit(self, _USCD.new__DataType_Vec_int_8()) + __swig_destroy__ = _USCD.delete__DataType_Vec_int_8 + +# Register _DataType_Vec_int_8 in _USCD: +_USCD._DataType_Vec_int_8_swigregister(_DataType_Vec_int_8) + + +Vec8i = _Vec_int_8 +DataType_Vec8i = _DataType_Vec_int_8 + +class _cv_numpy_sizeof_float(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_float_value + + def __init__(self): + _USCD._cv_numpy_sizeof_float_swiginit(self, _USCD.new__cv_numpy_sizeof_float()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_float + +# Register _cv_numpy_sizeof_float in _USCD: +_USCD._cv_numpy_sizeof_float_swigregister(_cv_numpy_sizeof_float) + + +if _cv_numpy_sizeof_float.value == 1: + _cv_numpy_typestr_map["float"] = "|" +"f" + "1" +else: + _cv_numpy_typestr_map["float"] = _cv_numpy_endianess +"f" + str(_cv_numpy_sizeof_float.value) + +class floatArray(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def iterator(self): + return _USCD.floatArray_iterator(self) + def __iter__(self): + return self.iterator() + + def __nonzero__(self): + return _USCD.floatArray___nonzero__(self) + + def __bool__(self): + return _USCD.floatArray___bool__(self) + + def __len__(self): + return _USCD.floatArray___len__(self) + + def __getslice__(self, i, j): + return _USCD.floatArray___getslice__(self, i, j) + + def __setslice__(self, *args): + return _USCD.floatArray___setslice__(self, *args) + + def __delslice__(self, i, j): + return _USCD.floatArray___delslice__(self, i, j) + + def __delitem__(self, *args): + return _USCD.floatArray___delitem__(self, *args) + + def __getitem__(self, *args): + return _USCD.floatArray___getitem__(self, *args) + + def __setitem__(self, *args): + return _USCD.floatArray___setitem__(self, *args) + + def pop(self): + return _USCD.floatArray_pop(self) + + def append(self, x): + return _USCD.floatArray_append(self, x) + + def empty(self): + return _USCD.floatArray_empty(self) + + def size(self): + return _USCD.floatArray_size(self) + + def swap(self, v): + return _USCD.floatArray_swap(self, v) + + def begin(self): + return _USCD.floatArray_begin(self) + + def end(self): + return _USCD.floatArray_end(self) + + def rbegin(self): + return _USCD.floatArray_rbegin(self) + + def rend(self): + return _USCD.floatArray_rend(self) + + def clear(self): + return _USCD.floatArray_clear(self) + + def get_allocator(self): + return _USCD.floatArray_get_allocator(self) + + def pop_back(self): + return _USCD.floatArray_pop_back(self) + + def erase(self, *args): + return _USCD.floatArray_erase(self, *args) + + def __init__(self, *args): + _USCD.floatArray_swiginit(self, _USCD.new_floatArray(*args)) + + def push_back(self, x): + return _USCD.floatArray_push_back(self, x) + + def front(self): + return _USCD.floatArray_front(self) + + def back(self): + return _USCD.floatArray_back(self) + + def assign(self, n, x): + return _USCD.floatArray_assign(self, n, x) + + def resize(self, *args): + return _USCD.floatArray_resize(self, *args) + + def insert(self, *args): + return _USCD.floatArray_insert(self, *args) + + def reserve(self, n): + return _USCD.floatArray_reserve(self, n) + + def capacity(self): + return _USCD.floatArray_capacity(self) + __swig_destroy__ = _USCD.delete_floatArray + +# Register floatArray in _USCD: +_USCD.floatArray_swigregister(floatArray) + + +_array_map["float"] =floatArray + +class _Matx_float_2_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_float_2_1_rows + cols = _USCD._Matx_float_2_1_cols + channels = _USCD._Matx_float_2_1_channels + shortdim = _USCD._Matx_float_2_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_float_2_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_float_2_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_float_2_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_float_2_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_float_2_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_float_2_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_float_2_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_float_2_1_ddot(self, v) + + def t(self): + return _USCD._Matx_float_2_1_t(self) + + def mul(self, a): + return _USCD._Matx_float_2_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_float_2_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_float_2_1___call__(self, i, j) + val = property(_USCD._Matx_float_2_1_val_get, _USCD._Matx_float_2_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_float_2_1_swiginit(self, _USCD.new__Matx_float_2_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_float_2_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_float_2_1 + +# Register _Matx_float_2_1 in _USCD: +_USCD._Matx_float_2_1_swigregister(_Matx_float_2_1) + +def _Matx_float_2_1_all(alpha): + return _USCD._Matx_float_2_1_all(alpha) + +def _Matx_float_2_1_zeros(): + return _USCD._Matx_float_2_1_zeros() + +def _Matx_float_2_1_ones(): + return _USCD._Matx_float_2_1_ones() + +def _Matx_float_2_1_eye(): + return _USCD._Matx_float_2_1_eye() + +def _Matx_float_2_1_randu(a, b): + return _USCD._Matx_float_2_1_randu(a, b) + +def _Matx_float_2_1_randn(a, b): + return _USCD._Matx_float_2_1_randn(a, b) + + +Matx21f = _Matx_float_2_1 + +class _Vec_float_2(_Matx_float_2_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_float_2_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_float_2_all(alpha) + + def mul(self, v): + return _USCD._Vec_float_2_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_float_2___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_float_2_swiginit(self, _USCD.new__Vec_float_2(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_float_2___str__(self) + __swig_destroy__ = _USCD.delete__Vec_float_2 + +# Register _Vec_float_2 in _USCD: +_USCD._Vec_float_2_swigregister(_Vec_float_2) + +def _Vec_float_2_all(alpha): + return _USCD._Vec_float_2_all(alpha) + +class _DataType_Vec_float_2(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_float_2_generic_type + channels = _USCD._DataType_Vec_float_2_channels + fmt = _USCD._DataType_Vec_float_2_fmt + + def __init__(self): + _USCD._DataType_Vec_float_2_swiginit(self, _USCD.new__DataType_Vec_float_2()) + __swig_destroy__ = _USCD.delete__DataType_Vec_float_2 + +# Register _DataType_Vec_float_2 in _USCD: +_USCD._DataType_Vec_float_2_swigregister(_DataType_Vec_float_2) + + +Vec2f = _Vec_float_2 +DataType_Vec2f = _DataType_Vec_float_2 + +class _Matx_float_3_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_float_3_1_rows + cols = _USCD._Matx_float_3_1_cols + channels = _USCD._Matx_float_3_1_channels + shortdim = _USCD._Matx_float_3_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_float_3_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_float_3_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_float_3_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_float_3_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_float_3_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_float_3_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_float_3_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_float_3_1_ddot(self, v) + + def t(self): + return _USCD._Matx_float_3_1_t(self) + + def mul(self, a): + return _USCD._Matx_float_3_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_float_3_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_float_3_1___call__(self, i, j) + val = property(_USCD._Matx_float_3_1_val_get, _USCD._Matx_float_3_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_float_3_1_swiginit(self, _USCD.new__Matx_float_3_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_float_3_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_float_3_1 + +# Register _Matx_float_3_1 in _USCD: +_USCD._Matx_float_3_1_swigregister(_Matx_float_3_1) + +def _Matx_float_3_1_all(alpha): + return _USCD._Matx_float_3_1_all(alpha) + +def _Matx_float_3_1_zeros(): + return _USCD._Matx_float_3_1_zeros() + +def _Matx_float_3_1_ones(): + return _USCD._Matx_float_3_1_ones() + +def _Matx_float_3_1_eye(): + return _USCD._Matx_float_3_1_eye() + +def _Matx_float_3_1_randu(a, b): + return _USCD._Matx_float_3_1_randu(a, b) + +def _Matx_float_3_1_randn(a, b): + return _USCD._Matx_float_3_1_randn(a, b) + + +Matx31f = _Matx_float_3_1 + +class _Vec_float_3(_Matx_float_3_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_float_3_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_float_3_all(alpha) + + def mul(self, v): + return _USCD._Vec_float_3_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_float_3___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_float_3_swiginit(self, _USCD.new__Vec_float_3(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_float_3___str__(self) + __swig_destroy__ = _USCD.delete__Vec_float_3 + +# Register _Vec_float_3 in _USCD: +_USCD._Vec_float_3_swigregister(_Vec_float_3) + +def _Vec_float_3_all(alpha): + return _USCD._Vec_float_3_all(alpha) + +class _DataType_Vec_float_3(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_float_3_generic_type + channels = _USCD._DataType_Vec_float_3_channels + fmt = _USCD._DataType_Vec_float_3_fmt + + def __init__(self): + _USCD._DataType_Vec_float_3_swiginit(self, _USCD.new__DataType_Vec_float_3()) + __swig_destroy__ = _USCD.delete__DataType_Vec_float_3 + +# Register _DataType_Vec_float_3 in _USCD: +_USCD._DataType_Vec_float_3_swigregister(_DataType_Vec_float_3) + + +Vec3f = _Vec_float_3 +DataType_Vec3f = _DataType_Vec_float_3 + +class _Matx_float_4_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_float_4_1_rows + cols = _USCD._Matx_float_4_1_cols + channels = _USCD._Matx_float_4_1_channels + shortdim = _USCD._Matx_float_4_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_float_4_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_float_4_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_float_4_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_float_4_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_float_4_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_float_4_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_float_4_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_float_4_1_ddot(self, v) + + def t(self): + return _USCD._Matx_float_4_1_t(self) + + def mul(self, a): + return _USCD._Matx_float_4_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_float_4_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_float_4_1___call__(self, i, j) + val = property(_USCD._Matx_float_4_1_val_get, _USCD._Matx_float_4_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_float_4_1_swiginit(self, _USCD.new__Matx_float_4_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_float_4_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_float_4_1 + +# Register _Matx_float_4_1 in _USCD: +_USCD._Matx_float_4_1_swigregister(_Matx_float_4_1) + +def _Matx_float_4_1_all(alpha): + return _USCD._Matx_float_4_1_all(alpha) + +def _Matx_float_4_1_zeros(): + return _USCD._Matx_float_4_1_zeros() + +def _Matx_float_4_1_ones(): + return _USCD._Matx_float_4_1_ones() + +def _Matx_float_4_1_eye(): + return _USCD._Matx_float_4_1_eye() + +def _Matx_float_4_1_randu(a, b): + return _USCD._Matx_float_4_1_randu(a, b) + +def _Matx_float_4_1_randn(a, b): + return _USCD._Matx_float_4_1_randn(a, b) + + +Matx41f = _Matx_float_4_1 + +class _Vec_float_4(_Matx_float_4_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_float_4_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_float_4_all(alpha) + + def mul(self, v): + return _USCD._Vec_float_4_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_float_4___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_float_4_swiginit(self, _USCD.new__Vec_float_4(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_float_4___str__(self) + __swig_destroy__ = _USCD.delete__Vec_float_4 + +# Register _Vec_float_4 in _USCD: +_USCD._Vec_float_4_swigregister(_Vec_float_4) + +def _Vec_float_4_all(alpha): + return _USCD._Vec_float_4_all(alpha) + +class _DataType_Vec_float_4(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_float_4_generic_type + channels = _USCD._DataType_Vec_float_4_channels + fmt = _USCD._DataType_Vec_float_4_fmt + + def __init__(self): + _USCD._DataType_Vec_float_4_swiginit(self, _USCD.new__DataType_Vec_float_4()) + __swig_destroy__ = _USCD.delete__DataType_Vec_float_4 + +# Register _DataType_Vec_float_4 in _USCD: +_USCD._DataType_Vec_float_4_swigregister(_DataType_Vec_float_4) + + +Vec4f = _Vec_float_4 +DataType_Vec4f = _DataType_Vec_float_4 + +class _Matx_float_6_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_float_6_1_rows + cols = _USCD._Matx_float_6_1_cols + channels = _USCD._Matx_float_6_1_channels + shortdim = _USCD._Matx_float_6_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_float_6_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_float_6_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_float_6_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_float_6_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_float_6_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_float_6_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_float_6_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_float_6_1_ddot(self, v) + + def t(self): + return _USCD._Matx_float_6_1_t(self) + + def mul(self, a): + return _USCD._Matx_float_6_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_float_6_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_float_6_1___call__(self, i, j) + val = property(_USCD._Matx_float_6_1_val_get, _USCD._Matx_float_6_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_float_6_1_swiginit(self, _USCD.new__Matx_float_6_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_float_6_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_float_6_1 + +# Register _Matx_float_6_1 in _USCD: +_USCD._Matx_float_6_1_swigregister(_Matx_float_6_1) + +def _Matx_float_6_1_all(alpha): + return _USCD._Matx_float_6_1_all(alpha) + +def _Matx_float_6_1_zeros(): + return _USCD._Matx_float_6_1_zeros() + +def _Matx_float_6_1_ones(): + return _USCD._Matx_float_6_1_ones() + +def _Matx_float_6_1_eye(): + return _USCD._Matx_float_6_1_eye() + +def _Matx_float_6_1_randu(a, b): + return _USCD._Matx_float_6_1_randu(a, b) + +def _Matx_float_6_1_randn(a, b): + return _USCD._Matx_float_6_1_randn(a, b) + + +Matx61f = _Matx_float_6_1 + +class _Vec_float_6(_Matx_float_6_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_float_6_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_float_6_all(alpha) + + def mul(self, v): + return _USCD._Vec_float_6_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_float_6___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_float_6_swiginit(self, _USCD.new__Vec_float_6(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_float_6___str__(self) + __swig_destroy__ = _USCD.delete__Vec_float_6 + +# Register _Vec_float_6 in _USCD: +_USCD._Vec_float_6_swigregister(_Vec_float_6) + +def _Vec_float_6_all(alpha): + return _USCD._Vec_float_6_all(alpha) + +class _DataType_Vec_float_6(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_float_6_generic_type + channels = _USCD._DataType_Vec_float_6_channels + fmt = _USCD._DataType_Vec_float_6_fmt + + def __init__(self): + _USCD._DataType_Vec_float_6_swiginit(self, _USCD.new__DataType_Vec_float_6()) + __swig_destroy__ = _USCD.delete__DataType_Vec_float_6 + +# Register _DataType_Vec_float_6 in _USCD: +_USCD._DataType_Vec_float_6_swigregister(_DataType_Vec_float_6) + + +Vec6f = _Vec_float_6 +DataType_Vec6f = _DataType_Vec_float_6 + +class _cv_numpy_sizeof_double(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_double_value + + def __init__(self): + _USCD._cv_numpy_sizeof_double_swiginit(self, _USCD.new__cv_numpy_sizeof_double()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_double + +# Register _cv_numpy_sizeof_double in _USCD: +_USCD._cv_numpy_sizeof_double_swigregister(_cv_numpy_sizeof_double) + + +if _cv_numpy_sizeof_double.value == 1: + _cv_numpy_typestr_map["double"] = "|" +"f" + "1" +else: + _cv_numpy_typestr_map["double"] = _cv_numpy_endianess +"f" + str(_cv_numpy_sizeof_double.value) + +class doubleArray(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def iterator(self): + return _USCD.doubleArray_iterator(self) + def __iter__(self): + return self.iterator() + + def __nonzero__(self): + return _USCD.doubleArray___nonzero__(self) + + def __bool__(self): + return _USCD.doubleArray___bool__(self) + + def __len__(self): + return _USCD.doubleArray___len__(self) + + def __getslice__(self, i, j): + return _USCD.doubleArray___getslice__(self, i, j) + + def __setslice__(self, *args): + return _USCD.doubleArray___setslice__(self, *args) + + def __delslice__(self, i, j): + return _USCD.doubleArray___delslice__(self, i, j) + + def __delitem__(self, *args): + return _USCD.doubleArray___delitem__(self, *args) + + def __getitem__(self, *args): + return _USCD.doubleArray___getitem__(self, *args) + + def __setitem__(self, *args): + return _USCD.doubleArray___setitem__(self, *args) + + def pop(self): + return _USCD.doubleArray_pop(self) + + def append(self, x): + return _USCD.doubleArray_append(self, x) + + def empty(self): + return _USCD.doubleArray_empty(self) + + def size(self): + return _USCD.doubleArray_size(self) + + def swap(self, v): + return _USCD.doubleArray_swap(self, v) + + def begin(self): + return _USCD.doubleArray_begin(self) + + def end(self): + return _USCD.doubleArray_end(self) + + def rbegin(self): + return _USCD.doubleArray_rbegin(self) + + def rend(self): + return _USCD.doubleArray_rend(self) + + def clear(self): + return _USCD.doubleArray_clear(self) + + def get_allocator(self): + return _USCD.doubleArray_get_allocator(self) + + def pop_back(self): + return _USCD.doubleArray_pop_back(self) + + def erase(self, *args): + return _USCD.doubleArray_erase(self, *args) + + def __init__(self, *args): + _USCD.doubleArray_swiginit(self, _USCD.new_doubleArray(*args)) + + def push_back(self, x): + return _USCD.doubleArray_push_back(self, x) + + def front(self): + return _USCD.doubleArray_front(self) + + def back(self): + return _USCD.doubleArray_back(self) + + def assign(self, n, x): + return _USCD.doubleArray_assign(self, n, x) + + def resize(self, *args): + return _USCD.doubleArray_resize(self, *args) + + def insert(self, *args): + return _USCD.doubleArray_insert(self, *args) + + def reserve(self, n): + return _USCD.doubleArray_reserve(self, n) + + def capacity(self): + return _USCD.doubleArray_capacity(self) + __swig_destroy__ = _USCD.delete_doubleArray + +# Register doubleArray in _USCD: +_USCD.doubleArray_swigregister(doubleArray) + + +_array_map["double"] =doubleArray + +class _Matx_double_2_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_double_2_1_rows + cols = _USCD._Matx_double_2_1_cols + channels = _USCD._Matx_double_2_1_channels + shortdim = _USCD._Matx_double_2_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_double_2_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_double_2_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_double_2_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_double_2_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_double_2_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_double_2_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_double_2_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_double_2_1_ddot(self, v) + + def t(self): + return _USCD._Matx_double_2_1_t(self) + + def mul(self, a): + return _USCD._Matx_double_2_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_double_2_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_double_2_1___call__(self, i, j) + val = property(_USCD._Matx_double_2_1_val_get, _USCD._Matx_double_2_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_double_2_1_swiginit(self, _USCD.new__Matx_double_2_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_double_2_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_double_2_1 + +# Register _Matx_double_2_1 in _USCD: +_USCD._Matx_double_2_1_swigregister(_Matx_double_2_1) + +def _Matx_double_2_1_all(alpha): + return _USCD._Matx_double_2_1_all(alpha) + +def _Matx_double_2_1_zeros(): + return _USCD._Matx_double_2_1_zeros() + +def _Matx_double_2_1_ones(): + return _USCD._Matx_double_2_1_ones() + +def _Matx_double_2_1_eye(): + return _USCD._Matx_double_2_1_eye() + +def _Matx_double_2_1_randu(a, b): + return _USCD._Matx_double_2_1_randu(a, b) + +def _Matx_double_2_1_randn(a, b): + return _USCD._Matx_double_2_1_randn(a, b) + + +Matx21d = _Matx_double_2_1 + +class _Vec_double_2(_Matx_double_2_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_double_2_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_double_2_all(alpha) + + def mul(self, v): + return _USCD._Vec_double_2_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_double_2___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_double_2_swiginit(self, _USCD.new__Vec_double_2(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_double_2___str__(self) + __swig_destroy__ = _USCD.delete__Vec_double_2 + +# Register _Vec_double_2 in _USCD: +_USCD._Vec_double_2_swigregister(_Vec_double_2) + +def _Vec_double_2_all(alpha): + return _USCD._Vec_double_2_all(alpha) + +class _DataType_Vec_double_2(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_double_2_generic_type + channels = _USCD._DataType_Vec_double_2_channels + fmt = _USCD._DataType_Vec_double_2_fmt + + def __init__(self): + _USCD._DataType_Vec_double_2_swiginit(self, _USCD.new__DataType_Vec_double_2()) + __swig_destroy__ = _USCD.delete__DataType_Vec_double_2 + +# Register _DataType_Vec_double_2 in _USCD: +_USCD._DataType_Vec_double_2_swigregister(_DataType_Vec_double_2) + + +Vec2d = _Vec_double_2 +DataType_Vec2d = _DataType_Vec_double_2 + +class _Matx_double_3_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_double_3_1_rows + cols = _USCD._Matx_double_3_1_cols + channels = _USCD._Matx_double_3_1_channels + shortdim = _USCD._Matx_double_3_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_double_3_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_double_3_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_double_3_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_double_3_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_double_3_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_double_3_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_double_3_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_double_3_1_ddot(self, v) + + def t(self): + return _USCD._Matx_double_3_1_t(self) + + def mul(self, a): + return _USCD._Matx_double_3_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_double_3_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_double_3_1___call__(self, i, j) + val = property(_USCD._Matx_double_3_1_val_get, _USCD._Matx_double_3_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_double_3_1_swiginit(self, _USCD.new__Matx_double_3_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_double_3_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_double_3_1 + +# Register _Matx_double_3_1 in _USCD: +_USCD._Matx_double_3_1_swigregister(_Matx_double_3_1) + +def _Matx_double_3_1_all(alpha): + return _USCD._Matx_double_3_1_all(alpha) + +def _Matx_double_3_1_zeros(): + return _USCD._Matx_double_3_1_zeros() + +def _Matx_double_3_1_ones(): + return _USCD._Matx_double_3_1_ones() + +def _Matx_double_3_1_eye(): + return _USCD._Matx_double_3_1_eye() + +def _Matx_double_3_1_randu(a, b): + return _USCD._Matx_double_3_1_randu(a, b) + +def _Matx_double_3_1_randn(a, b): + return _USCD._Matx_double_3_1_randn(a, b) + + +Matx31d = _Matx_double_3_1 + +class _Vec_double_3(_Matx_double_3_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_double_3_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_double_3_all(alpha) + + def mul(self, v): + return _USCD._Vec_double_3_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_double_3___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_double_3_swiginit(self, _USCD.new__Vec_double_3(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_double_3___str__(self) + __swig_destroy__ = _USCD.delete__Vec_double_3 + +# Register _Vec_double_3 in _USCD: +_USCD._Vec_double_3_swigregister(_Vec_double_3) + +def _Vec_double_3_all(alpha): + return _USCD._Vec_double_3_all(alpha) + +class _DataType_Vec_double_3(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_double_3_generic_type + channels = _USCD._DataType_Vec_double_3_channels + fmt = _USCD._DataType_Vec_double_3_fmt + + def __init__(self): + _USCD._DataType_Vec_double_3_swiginit(self, _USCD.new__DataType_Vec_double_3()) + __swig_destroy__ = _USCD.delete__DataType_Vec_double_3 + +# Register _DataType_Vec_double_3 in _USCD: +_USCD._DataType_Vec_double_3_swigregister(_DataType_Vec_double_3) + + +Vec3d = _Vec_double_3 +DataType_Vec3d = _DataType_Vec_double_3 + +class _Matx_double_4_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_double_4_1_rows + cols = _USCD._Matx_double_4_1_cols + channels = _USCD._Matx_double_4_1_channels + shortdim = _USCD._Matx_double_4_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_double_4_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_double_4_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_double_4_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_double_4_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_double_4_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_double_4_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_double_4_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_double_4_1_ddot(self, v) + + def t(self): + return _USCD._Matx_double_4_1_t(self) + + def mul(self, a): + return _USCD._Matx_double_4_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_double_4_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_double_4_1___call__(self, i, j) + val = property(_USCD._Matx_double_4_1_val_get, _USCD._Matx_double_4_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_double_4_1_swiginit(self, _USCD.new__Matx_double_4_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_double_4_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_double_4_1 + +# Register _Matx_double_4_1 in _USCD: +_USCD._Matx_double_4_1_swigregister(_Matx_double_4_1) + +def _Matx_double_4_1_all(alpha): + return _USCD._Matx_double_4_1_all(alpha) + +def _Matx_double_4_1_zeros(): + return _USCD._Matx_double_4_1_zeros() + +def _Matx_double_4_1_ones(): + return _USCD._Matx_double_4_1_ones() + +def _Matx_double_4_1_eye(): + return _USCD._Matx_double_4_1_eye() + +def _Matx_double_4_1_randu(a, b): + return _USCD._Matx_double_4_1_randu(a, b) + +def _Matx_double_4_1_randn(a, b): + return _USCD._Matx_double_4_1_randn(a, b) + + +Matx41d = _Matx_double_4_1 + +class _Vec_double_4(_Matx_double_4_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_double_4_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_double_4_all(alpha) + + def mul(self, v): + return _USCD._Vec_double_4_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_double_4___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_double_4_swiginit(self, _USCD.new__Vec_double_4(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_double_4___str__(self) + __swig_destroy__ = _USCD.delete__Vec_double_4 + +# Register _Vec_double_4 in _USCD: +_USCD._Vec_double_4_swigregister(_Vec_double_4) + +def _Vec_double_4_all(alpha): + return _USCD._Vec_double_4_all(alpha) + +class _DataType_Vec_double_4(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_double_4_generic_type + channels = _USCD._DataType_Vec_double_4_channels + fmt = _USCD._DataType_Vec_double_4_fmt + + def __init__(self): + _USCD._DataType_Vec_double_4_swiginit(self, _USCD.new__DataType_Vec_double_4()) + __swig_destroy__ = _USCD.delete__DataType_Vec_double_4 + +# Register _DataType_Vec_double_4 in _USCD: +_USCD._DataType_Vec_double_4_swigregister(_DataType_Vec_double_4) + + +Vec4d = _Vec_double_4 +DataType_Vec4d = _DataType_Vec_double_4 + +class _Matx_double_6_1(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_double_6_1_rows + cols = _USCD._Matx_double_6_1_cols + channels = _USCD._Matx_double_6_1_channels + shortdim = _USCD._Matx_double_6_1_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_double_6_1_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_double_6_1_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_double_6_1_ones() + + @staticmethod + def eye(): + return _USCD._Matx_double_6_1_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_double_6_1_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_double_6_1_randn(a, b) + + def dot(self, v): + return _USCD._Matx_double_6_1_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_double_6_1_ddot(self, v) + + def t(self): + return _USCD._Matx_double_6_1_t(self) + + def mul(self, a): + return _USCD._Matx_double_6_1_mul(self, a) + + def div(self, a): + return _USCD._Matx_double_6_1_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_double_6_1___call__(self, i, j) + val = property(_USCD._Matx_double_6_1_val_get, _USCD._Matx_double_6_1_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_double_6_1_swiginit(self, _USCD.new__Matx_double_6_1(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_double_6_1___str__(self) + __swig_destroy__ = _USCD.delete__Matx_double_6_1 + +# Register _Matx_double_6_1 in _USCD: +_USCD._Matx_double_6_1_swigregister(_Matx_double_6_1) + +def _Matx_double_6_1_all(alpha): + return _USCD._Matx_double_6_1_all(alpha) + +def _Matx_double_6_1_zeros(): + return _USCD._Matx_double_6_1_zeros() + +def _Matx_double_6_1_ones(): + return _USCD._Matx_double_6_1_ones() + +def _Matx_double_6_1_eye(): + return _USCD._Matx_double_6_1_eye() + +def _Matx_double_6_1_randu(a, b): + return _USCD._Matx_double_6_1_randu(a, b) + +def _Matx_double_6_1_randn(a, b): + return _USCD._Matx_double_6_1_randn(a, b) + + +Matx61d = _Matx_double_6_1 + +class _Vec_double_6(_Matx_double_6_1): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + channels = _USCD._Vec_double_6_channels + + @staticmethod + def all(alpha): + return _USCD._Vec_double_6_all(alpha) + + def mul(self, v): + return _USCD._Vec_double_6_mul(self, v) + + def __call__(self, i): + return _USCD._Vec_double_6___call__(self, i) + + import re + _re_pattern = re.compile("^_Vec_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + + array = _array_map[value_type](rows) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Vec_double_6_swiginit(self, _USCD.new__Vec_double_6(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + return {"shape": (rows, 1), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + + if not isinstance(key, int): + raise TypeError + + if key >= rows: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Vec_double_6___str__(self) + __swig_destroy__ = _USCD.delete__Vec_double_6 + +# Register _Vec_double_6 in _USCD: +_USCD._Vec_double_6_swigregister(_Vec_double_6) + +def _Vec_double_6_all(alpha): + return _USCD._Vec_double_6_all(alpha) + +class _DataType_Vec_double_6(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + generic_type = _USCD._DataType_Vec_double_6_generic_type + channels = _USCD._DataType_Vec_double_6_channels + fmt = _USCD._DataType_Vec_double_6_fmt + + def __init__(self): + _USCD._DataType_Vec_double_6_swiginit(self, _USCD.new__DataType_Vec_double_6()) + __swig_destroy__ = _USCD.delete__DataType_Vec_double_6 + +# Register _DataType_Vec_double_6 in _USCD: +_USCD._DataType_Vec_double_6_swigregister(_DataType_Vec_double_6) + + +Vec6d = _Vec_double_6 +DataType_Vec6d = _DataType_Vec_double_6 + +class _mat__np_array_constructor(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self): + _USCD._mat__np_array_constructor_swiginit(self, _USCD.new__mat__np_array_constructor()) + __swig_destroy__ = _USCD.delete__mat__np_array_constructor + +# Register _mat__np_array_constructor in _USCD: +_USCD._mat__np_array_constructor_swigregister(_mat__np_array_constructor) + + +def _depthToDtype(depth): + return _USCD._depthToDtype(depth) + +def _toCvType(dtype, nChannel): + return _USCD._toCvType(dtype, nChannel) +class _cv_numpy_sizeof_uchar(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_uchar_value + + def __init__(self): + _USCD._cv_numpy_sizeof_uchar_swiginit(self, _USCD.new__cv_numpy_sizeof_uchar()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_uchar + +# Register _cv_numpy_sizeof_uchar in _USCD: +_USCD._cv_numpy_sizeof_uchar_swigregister(_cv_numpy_sizeof_uchar) + + +if _cv_numpy_sizeof_uchar.value == 1: + _cv_numpy_typestr_map["uchar"] = "|" +"u" + "1" +else: + _cv_numpy_typestr_map["uchar"] = _cv_numpy_endianess +"u" + str(_cv_numpy_sizeof_uchar.value) + +class _Mat__uchar(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__uchar_create(self, *args) + + def cross(self, m): + return _USCD._Mat__uchar_cross(self, m) + + def row(self, y): + return _USCD._Mat__uchar_row(self, y) + + def col(self, x): + return _USCD._Mat__uchar_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__uchar_diag(self, d) + + def clone(self): + return _USCD._Mat__uchar_clone(self) + + def elemSize(self): + return _USCD._Mat__uchar_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__uchar_elemSize1(self) + + def type(self): + return _USCD._Mat__uchar_type(self) + + def depth(self): + return _USCD._Mat__uchar_depth(self) + + def channels(self): + return _USCD._Mat__uchar_channels(self) + + def step1(self, i=0): + return _USCD._Mat__uchar_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__uchar_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__uchar_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__uchar___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__uchar_swiginit(self, _USCD.new__Mat__uchar(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__uchar___str__(self) + __swig_destroy__ = _USCD.delete__Mat__uchar + +# Register _Mat__uchar in _USCD: +_USCD._Mat__uchar_swigregister(_Mat__uchar) + + +Mat1b = _Mat__uchar + +class _cv_numpy_sizeof_Vec2b(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_Vec2b_value + + def __init__(self): + _USCD._cv_numpy_sizeof_Vec2b_swiginit(self, _USCD.new__cv_numpy_sizeof_Vec2b()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_Vec2b + +# Register _cv_numpy_sizeof_Vec2b in _USCD: +_USCD._cv_numpy_sizeof_Vec2b_swigregister(_cv_numpy_sizeof_Vec2b) + + +if _cv_numpy_sizeof_Vec2b.value == 1: + _cv_numpy_typestr_map["Vec2b"] = "|" +"u" + "1" +else: + _cv_numpy_typestr_map["Vec2b"] = _cv_numpy_endianess +"u" + str(_cv_numpy_sizeof_Vec2b.value) + +class _Mat__Vec2b(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__Vec2b_create(self, *args) + + def cross(self, m): + return _USCD._Mat__Vec2b_cross(self, m) + + def row(self, y): + return _USCD._Mat__Vec2b_row(self, y) + + def col(self, x): + return _USCD._Mat__Vec2b_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__Vec2b_diag(self, d) + + def clone(self): + return _USCD._Mat__Vec2b_clone(self) + + def elemSize(self): + return _USCD._Mat__Vec2b_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__Vec2b_elemSize1(self) + + def type(self): + return _USCD._Mat__Vec2b_type(self) + + def depth(self): + return _USCD._Mat__Vec2b_depth(self) + + def channels(self): + return _USCD._Mat__Vec2b_channels(self) + + def step1(self, i=0): + return _USCD._Mat__Vec2b_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__Vec2b_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__Vec2b_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__Vec2b___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__Vec2b_swiginit(self, _USCD.new__Mat__Vec2b(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__Vec2b___str__(self) + __swig_destroy__ = _USCD.delete__Mat__Vec2b + +# Register _Mat__Vec2b in _USCD: +_USCD._Mat__Vec2b_swigregister(_Mat__Vec2b) + + +Mat2b = _Mat__Vec2b + +class _cv_numpy_sizeof_Vec3b(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_Vec3b_value + + def __init__(self): + _USCD._cv_numpy_sizeof_Vec3b_swiginit(self, _USCD.new__cv_numpy_sizeof_Vec3b()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_Vec3b + +# Register _cv_numpy_sizeof_Vec3b in _USCD: +_USCD._cv_numpy_sizeof_Vec3b_swigregister(_cv_numpy_sizeof_Vec3b) + + +if _cv_numpy_sizeof_Vec3b.value == 1: + _cv_numpy_typestr_map["Vec3b"] = "|" +"u" + "1" +else: + _cv_numpy_typestr_map["Vec3b"] = _cv_numpy_endianess +"u" + str(_cv_numpy_sizeof_Vec3b.value) + +class _Mat__Vec3b(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__Vec3b_create(self, *args) + + def cross(self, m): + return _USCD._Mat__Vec3b_cross(self, m) + + def row(self, y): + return _USCD._Mat__Vec3b_row(self, y) + + def col(self, x): + return _USCD._Mat__Vec3b_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__Vec3b_diag(self, d) + + def clone(self): + return _USCD._Mat__Vec3b_clone(self) + + def elemSize(self): + return _USCD._Mat__Vec3b_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__Vec3b_elemSize1(self) + + def type(self): + return _USCD._Mat__Vec3b_type(self) + + def depth(self): + return _USCD._Mat__Vec3b_depth(self) + + def channels(self): + return _USCD._Mat__Vec3b_channels(self) + + def step1(self, i=0): + return _USCD._Mat__Vec3b_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__Vec3b_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__Vec3b_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__Vec3b___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__Vec3b_swiginit(self, _USCD.new__Mat__Vec3b(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__Vec3b___str__(self) + __swig_destroy__ = _USCD.delete__Mat__Vec3b + +# Register _Mat__Vec3b in _USCD: +_USCD._Mat__Vec3b_swigregister(_Mat__Vec3b) + + +Mat3b = _Mat__Vec3b + +class _cv_numpy_sizeof_Vec4b(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_Vec4b_value + + def __init__(self): + _USCD._cv_numpy_sizeof_Vec4b_swiginit(self, _USCD.new__cv_numpy_sizeof_Vec4b()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_Vec4b + +# Register _cv_numpy_sizeof_Vec4b in _USCD: +_USCD._cv_numpy_sizeof_Vec4b_swigregister(_cv_numpy_sizeof_Vec4b) + + +if _cv_numpy_sizeof_Vec4b.value == 1: + _cv_numpy_typestr_map["Vec4b"] = "|" +"u" + "1" +else: + _cv_numpy_typestr_map["Vec4b"] = _cv_numpy_endianess +"u" + str(_cv_numpy_sizeof_Vec4b.value) + +class _Mat__Vec4b(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__Vec4b_create(self, *args) + + def cross(self, m): + return _USCD._Mat__Vec4b_cross(self, m) + + def row(self, y): + return _USCD._Mat__Vec4b_row(self, y) + + def col(self, x): + return _USCD._Mat__Vec4b_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__Vec4b_diag(self, d) + + def clone(self): + return _USCD._Mat__Vec4b_clone(self) + + def elemSize(self): + return _USCD._Mat__Vec4b_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__Vec4b_elemSize1(self) + + def type(self): + return _USCD._Mat__Vec4b_type(self) + + def depth(self): + return _USCD._Mat__Vec4b_depth(self) + + def channels(self): + return _USCD._Mat__Vec4b_channels(self) + + def step1(self, i=0): + return _USCD._Mat__Vec4b_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__Vec4b_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__Vec4b_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__Vec4b___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__Vec4b_swiginit(self, _USCD.new__Mat__Vec4b(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__Vec4b___str__(self) + __swig_destroy__ = _USCD.delete__Mat__Vec4b + +# Register _Mat__Vec4b in _USCD: +_USCD._Mat__Vec4b_swigregister(_Mat__Vec4b) + + +Mat4b = _Mat__Vec4b + +class _Mat__short(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__short_create(self, *args) + + def cross(self, m): + return _USCD._Mat__short_cross(self, m) + + def row(self, y): + return _USCD._Mat__short_row(self, y) + + def col(self, x): + return _USCD._Mat__short_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__short_diag(self, d) + + def clone(self): + return _USCD._Mat__short_clone(self) + + def elemSize(self): + return _USCD._Mat__short_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__short_elemSize1(self) + + def type(self): + return _USCD._Mat__short_type(self) + + def depth(self): + return _USCD._Mat__short_depth(self) + + def channels(self): + return _USCD._Mat__short_channels(self) + + def step1(self, i=0): + return _USCD._Mat__short_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__short_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__short_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__short___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__short_swiginit(self, _USCD.new__Mat__short(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__short___str__(self) + __swig_destroy__ = _USCD.delete__Mat__short + +# Register _Mat__short in _USCD: +_USCD._Mat__short_swigregister(_Mat__short) + + +Mat1s = _Mat__short + +class _cv_numpy_sizeof_Vec2s(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_Vec2s_value + + def __init__(self): + _USCD._cv_numpy_sizeof_Vec2s_swiginit(self, _USCD.new__cv_numpy_sizeof_Vec2s()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_Vec2s + +# Register _cv_numpy_sizeof_Vec2s in _USCD: +_USCD._cv_numpy_sizeof_Vec2s_swigregister(_cv_numpy_sizeof_Vec2s) + + +if _cv_numpy_sizeof_Vec2s.value == 1: + _cv_numpy_typestr_map["Vec2s"] = "|" +"i" + "1" +else: + _cv_numpy_typestr_map["Vec2s"] = _cv_numpy_endianess +"i" + str(_cv_numpy_sizeof_Vec2s.value) + +class _Mat__Vec2s(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__Vec2s_create(self, *args) + + def cross(self, m): + return _USCD._Mat__Vec2s_cross(self, m) + + def row(self, y): + return _USCD._Mat__Vec2s_row(self, y) + + def col(self, x): + return _USCD._Mat__Vec2s_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__Vec2s_diag(self, d) + + def clone(self): + return _USCD._Mat__Vec2s_clone(self) + + def elemSize(self): + return _USCD._Mat__Vec2s_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__Vec2s_elemSize1(self) + + def type(self): + return _USCD._Mat__Vec2s_type(self) + + def depth(self): + return _USCD._Mat__Vec2s_depth(self) + + def channels(self): + return _USCD._Mat__Vec2s_channels(self) + + def step1(self, i=0): + return _USCD._Mat__Vec2s_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__Vec2s_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__Vec2s_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__Vec2s___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__Vec2s_swiginit(self, _USCD.new__Mat__Vec2s(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__Vec2s___str__(self) + __swig_destroy__ = _USCD.delete__Mat__Vec2s + +# Register _Mat__Vec2s in _USCD: +_USCD._Mat__Vec2s_swigregister(_Mat__Vec2s) + + +Mat2s = _Mat__Vec2s + +class _cv_numpy_sizeof_Vec3s(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_Vec3s_value + + def __init__(self): + _USCD._cv_numpy_sizeof_Vec3s_swiginit(self, _USCD.new__cv_numpy_sizeof_Vec3s()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_Vec3s + +# Register _cv_numpy_sizeof_Vec3s in _USCD: +_USCD._cv_numpy_sizeof_Vec3s_swigregister(_cv_numpy_sizeof_Vec3s) + + +if _cv_numpy_sizeof_Vec3s.value == 1: + _cv_numpy_typestr_map["Vec3s"] = "|" +"i" + "1" +else: + _cv_numpy_typestr_map["Vec3s"] = _cv_numpy_endianess +"i" + str(_cv_numpy_sizeof_Vec3s.value) + +class _Mat__Vec3s(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__Vec3s_create(self, *args) + + def cross(self, m): + return _USCD._Mat__Vec3s_cross(self, m) + + def row(self, y): + return _USCD._Mat__Vec3s_row(self, y) + + def col(self, x): + return _USCD._Mat__Vec3s_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__Vec3s_diag(self, d) + + def clone(self): + return _USCD._Mat__Vec3s_clone(self) + + def elemSize(self): + return _USCD._Mat__Vec3s_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__Vec3s_elemSize1(self) + + def type(self): + return _USCD._Mat__Vec3s_type(self) + + def depth(self): + return _USCD._Mat__Vec3s_depth(self) + + def channels(self): + return _USCD._Mat__Vec3s_channels(self) + + def step1(self, i=0): + return _USCD._Mat__Vec3s_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__Vec3s_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__Vec3s_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__Vec3s___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__Vec3s_swiginit(self, _USCD.new__Mat__Vec3s(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__Vec3s___str__(self) + __swig_destroy__ = _USCD.delete__Mat__Vec3s + +# Register _Mat__Vec3s in _USCD: +_USCD._Mat__Vec3s_swigregister(_Mat__Vec3s) + + +Mat3s = _Mat__Vec3s + +class _cv_numpy_sizeof_Vec4s(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_Vec4s_value + + def __init__(self): + _USCD._cv_numpy_sizeof_Vec4s_swiginit(self, _USCD.new__cv_numpy_sizeof_Vec4s()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_Vec4s + +# Register _cv_numpy_sizeof_Vec4s in _USCD: +_USCD._cv_numpy_sizeof_Vec4s_swigregister(_cv_numpy_sizeof_Vec4s) + + +if _cv_numpy_sizeof_Vec4s.value == 1: + _cv_numpy_typestr_map["Vec4s"] = "|" +"i" + "1" +else: + _cv_numpy_typestr_map["Vec4s"] = _cv_numpy_endianess +"i" + str(_cv_numpy_sizeof_Vec4s.value) + +class _Mat__Vec4s(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__Vec4s_create(self, *args) + + def cross(self, m): + return _USCD._Mat__Vec4s_cross(self, m) + + def row(self, y): + return _USCD._Mat__Vec4s_row(self, y) + + def col(self, x): + return _USCD._Mat__Vec4s_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__Vec4s_diag(self, d) + + def clone(self): + return _USCD._Mat__Vec4s_clone(self) + + def elemSize(self): + return _USCD._Mat__Vec4s_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__Vec4s_elemSize1(self) + + def type(self): + return _USCD._Mat__Vec4s_type(self) + + def depth(self): + return _USCD._Mat__Vec4s_depth(self) + + def channels(self): + return _USCD._Mat__Vec4s_channels(self) + + def step1(self, i=0): + return _USCD._Mat__Vec4s_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__Vec4s_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__Vec4s_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__Vec4s___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__Vec4s_swiginit(self, _USCD.new__Mat__Vec4s(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__Vec4s___str__(self) + __swig_destroy__ = _USCD.delete__Mat__Vec4s + +# Register _Mat__Vec4s in _USCD: +_USCD._Mat__Vec4s_swigregister(_Mat__Vec4s) + + +Mat4s = _Mat__Vec4s + +class _Mat__ushort(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__ushort_create(self, *args) + + def cross(self, m): + return _USCD._Mat__ushort_cross(self, m) + + def row(self, y): + return _USCD._Mat__ushort_row(self, y) + + def col(self, x): + return _USCD._Mat__ushort_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__ushort_diag(self, d) + + def clone(self): + return _USCD._Mat__ushort_clone(self) + + def elemSize(self): + return _USCD._Mat__ushort_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__ushort_elemSize1(self) + + def type(self): + return _USCD._Mat__ushort_type(self) + + def depth(self): + return _USCD._Mat__ushort_depth(self) + + def channels(self): + return _USCD._Mat__ushort_channels(self) + + def step1(self, i=0): + return _USCD._Mat__ushort_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__ushort_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__ushort_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__ushort___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__ushort_swiginit(self, _USCD.new__Mat__ushort(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__ushort___str__(self) + __swig_destroy__ = _USCD.delete__Mat__ushort + +# Register _Mat__ushort in _USCD: +_USCD._Mat__ushort_swigregister(_Mat__ushort) + + +Mat1w = _Mat__ushort + +class _cv_numpy_sizeof_Vec2w(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_Vec2w_value + + def __init__(self): + _USCD._cv_numpy_sizeof_Vec2w_swiginit(self, _USCD.new__cv_numpy_sizeof_Vec2w()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_Vec2w + +# Register _cv_numpy_sizeof_Vec2w in _USCD: +_USCD._cv_numpy_sizeof_Vec2w_swigregister(_cv_numpy_sizeof_Vec2w) + + +if _cv_numpy_sizeof_Vec2w.value == 1: + _cv_numpy_typestr_map["Vec2w"] = "|" +"u" + "1" +else: + _cv_numpy_typestr_map["Vec2w"] = _cv_numpy_endianess +"u" + str(_cv_numpy_sizeof_Vec2w.value) + +class _Mat__Vec2w(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__Vec2w_create(self, *args) + + def cross(self, m): + return _USCD._Mat__Vec2w_cross(self, m) + + def row(self, y): + return _USCD._Mat__Vec2w_row(self, y) + + def col(self, x): + return _USCD._Mat__Vec2w_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__Vec2w_diag(self, d) + + def clone(self): + return _USCD._Mat__Vec2w_clone(self) + + def elemSize(self): + return _USCD._Mat__Vec2w_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__Vec2w_elemSize1(self) + + def type(self): + return _USCD._Mat__Vec2w_type(self) + + def depth(self): + return _USCD._Mat__Vec2w_depth(self) + + def channels(self): + return _USCD._Mat__Vec2w_channels(self) + + def step1(self, i=0): + return _USCD._Mat__Vec2w_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__Vec2w_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__Vec2w_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__Vec2w___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__Vec2w_swiginit(self, _USCD.new__Mat__Vec2w(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__Vec2w___str__(self) + __swig_destroy__ = _USCD.delete__Mat__Vec2w + +# Register _Mat__Vec2w in _USCD: +_USCD._Mat__Vec2w_swigregister(_Mat__Vec2w) + + +Mat2w = _Mat__Vec2w + +class _cv_numpy_sizeof_Vec3w(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_Vec3w_value + + def __init__(self): + _USCD._cv_numpy_sizeof_Vec3w_swiginit(self, _USCD.new__cv_numpy_sizeof_Vec3w()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_Vec3w + +# Register _cv_numpy_sizeof_Vec3w in _USCD: +_USCD._cv_numpy_sizeof_Vec3w_swigregister(_cv_numpy_sizeof_Vec3w) + + +if _cv_numpy_sizeof_Vec3w.value == 1: + _cv_numpy_typestr_map["Vec3w"] = "|" +"u" + "1" +else: + _cv_numpy_typestr_map["Vec3w"] = _cv_numpy_endianess +"u" + str(_cv_numpy_sizeof_Vec3w.value) + +class _Mat__Vec3w(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__Vec3w_create(self, *args) + + def cross(self, m): + return _USCD._Mat__Vec3w_cross(self, m) + + def row(self, y): + return _USCD._Mat__Vec3w_row(self, y) + + def col(self, x): + return _USCD._Mat__Vec3w_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__Vec3w_diag(self, d) + + def clone(self): + return _USCD._Mat__Vec3w_clone(self) + + def elemSize(self): + return _USCD._Mat__Vec3w_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__Vec3w_elemSize1(self) + + def type(self): + return _USCD._Mat__Vec3w_type(self) + + def depth(self): + return _USCD._Mat__Vec3w_depth(self) + + def channels(self): + return _USCD._Mat__Vec3w_channels(self) + + def step1(self, i=0): + return _USCD._Mat__Vec3w_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__Vec3w_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__Vec3w_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__Vec3w___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__Vec3w_swiginit(self, _USCD.new__Mat__Vec3w(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__Vec3w___str__(self) + __swig_destroy__ = _USCD.delete__Mat__Vec3w + +# Register _Mat__Vec3w in _USCD: +_USCD._Mat__Vec3w_swigregister(_Mat__Vec3w) + + +Mat3w = _Mat__Vec3w + +class _cv_numpy_sizeof_Vec4w(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_Vec4w_value + + def __init__(self): + _USCD._cv_numpy_sizeof_Vec4w_swiginit(self, _USCD.new__cv_numpy_sizeof_Vec4w()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_Vec4w + +# Register _cv_numpy_sizeof_Vec4w in _USCD: +_USCD._cv_numpy_sizeof_Vec4w_swigregister(_cv_numpy_sizeof_Vec4w) + + +if _cv_numpy_sizeof_Vec4w.value == 1: + _cv_numpy_typestr_map["Vec4w"] = "|" +"u" + "1" +else: + _cv_numpy_typestr_map["Vec4w"] = _cv_numpy_endianess +"u" + str(_cv_numpy_sizeof_Vec4w.value) + +class _Mat__Vec4w(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__Vec4w_create(self, *args) + + def cross(self, m): + return _USCD._Mat__Vec4w_cross(self, m) + + def row(self, y): + return _USCD._Mat__Vec4w_row(self, y) + + def col(self, x): + return _USCD._Mat__Vec4w_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__Vec4w_diag(self, d) + + def clone(self): + return _USCD._Mat__Vec4w_clone(self) + + def elemSize(self): + return _USCD._Mat__Vec4w_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__Vec4w_elemSize1(self) + + def type(self): + return _USCD._Mat__Vec4w_type(self) + + def depth(self): + return _USCD._Mat__Vec4w_depth(self) + + def channels(self): + return _USCD._Mat__Vec4w_channels(self) + + def step1(self, i=0): + return _USCD._Mat__Vec4w_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__Vec4w_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__Vec4w_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__Vec4w___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__Vec4w_swiginit(self, _USCD.new__Mat__Vec4w(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__Vec4w___str__(self) + __swig_destroy__ = _USCD.delete__Mat__Vec4w + +# Register _Mat__Vec4w in _USCD: +_USCD._Mat__Vec4w_swigregister(_Mat__Vec4w) + + +Mat4w = _Mat__Vec4w + +class _Mat__int(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__int_create(self, *args) + + def cross(self, m): + return _USCD._Mat__int_cross(self, m) + + def row(self, y): + return _USCD._Mat__int_row(self, y) + + def col(self, x): + return _USCD._Mat__int_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__int_diag(self, d) + + def clone(self): + return _USCD._Mat__int_clone(self) + + def elemSize(self): + return _USCD._Mat__int_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__int_elemSize1(self) + + def type(self): + return _USCD._Mat__int_type(self) + + def depth(self): + return _USCD._Mat__int_depth(self) + + def channels(self): + return _USCD._Mat__int_channels(self) + + def step1(self, i=0): + return _USCD._Mat__int_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__int_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__int_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__int___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__int_swiginit(self, _USCD.new__Mat__int(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__int___str__(self) + __swig_destroy__ = _USCD.delete__Mat__int + +# Register _Mat__int in _USCD: +_USCD._Mat__int_swigregister(_Mat__int) + + +Mat1i = _Mat__int + +class _cv_numpy_sizeof_Vec2i(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_Vec2i_value + + def __init__(self): + _USCD._cv_numpy_sizeof_Vec2i_swiginit(self, _USCD.new__cv_numpy_sizeof_Vec2i()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_Vec2i + +# Register _cv_numpy_sizeof_Vec2i in _USCD: +_USCD._cv_numpy_sizeof_Vec2i_swigregister(_cv_numpy_sizeof_Vec2i) + + +if _cv_numpy_sizeof_Vec2i.value == 1: + _cv_numpy_typestr_map["Vec2i"] = "|" +"i" + "1" +else: + _cv_numpy_typestr_map["Vec2i"] = _cv_numpy_endianess +"i" + str(_cv_numpy_sizeof_Vec2i.value) + +class _Mat__Vec2i(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__Vec2i_create(self, *args) + + def cross(self, m): + return _USCD._Mat__Vec2i_cross(self, m) + + def row(self, y): + return _USCD._Mat__Vec2i_row(self, y) + + def col(self, x): + return _USCD._Mat__Vec2i_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__Vec2i_diag(self, d) + + def clone(self): + return _USCD._Mat__Vec2i_clone(self) + + def elemSize(self): + return _USCD._Mat__Vec2i_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__Vec2i_elemSize1(self) + + def type(self): + return _USCD._Mat__Vec2i_type(self) + + def depth(self): + return _USCD._Mat__Vec2i_depth(self) + + def channels(self): + return _USCD._Mat__Vec2i_channels(self) + + def step1(self, i=0): + return _USCD._Mat__Vec2i_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__Vec2i_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__Vec2i_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__Vec2i___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__Vec2i_swiginit(self, _USCD.new__Mat__Vec2i(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__Vec2i___str__(self) + __swig_destroy__ = _USCD.delete__Mat__Vec2i + +# Register _Mat__Vec2i in _USCD: +_USCD._Mat__Vec2i_swigregister(_Mat__Vec2i) + + +Mat2i = _Mat__Vec2i + +class _cv_numpy_sizeof_Vec3i(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_Vec3i_value + + def __init__(self): + _USCD._cv_numpy_sizeof_Vec3i_swiginit(self, _USCD.new__cv_numpy_sizeof_Vec3i()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_Vec3i + +# Register _cv_numpy_sizeof_Vec3i in _USCD: +_USCD._cv_numpy_sizeof_Vec3i_swigregister(_cv_numpy_sizeof_Vec3i) + + +if _cv_numpy_sizeof_Vec3i.value == 1: + _cv_numpy_typestr_map["Vec3i"] = "|" +"i" + "1" +else: + _cv_numpy_typestr_map["Vec3i"] = _cv_numpy_endianess +"i" + str(_cv_numpy_sizeof_Vec3i.value) + +class _Mat__Vec3i(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__Vec3i_create(self, *args) + + def cross(self, m): + return _USCD._Mat__Vec3i_cross(self, m) + + def row(self, y): + return _USCD._Mat__Vec3i_row(self, y) + + def col(self, x): + return _USCD._Mat__Vec3i_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__Vec3i_diag(self, d) + + def clone(self): + return _USCD._Mat__Vec3i_clone(self) + + def elemSize(self): + return _USCD._Mat__Vec3i_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__Vec3i_elemSize1(self) + + def type(self): + return _USCD._Mat__Vec3i_type(self) + + def depth(self): + return _USCD._Mat__Vec3i_depth(self) + + def channels(self): + return _USCD._Mat__Vec3i_channels(self) + + def step1(self, i=0): + return _USCD._Mat__Vec3i_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__Vec3i_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__Vec3i_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__Vec3i___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__Vec3i_swiginit(self, _USCD.new__Mat__Vec3i(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__Vec3i___str__(self) + __swig_destroy__ = _USCD.delete__Mat__Vec3i + +# Register _Mat__Vec3i in _USCD: +_USCD._Mat__Vec3i_swigregister(_Mat__Vec3i) + + +Mat3i = _Mat__Vec3i + +class _cv_numpy_sizeof_Vec4i(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_Vec4i_value + + def __init__(self): + _USCD._cv_numpy_sizeof_Vec4i_swiginit(self, _USCD.new__cv_numpy_sizeof_Vec4i()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_Vec4i + +# Register _cv_numpy_sizeof_Vec4i in _USCD: +_USCD._cv_numpy_sizeof_Vec4i_swigregister(_cv_numpy_sizeof_Vec4i) + + +if _cv_numpy_sizeof_Vec4i.value == 1: + _cv_numpy_typestr_map["Vec4i"] = "|" +"i" + "1" +else: + _cv_numpy_typestr_map["Vec4i"] = _cv_numpy_endianess +"i" + str(_cv_numpy_sizeof_Vec4i.value) + +class _Mat__Vec4i(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__Vec4i_create(self, *args) + + def cross(self, m): + return _USCD._Mat__Vec4i_cross(self, m) + + def row(self, y): + return _USCD._Mat__Vec4i_row(self, y) + + def col(self, x): + return _USCD._Mat__Vec4i_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__Vec4i_diag(self, d) + + def clone(self): + return _USCD._Mat__Vec4i_clone(self) + + def elemSize(self): + return _USCD._Mat__Vec4i_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__Vec4i_elemSize1(self) + + def type(self): + return _USCD._Mat__Vec4i_type(self) + + def depth(self): + return _USCD._Mat__Vec4i_depth(self) + + def channels(self): + return _USCD._Mat__Vec4i_channels(self) + + def step1(self, i=0): + return _USCD._Mat__Vec4i_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__Vec4i_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__Vec4i_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__Vec4i___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__Vec4i_swiginit(self, _USCD.new__Mat__Vec4i(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__Vec4i___str__(self) + __swig_destroy__ = _USCD.delete__Mat__Vec4i + +# Register _Mat__Vec4i in _USCD: +_USCD._Mat__Vec4i_swigregister(_Mat__Vec4i) + + +Mat4i = _Mat__Vec4i + +class _Mat__float(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__float_create(self, *args) + + def cross(self, m): + return _USCD._Mat__float_cross(self, m) + + def row(self, y): + return _USCD._Mat__float_row(self, y) + + def col(self, x): + return _USCD._Mat__float_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__float_diag(self, d) + + def clone(self): + return _USCD._Mat__float_clone(self) + + def elemSize(self): + return _USCD._Mat__float_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__float_elemSize1(self) + + def type(self): + return _USCD._Mat__float_type(self) + + def depth(self): + return _USCD._Mat__float_depth(self) + + def channels(self): + return _USCD._Mat__float_channels(self) + + def step1(self, i=0): + return _USCD._Mat__float_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__float_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__float_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__float___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__float_swiginit(self, _USCD.new__Mat__float(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__float___str__(self) + __swig_destroy__ = _USCD.delete__Mat__float + +# Register _Mat__float in _USCD: +_USCD._Mat__float_swigregister(_Mat__float) + + +Mat1f = _Mat__float + +class _cv_numpy_sizeof_Vec2f(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_Vec2f_value + + def __init__(self): + _USCD._cv_numpy_sizeof_Vec2f_swiginit(self, _USCD.new__cv_numpy_sizeof_Vec2f()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_Vec2f + +# Register _cv_numpy_sizeof_Vec2f in _USCD: +_USCD._cv_numpy_sizeof_Vec2f_swigregister(_cv_numpy_sizeof_Vec2f) + + +if _cv_numpy_sizeof_Vec2f.value == 1: + _cv_numpy_typestr_map["Vec2f"] = "|" +"f" + "1" +else: + _cv_numpy_typestr_map["Vec2f"] = _cv_numpy_endianess +"f" + str(_cv_numpy_sizeof_Vec2f.value) + +class _Mat__Vec2f(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__Vec2f_create(self, *args) + + def cross(self, m): + return _USCD._Mat__Vec2f_cross(self, m) + + def row(self, y): + return _USCD._Mat__Vec2f_row(self, y) + + def col(self, x): + return _USCD._Mat__Vec2f_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__Vec2f_diag(self, d) + + def clone(self): + return _USCD._Mat__Vec2f_clone(self) + + def elemSize(self): + return _USCD._Mat__Vec2f_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__Vec2f_elemSize1(self) + + def type(self): + return _USCD._Mat__Vec2f_type(self) + + def depth(self): + return _USCD._Mat__Vec2f_depth(self) + + def channels(self): + return _USCD._Mat__Vec2f_channels(self) + + def step1(self, i=0): + return _USCD._Mat__Vec2f_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__Vec2f_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__Vec2f_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__Vec2f___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__Vec2f_swiginit(self, _USCD.new__Mat__Vec2f(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__Vec2f___str__(self) + __swig_destroy__ = _USCD.delete__Mat__Vec2f + +# Register _Mat__Vec2f in _USCD: +_USCD._Mat__Vec2f_swigregister(_Mat__Vec2f) + + +Mat2f = _Mat__Vec2f + +class _cv_numpy_sizeof_Vec3f(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_Vec3f_value + + def __init__(self): + _USCD._cv_numpy_sizeof_Vec3f_swiginit(self, _USCD.new__cv_numpy_sizeof_Vec3f()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_Vec3f + +# Register _cv_numpy_sizeof_Vec3f in _USCD: +_USCD._cv_numpy_sizeof_Vec3f_swigregister(_cv_numpy_sizeof_Vec3f) + + +if _cv_numpy_sizeof_Vec3f.value == 1: + _cv_numpy_typestr_map["Vec3f"] = "|" +"f" + "1" +else: + _cv_numpy_typestr_map["Vec3f"] = _cv_numpy_endianess +"f" + str(_cv_numpy_sizeof_Vec3f.value) + +class _Mat__Vec3f(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__Vec3f_create(self, *args) + + def cross(self, m): + return _USCD._Mat__Vec3f_cross(self, m) + + def row(self, y): + return _USCD._Mat__Vec3f_row(self, y) + + def col(self, x): + return _USCD._Mat__Vec3f_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__Vec3f_diag(self, d) + + def clone(self): + return _USCD._Mat__Vec3f_clone(self) + + def elemSize(self): + return _USCD._Mat__Vec3f_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__Vec3f_elemSize1(self) + + def type(self): + return _USCD._Mat__Vec3f_type(self) + + def depth(self): + return _USCD._Mat__Vec3f_depth(self) + + def channels(self): + return _USCD._Mat__Vec3f_channels(self) + + def step1(self, i=0): + return _USCD._Mat__Vec3f_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__Vec3f_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__Vec3f_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__Vec3f___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__Vec3f_swiginit(self, _USCD.new__Mat__Vec3f(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__Vec3f___str__(self) + __swig_destroy__ = _USCD.delete__Mat__Vec3f + +# Register _Mat__Vec3f in _USCD: +_USCD._Mat__Vec3f_swigregister(_Mat__Vec3f) + + +Mat3f = _Mat__Vec3f + +class _cv_numpy_sizeof_Vec4f(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_Vec4f_value + + def __init__(self): + _USCD._cv_numpy_sizeof_Vec4f_swiginit(self, _USCD.new__cv_numpy_sizeof_Vec4f()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_Vec4f + +# Register _cv_numpy_sizeof_Vec4f in _USCD: +_USCD._cv_numpy_sizeof_Vec4f_swigregister(_cv_numpy_sizeof_Vec4f) + + +if _cv_numpy_sizeof_Vec4f.value == 1: + _cv_numpy_typestr_map["Vec4f"] = "|" +"f" + "1" +else: + _cv_numpy_typestr_map["Vec4f"] = _cv_numpy_endianess +"f" + str(_cv_numpy_sizeof_Vec4f.value) + +class _Mat__Vec4f(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__Vec4f_create(self, *args) + + def cross(self, m): + return _USCD._Mat__Vec4f_cross(self, m) + + def row(self, y): + return _USCD._Mat__Vec4f_row(self, y) + + def col(self, x): + return _USCD._Mat__Vec4f_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__Vec4f_diag(self, d) + + def clone(self): + return _USCD._Mat__Vec4f_clone(self) + + def elemSize(self): + return _USCD._Mat__Vec4f_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__Vec4f_elemSize1(self) + + def type(self): + return _USCD._Mat__Vec4f_type(self) + + def depth(self): + return _USCD._Mat__Vec4f_depth(self) + + def channels(self): + return _USCD._Mat__Vec4f_channels(self) + + def step1(self, i=0): + return _USCD._Mat__Vec4f_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__Vec4f_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__Vec4f_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__Vec4f___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__Vec4f_swiginit(self, _USCD.new__Mat__Vec4f(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__Vec4f___str__(self) + __swig_destroy__ = _USCD.delete__Mat__Vec4f + +# Register _Mat__Vec4f in _USCD: +_USCD._Mat__Vec4f_swigregister(_Mat__Vec4f) + + +Mat4f = _Mat__Vec4f + +class _Mat__double(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__double_create(self, *args) + + def cross(self, m): + return _USCD._Mat__double_cross(self, m) + + def row(self, y): + return _USCD._Mat__double_row(self, y) + + def col(self, x): + return _USCD._Mat__double_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__double_diag(self, d) + + def clone(self): + return _USCD._Mat__double_clone(self) + + def elemSize(self): + return _USCD._Mat__double_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__double_elemSize1(self) + + def type(self): + return _USCD._Mat__double_type(self) + + def depth(self): + return _USCD._Mat__double_depth(self) + + def channels(self): + return _USCD._Mat__double_channels(self) + + def step1(self, i=0): + return _USCD._Mat__double_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__double_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__double_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__double___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__double_swiginit(self, _USCD.new__Mat__double(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__double___str__(self) + __swig_destroy__ = _USCD.delete__Mat__double + +# Register _Mat__double in _USCD: +_USCD._Mat__double_swigregister(_Mat__double) + + +Mat1d = _Mat__double + +class _cv_numpy_sizeof_Vec2d(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_Vec2d_value + + def __init__(self): + _USCD._cv_numpy_sizeof_Vec2d_swiginit(self, _USCD.new__cv_numpy_sizeof_Vec2d()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_Vec2d + +# Register _cv_numpy_sizeof_Vec2d in _USCD: +_USCD._cv_numpy_sizeof_Vec2d_swigregister(_cv_numpy_sizeof_Vec2d) + + +if _cv_numpy_sizeof_Vec2d.value == 1: + _cv_numpy_typestr_map["Vec2d"] = "|" +"f" + "1" +else: + _cv_numpy_typestr_map["Vec2d"] = _cv_numpy_endianess +"f" + str(_cv_numpy_sizeof_Vec2d.value) + +class _Mat__Vec2d(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__Vec2d_create(self, *args) + + def cross(self, m): + return _USCD._Mat__Vec2d_cross(self, m) + + def row(self, y): + return _USCD._Mat__Vec2d_row(self, y) + + def col(self, x): + return _USCD._Mat__Vec2d_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__Vec2d_diag(self, d) + + def clone(self): + return _USCD._Mat__Vec2d_clone(self) + + def elemSize(self): + return _USCD._Mat__Vec2d_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__Vec2d_elemSize1(self) + + def type(self): + return _USCD._Mat__Vec2d_type(self) + + def depth(self): + return _USCD._Mat__Vec2d_depth(self) + + def channels(self): + return _USCD._Mat__Vec2d_channels(self) + + def step1(self, i=0): + return _USCD._Mat__Vec2d_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__Vec2d_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__Vec2d_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__Vec2d___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__Vec2d_swiginit(self, _USCD.new__Mat__Vec2d(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__Vec2d___str__(self) + __swig_destroy__ = _USCD.delete__Mat__Vec2d + +# Register _Mat__Vec2d in _USCD: +_USCD._Mat__Vec2d_swigregister(_Mat__Vec2d) + + +Mat2d = _Mat__Vec2d + +class _cv_numpy_sizeof_Vec3d(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_Vec3d_value + + def __init__(self): + _USCD._cv_numpy_sizeof_Vec3d_swiginit(self, _USCD.new__cv_numpy_sizeof_Vec3d()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_Vec3d + +# Register _cv_numpy_sizeof_Vec3d in _USCD: +_USCD._cv_numpy_sizeof_Vec3d_swigregister(_cv_numpy_sizeof_Vec3d) + + +if _cv_numpy_sizeof_Vec3d.value == 1: + _cv_numpy_typestr_map["Vec3d"] = "|" +"f" + "1" +else: + _cv_numpy_typestr_map["Vec3d"] = _cv_numpy_endianess +"f" + str(_cv_numpy_sizeof_Vec3d.value) + +class _Mat__Vec3d(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__Vec3d_create(self, *args) + + def cross(self, m): + return _USCD._Mat__Vec3d_cross(self, m) + + def row(self, y): + return _USCD._Mat__Vec3d_row(self, y) + + def col(self, x): + return _USCD._Mat__Vec3d_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__Vec3d_diag(self, d) + + def clone(self): + return _USCD._Mat__Vec3d_clone(self) + + def elemSize(self): + return _USCD._Mat__Vec3d_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__Vec3d_elemSize1(self) + + def type(self): + return _USCD._Mat__Vec3d_type(self) + + def depth(self): + return _USCD._Mat__Vec3d_depth(self) + + def channels(self): + return _USCD._Mat__Vec3d_channels(self) + + def step1(self, i=0): + return _USCD._Mat__Vec3d_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__Vec3d_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__Vec3d_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__Vec3d___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__Vec3d_swiginit(self, _USCD.new__Mat__Vec3d(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__Vec3d___str__(self) + __swig_destroy__ = _USCD.delete__Mat__Vec3d + +# Register _Mat__Vec3d in _USCD: +_USCD._Mat__Vec3d_swigregister(_Mat__Vec3d) + + +Mat3d = _Mat__Vec3d + +class _cv_numpy_sizeof_Vec4d(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + value = _USCD._cv_numpy_sizeof_Vec4d_value + + def __init__(self): + _USCD._cv_numpy_sizeof_Vec4d_swiginit(self, _USCD.new__cv_numpy_sizeof_Vec4d()) + __swig_destroy__ = _USCD.delete__cv_numpy_sizeof_Vec4d + +# Register _cv_numpy_sizeof_Vec4d in _USCD: +_USCD._cv_numpy_sizeof_Vec4d_swigregister(_cv_numpy_sizeof_Vec4d) + + +if _cv_numpy_sizeof_Vec4d.value == 1: + _cv_numpy_typestr_map["Vec4d"] = "|" +"f" + "1" +else: + _cv_numpy_typestr_map["Vec4d"] = _cv_numpy_endianess +"f" + str(_cv_numpy_sizeof_Vec4d.value) + +class _Mat__Vec4d(Mat): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def create(self, *args): + return _USCD._Mat__Vec4d_create(self, *args) + + def cross(self, m): + return _USCD._Mat__Vec4d_cross(self, m) + + def row(self, y): + return _USCD._Mat__Vec4d_row(self, y) + + def col(self, x): + return _USCD._Mat__Vec4d_col(self, x) + + def diag(self, d=0): + return _USCD._Mat__Vec4d_diag(self, d) + + def clone(self): + return _USCD._Mat__Vec4d_clone(self) + + def elemSize(self): + return _USCD._Mat__Vec4d_elemSize(self) + + def elemSize1(self): + return _USCD._Mat__Vec4d_elemSize1(self) + + def type(self): + return _USCD._Mat__Vec4d_type(self) + + def depth(self): + return _USCD._Mat__Vec4d_depth(self) + + def channels(self): + return _USCD._Mat__Vec4d_channels(self) + + def step1(self, i=0): + return _USCD._Mat__Vec4d_step1(self, i) + + def stepT(self, i=0): + return _USCD._Mat__Vec4d_stepT(self, i) + + def adjustROI(self, dtop, dbottom, dleft, dright): + return _USCD._Mat__Vec4d_adjustROI(self, dtop, dbottom, dleft, dright) + + def __call__(self, *args): + return _USCD._Mat__Vec4d___call__(self, *args) + + def __init__(self, *args): + _USCD._Mat__Vec4d_swiginit(self, _USCD.new__Mat__Vec4d(*args)) + + @classmethod + def __check_channels_compatibility(cls, array): + obj = cls() + n_channel = obj.channels() + + if n_channel == 1: + if len(array.shape) != 2: + raise ValueError("{} expects a 2-dimensional numpy ndarray.".format(cls)) + else: + if len(array.shape) != 3: + raise ValueError("{} expects a 3-dimensional numpy ndarray.".format(cls)) + elif array.shape[2] != n_channel: + raise ValueError("{} expects the last ndarray dimension to have a size of {}".format(cls, n_channel)) + + @classmethod + def from_array(cls, array): + import numpy as np + array = np.asarray(array) + + if cls()._typestr() != array.__array_interface__['typestr']: + raise ValueError("{} expects a {} datatype.".format(cls, cls()._typestr())) + + cls.__check_channels_compatibility(array) + + new_mat = cls(_mat__np_array_constructor(), + array.shape[0], + array.shape[1], + array.__array_interface__['data'][0]) + + # Holds an internal reference to keep the image buffer alive + new_mat._array = array + + return new_mat + + + def __str__(self): + return _USCD._Mat__Vec4d___str__(self) + __swig_destroy__ = _USCD.delete__Mat__Vec4d + +# Register _Mat__Vec4d in _USCD: +_USCD._Mat__Vec4d_swigregister(_Mat__Vec4d) + + +Mat4d = _Mat__Vec4d + +class _Matx_float_1_2(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_float_1_2_rows + cols = _USCD._Matx_float_1_2_cols + channels = _USCD._Matx_float_1_2_channels + shortdim = _USCD._Matx_float_1_2_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_float_1_2_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_float_1_2_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_float_1_2_ones() + + @staticmethod + def eye(): + return _USCD._Matx_float_1_2_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_float_1_2_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_float_1_2_randn(a, b) + + def dot(self, v): + return _USCD._Matx_float_1_2_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_float_1_2_ddot(self, v) + + def t(self): + return _USCD._Matx_float_1_2_t(self) + + def mul(self, a): + return _USCD._Matx_float_1_2_mul(self, a) + + def div(self, a): + return _USCD._Matx_float_1_2_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_float_1_2___call__(self, i, j) + val = property(_USCD._Matx_float_1_2_val_get, _USCD._Matx_float_1_2_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_float_1_2_swiginit(self, _USCD.new__Matx_float_1_2(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_float_1_2___str__(self) + __swig_destroy__ = _USCD.delete__Matx_float_1_2 + +# Register _Matx_float_1_2 in _USCD: +_USCD._Matx_float_1_2_swigregister(_Matx_float_1_2) + +def _Matx_float_1_2_all(alpha): + return _USCD._Matx_float_1_2_all(alpha) + +def _Matx_float_1_2_zeros(): + return _USCD._Matx_float_1_2_zeros() + +def _Matx_float_1_2_ones(): + return _USCD._Matx_float_1_2_ones() + +def _Matx_float_1_2_eye(): + return _USCD._Matx_float_1_2_eye() + +def _Matx_float_1_2_randu(a, b): + return _USCD._Matx_float_1_2_randu(a, b) + +def _Matx_float_1_2_randn(a, b): + return _USCD._Matx_float_1_2_randn(a, b) + + +Matx12f = _Matx_float_1_2 + +class _Matx_double_1_2(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_double_1_2_rows + cols = _USCD._Matx_double_1_2_cols + channels = _USCD._Matx_double_1_2_channels + shortdim = _USCD._Matx_double_1_2_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_double_1_2_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_double_1_2_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_double_1_2_ones() + + @staticmethod + def eye(): + return _USCD._Matx_double_1_2_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_double_1_2_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_double_1_2_randn(a, b) + + def dot(self, v): + return _USCD._Matx_double_1_2_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_double_1_2_ddot(self, v) + + def t(self): + return _USCD._Matx_double_1_2_t(self) + + def mul(self, a): + return _USCD._Matx_double_1_2_mul(self, a) + + def div(self, a): + return _USCD._Matx_double_1_2_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_double_1_2___call__(self, i, j) + val = property(_USCD._Matx_double_1_2_val_get, _USCD._Matx_double_1_2_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_double_1_2_swiginit(self, _USCD.new__Matx_double_1_2(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_double_1_2___str__(self) + __swig_destroy__ = _USCD.delete__Matx_double_1_2 + +# Register _Matx_double_1_2 in _USCD: +_USCD._Matx_double_1_2_swigregister(_Matx_double_1_2) + +def _Matx_double_1_2_all(alpha): + return _USCD._Matx_double_1_2_all(alpha) + +def _Matx_double_1_2_zeros(): + return _USCD._Matx_double_1_2_zeros() + +def _Matx_double_1_2_ones(): + return _USCD._Matx_double_1_2_ones() + +def _Matx_double_1_2_eye(): + return _USCD._Matx_double_1_2_eye() + +def _Matx_double_1_2_randu(a, b): + return _USCD._Matx_double_1_2_randu(a, b) + +def _Matx_double_1_2_randn(a, b): + return _USCD._Matx_double_1_2_randn(a, b) + + +Matx12d = _Matx_double_1_2 + +class _Matx_float_1_3(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_float_1_3_rows + cols = _USCD._Matx_float_1_3_cols + channels = _USCD._Matx_float_1_3_channels + shortdim = _USCD._Matx_float_1_3_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_float_1_3_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_float_1_3_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_float_1_3_ones() + + @staticmethod + def eye(): + return _USCD._Matx_float_1_3_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_float_1_3_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_float_1_3_randn(a, b) + + def dot(self, v): + return _USCD._Matx_float_1_3_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_float_1_3_ddot(self, v) + + def t(self): + return _USCD._Matx_float_1_3_t(self) + + def mul(self, a): + return _USCD._Matx_float_1_3_mul(self, a) + + def div(self, a): + return _USCD._Matx_float_1_3_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_float_1_3___call__(self, i, j) + val = property(_USCD._Matx_float_1_3_val_get, _USCD._Matx_float_1_3_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_float_1_3_swiginit(self, _USCD.new__Matx_float_1_3(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_float_1_3___str__(self) + __swig_destroy__ = _USCD.delete__Matx_float_1_3 + +# Register _Matx_float_1_3 in _USCD: +_USCD._Matx_float_1_3_swigregister(_Matx_float_1_3) + +def _Matx_float_1_3_all(alpha): + return _USCD._Matx_float_1_3_all(alpha) + +def _Matx_float_1_3_zeros(): + return _USCD._Matx_float_1_3_zeros() + +def _Matx_float_1_3_ones(): + return _USCD._Matx_float_1_3_ones() + +def _Matx_float_1_3_eye(): + return _USCD._Matx_float_1_3_eye() + +def _Matx_float_1_3_randu(a, b): + return _USCD._Matx_float_1_3_randu(a, b) + +def _Matx_float_1_3_randn(a, b): + return _USCD._Matx_float_1_3_randn(a, b) + + +Matx13f = _Matx_float_1_3 + +class _Matx_double_1_3(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_double_1_3_rows + cols = _USCD._Matx_double_1_3_cols + channels = _USCD._Matx_double_1_3_channels + shortdim = _USCD._Matx_double_1_3_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_double_1_3_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_double_1_3_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_double_1_3_ones() + + @staticmethod + def eye(): + return _USCD._Matx_double_1_3_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_double_1_3_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_double_1_3_randn(a, b) + + def dot(self, v): + return _USCD._Matx_double_1_3_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_double_1_3_ddot(self, v) + + def t(self): + return _USCD._Matx_double_1_3_t(self) + + def mul(self, a): + return _USCD._Matx_double_1_3_mul(self, a) + + def div(self, a): + return _USCD._Matx_double_1_3_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_double_1_3___call__(self, i, j) + val = property(_USCD._Matx_double_1_3_val_get, _USCD._Matx_double_1_3_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_double_1_3_swiginit(self, _USCD.new__Matx_double_1_3(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_double_1_3___str__(self) + __swig_destroy__ = _USCD.delete__Matx_double_1_3 + +# Register _Matx_double_1_3 in _USCD: +_USCD._Matx_double_1_3_swigregister(_Matx_double_1_3) + +def _Matx_double_1_3_all(alpha): + return _USCD._Matx_double_1_3_all(alpha) + +def _Matx_double_1_3_zeros(): + return _USCD._Matx_double_1_3_zeros() + +def _Matx_double_1_3_ones(): + return _USCD._Matx_double_1_3_ones() + +def _Matx_double_1_3_eye(): + return _USCD._Matx_double_1_3_eye() + +def _Matx_double_1_3_randu(a, b): + return _USCD._Matx_double_1_3_randu(a, b) + +def _Matx_double_1_3_randn(a, b): + return _USCD._Matx_double_1_3_randn(a, b) + + +Matx13d = _Matx_double_1_3 + +class _Matx_float_1_4(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_float_1_4_rows + cols = _USCD._Matx_float_1_4_cols + channels = _USCD._Matx_float_1_4_channels + shortdim = _USCD._Matx_float_1_4_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_float_1_4_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_float_1_4_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_float_1_4_ones() + + @staticmethod + def eye(): + return _USCD._Matx_float_1_4_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_float_1_4_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_float_1_4_randn(a, b) + + def dot(self, v): + return _USCD._Matx_float_1_4_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_float_1_4_ddot(self, v) + + def t(self): + return _USCD._Matx_float_1_4_t(self) + + def mul(self, a): + return _USCD._Matx_float_1_4_mul(self, a) + + def div(self, a): + return _USCD._Matx_float_1_4_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_float_1_4___call__(self, i, j) + val = property(_USCD._Matx_float_1_4_val_get, _USCD._Matx_float_1_4_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_float_1_4_swiginit(self, _USCD.new__Matx_float_1_4(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_float_1_4___str__(self) + __swig_destroy__ = _USCD.delete__Matx_float_1_4 + +# Register _Matx_float_1_4 in _USCD: +_USCD._Matx_float_1_4_swigregister(_Matx_float_1_4) + +def _Matx_float_1_4_all(alpha): + return _USCD._Matx_float_1_4_all(alpha) + +def _Matx_float_1_4_zeros(): + return _USCD._Matx_float_1_4_zeros() + +def _Matx_float_1_4_ones(): + return _USCD._Matx_float_1_4_ones() + +def _Matx_float_1_4_eye(): + return _USCD._Matx_float_1_4_eye() + +def _Matx_float_1_4_randu(a, b): + return _USCD._Matx_float_1_4_randu(a, b) + +def _Matx_float_1_4_randn(a, b): + return _USCD._Matx_float_1_4_randn(a, b) + + +Matx14f = _Matx_float_1_4 + +class _Matx_double_1_4(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_double_1_4_rows + cols = _USCD._Matx_double_1_4_cols + channels = _USCD._Matx_double_1_4_channels + shortdim = _USCD._Matx_double_1_4_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_double_1_4_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_double_1_4_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_double_1_4_ones() + + @staticmethod + def eye(): + return _USCD._Matx_double_1_4_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_double_1_4_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_double_1_4_randn(a, b) + + def dot(self, v): + return _USCD._Matx_double_1_4_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_double_1_4_ddot(self, v) + + def t(self): + return _USCD._Matx_double_1_4_t(self) + + def mul(self, a): + return _USCD._Matx_double_1_4_mul(self, a) + + def div(self, a): + return _USCD._Matx_double_1_4_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_double_1_4___call__(self, i, j) + val = property(_USCD._Matx_double_1_4_val_get, _USCD._Matx_double_1_4_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_double_1_4_swiginit(self, _USCD.new__Matx_double_1_4(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_double_1_4___str__(self) + __swig_destroy__ = _USCD.delete__Matx_double_1_4 + +# Register _Matx_double_1_4 in _USCD: +_USCD._Matx_double_1_4_swigregister(_Matx_double_1_4) + +def _Matx_double_1_4_all(alpha): + return _USCD._Matx_double_1_4_all(alpha) + +def _Matx_double_1_4_zeros(): + return _USCD._Matx_double_1_4_zeros() + +def _Matx_double_1_4_ones(): + return _USCD._Matx_double_1_4_ones() + +def _Matx_double_1_4_eye(): + return _USCD._Matx_double_1_4_eye() + +def _Matx_double_1_4_randu(a, b): + return _USCD._Matx_double_1_4_randu(a, b) + +def _Matx_double_1_4_randn(a, b): + return _USCD._Matx_double_1_4_randn(a, b) + + +Matx14d = _Matx_double_1_4 + +class _Matx_float_1_6(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_float_1_6_rows + cols = _USCD._Matx_float_1_6_cols + channels = _USCD._Matx_float_1_6_channels + shortdim = _USCD._Matx_float_1_6_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_float_1_6_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_float_1_6_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_float_1_6_ones() + + @staticmethod + def eye(): + return _USCD._Matx_float_1_6_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_float_1_6_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_float_1_6_randn(a, b) + + def dot(self, v): + return _USCD._Matx_float_1_6_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_float_1_6_ddot(self, v) + + def t(self): + return _USCD._Matx_float_1_6_t(self) + + def mul(self, a): + return _USCD._Matx_float_1_6_mul(self, a) + + def div(self, a): + return _USCD._Matx_float_1_6_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_float_1_6___call__(self, i, j) + val = property(_USCD._Matx_float_1_6_val_get, _USCD._Matx_float_1_6_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_float_1_6_swiginit(self, _USCD.new__Matx_float_1_6(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_float_1_6___str__(self) + __swig_destroy__ = _USCD.delete__Matx_float_1_6 + +# Register _Matx_float_1_6 in _USCD: +_USCD._Matx_float_1_6_swigregister(_Matx_float_1_6) + +def _Matx_float_1_6_all(alpha): + return _USCD._Matx_float_1_6_all(alpha) + +def _Matx_float_1_6_zeros(): + return _USCD._Matx_float_1_6_zeros() + +def _Matx_float_1_6_ones(): + return _USCD._Matx_float_1_6_ones() + +def _Matx_float_1_6_eye(): + return _USCD._Matx_float_1_6_eye() + +def _Matx_float_1_6_randu(a, b): + return _USCD._Matx_float_1_6_randu(a, b) + +def _Matx_float_1_6_randn(a, b): + return _USCD._Matx_float_1_6_randn(a, b) + + +Matx16f = _Matx_float_1_6 + +class _Matx_double_1_6(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_double_1_6_rows + cols = _USCD._Matx_double_1_6_cols + channels = _USCD._Matx_double_1_6_channels + shortdim = _USCD._Matx_double_1_6_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_double_1_6_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_double_1_6_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_double_1_6_ones() + + @staticmethod + def eye(): + return _USCD._Matx_double_1_6_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_double_1_6_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_double_1_6_randn(a, b) + + def dot(self, v): + return _USCD._Matx_double_1_6_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_double_1_6_ddot(self, v) + + def t(self): + return _USCD._Matx_double_1_6_t(self) + + def mul(self, a): + return _USCD._Matx_double_1_6_mul(self, a) + + def div(self, a): + return _USCD._Matx_double_1_6_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_double_1_6___call__(self, i, j) + val = property(_USCD._Matx_double_1_6_val_get, _USCD._Matx_double_1_6_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_double_1_6_swiginit(self, _USCD.new__Matx_double_1_6(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_double_1_6___str__(self) + __swig_destroy__ = _USCD.delete__Matx_double_1_6 + +# Register _Matx_double_1_6 in _USCD: +_USCD._Matx_double_1_6_swigregister(_Matx_double_1_6) + +def _Matx_double_1_6_all(alpha): + return _USCD._Matx_double_1_6_all(alpha) + +def _Matx_double_1_6_zeros(): + return _USCD._Matx_double_1_6_zeros() + +def _Matx_double_1_6_ones(): + return _USCD._Matx_double_1_6_ones() + +def _Matx_double_1_6_eye(): + return _USCD._Matx_double_1_6_eye() + +def _Matx_double_1_6_randu(a, b): + return _USCD._Matx_double_1_6_randu(a, b) + +def _Matx_double_1_6_randn(a, b): + return _USCD._Matx_double_1_6_randn(a, b) + + +Matx16d = _Matx_double_1_6 + +class _Matx_float_2_2(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_float_2_2_rows + cols = _USCD._Matx_float_2_2_cols + channels = _USCD._Matx_float_2_2_channels + shortdim = _USCD._Matx_float_2_2_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_float_2_2_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_float_2_2_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_float_2_2_ones() + + @staticmethod + def eye(): + return _USCD._Matx_float_2_2_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_float_2_2_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_float_2_2_randn(a, b) + + def dot(self, v): + return _USCD._Matx_float_2_2_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_float_2_2_ddot(self, v) + + def t(self): + return _USCD._Matx_float_2_2_t(self) + + def mul(self, a): + return _USCD._Matx_float_2_2_mul(self, a) + + def div(self, a): + return _USCD._Matx_float_2_2_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_float_2_2___call__(self, i, j) + val = property(_USCD._Matx_float_2_2_val_get, _USCD._Matx_float_2_2_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_float_2_2_swiginit(self, _USCD.new__Matx_float_2_2(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_float_2_2___str__(self) + __swig_destroy__ = _USCD.delete__Matx_float_2_2 + +# Register _Matx_float_2_2 in _USCD: +_USCD._Matx_float_2_2_swigregister(_Matx_float_2_2) + +def _Matx_float_2_2_all(alpha): + return _USCD._Matx_float_2_2_all(alpha) + +def _Matx_float_2_2_zeros(): + return _USCD._Matx_float_2_2_zeros() + +def _Matx_float_2_2_ones(): + return _USCD._Matx_float_2_2_ones() + +def _Matx_float_2_2_eye(): + return _USCD._Matx_float_2_2_eye() + +def _Matx_float_2_2_randu(a, b): + return _USCD._Matx_float_2_2_randu(a, b) + +def _Matx_float_2_2_randn(a, b): + return _USCD._Matx_float_2_2_randn(a, b) + + +Matx22f = _Matx_float_2_2 + +class _Matx_double_2_2(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_double_2_2_rows + cols = _USCD._Matx_double_2_2_cols + channels = _USCD._Matx_double_2_2_channels + shortdim = _USCD._Matx_double_2_2_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_double_2_2_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_double_2_2_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_double_2_2_ones() + + @staticmethod + def eye(): + return _USCD._Matx_double_2_2_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_double_2_2_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_double_2_2_randn(a, b) + + def dot(self, v): + return _USCD._Matx_double_2_2_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_double_2_2_ddot(self, v) + + def t(self): + return _USCD._Matx_double_2_2_t(self) + + def mul(self, a): + return _USCD._Matx_double_2_2_mul(self, a) + + def div(self, a): + return _USCD._Matx_double_2_2_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_double_2_2___call__(self, i, j) + val = property(_USCD._Matx_double_2_2_val_get, _USCD._Matx_double_2_2_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_double_2_2_swiginit(self, _USCD.new__Matx_double_2_2(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_double_2_2___str__(self) + __swig_destroy__ = _USCD.delete__Matx_double_2_2 + +# Register _Matx_double_2_2 in _USCD: +_USCD._Matx_double_2_2_swigregister(_Matx_double_2_2) + +def _Matx_double_2_2_all(alpha): + return _USCD._Matx_double_2_2_all(alpha) + +def _Matx_double_2_2_zeros(): + return _USCD._Matx_double_2_2_zeros() + +def _Matx_double_2_2_ones(): + return _USCD._Matx_double_2_2_ones() + +def _Matx_double_2_2_eye(): + return _USCD._Matx_double_2_2_eye() + +def _Matx_double_2_2_randu(a, b): + return _USCD._Matx_double_2_2_randu(a, b) + +def _Matx_double_2_2_randn(a, b): + return _USCD._Matx_double_2_2_randn(a, b) + + +Matx22d = _Matx_double_2_2 + +class _Matx_float_2_3(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_float_2_3_rows + cols = _USCD._Matx_float_2_3_cols + channels = _USCD._Matx_float_2_3_channels + shortdim = _USCD._Matx_float_2_3_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_float_2_3_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_float_2_3_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_float_2_3_ones() + + @staticmethod + def eye(): + return _USCD._Matx_float_2_3_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_float_2_3_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_float_2_3_randn(a, b) + + def dot(self, v): + return _USCD._Matx_float_2_3_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_float_2_3_ddot(self, v) + + def t(self): + return _USCD._Matx_float_2_3_t(self) + + def mul(self, a): + return _USCD._Matx_float_2_3_mul(self, a) + + def div(self, a): + return _USCD._Matx_float_2_3_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_float_2_3___call__(self, i, j) + val = property(_USCD._Matx_float_2_3_val_get, _USCD._Matx_float_2_3_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_float_2_3_swiginit(self, _USCD.new__Matx_float_2_3(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_float_2_3___str__(self) + __swig_destroy__ = _USCD.delete__Matx_float_2_3 + +# Register _Matx_float_2_3 in _USCD: +_USCD._Matx_float_2_3_swigregister(_Matx_float_2_3) + +def _Matx_float_2_3_all(alpha): + return _USCD._Matx_float_2_3_all(alpha) + +def _Matx_float_2_3_zeros(): + return _USCD._Matx_float_2_3_zeros() + +def _Matx_float_2_3_ones(): + return _USCD._Matx_float_2_3_ones() + +def _Matx_float_2_3_eye(): + return _USCD._Matx_float_2_3_eye() + +def _Matx_float_2_3_randu(a, b): + return _USCD._Matx_float_2_3_randu(a, b) + +def _Matx_float_2_3_randn(a, b): + return _USCD._Matx_float_2_3_randn(a, b) + + +Matx23f = _Matx_float_2_3 + +class _Matx_double_2_3(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_double_2_3_rows + cols = _USCD._Matx_double_2_3_cols + channels = _USCD._Matx_double_2_3_channels + shortdim = _USCD._Matx_double_2_3_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_double_2_3_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_double_2_3_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_double_2_3_ones() + + @staticmethod + def eye(): + return _USCD._Matx_double_2_3_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_double_2_3_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_double_2_3_randn(a, b) + + def dot(self, v): + return _USCD._Matx_double_2_3_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_double_2_3_ddot(self, v) + + def t(self): + return _USCD._Matx_double_2_3_t(self) + + def mul(self, a): + return _USCD._Matx_double_2_3_mul(self, a) + + def div(self, a): + return _USCD._Matx_double_2_3_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_double_2_3___call__(self, i, j) + val = property(_USCD._Matx_double_2_3_val_get, _USCD._Matx_double_2_3_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_double_2_3_swiginit(self, _USCD.new__Matx_double_2_3(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_double_2_3___str__(self) + __swig_destroy__ = _USCD.delete__Matx_double_2_3 + +# Register _Matx_double_2_3 in _USCD: +_USCD._Matx_double_2_3_swigregister(_Matx_double_2_3) + +def _Matx_double_2_3_all(alpha): + return _USCD._Matx_double_2_3_all(alpha) + +def _Matx_double_2_3_zeros(): + return _USCD._Matx_double_2_3_zeros() + +def _Matx_double_2_3_ones(): + return _USCD._Matx_double_2_3_ones() + +def _Matx_double_2_3_eye(): + return _USCD._Matx_double_2_3_eye() + +def _Matx_double_2_3_randu(a, b): + return _USCD._Matx_double_2_3_randu(a, b) + +def _Matx_double_2_3_randn(a, b): + return _USCD._Matx_double_2_3_randn(a, b) + + +Matx23d = _Matx_double_2_3 + +class _Matx_float_3_2(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_float_3_2_rows + cols = _USCD._Matx_float_3_2_cols + channels = _USCD._Matx_float_3_2_channels + shortdim = _USCD._Matx_float_3_2_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_float_3_2_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_float_3_2_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_float_3_2_ones() + + @staticmethod + def eye(): + return _USCD._Matx_float_3_2_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_float_3_2_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_float_3_2_randn(a, b) + + def dot(self, v): + return _USCD._Matx_float_3_2_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_float_3_2_ddot(self, v) + + def t(self): + return _USCD._Matx_float_3_2_t(self) + + def mul(self, a): + return _USCD._Matx_float_3_2_mul(self, a) + + def div(self, a): + return _USCD._Matx_float_3_2_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_float_3_2___call__(self, i, j) + val = property(_USCD._Matx_float_3_2_val_get, _USCD._Matx_float_3_2_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_float_3_2_swiginit(self, _USCD.new__Matx_float_3_2(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_float_3_2___str__(self) + __swig_destroy__ = _USCD.delete__Matx_float_3_2 + +# Register _Matx_float_3_2 in _USCD: +_USCD._Matx_float_3_2_swigregister(_Matx_float_3_2) + +def _Matx_float_3_2_all(alpha): + return _USCD._Matx_float_3_2_all(alpha) + +def _Matx_float_3_2_zeros(): + return _USCD._Matx_float_3_2_zeros() + +def _Matx_float_3_2_ones(): + return _USCD._Matx_float_3_2_ones() + +def _Matx_float_3_2_eye(): + return _USCD._Matx_float_3_2_eye() + +def _Matx_float_3_2_randu(a, b): + return _USCD._Matx_float_3_2_randu(a, b) + +def _Matx_float_3_2_randn(a, b): + return _USCD._Matx_float_3_2_randn(a, b) + + +Matx32f = _Matx_float_3_2 + +class _Matx_double_3_2(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_double_3_2_rows + cols = _USCD._Matx_double_3_2_cols + channels = _USCD._Matx_double_3_2_channels + shortdim = _USCD._Matx_double_3_2_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_double_3_2_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_double_3_2_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_double_3_2_ones() + + @staticmethod + def eye(): + return _USCD._Matx_double_3_2_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_double_3_2_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_double_3_2_randn(a, b) + + def dot(self, v): + return _USCD._Matx_double_3_2_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_double_3_2_ddot(self, v) + + def t(self): + return _USCD._Matx_double_3_2_t(self) + + def mul(self, a): + return _USCD._Matx_double_3_2_mul(self, a) + + def div(self, a): + return _USCD._Matx_double_3_2_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_double_3_2___call__(self, i, j) + val = property(_USCD._Matx_double_3_2_val_get, _USCD._Matx_double_3_2_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_double_3_2_swiginit(self, _USCD.new__Matx_double_3_2(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_double_3_2___str__(self) + __swig_destroy__ = _USCD.delete__Matx_double_3_2 + +# Register _Matx_double_3_2 in _USCD: +_USCD._Matx_double_3_2_swigregister(_Matx_double_3_2) + +def _Matx_double_3_2_all(alpha): + return _USCD._Matx_double_3_2_all(alpha) + +def _Matx_double_3_2_zeros(): + return _USCD._Matx_double_3_2_zeros() + +def _Matx_double_3_2_ones(): + return _USCD._Matx_double_3_2_ones() + +def _Matx_double_3_2_eye(): + return _USCD._Matx_double_3_2_eye() + +def _Matx_double_3_2_randu(a, b): + return _USCD._Matx_double_3_2_randu(a, b) + +def _Matx_double_3_2_randn(a, b): + return _USCD._Matx_double_3_2_randn(a, b) + + +Matx32d = _Matx_double_3_2 + +class _Matx_float_3_3(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_float_3_3_rows + cols = _USCD._Matx_float_3_3_cols + channels = _USCD._Matx_float_3_3_channels + shortdim = _USCD._Matx_float_3_3_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_float_3_3_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_float_3_3_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_float_3_3_ones() + + @staticmethod + def eye(): + return _USCD._Matx_float_3_3_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_float_3_3_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_float_3_3_randn(a, b) + + def dot(self, v): + return _USCD._Matx_float_3_3_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_float_3_3_ddot(self, v) + + def t(self): + return _USCD._Matx_float_3_3_t(self) + + def mul(self, a): + return _USCD._Matx_float_3_3_mul(self, a) + + def div(self, a): + return _USCD._Matx_float_3_3_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_float_3_3___call__(self, i, j) + val = property(_USCD._Matx_float_3_3_val_get, _USCD._Matx_float_3_3_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_float_3_3_swiginit(self, _USCD.new__Matx_float_3_3(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_float_3_3___str__(self) + __swig_destroy__ = _USCD.delete__Matx_float_3_3 + +# Register _Matx_float_3_3 in _USCD: +_USCD._Matx_float_3_3_swigregister(_Matx_float_3_3) + +def _Matx_float_3_3_all(alpha): + return _USCD._Matx_float_3_3_all(alpha) + +def _Matx_float_3_3_zeros(): + return _USCD._Matx_float_3_3_zeros() + +def _Matx_float_3_3_ones(): + return _USCD._Matx_float_3_3_ones() + +def _Matx_float_3_3_eye(): + return _USCD._Matx_float_3_3_eye() + +def _Matx_float_3_3_randu(a, b): + return _USCD._Matx_float_3_3_randu(a, b) + +def _Matx_float_3_3_randn(a, b): + return _USCD._Matx_float_3_3_randn(a, b) + + +Matx33f = _Matx_float_3_3 + +class _Matx_double_3_3(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_double_3_3_rows + cols = _USCD._Matx_double_3_3_cols + channels = _USCD._Matx_double_3_3_channels + shortdim = _USCD._Matx_double_3_3_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_double_3_3_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_double_3_3_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_double_3_3_ones() + + @staticmethod + def eye(): + return _USCD._Matx_double_3_3_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_double_3_3_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_double_3_3_randn(a, b) + + def dot(self, v): + return _USCD._Matx_double_3_3_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_double_3_3_ddot(self, v) + + def t(self): + return _USCD._Matx_double_3_3_t(self) + + def mul(self, a): + return _USCD._Matx_double_3_3_mul(self, a) + + def div(self, a): + return _USCD._Matx_double_3_3_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_double_3_3___call__(self, i, j) + val = property(_USCD._Matx_double_3_3_val_get, _USCD._Matx_double_3_3_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_double_3_3_swiginit(self, _USCD.new__Matx_double_3_3(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_double_3_3___str__(self) + __swig_destroy__ = _USCD.delete__Matx_double_3_3 + +# Register _Matx_double_3_3 in _USCD: +_USCD._Matx_double_3_3_swigregister(_Matx_double_3_3) + +def _Matx_double_3_3_all(alpha): + return _USCD._Matx_double_3_3_all(alpha) + +def _Matx_double_3_3_zeros(): + return _USCD._Matx_double_3_3_zeros() + +def _Matx_double_3_3_ones(): + return _USCD._Matx_double_3_3_ones() + +def _Matx_double_3_3_eye(): + return _USCD._Matx_double_3_3_eye() + +def _Matx_double_3_3_randu(a, b): + return _USCD._Matx_double_3_3_randu(a, b) + +def _Matx_double_3_3_randn(a, b): + return _USCD._Matx_double_3_3_randn(a, b) + + +Matx33d = _Matx_double_3_3 + +class _Matx_float_3_4(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_float_3_4_rows + cols = _USCD._Matx_float_3_4_cols + channels = _USCD._Matx_float_3_4_channels + shortdim = _USCD._Matx_float_3_4_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_float_3_4_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_float_3_4_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_float_3_4_ones() + + @staticmethod + def eye(): + return _USCD._Matx_float_3_4_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_float_3_4_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_float_3_4_randn(a, b) + + def dot(self, v): + return _USCD._Matx_float_3_4_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_float_3_4_ddot(self, v) + + def t(self): + return _USCD._Matx_float_3_4_t(self) + + def mul(self, a): + return _USCD._Matx_float_3_4_mul(self, a) + + def div(self, a): + return _USCD._Matx_float_3_4_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_float_3_4___call__(self, i, j) + val = property(_USCD._Matx_float_3_4_val_get, _USCD._Matx_float_3_4_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_float_3_4_swiginit(self, _USCD.new__Matx_float_3_4(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_float_3_4___str__(self) + __swig_destroy__ = _USCD.delete__Matx_float_3_4 + +# Register _Matx_float_3_4 in _USCD: +_USCD._Matx_float_3_4_swigregister(_Matx_float_3_4) + +def _Matx_float_3_4_all(alpha): + return _USCD._Matx_float_3_4_all(alpha) + +def _Matx_float_3_4_zeros(): + return _USCD._Matx_float_3_4_zeros() + +def _Matx_float_3_4_ones(): + return _USCD._Matx_float_3_4_ones() + +def _Matx_float_3_4_eye(): + return _USCD._Matx_float_3_4_eye() + +def _Matx_float_3_4_randu(a, b): + return _USCD._Matx_float_3_4_randu(a, b) + +def _Matx_float_3_4_randn(a, b): + return _USCD._Matx_float_3_4_randn(a, b) + + +Matx34f = _Matx_float_3_4 + +class _Matx_double_3_4(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_double_3_4_rows + cols = _USCD._Matx_double_3_4_cols + channels = _USCD._Matx_double_3_4_channels + shortdim = _USCD._Matx_double_3_4_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_double_3_4_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_double_3_4_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_double_3_4_ones() + + @staticmethod + def eye(): + return _USCD._Matx_double_3_4_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_double_3_4_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_double_3_4_randn(a, b) + + def dot(self, v): + return _USCD._Matx_double_3_4_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_double_3_4_ddot(self, v) + + def t(self): + return _USCD._Matx_double_3_4_t(self) + + def mul(self, a): + return _USCD._Matx_double_3_4_mul(self, a) + + def div(self, a): + return _USCD._Matx_double_3_4_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_double_3_4___call__(self, i, j) + val = property(_USCD._Matx_double_3_4_val_get, _USCD._Matx_double_3_4_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_double_3_4_swiginit(self, _USCD.new__Matx_double_3_4(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_double_3_4___str__(self) + __swig_destroy__ = _USCD.delete__Matx_double_3_4 + +# Register _Matx_double_3_4 in _USCD: +_USCD._Matx_double_3_4_swigregister(_Matx_double_3_4) + +def _Matx_double_3_4_all(alpha): + return _USCD._Matx_double_3_4_all(alpha) + +def _Matx_double_3_4_zeros(): + return _USCD._Matx_double_3_4_zeros() + +def _Matx_double_3_4_ones(): + return _USCD._Matx_double_3_4_ones() + +def _Matx_double_3_4_eye(): + return _USCD._Matx_double_3_4_eye() + +def _Matx_double_3_4_randu(a, b): + return _USCD._Matx_double_3_4_randu(a, b) + +def _Matx_double_3_4_randn(a, b): + return _USCD._Matx_double_3_4_randn(a, b) + + +Matx34d = _Matx_double_3_4 + +class _Matx_float_4_3(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_float_4_3_rows + cols = _USCD._Matx_float_4_3_cols + channels = _USCD._Matx_float_4_3_channels + shortdim = _USCD._Matx_float_4_3_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_float_4_3_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_float_4_3_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_float_4_3_ones() + + @staticmethod + def eye(): + return _USCD._Matx_float_4_3_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_float_4_3_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_float_4_3_randn(a, b) + + def dot(self, v): + return _USCD._Matx_float_4_3_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_float_4_3_ddot(self, v) + + def t(self): + return _USCD._Matx_float_4_3_t(self) + + def mul(self, a): + return _USCD._Matx_float_4_3_mul(self, a) + + def div(self, a): + return _USCD._Matx_float_4_3_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_float_4_3___call__(self, i, j) + val = property(_USCD._Matx_float_4_3_val_get, _USCD._Matx_float_4_3_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_float_4_3_swiginit(self, _USCD.new__Matx_float_4_3(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_float_4_3___str__(self) + __swig_destroy__ = _USCD.delete__Matx_float_4_3 + +# Register _Matx_float_4_3 in _USCD: +_USCD._Matx_float_4_3_swigregister(_Matx_float_4_3) + +def _Matx_float_4_3_all(alpha): + return _USCD._Matx_float_4_3_all(alpha) + +def _Matx_float_4_3_zeros(): + return _USCD._Matx_float_4_3_zeros() + +def _Matx_float_4_3_ones(): + return _USCD._Matx_float_4_3_ones() + +def _Matx_float_4_3_eye(): + return _USCD._Matx_float_4_3_eye() + +def _Matx_float_4_3_randu(a, b): + return _USCD._Matx_float_4_3_randu(a, b) + +def _Matx_float_4_3_randn(a, b): + return _USCD._Matx_float_4_3_randn(a, b) + + +Matx43f = _Matx_float_4_3 + +class _Matx_double_4_3(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_double_4_3_rows + cols = _USCD._Matx_double_4_3_cols + channels = _USCD._Matx_double_4_3_channels + shortdim = _USCD._Matx_double_4_3_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_double_4_3_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_double_4_3_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_double_4_3_ones() + + @staticmethod + def eye(): + return _USCD._Matx_double_4_3_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_double_4_3_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_double_4_3_randn(a, b) + + def dot(self, v): + return _USCD._Matx_double_4_3_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_double_4_3_ddot(self, v) + + def t(self): + return _USCD._Matx_double_4_3_t(self) + + def mul(self, a): + return _USCD._Matx_double_4_3_mul(self, a) + + def div(self, a): + return _USCD._Matx_double_4_3_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_double_4_3___call__(self, i, j) + val = property(_USCD._Matx_double_4_3_val_get, _USCD._Matx_double_4_3_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_double_4_3_swiginit(self, _USCD.new__Matx_double_4_3(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_double_4_3___str__(self) + __swig_destroy__ = _USCD.delete__Matx_double_4_3 + +# Register _Matx_double_4_3 in _USCD: +_USCD._Matx_double_4_3_swigregister(_Matx_double_4_3) + +def _Matx_double_4_3_all(alpha): + return _USCD._Matx_double_4_3_all(alpha) + +def _Matx_double_4_3_zeros(): + return _USCD._Matx_double_4_3_zeros() + +def _Matx_double_4_3_ones(): + return _USCD._Matx_double_4_3_ones() + +def _Matx_double_4_3_eye(): + return _USCD._Matx_double_4_3_eye() + +def _Matx_double_4_3_randu(a, b): + return _USCD._Matx_double_4_3_randu(a, b) + +def _Matx_double_4_3_randn(a, b): + return _USCD._Matx_double_4_3_randn(a, b) + + +Matx43d = _Matx_double_4_3 + +class _Matx_float_4_4(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_float_4_4_rows + cols = _USCD._Matx_float_4_4_cols + channels = _USCD._Matx_float_4_4_channels + shortdim = _USCD._Matx_float_4_4_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_float_4_4_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_float_4_4_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_float_4_4_ones() + + @staticmethod + def eye(): + return _USCD._Matx_float_4_4_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_float_4_4_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_float_4_4_randn(a, b) + + def dot(self, v): + return _USCD._Matx_float_4_4_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_float_4_4_ddot(self, v) + + def t(self): + return _USCD._Matx_float_4_4_t(self) + + def mul(self, a): + return _USCD._Matx_float_4_4_mul(self, a) + + def div(self, a): + return _USCD._Matx_float_4_4_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_float_4_4___call__(self, i, j) + val = property(_USCD._Matx_float_4_4_val_get, _USCD._Matx_float_4_4_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_float_4_4_swiginit(self, _USCD.new__Matx_float_4_4(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_float_4_4___str__(self) + __swig_destroy__ = _USCD.delete__Matx_float_4_4 + +# Register _Matx_float_4_4 in _USCD: +_USCD._Matx_float_4_4_swigregister(_Matx_float_4_4) + +def _Matx_float_4_4_all(alpha): + return _USCD._Matx_float_4_4_all(alpha) + +def _Matx_float_4_4_zeros(): + return _USCD._Matx_float_4_4_zeros() + +def _Matx_float_4_4_ones(): + return _USCD._Matx_float_4_4_ones() + +def _Matx_float_4_4_eye(): + return _USCD._Matx_float_4_4_eye() + +def _Matx_float_4_4_randu(a, b): + return _USCD._Matx_float_4_4_randu(a, b) + +def _Matx_float_4_4_randn(a, b): + return _USCD._Matx_float_4_4_randn(a, b) + + +Matx44f = _Matx_float_4_4 + +class _Matx_double_4_4(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_double_4_4_rows + cols = _USCD._Matx_double_4_4_cols + channels = _USCD._Matx_double_4_4_channels + shortdim = _USCD._Matx_double_4_4_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_double_4_4_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_double_4_4_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_double_4_4_ones() + + @staticmethod + def eye(): + return _USCD._Matx_double_4_4_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_double_4_4_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_double_4_4_randn(a, b) + + def dot(self, v): + return _USCD._Matx_double_4_4_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_double_4_4_ddot(self, v) + + def t(self): + return _USCD._Matx_double_4_4_t(self) + + def mul(self, a): + return _USCD._Matx_double_4_4_mul(self, a) + + def div(self, a): + return _USCD._Matx_double_4_4_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_double_4_4___call__(self, i, j) + val = property(_USCD._Matx_double_4_4_val_get, _USCD._Matx_double_4_4_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_double_4_4_swiginit(self, _USCD.new__Matx_double_4_4(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_double_4_4___str__(self) + __swig_destroy__ = _USCD.delete__Matx_double_4_4 + +# Register _Matx_double_4_4 in _USCD: +_USCD._Matx_double_4_4_swigregister(_Matx_double_4_4) + +def _Matx_double_4_4_all(alpha): + return _USCD._Matx_double_4_4_all(alpha) + +def _Matx_double_4_4_zeros(): + return _USCD._Matx_double_4_4_zeros() + +def _Matx_double_4_4_ones(): + return _USCD._Matx_double_4_4_ones() + +def _Matx_double_4_4_eye(): + return _USCD._Matx_double_4_4_eye() + +def _Matx_double_4_4_randu(a, b): + return _USCD._Matx_double_4_4_randu(a, b) + +def _Matx_double_4_4_randn(a, b): + return _USCD._Matx_double_4_4_randn(a, b) + + +Matx44d = _Matx_double_4_4 + +class _Matx_float_6_6(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_float_6_6_rows + cols = _USCD._Matx_float_6_6_cols + channels = _USCD._Matx_float_6_6_channels + shortdim = _USCD._Matx_float_6_6_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_float_6_6_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_float_6_6_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_float_6_6_ones() + + @staticmethod + def eye(): + return _USCD._Matx_float_6_6_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_float_6_6_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_float_6_6_randn(a, b) + + def dot(self, v): + return _USCD._Matx_float_6_6_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_float_6_6_ddot(self, v) + + def t(self): + return _USCD._Matx_float_6_6_t(self) + + def mul(self, a): + return _USCD._Matx_float_6_6_mul(self, a) + + def div(self, a): + return _USCD._Matx_float_6_6_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_float_6_6___call__(self, i, j) + val = property(_USCD._Matx_float_6_6_val_get, _USCD._Matx_float_6_6_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_float_6_6_swiginit(self, _USCD.new__Matx_float_6_6(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_float_6_6___str__(self) + __swig_destroy__ = _USCD.delete__Matx_float_6_6 + +# Register _Matx_float_6_6 in _USCD: +_USCD._Matx_float_6_6_swigregister(_Matx_float_6_6) + +def _Matx_float_6_6_all(alpha): + return _USCD._Matx_float_6_6_all(alpha) + +def _Matx_float_6_6_zeros(): + return _USCD._Matx_float_6_6_zeros() + +def _Matx_float_6_6_ones(): + return _USCD._Matx_float_6_6_ones() + +def _Matx_float_6_6_eye(): + return _USCD._Matx_float_6_6_eye() + +def _Matx_float_6_6_randu(a, b): + return _USCD._Matx_float_6_6_randu(a, b) + +def _Matx_float_6_6_randn(a, b): + return _USCD._Matx_float_6_6_randn(a, b) + + +Matx66f = _Matx_float_6_6 + +class _Matx_double_6_6(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + rows = _USCD._Matx_double_6_6_rows + cols = _USCD._Matx_double_6_6_cols + channels = _USCD._Matx_double_6_6_channels + shortdim = _USCD._Matx_double_6_6_shortdim + + @staticmethod + def all(alpha): + return _USCD._Matx_double_6_6_all(alpha) + + @staticmethod + def zeros(): + return _USCD._Matx_double_6_6_zeros() + + @staticmethod + def ones(): + return _USCD._Matx_double_6_6_ones() + + @staticmethod + def eye(): + return _USCD._Matx_double_6_6_eye() + + @staticmethod + def randu(a, b): + return _USCD._Matx_double_6_6_randu(a, b) + + @staticmethod + def randn(a, b): + return _USCD._Matx_double_6_6_randn(a, b) + + def dot(self, v): + return _USCD._Matx_double_6_6_dot(self, v) + + def ddot(self, v): + return _USCD._Matx_double_6_6_ddot(self, v) + + def t(self): + return _USCD._Matx_double_6_6_t(self) + + def mul(self, a): + return _USCD._Matx_double_6_6_mul(self, a) + + def div(self, a): + return _USCD._Matx_double_6_6_div(self, a) + + def __call__(self, i, j): + return _USCD._Matx_double_6_6___call__(self, i, j) + val = property(_USCD._Matx_double_6_6_val_get, _USCD._Matx_double_6_6_val_set) + + import re + _re_pattern = re.compile("^_Matx_(?P[a-zA-Z_][a-zA-Z0-9_]*)_(?P[0-9]+)_(?P[0-9]+)$") + + + def __init__(self, *args): + + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + array = _array_map[value_type](rows*cols) + for i in range(len(args)): + array[i] = args[i] + + args = [array] + + + _USCD._Matx_double_6_6_swiginit(self, _USCD.new__Matx_double_6_6(*args)) + + def __getattribute__(self, name): + if name == "__array_interface__": + ma = self._re_pattern.match(self.__class__.__name__) + value_type = ma.group("value_type") + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + return {"shape": (rows, cols), + "typestr": _cv_numpy_typestr_map[value_type], + "data": (int(self.val), False)} + else: + return object.__getattribute__(self, name) + + + def __getitem__(self, key): + ma = self._re_pattern.match(self.__class__.__name__) + rows = int(ma.group("rows")) + cols = int(ma.group("cols")) + + if isinstance(key, int): + if rows != 1 and cols != 1: + raise IndexError + i = key + j = 0 + elif isinstance(key, tuple) and len(key) == 2: + i = key[0] + j = key[1] + else: + raise TypeError + + if i >= rows or j >= cols: + raise IndexError + + return self(i, j) + + + def __str__(self): + return _USCD._Matx_double_6_6___str__(self) + __swig_destroy__ = _USCD.delete__Matx_double_6_6 + +# Register _Matx_double_6_6 in _USCD: +_USCD._Matx_double_6_6_swigregister(_Matx_double_6_6) + +def _Matx_double_6_6_all(alpha): + return _USCD._Matx_double_6_6_all(alpha) + +def _Matx_double_6_6_zeros(): + return _USCD._Matx_double_6_6_zeros() + +def _Matx_double_6_6_ones(): + return _USCD._Matx_double_6_6_ones() + +def _Matx_double_6_6_eye(): + return _USCD._Matx_double_6_6_eye() + +def _Matx_double_6_6_randu(a, b): + return _USCD._Matx_double_6_6_randu(a, b) + +def _Matx_double_6_6_randn(a, b): + return _USCD._Matx_double_6_6_randn(a, b) + + +Matx66d = _Matx_double_6_6 + +class _Point__int(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self, *args): + _USCD._Point__int_swiginit(self, _USCD.new__Point__int(*args)) + + def dot(self, pt): + return _USCD._Point__int_dot(self, pt) + + def ddot(self, pt): + return _USCD._Point__int_ddot(self, pt) + + def cross(self, pt): + return _USCD._Point__int_cross(self, pt) + x = property(_USCD._Point__int_x_get, _USCD._Point__int_x_set) + y = property(_USCD._Point__int_y_get, _USCD._Point__int_y_set) + + def __iter__(self): + return iter((self.x, self.y)) + + + def __str__(self): + return _USCD._Point__int___str__(self) + __swig_destroy__ = _USCD.delete__Point__int + +# Register _Point__int in _USCD: +_USCD._Point__int_swigregister(_Point__int) + + +Point2i = _Point__int + +class _Point__float(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self, *args): + _USCD._Point__float_swiginit(self, _USCD.new__Point__float(*args)) + + def dot(self, pt): + return _USCD._Point__float_dot(self, pt) + + def ddot(self, pt): + return _USCD._Point__float_ddot(self, pt) + + def cross(self, pt): + return _USCD._Point__float_cross(self, pt) + x = property(_USCD._Point__float_x_get, _USCD._Point__float_x_set) + y = property(_USCD._Point__float_y_get, _USCD._Point__float_y_set) + + def __iter__(self): + return iter((self.x, self.y)) + + + def __str__(self): + return _USCD._Point__float___str__(self) + __swig_destroy__ = _USCD.delete__Point__float + +# Register _Point__float in _USCD: +_USCD._Point__float_swigregister(_Point__float) + + +Point2f = _Point__float + +class _Point__double(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self, *args): + _USCD._Point__double_swiginit(self, _USCD.new__Point__double(*args)) + + def dot(self, pt): + return _USCD._Point__double_dot(self, pt) + + def ddot(self, pt): + return _USCD._Point__double_ddot(self, pt) + + def cross(self, pt): + return _USCD._Point__double_cross(self, pt) + x = property(_USCD._Point__double_x_get, _USCD._Point__double_x_set) + y = property(_USCD._Point__double_y_get, _USCD._Point__double_y_set) + + def __iter__(self): + return iter((self.x, self.y)) + + + def __str__(self): + return _USCD._Point__double___str__(self) + __swig_destroy__ = _USCD.delete__Point__double + +# Register _Point__double in _USCD: +_USCD._Point__double_swigregister(_Point__double) + + +Point2d = _Point__double + + +Point = Point2i + +class _Rect__int(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self, *args): + _USCD._Rect__int_swiginit(self, _USCD.new__Rect__int(*args)) + + def tl(self): + return _USCD._Rect__int_tl(self) + + def br(self): + return _USCD._Rect__int_br(self) + + def size(self): + return _USCD._Rect__int_size(self) + + def area(self): + return _USCD._Rect__int_area(self) + + def contains(self, pt): + return _USCD._Rect__int_contains(self, pt) + x = property(_USCD._Rect__int_x_get, _USCD._Rect__int_x_set) + y = property(_USCD._Rect__int_y_get, _USCD._Rect__int_y_set) + width = property(_USCD._Rect__int_width_get, _USCD._Rect__int_width_set) + height = property(_USCD._Rect__int_height_get, _USCD._Rect__int_height_set) + + def __iter__(self): + return iter((self.x, self.y, self.width, self.height)) + + + def __str__(self): + return _USCD._Rect__int___str__(self) + __swig_destroy__ = _USCD.delete__Rect__int + +# Register _Rect__int in _USCD: +_USCD._Rect__int_swigregister(_Rect__int) + + +Rect2i = _Rect__int + +class _Rect__float(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self, *args): + _USCD._Rect__float_swiginit(self, _USCD.new__Rect__float(*args)) + + def tl(self): + return _USCD._Rect__float_tl(self) + + def br(self): + return _USCD._Rect__float_br(self) + + def size(self): + return _USCD._Rect__float_size(self) + + def area(self): + return _USCD._Rect__float_area(self) + + def contains(self, pt): + return _USCD._Rect__float_contains(self, pt) + x = property(_USCD._Rect__float_x_get, _USCD._Rect__float_x_set) + y = property(_USCD._Rect__float_y_get, _USCD._Rect__float_y_set) + width = property(_USCD._Rect__float_width_get, _USCD._Rect__float_width_set) + height = property(_USCD._Rect__float_height_get, _USCD._Rect__float_height_set) + + def __iter__(self): + return iter((self.x, self.y, self.width, self.height)) + + + def __str__(self): + return _USCD._Rect__float___str__(self) + __swig_destroy__ = _USCD.delete__Rect__float + +# Register _Rect__float in _USCD: +_USCD._Rect__float_swigregister(_Rect__float) + + +Rect2f = _Rect__float + +class _Rect__double(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self, *args): + _USCD._Rect__double_swiginit(self, _USCD.new__Rect__double(*args)) + + def tl(self): + return _USCD._Rect__double_tl(self) + + def br(self): + return _USCD._Rect__double_br(self) + + def size(self): + return _USCD._Rect__double_size(self) + + def area(self): + return _USCD._Rect__double_area(self) + + def contains(self, pt): + return _USCD._Rect__double_contains(self, pt) + x = property(_USCD._Rect__double_x_get, _USCD._Rect__double_x_set) + y = property(_USCD._Rect__double_y_get, _USCD._Rect__double_y_set) + width = property(_USCD._Rect__double_width_get, _USCD._Rect__double_width_set) + height = property(_USCD._Rect__double_height_get, _USCD._Rect__double_height_set) + + def __iter__(self): + return iter((self.x, self.y, self.width, self.height)) + + + def __str__(self): + return _USCD._Rect__double___str__(self) + __swig_destroy__ = _USCD.delete__Rect__double + +# Register _Rect__double in _USCD: +_USCD._Rect__double_swigregister(_Rect__double) + + +Rect2d = _Rect__double + + +Rect = Rect2i + +class _Scalar__double(_Vec_double_4): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self, *args): + _USCD._Scalar__double_swiginit(self, _USCD.new__Scalar__double(*args)) + + @staticmethod + def all(v0): + return _USCD._Scalar__double_all(v0) + + def mul(self, a, scale=1): + return _USCD._Scalar__double_mul(self, a, scale) + + def conj(self): + return _USCD._Scalar__double_conj(self) + + def isReal(self): + return _USCD._Scalar__double_isReal(self) + + def __iter__(self): + return iter((self(0), self(1), self(2), self(3))) + + def __getitem__(self, key): + if not isinstance(key, int): + raise TypeError + + if key >= 4: + raise IndexError + + return self(key) + + + def __str__(self): + return _USCD._Scalar__double___str__(self) + __swig_destroy__ = _USCD.delete__Scalar__double + +# Register _Scalar__double in _USCD: +_USCD._Scalar__double_swigregister(_Scalar__double) + +def _Scalar__double_all(v0): + return _USCD._Scalar__double_all(v0) + + +Scalar4d = _Scalar__double + + +Scalar = Scalar4d + +class _Size__int(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self, *args): + _USCD._Size__int_swiginit(self, _USCD.new__Size__int(*args)) + + def area(self): + return _USCD._Size__int_area(self) + width = property(_USCD._Size__int_width_get, _USCD._Size__int_width_set) + height = property(_USCD._Size__int_height_get, _USCD._Size__int_height_set) + + def __iter__(self): + return iter((self.width, self.height)) + + + def __str__(self): + return _USCD._Size__int___str__(self) + __swig_destroy__ = _USCD.delete__Size__int + +# Register _Size__int in _USCD: +_USCD._Size__int_swigregister(_Size__int) + + +Size2i = _Size__int + +class _Size__float(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self, *args): + _USCD._Size__float_swiginit(self, _USCD.new__Size__float(*args)) + + def area(self): + return _USCD._Size__float_area(self) + width = property(_USCD._Size__float_width_get, _USCD._Size__float_width_set) + height = property(_USCD._Size__float_height_get, _USCD._Size__float_height_set) + + def __iter__(self): + return iter((self.width, self.height)) + + + def __str__(self): + return _USCD._Size__float___str__(self) + __swig_destroy__ = _USCD.delete__Size__float + +# Register _Size__float in _USCD: +_USCD._Size__float_swigregister(_Size__float) + + +Size2f = _Size__float + +class _Size__double(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self, *args): + _USCD._Size__double_swiginit(self, _USCD.new__Size__double(*args)) + + def area(self): + return _USCD._Size__double_area(self) + width = property(_USCD._Size__double_width_get, _USCD._Size__double_width_set) + height = property(_USCD._Size__double_height_get, _USCD._Size__double_height_set) + + def __iter__(self): + return iter((self.width, self.height)) + + + def __str__(self): + return _USCD._Size__double___str__(self) + __swig_destroy__ = _USCD.delete__Size__double + +# Register _Size__double in _USCD: +_USCD._Size__double_swigregister(_Size__double) + + +Size2d = _Size__double + + +Size = Size2i + + +def ACD(filebname1, filename2, outfile): + return _USCD.ACD(filebname1, filename2, outfile) + + diff --git a/plugins/In_one/scripts/UnsupervisedCD.py b/plugins/In_one/scripts/UnsupervisedCD.py new file mode 100644 index 0000000..15d8a5e --- /dev/null +++ b/plugins/In_one/scripts/UnsupervisedCD.py @@ -0,0 +1,385 @@ +from osgeo import gdal +import math,os +import time +from sklearn.cluster import k_means +from rscder.utils.geomath import geo2imageRC, imageRC2geo +from rscder.utils.project import Project, PairLayer +import numpy as np +from .USCD import ACD + +def warp(file,ds:gdal.Dataset,srcWin=[0,0,0,0]): + driver = gdal.GetDriverByName('GTiff') + xsize=ds.RasterXSize + ysize=ds.RasterYSize + geo=ds.GetGeoTransform() + orj=ds.GetProjection() + band=ds.RasterCount + out_ds:gdal.Dataset=driver.Create(file, xsize, ysize, band, gdal.GDT_Byte) + out_ds.SetGeoTransform(geo) + out_ds.SetProjection(orj) + for b in range(1,band+1): + out_ds.GetRasterBand(b).WriteArray(ds.ReadAsArray(*srcWin,band_list=[b]),*(0,0)) + del out_ds + +def basic_cd(pth1:str,pth2:str,layer_parent:PairLayer,send_message): + ds1:gdal.Dataset=gdal.Open(pth1) + ds2:gdal.Dataset=gdal.Open(pth2) + + cell_size = layer_parent.cell_size + xsize = layer_parent.size[0] + ysize = layer_parent.size[1] + + band = ds1.RasterCount + yblocks = ysize // cell_size[1] + + driver = gdal.GetDriverByName('GTiff') + out_tif = os.path.join(Project().cmi_path, 'temp.tif') + out_ds = driver.Create(out_tif, xsize, ysize, 1, gdal.GDT_Float32) + geo=layer_parent.grid.geo + proj=layer_parent.grid.proj + out_ds.SetGeoTransform(geo) + out_ds.SetProjection(proj) + + max_diff = 0 + min_diff = math.inf + + start1x,start1y=geo2imageRC(ds1.GetGeoTransform(),layer_parent.mask.xy[0],layer_parent.mask.xy[1]) + end1x,end1y=geo2imageRC(ds1.GetGeoTransform(),layer_parent.mask.xy[2],layer_parent.mask.xy[3]) + + start2x,start2y=geo2imageRC(ds2.GetGeoTransform(),layer_parent.mask.xy[0],layer_parent.mask.xy[1]) + end2x,end2y=geo2imageRC(ds2.GetGeoTransform(),layer_parent.mask.xy[2],layer_parent.mask.xy[3]) + + for j in range(yblocks + 1):#该改这里了 + + send_message.emit(f'计算{j}/{yblocks}') + block_xy1 = (start1x, start1y+j * cell_size[1]) + block_xy2 = (start2x,start2y+j*cell_size[1]) + block_xy=(0,j * cell_size[1]) + if block_xy1[1] > end1y or block_xy2[1] > end2y: + break + block_size=(xsize, cell_size[1]) + block_size1 = (xsize, cell_size[1]) + block_size2 = (xsize,cell_size[1]) + if block_xy[1] + block_size[1] > ysize: + block_size = (xsize, ysize - block_xy[1]) + if block_xy1[1] + block_size1[1] > end1y: + block_size1 = (xsize,end1y - block_xy1[1]) + if block_xy2[1] + block_size2[1] > end2y: + block_size2 = (xsize, end2y - block_xy2[1]) + block_data1 = ds1.ReadAsArray(*block_xy1, *block_size1) + block_data2 = ds2.ReadAsArray(*block_xy2, *block_size2) + + if band == 1: + block_data1 = block_data1[None, ...] + block_data2 = block_data2[None, ...] + # pdb.set_trace() + block_diff = block_data1.sum(0) - block_data2.sum(0) + block_diff = block_diff.astype(np.float32) + block_diff = np.abs(block_diff) + + min_diff = min(min_diff, block_diff[block_diff > 0].min()) + max_diff = max(max_diff, block_diff.max()) + out_ds.GetRasterBand(1).WriteArray(block_diff, *block_xy) + + send_message.emit(f'完成{j}/{yblocks}') + del ds2 + del ds1 + out_ds.FlushCache() + del out_ds + send_message.emit('归一化概率中...') + temp_in_ds = gdal.Open(out_tif) + + out_normal_tif = os.path.join(Project().cmi_path, '{}_{}_cmi.tif'.format(layer_parent.name, int(np.random.rand() * 100000))) + out_normal_ds = driver.Create(out_normal_tif, xsize, ysize, 1, gdal.GDT_Byte) + out_normal_ds.SetGeoTransform(geo) + out_normal_ds.SetProjection(proj) + # hist = np.zeros(256, dtype=np.int32) + for j in range(yblocks+1): + block_xy = (0, j * cell_size[1]) + if block_xy[1] > ysize: + break + block_size = (xsize, cell_size[1]) + if block_xy[1] + block_size[1] > ysize: + block_size = (xsize, ysize - block_xy[1]) + block_data = temp_in_ds.ReadAsArray(*block_xy, *block_size) + block_data = (block_data - min_diff) / (max_diff - min_diff) * 255 + block_data = block_data.astype(np.uint8) + out_normal_ds.GetRasterBand(1).WriteArray(block_data, *block_xy) + # hist_t, _ = np.histogram(block_data, bins=256, range=(0, 256)) + # hist += hist_t + # print(hist) + del temp_in_ds + del out_normal_ds + try: + os.remove(out_tif) + except: + pass + send_message.emit('差分法计算完成') + return out_normal_tif + +def LSTS(pth1:str,pth2:str,layer_parent:PairLayer,send_message,n=5,w_size=(3,3)): + ds1:gdal.Dataset=gdal.Open(pth1) + ds2:gdal.Dataset=gdal.Open(pth2) + + cell_size = layer_parent.cell_size + xsize = layer_parent.size[0] + ysize = layer_parent.size[1] + + band = ds1.RasterCount + yblocks = ysize // cell_size[1] + + driver = gdal.GetDriverByName('GTiff') + out_tif = os.path.join(Project().cmi_path, 'temp.tif') + out_ds = driver.Create(out_tif, xsize, ysize, 1, gdal.GDT_Float32) + geo=layer_parent.grid.geo + proj=layer_parent.grid.proj + out_ds.SetGeoTransform(geo) + out_ds.SetProjection(proj) + pixnum=w_size[0]*w_size[1] + print('pixnum',pixnum) + max_diff = 0 + min_diff = math.inf + win_h=w_size[0]//2 #half hight of window + win_w=w_size[1]//2 #half width of window + a=[[(i+1)**j for j in range(n+1)] for i in range(pixnum)] + A=np.array(a).astype(np.float64)# + + k_=np.array(range(1,n+1)) + df1=np.zeros(pixnum).astype(np.float64) + df2=np.zeros(pixnum).astype(np.float64) + + start1x,start1y=geo2imageRC(ds1.GetGeoTransform(),layer_parent.mask.xy[0],layer_parent.mask.xy[1]) + end1x,end1y=geo2imageRC(ds1.GetGeoTransform(),layer_parent.mask.xy[2],layer_parent.mask.xy[3]) + + start2x,start2y=geo2imageRC(ds2.GetGeoTransform(),layer_parent.mask.xy[0],layer_parent.mask.xy[1]) + end2x,end2y=geo2imageRC(ds2.GetGeoTransform(),layer_parent.mask.xy[2],layer_parent.mask.xy[3]) + + for j in range(yblocks + 1): + + send_message.emit(f'计算{j}/{yblocks}') + block_xy1 = (start1x, start1y+j * cell_size[1]) + block_xy2 = (start2x,start2y+j*cell_size[1]) + block_xy=(0,j * cell_size[1]) + if block_xy1[1] > end1y or block_xy2[1] > end2y: + break + block_size=(xsize, cell_size[1]) + block_size1 = (xsize, cell_size[1]) + block_size2 = (xsize,cell_size[1]) + if block_xy[1] + block_size[1] > ysize: + block_size = (xsize, ysize - block_xy[1]) + if block_xy1[1] + block_size1[1] > end1y: + block_size1 = (xsize,end1y - block_xy1[1]) + if block_xy2[1] + block_size2[1] > end2y: + block_size2 = (xsize, end2y - block_xy2[1]) + block_data1 = ds1.ReadAsArray(*block_xy1, *block_size1) + block_data2 = ds2.ReadAsArray(*block_xy2, *block_size2) + + if band == 1: + block_data1 = block_data1[None, ...] + block_data2 = block_data2[None, ...] + # pdb.set_trace() + else: + block_data1=np.mean(block_data1,0) + block_data2=np.mean(block_data2,0) + block_diff=np.zeros(block_data1.shape).astype(np.float64) + + for i in range(win_h,block_size1[1]-win_h): + for j_ in range(win_w,block_size1[0]-win_w): + pix=0 + + #get b + # b1=block_data[i+win_h:i+win_h] c in range(j_-win_w,j_+win_w+1) + b1=block_data1[i-win_h:i+win_h+1,j_-win_w:j_+win_w+1] + b2=block_data2[i-win_h:i+win_h+1,j_-win_w:j_+win_w+1] + b1=[b if (r+1)//2 else b[::-1] for r,b in enumerate(b1)] + b2=[b if (r+1)//2 else b[::-1] for r,b in enumerate(b2)] + b1=np.expand_dims(np.concatenate(b1,0),1) + b2=np.expand_dims(np.concatenate(b2,0),1) + + #end get b + + x1=np.squeeze(np.linalg.pinv(A).dot(b1)) + x2=np.squeeze(np.linalg.pinv(A).dot(b2)) + #df + k_=range(1,n+1) + for pix in range(1,pixnum+1): + df1[pix-1]=x1[1:n+1].dot(np.array([k*(pix**(k-1)) for k in k_])) + df2[pix-1]=x2[1:n+1].dot(np.array([k*(pix**(k-1)) for k in k_])) + + #distance 欧式距离 + block_diff[i][j_]=np.dot(df1-df2,df1-df2)**0.5 + + min_diff = min(min_diff, block_diff[block_diff > 0].min()) + max_diff = max(max_diff, block_diff.max()) + out_ds.GetRasterBand(1).WriteArray(block_diff, *block_xy) + + send_message.emit(f'完成{j}/{yblocks}') + del ds2 + del ds1 + out_ds.FlushCache() + del out_ds + send_message.emit('归一化概率中...') + temp_in_ds = gdal.Open(out_tif) + + out_normal_tif = os.path.join(Project().cmi_path, '{}_{}_cmi.tif'.format(layer_parent.name, int(np.random.rand() * 100000))) + out_normal_ds = driver.Create(out_normal_tif, xsize, ysize, 1, gdal.GDT_Byte) + out_normal_ds.SetGeoTransform(geo) + out_normal_ds.SetProjection(proj) + # hist = np.zeros(256, dtype=np.int32) + for j in range(yblocks+1): + block_xy = (0, j * cell_size[1]) + if block_xy[1] > ysize: + break + block_size = (xsize, cell_size[1]) + if block_xy[1] + block_size[1] > ysize: + block_size = (xsize, ysize - block_xy[1]) + block_data = temp_in_ds.ReadAsArray(*block_xy, *block_size) + block_data = (block_data - min_diff) / (max_diff - min_diff) * 255 + block_data = block_data.astype(np.uint8) + out_normal_ds.GetRasterBand(1).WriteArray(block_data, *block_xy) + # hist_t, _ = np.histogram(block_data, bins=256, range=(0, 256)) + # hist += hist_t + # print(hist) + del temp_in_ds + del out_normal_ds + try: + os.remove(out_tif) + except: + pass + + send_message.emit('LSTS法计算完成') + return out_normal_tif + +def CVA(pth1:str,pth2:str,layer_parent:PairLayer,send_message): + ds1:gdal.Dataset=gdal.Open(pth1) + ds2:gdal.Dataset=gdal.Open(pth2) + + cell_size = layer_parent.cell_size + xsize = layer_parent.size[0] + ysize = layer_parent.size[1] + + band = ds1.RasterCount + yblocks = ysize // cell_size[1] + + driver = gdal.GetDriverByName('GTiff') + out_tif = os.path.join(Project().cmi_path, 'temp.tif') + out_ds = driver.Create(out_tif, xsize, ysize, 1, gdal.GDT_Float32) + geo=layer_parent.grid.geo + proj=layer_parent.grid.proj + out_ds.SetGeoTransform(geo) + out_ds.SetProjection(proj) + max_diff = 0 + min_diff = math.inf + + + start1x,start1y=geo2imageRC(ds1.GetGeoTransform(),layer_parent.mask.xy[0],layer_parent.mask.xy[1]) + end1x,end1y=geo2imageRC(ds1.GetGeoTransform(),layer_parent.mask.xy[2],layer_parent.mask.xy[3]) + + start2x,start2y=geo2imageRC(ds2.GetGeoTransform(),layer_parent.mask.xy[0],layer_parent.mask.xy[1]) + end2x,end2y=geo2imageRC(ds2.GetGeoTransform(),layer_parent.mask.xy[2],layer_parent.mask.xy[3]) + + for j in range(yblocks + 1): + + send_message.emit(f'计算{j}/{yblocks}') + block_xy1 = (start1x, start1y+j * cell_size[1]) + block_xy2 = (start2x,start2y+j*cell_size[1]) + block_xy=(0,j * cell_size[1]) + if block_xy1[1] > end1y or block_xy2[1] > end2y: + break + block_size=(xsize, cell_size[1]) + block_size1 = (xsize, cell_size[1]) + block_size2 = (xsize,cell_size[1]) + if block_xy[1] + block_size[1] > ysize: + block_size = (xsize, ysize - block_xy[1]) + if block_xy1[1] + block_size1[1] > end1y: + block_size1 = (xsize,end1y - block_xy1[1]) + if block_xy2[1] + block_size2[1] > end2y: + block_size2 = (xsize, end2y - block_xy2[1]) + block_data1 = ds1.ReadAsArray(*block_xy1, *block_size1) + block_data2 = ds2.ReadAsArray(*block_xy2, *block_size2) + + if band == 1: + block_data1 = block_data1[None, ...] + block_data2 = block_data2[None, ...] + # pdb.set_trace() + block_diff=np.sum((block_data1-block_data2)**2,0)**0.5 + min_diff = min(min_diff, block_diff[block_diff > 0].min()) + max_diff = max(max_diff, block_diff.max()) + out_ds.GetRasterBand(1).WriteArray(block_diff, *block_xy) + + send_message.emit(f'完成{j}/{yblocks}') + del ds2 + del ds1 + out_ds.FlushCache() + del out_ds + send_message.emit('归一化概率中...') + temp_in_ds = gdal.Open(out_tif) + + out_normal_tif = os.path.join(Project().cmi_path, '{}_{}_cmi.tif'.format(layer_parent.name, int(np.random.rand() * 100000))) + out_normal_ds = driver.Create(out_normal_tif, xsize, ysize, 1, gdal.GDT_Byte) + out_normal_ds.SetGeoTransform(geo) + out_normal_ds.SetProjection(proj) + # hist = np.zeros(256, dtype=np.int32) + for j in range(yblocks+1): + block_xy = (0, j * cell_size[1]) + if block_xy[1] > ysize: + break + block_size = (xsize, cell_size[1]) + if block_xy[1] + block_size[1] > ysize: + block_size = (xsize, ysize - block_xy[1]) + block_data = temp_in_ds.ReadAsArray(*block_xy, *block_size) + block_data = (block_data - min_diff) / (max_diff - min_diff) * 255 + block_data = block_data.astype(np.uint8) + out_normal_ds.GetRasterBand(1).WriteArray(block_data, *block_xy) + # hist_t, _ = np.histogram(block_data, bins=256, range=(0, 256)) + # hist += hist_t + # print(hist) + del temp_in_ds + del out_normal_ds + try: + os.remove(out_tif) + except: + pass + send_message.emit('欧式距离计算完成') + return out_normal_tif + +def ACD_(pth1:str,pth2:str,layer_parent:PairLayer,send_message): + xsize = layer_parent.size[0] + ysize = layer_parent.size[1] + geo=layer_parent.grid.geo + proj=layer_parent.grid.proj + #提取公共部分 + send_message.emit('提取重叠区域数据.....') + + ds2:gdal.Dataset=gdal.Open(pth2) + temp_tif2 = os.path.join(Project().cmi_path,'temp2.tif') + start2x,start2y=geo2imageRC(ds2.GetGeoTransform(),layer_parent.mask.xy[0],layer_parent.mask.xy[1]) + end2x,end2y=geo2imageRC(ds2.GetGeoTransform(),layer_parent.mask.xy[2],layer_parent.mask.xy[3]) + warp(temp_tif2,ds2,srcWin=[start2x,start2y,xsize,ysize]) + del ds2 + send_message.emit('图像二提取完成') + + + ds1:gdal.Dataset=gdal.Open(pth1) + temp_tif1 = os.path.join(Project().cmi_path, 'temp1.tif') + start1x,start1y=geo2imageRC(ds1.GetGeoTransform(),layer_parent.mask.xy[0],layer_parent.mask.xy[1]) + end1x,end1y=geo2imageRC(ds1.GetGeoTransform(),layer_parent.mask.xy[2],layer_parent.mask.xy[3]) + warp(temp_tif1,ds1,srcWin=[start1x,start1y,xsize,ysize]) + del ds1 + send_message.emit('图像一提取完成') + + + + #运算 + send_message.emit('开始ACD计算.....') + time.sleep(0.1) + out_normal_tif = os.path.join(Project().cmi_path, '{}_{}_cmi.tif'.format(layer_parent.name, int(np.random.rand() * 100000))) + ACD(temp_tif1,temp_tif2,out_normal_tif) + #添加投影 + send_message.emit('录入投影信息.....') + ds=gdal.Open(out_normal_tif) + ds.SetGeoTransform(geo) + ds.SetProjection(proj) + del ds + + return out_normal_tif diff --git a/plugins/In_one/scripts/_USCD.pyd b/plugins/In_one/scripts/_USCD.pyd new file mode 100644 index 0000000..2883e45 Binary files /dev/null and b/plugins/In_one/scripts/_USCD.pyd differ diff --git a/plugins/In_one/scripts/opencv_ffmpeg3415_64.dll b/plugins/In_one/scripts/opencv_ffmpeg3415_64.dll new file mode 100644 index 0000000..4b73baa Binary files /dev/null and b/plugins/In_one/scripts/opencv_ffmpeg3415_64.dll differ diff --git a/plugins/In_one/scripts/opencv_world3415.dll b/plugins/In_one/scripts/opencv_world3415.dll new file mode 100644 index 0000000..fa03239 Binary files /dev/null and b/plugins/In_one/scripts/opencv_world3415.dll differ diff --git a/plugins/change_rate/main.py b/plugins/change_rate/main.py index 55fcf2d..a61fea8 100644 --- a/plugins/change_rate/main.py +++ b/plugins/change_rate/main.py @@ -1,9 +1,10 @@ import os +from pickle import TRUE from threading import Thread from rscder.gui.actions import ActionManager from rscder.gui.layercombox import ResultPointLayerCombox from rscder.plugins.basic import BasicPlugin -from PyQt5.QtWidgets import QAction, QDialog, QLabel, QHBoxLayout, QVBoxLayout, QPushButton,QSlider,QSpinBox,QSpacerItem +from PyQt5.QtWidgets import QAction, QDialog, QLabel, QHBoxLayout, QVBoxLayout, QPushButton,QSlider,QSpinBox,QSpacerItem,QDialogButtonBox from PyQt5.QtCore import pyqtSignal,Qt from PyQt5.QtGui import QIcon from rscder.utils.icons import IconInstance @@ -36,24 +37,20 @@ class RateSetdialog(QDialog): self.ok_button = QPushButton('确定', self) self.ok_button.setIcon(IconInstance().OK) self.ok_button.clicked.connect(self.on_ok) - + self.ok_button.setDefault(True) self.cancel_button = QPushButton('取消', self) self.cancel_button.setIcon(IconInstance().CANCEL) self.cancel_button.clicked.connect(self.on_cancel) - - self.button_layout = QHBoxLayout() - okl=QHBoxLayout() - okl.addWidget(self.ok_button,alignment=Qt.AlignCenter) - cll=QHBoxLayout() - cll.addWidget(self.cancel_button,alignment=Qt.AlignCenter) - self.button_layout.addLayout(okl) - self.button_layout.addLayout(cll) - + self.cancel_button.setDefault(False) + self.buttonbox=QDialogButtonBox(self) + self.buttonbox.addButton(self.ok_button,QDialogButtonBox.NoRole) + self.buttonbox.addButton(self.cancel_button,QDialogButtonBox.NoRole) + self.buttonbox.setCenterButtons(True) vlayout=QVBoxLayout() vlayout.addLayout(h1) vlayout.addWidget(QLabel('设置阈值')) vlayout.addLayout(h2) - vlayout.addLayout(self.button_layout) + vlayout.addWidget(self.buttonbox) self.setLayout(vlayout) self.old_data = None diff --git a/plugins/evaluation/main.py b/plugins/evaluation/main.py index c22e687..46b4242 100644 --- a/plugins/evaluation/main.py +++ b/plugins/evaluation/main.py @@ -7,7 +7,7 @@ import numpy as np from rscder.gui.actions import ActionManager from rscder.plugins.basic import BasicPlugin from rscder.gui.layercombox import RasterLayerCombox,ResultLayercombox, ResultPointLayerCombox -from PyQt5.QtWidgets import QAction, QFileDialog, QDialog, QLabel, QHBoxLayout, QVBoxLayout, QPushButton +from PyQt5.QtWidgets import QAction, QFileDialog, QDialog, QLabel, QHBoxLayout, QVBoxLayout, QPushButton,QDialogButtonBox from PyQt5.QtGui import QIcon from PyQt5.QtCore import Qt from osgeo import gdal @@ -49,10 +49,16 @@ class EvalutationDialog(QDialog): self.ok_button = QPushButton('确定', self) self.ok_button.setIcon(IconInstance().OK) self.ok_button.clicked.connect(self.on_ok) - + self.ok_button.setDefault(True) self.cancel_button = QPushButton('取消', self) self.cancel_button.setIcon(IconInstance().CANCEL) self.cancel_button.clicked.connect(self.on_cancel) + self.cancel_button.setDefault(False) + self.buttonbox=QDialogButtonBox(self) + self.buttonbox.addButton(self.ok_button,QDialogButtonBox.NoRole) + self.buttonbox.addButton(self.cancel_button,QDialogButtonBox.NoRole) + self.buttonbox.setCenterButtons(True) + self.button_layout = QHBoxLayout() self.button_layout.addWidget(self.ok_button,0,alignment=Qt.AlignHCenter) self.button_layout.addLayout(self.cancel_button,0,alignment=Qt.AlignHCenter) diff --git a/rscder/gui/actions.py b/rscder/gui/actions.py index a13b031..43e2c73 100644 --- a/rscder/gui/actions.py +++ b/rscder/gui/actions.py @@ -52,7 +52,7 @@ class ActionManager(QtCore.QObject): self.basic_menu = menubar.addMenu( '&基础工具') self.filter_menu = self.basic_menu.addMenu(IconInstance().FILTER, '&滤波处理') self.change_detection_menu = menubar.addMenu('&通用变化检测') - self.unsupervised_menu = self.change_detection_menu.addMenu(IconInstance().UNSUPERVISED, '&无监督变化检测') + # self.unsupervised_menu = self.change_detection_menu.addMenu(IconInstance().UNSUPERVISED, '&无监督变化检测') self.supervised_menu = self.change_detection_menu.addMenu(IconInstance().SUPERVISED,'&监督变化检测') self.ai_menu = self.change_detection_menu.addMenu(IconInstance().AI_DETECT,'&AI变化检测') self.special_chagne_detec_menu = menubar.addMenu( '&专题变化检测') diff --git a/rscder/gui/load.py b/rscder/gui/load.py index 1bfab0f..5f1712b 100644 --- a/rscder/gui/load.py +++ b/rscder/gui/load.py @@ -3,7 +3,7 @@ import os from turtle import width from osgeo import gdal from PyQt5.QtWidgets import QWidget, QApplication, QMainWindow, QToolBox -from PyQt5.QtWidgets import QDialog, QFileDialog, QLineEdit, QPushButton, QVBoxLayout, QHBoxLayout, QLabel, QMessageBox,QSpacerItem +from PyQt5.QtWidgets import QDialog, QFileDialog, QLineEdit, QPushButton, QVBoxLayout, QHBoxLayout, QLabel, QMessageBox,QSpacerItem,QDialogButtonBox from PyQt5.QtCore import Qt, QSize,QSettings,pyqtSignal,QThread from PyQt5.QtGui import QIcon,QColor,QPalette,QPixmap from PyQt5 import QtGui @@ -150,11 +150,16 @@ class loader(QDialog): ok_button.clicked.connect(self.ok) cancel_button.clicked.connect(self.cancel) - - button_layout = QHBoxLayout() - button_layout.setDirection(QHBoxLayout.RightToLeft) - button_layout.addWidget(cancel_button, 0, Qt.AlignCenter) - button_layout.addWidget(ok_button, 0, Qt.AlignCenter) + ok_button.setDefault(True) + cancel_button.setDefault(False) + buttonbox=QDialogButtonBox(self) + buttonbox.addButton(ok_button,QDialogButtonBox.NoRole) + buttonbox.addButton(cancel_button,QDialogButtonBox.NoRole) + buttonbox.setCenterButtons(True) + # button_layout = QHBoxLayout() + # button_layout.setDirection(QHBoxLayout.RightToLeft) + # button_layout.addWidget(cancel_button, 0, Qt.AlignCenter) + # button_layout.addWidget(ok_button, 0, Qt.AlignCenter) main_layout = QVBoxLayout() main_layout.addLayout(path1_layout) @@ -162,7 +167,8 @@ class loader(QDialog): main_layout.addLayout(path2_layout) main_layout.addLayout(style2_layout) main_layout.addLayout(maplayout) - main_layout.addLayout(button_layout) + main_layout.addWidget(buttonbox) + # main_layout.addLayout(button_layout) self.setLayout(main_layout) def open_file1(self):