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