Improve readability of InputArray type arg-s in func-s signature (Feature #2518)
Description
[from ECCV-2012 / Mobile OpenCV tutorial / wishlist brainstorm]
Some of OpenCV functions ( e.g. cv::add()
) accepts input arg-s of almost any types, so InputArray
works like a charm here.
But there are some others that expect InputArray
-s of particular type(s) only, and use of InputArray
type for input arg-s here complicates their usage. Examples:
findHomography
: theInputArray srcPoints, InputArray dstPoints
are expected to be 2D points vector, i.e.std::vector<Point2{i,f,d}>, Mat 1xN or Nx1 CV_{32S,32F,64F}C2
convexityDefects
: theInputArray _points
is expected to bestd::vector<Point2i>, Mat 1xN or Nx1 CV_32SC2
calcOpticalFlowPyrLK
:InputArray prevImg, InputArray nextImg
are expected to be gray-scale images (8UC1
) or pyramid (std::vector<Mat>
)InputArray prevPts, CV_OUT InputOutputArray nextPts
are expected to be Point2f vector
and etc.
Even forcv::add()
theInputArray src2
can be not only image butcv::Scalar
as well!
The suggestion is to define a set of typedef
-s that will help to understand what is expected and use them in signatures.
- randu
- randn
- inRange
- goodFeaturesToTrack
- findFundamentalMat
- cornerSubPix
- minEnclosingCircle
- findHomography
- solvePnP
- distCoeffs
- solvePnPRansac
- distCoeffs
- calcOpticalFlowPyrLK
- fitEllipse
- fillPoly
- polylines
- fillConvexPoly
- boundingRect
- approxPolyDP
- arcLength
- pointPolygonTest
- minAreaRect
- getAffineTransform
- hconcat
- vconcat
- undistortPoints
- checkRange
- meanStdDev
- drawContours
- findContours
- convexityDefects
- isContourConvex
- convexHull
- projectPoints
- distCoeffs
- initCameraMatrix2D
- findChessboardCorners
- drawChessboardCorners
History
Updated by Maksim Shabunin over 9 years ago
Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4449