Skip to content

Commit 51a3786

Browse files
committed
Rename InputArrayRef/OutputArrayRef/InputOutputArrayRef to their final names (issue #1976 step 5, final cleanup part 3)
Mechanical rename now that the class-based InputArray/OutputArray/ InputOutputArray are gone and the names are free: InputArrayRef -> InputArray OutputArrayRef -> OutputArray InputOutputArrayRef -> InputOutputArray Single-pass whole-word regex per name (no placeholder/2-pass needed, unlike the earlier MatExprNode->MatExpr rename, since these three names don't overlap as substrings of each other and the target names weren't already in use). Renamed the defining file InputArrayRef.cs -> InputArray.cs and the test file/class InputArrayRefTest(.cs) -> InputArrayTest. Also dropped the ArrayProxyKind.RawInputArray/RawOutputArray/ RawInputOutputArray migration-scaffold enum values and rewrote the file-header comment in InputArray.cs: both were explicitly documented as "removed once the type flip is complete", which it now is. Nothing in the codebase ever constructed a proxy with those Kind values anymore (they existed solely so externs could wrap a class-based InputArray/OutputArray/InputOutputArray handle during the incremental ArrayProxy ABI migration). This completes issue #1976 step 5: InputArray/OutputArray/ InputOutputArray are now ref structs everywhere, matching their original class-based public API names.
1 parent d517a6f commit 51a3786

135 files changed

Lines changed: 1011 additions & 1025 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/OpenCvSharp/Cv2/Cv2_calib.FishEye.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public static class FishEye
3434
/// rotation vector, translation vector, and the skew.In the old interface different components of
3535
/// the jacobian are returned via different output parameters.</param>
3636
public static void ProjectPoints(
37-
InputArrayRef objectPoints, OutputArrayRef imagePoints, InputArrayRef rvec, InputArrayRef tvec,
38-
InputArrayRef k, InputArrayRef d, double alpha = 0, OutputArrayRef jacobian = default)
37+
InputArray objectPoints, OutputArray imagePoints, InputArray rvec, InputArray tvec,
38+
InputArray k, InputArray d, double alpha = 0, OutputArray jacobian = default)
3939
{
4040
NativeMethods.HandleException(
4141
NativeMethods.calib_fisheye_projectPoints2(
@@ -64,7 +64,7 @@ public static void ProjectPoints(
6464
/// <param name="d">Input vector of distortion coefficients</param>
6565
/// <param name="alpha">The skew coefficient.</param>
6666
public static void DistortPoints(
67-
InputArrayRef undistorted, OutputArrayRef distorted, InputArrayRef k, InputArrayRef d, double alpha = 0)
67+
InputArray undistorted, OutputArray distorted, InputArray k, InputArray d, double alpha = 0)
6868
{
6969
NativeMethods.HandleException(
7070
NativeMethods.calib_fisheye_distortPoints(
@@ -89,7 +89,7 @@ public static void DistortPoints(
8989
/// <param name="d">Input vector of distortion coefficients.</param>
9090
/// <param name="alpha">The skew coefficient.</param>
9191
public static void DistortPoints(
92-
InputArrayRef undistorted, OutputArrayRef distorted, InputArrayRef kundistorted, InputArrayRef k, InputArrayRef d, double alpha = 0)
92+
InputArray undistorted, OutputArray distorted, InputArray kundistorted, InputArray k, InputArray d, double alpha = 0)
9393
{
9494
NativeMethods.HandleException(
9595
NativeMethods.calib_fisheye_distortPoints2(
@@ -114,8 +114,8 @@ public static void DistortPoints(
114114
/// <param name="p">New camera matrix (3x3) or new projection matrix (3x4)</param>
115115
// ReSharper disable once MemberHidesStaticFromOuterClass
116116
public static void UndistortPoints(
117-
InputArrayRef distorted, OutputArrayRef undistorted,
118-
InputArrayRef k, InputArrayRef d, InputArrayRef r = default, InputArrayRef p = default)
117+
InputArray distorted, OutputArray undistorted,
118+
InputArray k, InputArray d, InputArray r = default, InputArray p = default)
119119
{
120120
NativeMethods.HandleException(
121121
NativeMethods.calib_fisheye_undistortPoints(
@@ -142,8 +142,8 @@ public static void UndistortPoints(
142142
/// <param name="map1">The first output map.</param>
143143
/// <param name="map2">The second output map.</param>
144144
public static void InitUndistortRectifyMap(
145-
InputArrayRef k, InputArrayRef d, InputArrayRef r, InputArrayRef p,
146-
Size size, int m1type, OutputArrayRef map1, OutputArrayRef map2)
145+
InputArray k, InputArray d, InputArray r, InputArray p,
146+
Size size, int m1type, OutputArray map1, OutputArray map2)
147147
{
148148
NativeMethods.HandleException(
149149
NativeMethods.calib_fisheye_initUndistortRectifyMap(
@@ -168,8 +168,8 @@ public static void InitUndistortRectifyMap(
168168
/// may additionally scale and shift the result by using a different matrix.</param>
169169
/// <param name="newSize"></param>
170170
public static void UndistortImage(
171-
InputArrayRef distorted, OutputArrayRef undistorted,
172-
InputArrayRef k, InputArrayRef d, InputArrayRef knew = default, Size newSize = default)
171+
InputArray distorted, OutputArray undistorted,
172+
InputArray k, InputArray d, InputArray knew = default, Size newSize = default)
173173
{
174174
NativeMethods.HandleException(
175175
NativeMethods.calib_fisheye_undistortImage(
@@ -196,8 +196,8 @@ public static void UndistortImage(
196196
/// <param name="newSize"></param>
197197
/// <param name="fovScale">Divisor for new focal length.</param>
198198
public static void EstimateNewCameraMatrixForUndistortRectify(
199-
InputArrayRef k, InputArrayRef d, Size imageSize, InputArrayRef r,
200-
OutputArrayRef p, double balance = 0.0, Size newSize = default, double fovScale = 1.0)
199+
InputArray k, InputArray d, Size imageSize, InputArray r,
200+
OutputArray p, double balance = 0.0, Size newSize = default, double fovScale = 1.0)
201201
{
202202
NativeMethods.HandleException(
203203
NativeMethods.calib_fisheye_estimateNewCameraMatrixForUndistortRectify(
@@ -230,7 +230,7 @@ public static void EstimateNewCameraMatrixForUndistortRectify(
230230
/// <returns></returns>
231231
public static double Calibrate(
232232
IEnumerable<Mat> objectPoints, IEnumerable<Mat> imagePoints,
233-
Size imageSize, InputOutputArrayRef k, InputOutputArrayRef d,
233+
Size imageSize, InputOutputArray k, InputOutputArray d,
234234
out IEnumerable<Mat> rvecs, out IEnumerable<Mat> tvecs,
235235
FishEyeCalibrationFlags flags = 0, TermCriteria? criteria = null)
236236
{
@@ -290,9 +290,9 @@ public static double Calibrate(
290290
/// length.Balance is in range of[0, 1].</param>
291291
/// <param name="fovScale">Divisor for new focal length.</param>
292292
public static void StereoRectify(
293-
InputArrayRef k1, InputArrayRef d1, InputArrayRef k2, InputArrayRef d2,
294-
Size imageSize, InputArrayRef r, InputArrayRef tvec, OutputArrayRef r1, OutputArrayRef r2,
295-
OutputArrayRef p1, OutputArrayRef p2, OutputArrayRef q, FishEyeCalibrationFlags flags, Size newImageSize = default,
293+
InputArray k1, InputArray d1, InputArray k2, InputArray d2,
294+
Size imageSize, InputArray r, InputArray tvec, OutputArray r1, OutputArray r2,
295+
OutputArray p1, OutputArray p2, OutputArray q, FishEyeCalibrationFlags flags, Size newImageSize = default,
296296
double balance = 0.0, double fovScale = 1.0)
297297
{
298298
NativeMethods.HandleException(
@@ -335,8 +335,8 @@ public static void StereoRectify(
335335
/// <returns></returns>
336336
public static double StereoCalibrate(
337337
IEnumerable<Mat> objectPoints, IEnumerable<Mat> imagePoints1, IEnumerable<Mat> imagePoints2,
338-
InputOutputArrayRef k1, InputOutputArrayRef d1, InputOutputArrayRef k2, InputOutputArrayRef d2, Size imageSize,
339-
OutputArrayRef r, OutputArrayRef t, FishEyeCalibrationFlags flags = FishEyeCalibrationFlags.FixIntrinsic,
338+
InputOutputArray k1, InputOutputArray d1, InputOutputArray k2, InputOutputArray d2, Size imageSize,
339+
OutputArray r, OutputArray t, FishEyeCalibrationFlags flags = FishEyeCalibrationFlags.FixIntrinsic,
340340
TermCriteria? criteria = null)
341341
{
342342
if (objectPoints is null)

src/OpenCvSharp/Cv2/Cv2_calib.cs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ public static Mat InitCameraMatrix2D(
8484
/// <returns>The function returns true if all of the corners are found and they are placed in a certain order (row by row, left to right in every row).
8585
/// Otherwise, if the function fails to find all the corners or reorder them, it returns false.</returns>
8686
public static bool FindChessboardCorners(
87-
InputArrayRef image,
87+
InputArray image,
8888
Size patternSize,
89-
OutputArrayRef corners,
89+
OutputArray corners,
9090
ChessboardFlags flags = ChessboardFlags.AdaptiveThresh | ChessboardFlags.NormalizeImage)
9191
{
9292
NativeMethods.HandleException(
@@ -106,7 +106,7 @@ public static bool FindChessboardCorners(
106106
/// <returns>The function returns true if all of the corners are found and they are placed in a certain order (row by row, left to right in every row).
107107
/// Otherwise, if the function fails to find all the corners or reorder them, it returns false.</returns>
108108
public static bool FindChessboardCorners(
109-
InputArrayRef image,
109+
InputArray image,
110110
Size patternSize,
111111
out Point2f[] corners,
112112
ChessboardFlags flags = ChessboardFlags.AdaptiveThresh | ChessboardFlags.NormalizeImage)
@@ -130,9 +130,9 @@ public static bool FindChessboardCorners(
130130
/// <param name="blobDetector">feature detector that finds blobs like dark circles on light background.</param>
131131
/// <returns></returns>
132132
public static bool FindCirclesGrid(
133-
InputArrayRef image,
133+
InputArray image,
134134
Size patternSize,
135-
OutputArrayRef centers,
135+
OutputArray centers,
136136
FindCirclesGridFlags flags = FindCirclesGridFlags.SymmetricGrid,
137137
FeatureDetector? blobDetector = null)
138138
{
@@ -155,7 +155,7 @@ public static bool FindCirclesGrid(
155155
/// <param name="blobDetector">feature detector that finds blobs like dark circles on light background.</param>
156156
/// <returns></returns>
157157
public static bool FindCirclesGrid(
158-
InputArrayRef image,
158+
InputArray image,
159159
Size patternSize,
160160
out Point2f[] centers,
161161
FindCirclesGridFlags flags = FindCirclesGridFlags.SymmetricGrid,
@@ -199,8 +199,8 @@ public static double CalibrateCamera(
199199
IEnumerable<Mat> objectPoints,
200200
IEnumerable<Mat> imagePoints,
201201
Size imageSize,
202-
InputOutputArrayRef cameraMatrix,
203-
InputOutputArrayRef distCoeffs,
202+
InputOutputArray cameraMatrix,
203+
InputOutputArray distCoeffs,
204204
out Mat[] rvecs,
205205
out Mat[] tvecs,
206206
CalibrationFlags flags = CalibrationFlags.None,
@@ -330,10 +330,10 @@ public static double CalibrateCamera(
330330
public static double RegisterCameras(
331331
IEnumerable<Mat> objectPoints1, IEnumerable<Mat> objectPoints2,
332332
IEnumerable<Mat> imagePoints1, IEnumerable<Mat> imagePoints2,
333-
InputArrayRef cameraMatrix1, InputArrayRef distCoeffs1, CameraModel cameraModel1,
334-
InputArrayRef cameraMatrix2, InputArrayRef distCoeffs2, CameraModel cameraModel2,
335-
InputOutputArrayRef r, InputOutputArrayRef t, OutputArrayRef e, OutputArrayRef f,
336-
OutputArrayRef perViewErrors, int flags = 0, TermCriteria? criteria = null)
333+
InputArray cameraMatrix1, InputArray distCoeffs1, CameraModel cameraModel1,
334+
InputArray cameraMatrix2, InputArray distCoeffs2, CameraModel cameraModel2,
335+
InputOutputArray r, InputOutputArray t, OutputArray e, OutputArray f,
336+
OutputArray perViewErrors, int flags = 0, TermCriteria? criteria = null)
337337
{
338338
if (objectPoints1 is null)
339339
throw new ArgumentNullException(nameof(objectPoints1));
@@ -397,10 +397,10 @@ public static double CalibrateMultiview(
397397
IEnumerable<Mat> objPoints,
398398
IReadOnlyList<IReadOnlyList<Mat>> imagePoints,
399399
IEnumerable<Size> imageSize,
400-
InputArrayRef detectionMask,
401-
InputArrayRef models,
400+
InputArray detectionMask,
401+
InputArray models,
402402
out Mat[] ks, out Mat[] distortions, out Mat[] rs, out Mat[] ts,
403-
InputArrayRef flagsForIntrinsics = default,
403+
InputArray flagsForIntrinsics = default,
404404
int flags = 0,
405405
TermCriteria? criteria = null)
406406
{
@@ -478,10 +478,10 @@ public static double StereoCalibrate(
478478
IReadOnlyList<Mat> objectPoints,
479479
IReadOnlyList<Mat> imagePoints1,
480480
IReadOnlyList<Mat> imagePoints2,
481-
InputOutputArrayRef cameraMatrix1, InputOutputArrayRef distCoeffs1,
482-
InputOutputArrayRef cameraMatrix2, InputOutputArrayRef distCoeffs2,
483-
Size imageSize, OutputArrayRef R,
484-
OutputArrayRef T, OutputArrayRef E, OutputArrayRef F,
481+
InputOutputArray cameraMatrix1, InputOutputArray distCoeffs1,
482+
InputOutputArray cameraMatrix2, InputOutputArray distCoeffs2,
483+
Size imageSize, OutputArray R,
484+
OutputArray T, OutputArray E, OutputArray F,
485485
CalibrationFlags flags = CalibrationFlags.FixIntrinsic,
486486
TermCriteria? criteria = null)
487487
{
@@ -548,8 +548,8 @@ public static double StereoCalibrate(
548548
IEnumerable<IEnumerable<Point2f>> imagePoints2,
549549
double[,] cameraMatrix1, double[] distCoeffs1,
550550
double[,] cameraMatrix2, double[] distCoeffs2,
551-
Size imageSize, OutputArrayRef R,
552-
OutputArrayRef T, OutputArrayRef E, OutputArrayRef F,
551+
Size imageSize, OutputArray R,
552+
OutputArray T, OutputArray E, OutputArray F,
553553
CalibrationFlags flags = CalibrationFlags.FixIntrinsic,
554554
TermCriteria? criteria = null)
555555
{
@@ -637,8 +637,8 @@ public static void CalibrateHandEye(
637637
IEnumerable<Mat> t_gripper2base,
638638
IEnumerable<Mat> R_target2cam,
639639
IEnumerable<Mat> t_target2cam,
640-
OutputArrayRef R_cam2gripper,
641-
OutputArrayRef t_cam2gripper,
640+
OutputArray R_cam2gripper,
641+
OutputArray t_cam2gripper,
642642
HandEyeCalibrationMethod method = HandEyeCalibrationMethod.TSAI)
643643
{
644644
if (R_gripper2base is null)
@@ -719,10 +719,10 @@ public static void CalibrateRobotWorldHandEye(
719719
IEnumerable<Mat> t_world2cam,
720720
IEnumerable<Mat> R_base2gripper,
721721
IEnumerable<Mat> t_base2gripper,
722-
OutputArrayRef R_base2world,
723-
OutputArrayRef t_base2world,
724-
OutputArrayRef R_gripper2cam,
725-
OutputArrayRef t_gripper2cam,
722+
OutputArray R_base2world,
723+
OutputArray t_base2world,
724+
OutputArray R_gripper2cam,
725+
OutputArray t_gripper2cam,
726726
RobotWorldHandEyeCalibrationMethod method = RobotWorldHandEyeCalibrationMethod.SHAH)
727727
{
728728
if (R_world2cam is null)

0 commit comments

Comments
 (0)