Commit e16af9bd authored by Roman Donchenko's avatar Roman Donchenko Committed by OpenCV Buildbot

Merge pull request #958 from apavlenko:fix_java_mixchannels

parents 1fe7ad85 438649ff
...@@ -512,48 +512,68 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1getTextSize ...@@ -512,48 +512,68 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1getTextSize
} }
# { class : { func : {arg_name : ctype} } } # { class : { func : { arg_name : {"ctype" : ctype, "attrib" : [attrib]} } } }
func_arg_fix = { func_arg_fix = {
'' : { '' : {
'randu' : { 'low' : 'double', 'high' : 'double', }, 'randu' : { 'low' : {"ctype" : 'double'},
'randn' : { 'mean' : 'double', 'stddev' : 'double', }, 'high' : {"ctype" : 'double'} },
'inRange' : { 'lowerb' : 'Scalar', 'upperb' : 'Scalar', }, 'randn' : { 'mean' : {"ctype" : 'double'},
'goodFeaturesToTrack' : { 'corners' : 'vector_Point', }, 'stddev' : {"ctype" : 'double'} },
'findFundamentalMat' : { 'points1' : 'vector_Point2f', 'points2' : 'vector_Point2f', }, 'inRange' : { 'lowerb' : {"ctype" : 'Scalar'},
'cornerSubPix' : { 'corners' : 'vector_Point2f', }, 'upperb' : {"ctype" : 'Scalar'} },
'minEnclosingCircle' : { 'points' : 'vector_Point2f', }, 'goodFeaturesToTrack' : { 'corners' : {"ctype" : 'vector_Point'} },
'findHomography' : { 'srcPoints' : 'vector_Point2f', 'dstPoints' : 'vector_Point2f', }, 'findFundamentalMat' : { 'points1' : {"ctype" : 'vector_Point2f'},
'solvePnP' : { 'objectPoints' : 'vector_Point3f', 'imagePoints' : 'vector_Point2f', 'points2' : {"ctype" : 'vector_Point2f'} },
'distCoeffs' : 'vector_double' }, 'cornerSubPix' : { 'corners' : {"ctype" : 'vector_Point2f'} },
'solvePnPRansac' : { 'objectPoints' : 'vector_Point3f', 'imagePoints' : 'vector_Point2f', 'minEnclosingCircle' : { 'points' : {"ctype" : 'vector_Point2f'} },
'distCoeffs' : 'vector_double' }, 'findHomography' : { 'srcPoints' : {"ctype" : 'vector_Point2f'},
'calcOpticalFlowPyrLK' : { 'prevPts' : 'vector_Point2f', 'nextPts' : 'vector_Point2f', 'dstPoints' : {"ctype" : 'vector_Point2f'} },
'status' : 'vector_uchar', 'err' : 'vector_float', }, 'solvePnP' : { 'objectPoints' : {"ctype" : 'vector_Point3f'},
'fitEllipse' : { 'points' : 'vector_Point2f', }, 'imagePoints' : {"ctype" : 'vector_Point2f'},
'fillPoly' : { 'pts' : 'vector_vector_Point', }, 'distCoeffs' : {"ctype" : 'vector_double' } },
'polylines' : { 'pts' : 'vector_vector_Point', }, 'solvePnPRansac' : { 'objectPoints' : {"ctype" : 'vector_Point3f'},
'fillConvexPoly' : { 'points' : 'vector_Point', }, 'imagePoints' : {"ctype" : 'vector_Point2f'},
'boundingRect' : { 'points' : 'vector_Point', }, 'distCoeffs' : {"ctype" : 'vector_double' } },
'approxPolyDP' : { 'curve' : 'vector_Point2f', 'approxCurve' : 'vector_Point2f', }, 'calcOpticalFlowPyrLK' : { 'prevPts' : {"ctype" : 'vector_Point2f'},
'arcLength' : { 'curve' : 'vector_Point2f', }, 'nextPts' : {"ctype" : 'vector_Point2f'},
'pointPolygonTest' : { 'contour' : 'vector_Point2f', }, 'status' : {"ctype" : 'vector_uchar'},
'minAreaRect' : { 'points' : 'vector_Point2f', }, 'err' : {"ctype" : 'vector_float'} },
'getAffineTransform' : { 'src' : 'vector_Point2f', 'dst' : 'vector_Point2f', }, 'fitEllipse' : { 'points' : {"ctype" : 'vector_Point2f'} },
'hconcat' : { 'src' : 'vector_Mat', }, 'fillPoly' : { 'pts' : {"ctype" : 'vector_vector_Point'} },
'vconcat' : { 'src' : 'vector_Mat', }, 'polylines' : { 'pts' : {"ctype" : 'vector_vector_Point'} },
'undistortPoints' : { 'src' : 'vector_Point2f', 'dst' : 'vector_Point2f' }, 'fillConvexPoly' : { 'points' : {"ctype" : 'vector_Point'} },
'checkRange' : {'pos' : '*'}, 'boundingRect' : { 'points' : {"ctype" : 'vector_Point'} },
'meanStdDev' : {'mean' : 'vector_double', 'stddev' : 'vector_double'}, 'approxPolyDP' : { 'curve' : {"ctype" : 'vector_Point2f'},
'drawContours' : {'contours' : 'vector_vector_Point'}, 'approxCurve' : {"ctype" : 'vector_Point2f'} },
'findContours' : {'contours' : 'vector_vector_Point'}, 'arcLength' : { 'curve' : {"ctype" : 'vector_Point2f'} },
'convexityDefects' : {'contour' : 'vector_Point', 'convexhull' : 'vector_int', 'convexityDefects' : 'vector_Vec4i'}, 'pointPolygonTest' : { 'contour' : {"ctype" : 'vector_Point2f'} },
'isContourConvex' : { 'contour' : 'vector_Point', }, 'minAreaRect' : { 'points' : {"ctype" : 'vector_Point2f'} },
'convexHull' : {'points' : 'vector_Point', 'hull' : 'vector_int', 'returnPoints' : ''}, 'getAffineTransform' : { 'src' : {"ctype" : 'vector_Point2f'},
'projectPoints' : { 'objectPoints' : 'vector_Point3f', 'imagePoints' : 'vector_Point2f', 'dst' : {"ctype" : 'vector_Point2f'} },
'distCoeffs' : 'vector_double' }, 'hconcat' : { 'src' : {"ctype" : 'vector_Mat'} },
'initCameraMatrix2D' : {'objectPoints' : 'vector_vector_Point3f', 'imagePoints' : 'vector_vector_Point2f', }, 'vconcat' : { 'src' : {"ctype" : 'vector_Mat'} },
'findChessboardCorners' : { 'corners' : 'vector_Point2f' }, 'undistortPoints' : { 'src' : {"ctype" : 'vector_Point2f'},
'drawChessboardCorners' : { 'corners' : 'vector_Point2f' }, 'dst' : {"ctype" : 'vector_Point2f'} },
'checkRange' : {'pos' : {"ctype" : '*'} },
'meanStdDev' : { 'mean' : {"ctype" : 'vector_double'},
'stddev' : {"ctype" : 'vector_double'} },
'drawContours' : {'contours' : {"ctype" : 'vector_vector_Point'} },
'findContours' : {'contours' : {"ctype" : 'vector_vector_Point'} },
'convexityDefects' : { 'contour' : {"ctype" : 'vector_Point'},
'convexhull' : {"ctype" : 'vector_int'},
'convexityDefects' : {"ctype" : 'vector_Vec4i'} },
'isContourConvex' : { 'contour' : {"ctype" : 'vector_Point'} },
'convexHull' : { 'points' : {"ctype" : 'vector_Point'},
'hull' : {"ctype" : 'vector_int'},
'returnPoints' : {"ctype" : ''} },
'projectPoints' : { 'objectPoints' : {"ctype" : 'vector_Point3f'},
'imagePoints' : {"ctype" : 'vector_Point2f'},
'distCoeffs' : {"ctype" : 'vector_double' } },
'initCameraMatrix2D' : { 'objectPoints' : {"ctype" : 'vector_vector_Point3f'},
'imagePoints' : {"ctype" : 'vector_vector_Point2f'} },
'findChessboardCorners' : { 'corners' : {"ctype" : 'vector_Point2f'} },
'drawChessboardCorners' : { 'corners' : {"ctype" : 'vector_Point2f'} },
'mixChannels' : { 'dst' : {"attrib" : []} },
}, # '', i.e. no class }, # '', i.e. no class
} # func_arg_fix } # func_arg_fix
...@@ -641,10 +661,12 @@ class FuncInfo(object): ...@@ -641,10 +661,12 @@ class FuncInfo(object):
self.static = ["","static"][ "/S" in decl[2] ] self.static = ["","static"][ "/S" in decl[2] ]
self.ctype = re.sub(r"^CvTermCriteria", "TermCriteria", decl[1] or "") self.ctype = re.sub(r"^CvTermCriteria", "TermCriteria", decl[1] or "")
self.args = [] self.args = []
arg_fix_map = func_arg_fix.get(classname, {}).get(self.jname, {}) func_fix_map = func_arg_fix.get(classname, {}).get(self.jname, {})
for a in decl[3]: for a in decl[3]:
arg = a[:] arg = a[:]
arg[0] = arg_fix_map.get(arg[1], arg[0]) arg_fix_map = func_fix_map.get(arg[1], {})
arg[0] = arg_fix_map.get('ctype', arg[0]) #fixing arg type
arg[3] = arg_fix_map.get('attrib', arg[3]) #fixing arg attrib
ai = ArgInfo(arg) ai = ArgInfo(arg)
self.args.append(ai) self.args.append(ai)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment