-
Notifications
You must be signed in to change notification settings - Fork 0
/
opencv.webarkit_config.py
205 lines (194 loc) · 9.34 KB
/
opencv.webarkit_config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# Classes and methods whitelist
core = {
'': [
'absdiff', 'add', 'addWeighted', 'bitwise_and', 'bitwise_not', 'bitwise_or', 'bitwise_xor', 'cartToPolar',
'compare', 'convertScaleAbs', 'copyMakeBorder', 'countNonZero', 'determinant', 'dft', 'divide', 'eigen',
'exp', 'flip', 'getOptimalDFTSize', 'gemm', 'hconcat', 'inRange', 'invert', 'kmeans', 'log', 'magnitude',
'max', 'mean', 'meanStdDev', 'merge', 'min', 'minMaxLoc', 'mixChannels', 'multiply', 'norm', 'normalize',
'perspectiveTransform', 'polarToCart', 'pow', 'randn', 'randu', 'reduce', 'repeat', 'rotate', 'setIdentity', 'setRNGSeed',
'solve', 'solvePoly', 'split', 'sqrt', 'subtract', 'trace', 'transform', 'transpose', 'vconcat',
'setLogLevel', 'getLogLevel',
],
'Algorithm': [],
}
imgproc = {
'': [
'Canny',
'GaussianBlur',
'Laplacian',
'HoughLines',
'HoughLinesP',
'HoughCircles',
'Scharr',
'Sobel',
'adaptiveThreshold',
'approxPolyDP',
'arcLength',
'bilateralFilter',
'blur',
'boundingRect',
'boxFilter',
'calcBackProject',
'calcHist',
'circle',
'compareHist',
'connectedComponents',
'connectedComponentsWithStats',
'contourArea',
'convexHull',
'convexityDefects',
'cornerHarris',
'cornerMinEigenVal',
'createCLAHE',
'createLineSegmentDetector',
'cvtColor',
'demosaicing',
'dilate',
'distanceTransform',
'distanceTransformWithLabels',
'drawContours',
'ellipse',
'ellipse2Poly',
'equalizeHist',
'erode',
'filter2D',
'findContours',
'fitEllipse',
'fitLine',
'floodFill',
'getAffineTransform',
'getPerspectiveTransform',
'getRotationMatrix2D',
'getStructuringElement',
'goodFeaturesToTrack',
'grabCut',
# 'initUndistortRectifyMap', # 4.x: moved to calib3d
'integral',
'integral2',
'isContourConvex',
'line',
'matchShapes',
'matchTemplate',
'medianBlur',
'minAreaRect',
'minEnclosingCircle',
'moments',
'morphologyEx',
'pointPolygonTest',
'putText',
'pyrDown',
'pyrUp',
'rectangle',
'remap',
'resize',
'sepFilter2D',
'threshold',
# 'undistort', # 4.x: moved to calib3d
'warpAffine',
'warpPerspective',
'warpPolar',
'watershed',
'fillPoly',
'fillConvexPoly',
'polylines',
],
'CLAHE': ['apply', 'collectGarbage', 'getClipLimit', 'getTilesGridSize', 'setClipLimit', 'setTilesGridSize'],
'segmentation_IntelligentScissorsMB': [
'IntelligentScissorsMB',
'setWeights',
'setGradientMagnitudeMaxLimit',
'setEdgeFeatureZeroCrossingParameters',
'setEdgeFeatureCannyParameters',
'applyImage',
'applyImageFeatures',
'buildMap',
'getContour'
],
}
objdetect = {'': ['groupRectangles'],
'HOGDescriptor': ['load', 'HOGDescriptor', 'getDefaultPeopleDetector', 'getDaimlerPeopleDetector', 'setSVMDetector', 'detectMultiScale'],
'CascadeClassifier': ['load', 'detectMultiScale2', 'CascadeClassifier', 'detectMultiScale3', 'empty', 'detectMultiScale'],
'QRCodeDetector': ['QRCodeDetector', 'decode', 'decodeCurved', 'detect', 'detectAndDecode', 'detectMulti', 'setEpsX', 'setEpsY'],
'ArucoDetector': ['getPredefinedDictionary', 'detectMarkers', 'refineDetectedMarkers', 'getDictionary', 'setDictionary', 'getDetectorParameters', 'setDetectorParameters', 'getRefineParameters', 'setRefineParameters'],
'GridBoard': ['create', 'generateImage', 'getGridSize', 'getMarkerLength', 'getMarkerSeparation'],
'CharucoBoard': ['create', 'generateImage', 'getChessboardCorners', 'getNearestMarkerCorners', 'checkCharucoCornersCollinear']
}
video = {
'': [
'CamShift',
'calcOpticalFlowFarneback',
'calcOpticalFlowPyrLK',
'createBackgroundSubtractorMOG2',
'findTransformECC',
'meanShift',
],
'BackgroundSubtractorMOG2': ['BackgroundSubtractorMOG2', 'apply'],
'BackgroundSubtractor': ['apply', 'getBackgroundImage'],
# issue #21070: 'Tracker': ['init', 'update'],
'TrackerMIL': ['create'],
'TrackerMIL_Params': [],
}
dnn = {'dnn_Net': ['setInput', 'forward', 'setPreferableBackend'],
'': ['readNetFromCaffe', 'readNetFromTensorflow', 'readNetFromTorch', 'readNetFromDarknet',
'readNetFromONNX', 'readNetFromTFLite', 'readNet', 'blobFromImage']}
features2d = {'Feature2D': ['detect', 'compute', 'detectAndCompute', 'descriptorSize', 'descriptorType', 'defaultNorm', 'empty', 'getDefaultName'],
'BRISK': ['create', 'getDefaultName'],
'ORB': ['create', 'setMaxFeatures', 'setScaleFactor', 'setNLevels', 'setEdgeThreshold', 'setFastThreshold', 'setFirstLevel', 'setWTA_K', 'setScoreType', 'setPatchSize', 'getFastThreshold', 'getDefaultName'],
'MSER': ['create', 'detectRegions', 'setDelta', 'getDelta', 'setMinArea', 'getMinArea', 'setMaxArea', 'getMaxArea', 'setPass2Only', 'getPass2Only', 'getDefaultName'],
'FastFeatureDetector': ['create', 'setThreshold', 'getThreshold', 'setNonmaxSuppression', 'getNonmaxSuppression', 'setType', 'getType', 'getDefaultName'],
'AgastFeatureDetector': ['create', 'setThreshold', 'getThreshold', 'setNonmaxSuppression', 'getNonmaxSuppression', 'setType', 'getType', 'getDefaultName'],
'GFTTDetector': ['create', 'setMaxFeatures', 'getMaxFeatures', 'setQualityLevel', 'getQualityLevel', 'setMinDistance', 'getMinDistance', 'setBlockSize', 'getBlockSize', 'setHarrisDetector', 'getHarrisDetector', 'setK', 'getK', 'getDefaultName'],
# 'SimpleBlobDetector': ['create'],
'KAZE': ['create', 'setExtended', 'getExtended', 'setUpright', 'getUpright', 'setThreshold', 'getThreshold', 'setNOctaves', 'getNOctaves', 'setNOctaveLayers', 'getNOctaveLayers', 'setDiffusivity', 'getDiffusivity', 'getDefaultName'],
'AKAZE': ['create', 'setDescriptorType', 'getDescriptorType', 'setDescriptorSize', 'getDescriptorSize', 'setDescriptorChannels', 'getDescriptorChannels', 'setThreshold', 'getThreshold', 'setNOctaves', 'getNOctaves', 'setNOctaveLayers', 'getNOctaveLayers', 'setDiffusivity', 'getDiffusivity', 'getDefaultName'],
'DescriptorMatcher': ['add', 'clear', 'empty', 'isMaskSupported', 'train', 'match', 'knnMatch', 'radiusMatch', 'clone', 'create'],
'BFMatcher': ['isMaskSupported', 'create'],
'': ['drawKeypoints', 'drawMatches', 'drawMatchesKnn']}
photo = {'': ['createAlignMTB', 'createCalibrateDebevec', 'createCalibrateRobertson',
'createMergeDebevec', 'createMergeMertens', 'createMergeRobertson',
'createTonemapDrago', 'createTonemapMantiuk', 'createTonemapReinhard', 'inpaint'],
'CalibrateCRF': ['process'],
'AlignMTB': ['calculateShift', 'shiftMat', 'computeBitmaps', 'getMaxBits', 'setMaxBits',
'getExcludeRange', 'setExcludeRange', 'getCut', 'setCut'],
'CalibrateDebevec': ['getLambda', 'setLambda', 'getSamples', 'setSamples', 'getRandom', 'setRandom'],
'CalibrateRobertson': ['getMaxIter', 'setMaxIter', 'getThreshold', 'setThreshold', 'getRadiance'],
'MergeExposures': ['process'],
'MergeDebevec': ['process'],
'MergeMertens': ['process', 'getContrastWeight', 'setContrastWeight', 'getSaturationWeight',
'setSaturationWeight', 'getExposureWeight', 'setExposureWeight'],
'MergeRobertson': ['process'],
'Tonemap': ['process', 'getGamma', 'setGamma'],
'TonemapDrago': ['getSaturation', 'setSaturation', 'getBias', 'setBias',
'getSigmaColor', 'setSigmaColor', 'getSigmaSpace', 'setSigmaSpace'],
'TonemapMantiuk': ['getScale', 'setScale', 'getSaturation', 'setSaturation'],
'TonemapReinhard': ['getIntensity', 'setIntensity', 'getLightAdaptation', 'setLightAdaptation',
'getColorAdaptation', 'setColorAdaptation']
}
calib3d = {
'': [
'findHomography',
'calibrateCameraExtended',
'drawFrameAxes',
'estimateAffine2D',
'getDefaultNewCameraMatrix',
'initUndistortRectifyMap',
'Rodrigues',
'solvePnP',
'solvePnPRansac',
'solvePnPRefineLM',
'projectPoints',
'undistort',
# cv::fisheye namespace
# Disabling because i think i will never use these...
# 'fisheye_initUndistortRectifyMap',
# 'fisheye_projectPoints',
],
}
xfeatures2d = {
'FREAK': ['create', 'setOrientationNormalized', 'getOrientationNormalized', 'setScaleNormalized', 'getScaleNormalized', 'setPatternScale', 'getPatternScale', 'setNOctaves', 'getNOctaves', 'getDefaultName'],
'TEBLID': ['create', 'getDefaultName'],
}
white_list = makeWhiteList(
[core, imgproc, objdetect, video, dnn, features2d, photo, calib3d, xfeatures2d])
# namespace_prefix_override['dnn'] = '' # compatibility stuff (enabled by default)
# namespace_prefix_override['aruco'] = '' # compatibility stuff (enabled by default)