Skip to content

Enable p3p and ap3p in solvePnPRansac#8585

Merged
alalek merged 9 commits intoopencv:masterfrom
MathLens:ap3p
Jun 28, 2017
Merged

Enable p3p and ap3p in solvePnPRansac#8585
alalek merged 9 commits intoopencv:masterfrom
MathLens:ap3p

Conversation

@MathLens
Copy link
Copy Markdown
Contributor

@MathLens MathLens commented Apr 15, 2017

Currently, solvePnPRansac is always using EPNP as the ransac kernel, while p3p and ap3p should be able to do the same thing with fewer points (4 instead of 5 for EPNP).

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add tests for solvePnPRansac for P3P/AP3P flag.

{
model_points = 4;
ransac_kernel_method = SOLVEPNP_P3P;
ransac_kernel_method = flags;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Behavior is changed here.
But previous behavior is not mentioned in documentation (and looks like it is not tested), so this may be a legal fix.

Probably in this form:

if( flags == SOLVEPNP_P3P || flags == SOLVEPNP_AP3P)
{
    model_points = 4;
    ransac_kernel_method = flags;
}
else if( npoints == 4 )
{
    model_points = 4;
    ransac_kernel_method = SOLVEPNP_P3P;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alalek The code has been updated. I believe tests for p3p/ap3p are already here:
https://github.com/opencv/opencv/blob/master/modules/calib3d/test/test_solvepnp_ransac.cpp

@MathLens
Copy link
Copy Markdown
Contributor Author

@alalek I am also trying to find a way for OpenCV users to call functions in p3p.h and ap3p.h. It seems that the current code cannot include p3p.h or ap3p.h. How should I modify the code so that they are available for users?

@catree
Copy link
Copy Markdown
Contributor

catree commented Apr 23, 2017

This is a proposition to let the user access to all the solutions of the two P3P methods:

  • add a new function similar to solvePnP: for example: solveP3P

  • in this function, call the [a]p3p::solve() method but with all the solutions instead

  • p3P and ap3p classes remain "hidden" / not accessible to the user

The signature should be something like this: int solveP3P( InputArray objectPoints, InputArray imagePoints, InputArray cameraMatrix, InputArray distCoeffs, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, int flags ). This way:

  • imagePoints can also be image coordinates already in the normalized camera frame at z=1 by setting cameraMatrix to a 3x3 identity matrix

  • flags can be SOLVEPNP_P3P or SOLVEPNP_AP3P

Corresponding code:

diff --git a/modules/calib3d/include/opencv2/calib3d.hpp b/modules/calib3d/include/opencv2/calib3d.hpp
index c58daab..e121ec1 100644
--- a/modules/calib3d/include/opencv2/calib3d.hpp
+++ b/modules/calib3d/include/opencv2/calib3d.hpp
@@ -625,6 +625,11 @@ CV_EXPORTS_W bool solvePnPRansac( InputArray objectPoints, InputArray imagePoint
                                   float reprojectionError = 8.0, double confidence = 0.99,
                                   OutputArray inliers = noArray(), int flags = SOLVEPNP_ITERATIVE );
 
+CV_EXPORTS_W int solveP3P( InputArray objectPoints, InputArray imagePoints,
+                           InputArray cameraMatrix, InputArray distCoeffs,
+                           OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs,
+                           int flags );
+
 /** @brief Finds an initial camera matrix from 3D-2D point correspondences.
 
 @param objectPoints Vector of vectors of the calibration pattern points in the calibration pattern
diff --git a/modules/calib3d/src/ap3p.cpp b/modules/calib3d/src/ap3p.cpp
index db88a02..6aa771d 100644
--- a/modules/calib3d/src/ap3p.cpp
+++ b/modules/calib3d/src/ap3p.cpp
@@ -313,6 +313,38 @@ bool ap3p::solve(cv::Mat &R, cv::Mat &tvec, const cv::Mat &opoints, const cv::Ma
     return result;
 }
 
+int ap3p::solve(std::vector<cv::Mat> &Rs, std::vector<cv::Mat> &tvecs, const cv::Mat &opoints, const cv::Mat &ipoints) {
+    CV_INSTRUMENT_REGION()
+
+    double rotation_matrix[4][3][3], translation[4][3];
+    std::vector<double> points;
+    if (opoints.depth() == ipoints.depth()) {
+        if (opoints.depth() == CV_32F)
+            extract_points<cv::Point3f, cv::Point2f>(opoints, ipoints, points);
+        else
+            extract_points<cv::Point3d, cv::Point2d>(opoints, ipoints, points);
+    } else if (opoints.depth() == CV_32F)
+        extract_points<cv::Point3f, cv::Point2d>(opoints, ipoints, points);
+    else
+        extract_points<cv::Point3d, cv::Point2f>(opoints, ipoints, points);
+
+    int solutions = solve(rotation_matrix, translation,
+                          points[0], points[1], points[2], points[3], points[4],
+                          points[5], points[6], points[7], points[8], points[9],
+                          points[10], points[11], points[12], points[13], points[14]);
+
+    for (int i = 0; i < solutions; i++) {
+        cv::Mat R, tvec;
+        cv::Mat(3, 1, CV_64F, translation[i]).copyTo(tvec);
+        cv::Mat(3, 3, CV_64F, rotation_matrix[i]).copyTo(R);
+
+        Rs.push_back(R);
+        tvecs.push_back(tvec);
+    }
+
+    return solutions;
+}
+
 bool
 ap3p::solve(double R[3][3], double t[3], double mu0, double mv0, double X0, double Y0, double Z0, double mu1,
             double mv1,
@@ -383,4 +415,4 @@ int ap3p::solve(double R[4][3][3], double t[4][3], double mu0, double mv0, doubl
 
     return computePoses(featureVectors, worldPoints, R, t);
 }
-}
\ No newline at end of file
+}
diff --git a/modules/calib3d/src/ap3p.h b/modules/calib3d/src/ap3p.h
index 37c7be1..241e3e6 100644
--- a/modules/calib3d/src/ap3p.h
+++ b/modules/calib3d/src/ap3p.h
@@ -17,8 +17,9 @@ private:
     template<typename OpointType, typename IpointType>
     void extract_points(const cv::Mat &opoints, const cv::Mat &ipoints, std::vector<double> &points) {
         points.clear();
-        points.resize(20);
-        for (int i = 0; i < 4; i++) {
+        int npoints = std::max(opoints.checkVector(3, CV_32F), opoints.checkVector(3, CV_64F));
+        points.resize(5*npoints);
+        for (int i = 0; i < npoints; i++) {
             points[i * 5] = ipoints.at<IpointType>(i).x * fx + cx;
             points[i * 5 + 1] = ipoints.at<IpointType>(i).y * fy + cy;
             points[i * 5 + 2] = opoints.at<OpointType>(i).x;
@@ -39,6 +40,7 @@ public:
     ap3p(cv::Mat cameraMatrix);
 
     bool solve(cv::Mat &R, cv::Mat &tvec, const cv::Mat &opoints, const cv::Mat &ipoints);
+    int solve(std::vector<cv::Mat> &Rs, std::vector<cv::Mat> &tvecs, const cv::Mat &opoints, const cv::Mat &ipoints);
 
     int solve(double R[4][3][3], double t[4][3],
               double mu0, double mv0, double X0, double Y0, double Z0,
diff --git a/modules/calib3d/src/p3p.cpp b/modules/calib3d/src/p3p.cpp
index f91925b..8bf0c35 100644
--- a/modules/calib3d/src/p3p.cpp
+++ b/modules/calib3d/src/p3p.cpp
@@ -57,6 +57,41 @@ bool p3p::solve(cv::Mat& R, cv::Mat& tvec, const cv::Mat& opoints, const cv::Mat
     return result;
 }
 
+int p3p::solve(std::vector<cv::Mat>& Rs, std::vector<cv::Mat>& tvecs, const cv::Mat& opoints, const cv::Mat& ipoints)
+{
+    CV_INSTRUMENT_REGION()
+
+    double rotation_matrix[4][3][3], translation[4][3];
+    std::vector<double> points;
+    if (opoints.depth() == ipoints.depth())
+    {
+        if (opoints.depth() == CV_32F)
+            extract_points<cv::Point3f,cv::Point2f>(opoints, ipoints, points);
+        else
+            extract_points<cv::Point3d,cv::Point2d>(opoints, ipoints, points);
+    }
+    else if (opoints.depth() == CV_32F)
+        extract_points<cv::Point3f,cv::Point2d>(opoints, ipoints, points);
+    else
+        extract_points<cv::Point3d,cv::Point2f>(opoints, ipoints, points);
+
+    int solutions = solve(rotation_matrix, translation,
+                          points[0], points[1], points[2], points[3], points[4],
+                          points[5], points[6], points[7], points[8], points[9],
+                          points[10], points[11], points[12], points[13], points[14]);
+
+    for (int i = 0; i < solutions; i++) {
+        cv::Mat R, tvec;
+        cv::Mat(3, 1, CV_64F, translation[i]).copyTo(tvec);
+        cv::Mat(3, 3, CV_64F, rotation_matrix[i]).copyTo(R);
+
+        Rs.push_back(R);
+        tvecs.push_back(tvec);
+    }
+
+    return solutions;
+}
+
 bool p3p::solve(double R[3][3], double t[3],
     double mu0, double mv0,   double X0, double Y0, double Z0,
     double mu1, double mv1,   double X1, double Y1, double Z1,
diff --git a/modules/calib3d/src/p3p.h b/modules/calib3d/src/p3p.h
index 00d99ae..9c7f7ec 100644
--- a/modules/calib3d/src/p3p.h
+++ b/modules/calib3d/src/p3p.h
@@ -11,6 +11,7 @@ class p3p
   p3p(cv::Mat cameraMatrix);
 
   bool solve(cv::Mat& R, cv::Mat& tvec, const cv::Mat& opoints, const cv::Mat& ipoints);
+  int solve(std::vector<cv::Mat>& Rs, std::vector<cv::Mat>& tvecs, const cv::Mat& opoints, const cv::Mat& ipoints);
   int solve(double R[4][3][3], double t[4][3],
             double mu0, double mv0,   double X0, double Y0, double Z0,
             double mu1, double mv1,   double X1, double Y1, double Z1,
@@ -34,8 +35,9 @@ class p3p
   void extract_points(const cv::Mat& opoints, const cv::Mat& ipoints, std::vector<double>& points)
   {
       points.clear();
-      points.resize(20);
-      for(int i = 0; i < 4; i++)
+      int npoints = std::max(opoints.checkVector(3, CV_32F), opoints.checkVector(3, CV_64F));
+      points.resize(5*npoints);
+      for(int i = 0; i < npoints; i++)
       {
           points[i*5] = ipoints.at<IpointType>(i).x*fx + cx;
           points[i*5+1] = ipoints.at<IpointType>(i).y*fy + cy;
diff --git a/modules/calib3d/src/solvepnp.cpp b/modules/calib3d/src/solvepnp.cpp
index a9be4c8..2315faa 100644
--- a/modules/calib3d/src/solvepnp.cpp
+++ b/modules/calib3d/src/solvepnp.cpp
@@ -337,4 +337,58 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
     return true;
 }
 
+int solveP3P( InputArray _opoints, InputArray _ipoints,
+              InputArray _cameraMatrix, InputArray _distCoeffs,
+              OutputArrayOfArrays _rvecs, OutputArrayOfArrays _tvecs, int flags) {
+    CV_INSTRUMENT_REGION()
+
+    Mat opoints = _opoints.getMat(), ipoints = _ipoints.getMat();
+    int npoints = std::max(opoints.checkVector(3, CV_32F), opoints.checkVector(3, CV_64F));
+    CV_Assert( npoints == 3 && npoints == std::max(ipoints.checkVector(2, CV_32F), ipoints.checkVector(2, CV_64F)) );
+    CV_Assert( flags == SOLVEPNP_P3P || flags == SOLVEPNP_AP3P );
+
+    Mat cameraMatrix0 = _cameraMatrix.getMat();
+    Mat distCoeffs0 = _distCoeffs.getMat();
+    Mat cameraMatrix = Mat_<double>(cameraMatrix0);
+    Mat distCoeffs = Mat_<double>(distCoeffs0);
+
+    Mat undistortedPoints;
+    undistortPoints(ipoints, undistortedPoints, cameraMatrix, distCoeffs);
+    std::vector<Mat> Rs, ts;
+
+    int solutions = 0;
+    if (flags == SOLVEPNP_P3P)
+    {
+        p3p P3Psolver(cameraMatrix);
+        solutions = P3Psolver.solve(Rs, ts, opoints, undistortedPoints);
+    }
+    else if (flags == SOLVEPNP_AP3P)
+    {
+        ap3p P3Psolver(cameraMatrix);
+        solutions = P3Psolver.solve(Rs, ts, opoints, undistortedPoints);
+    }
+
+    if (solutions == 0) {
+        return 0;
+    }
+
+    if (_rvecs.needed()) {
+        _rvecs.create(solutions, 1, CV_64F);
+    }
+
+    if (_tvecs.needed()) {
+        _tvecs.create(solutions, 1, CV_64F);
+    }
+
+    for (int i = 0; i < solutions; i++) {
+        Mat rvec;
+        Rodrigues(Rs[i], rvec);
+        _rvecs.getMatRef(i) = rvec;
+
+        _tvecs.getMatRef(i) = ts[i];
+    }
+
+    return solutions;
+}
+
 }

Not sure if _rvecs.needed() is needed, I used the same code than in decomposeHomographyMat here. The documentation is missing also.

@vpisarev vpisarev self-assigned this May 3, 2017
@MathLens
Copy link
Copy Markdown
Contributor Author

MathLens commented May 8, 2017

I have applied @catree 's update. I am not sure about _rvecs.needed(), either. Do you have any comments for this update? @vpisarev @alalek

@MathLens
Copy link
Copy Markdown
Contributor Author

@vpisarev @alalek

for (int i = 0; i < solutions; i++) {
Mat rvec;
Rodrigues(Rs[i], rvec);
_rvecs.getMatRef(i) = rvec;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getMatRef() should not be used without additional checks.
Use rvec.copyTo(_rvecs) or Rodrigues(Rs[i], _rvecs); instead.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, _rvecs is "OutputArrayOfArrays", so try something like this: rvec.copyTo(_rvecs.getMat(i))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alalek fixed

@MathLens
Copy link
Copy Markdown
Contributor Author

MathLens commented Jun 4, 2017

@alalek fixed

@alalek
Copy link
Copy Markdown
Member

alalek commented Jun 7, 2017

@tonyke1993

  1. Public OpenCV functions should be documented (via comments in .hpp files, we use doxygen).
  2. Please add tests (accuracy at least, performance tests are optional for this).

@MathLens
Copy link
Copy Markdown
Contributor Author

@alalek

  1. Comments added to the solveP3P function.
  2. I believe the two p3p functions have been tested along with the pnp functions:
    https://github.com/opencv/opencv/blob/master/modules/calib3d/test/test_solvepnp_ransac.cpp#L257

@alalek
Copy link
Copy Markdown
Member

alalek commented Jun 13, 2017

  1. Looks good. Thank you!
  2. solveP3P is not tested. At least simple smoke test are required. Also simple tests are good example how to use existed functionality.

@catree
Copy link
Copy Markdown
Contributor

catree commented Jun 13, 2017

A possible test (similar to this):

  • generate random data (generateCameraMatrix, generateDistCoeffs, generatePose)
  • project 4 object points but use only 3 points for solveP3P
  • keep the solution with the lowest reprojection error using the 4th points (similar to this)
  • test if the retained rvec and tvec are well estimated

Another possibility is to directly test if one of the up to 4 solutions has a rvec and tvec well estimated.

@MathLens
Copy link
Copy Markdown
Contributor Author

@alalek I have added a test for solveP3P. I change back to "_rvecs.getMatRef(i) = rvec;" since "rvec.copyTo(_rvecs.getMat(i))" leads to errors.

@MathLens
Copy link
Copy Markdown
Contributor Author

@alalek

projectedPoints.resize(opoints.size());
projectPoints(Mat(opoints), trueRvec, trueTvec, intrinsics, distCoeffs, projectedPoints);

solveP3P(opoints, projectedPoints, intrinsics, distCoeffs, rvecs, tvecs, method);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please test return value too.

  • "zero" value
  • compare with rvecs.size()
  • compare with tvecs.size()

@MathLens
Copy link
Copy Markdown
Contributor Author

@alalek Tests for return values added.

@alalek
Copy link
Copy Markdown
Member

alalek commented Jun 27, 2017

Looks good to me!
👍

@catree
Copy link
Copy Markdown
Contributor

catree commented Jun 28, 2017

double min_rvecDiff = DBL_MAX, min_tvecDiff = DBL_MAX;
for (unsigned int i = 0; i < rvecs.size(); ++i) {
  double rvecDiff = norm(rvecs[i]-trueRvec);
  min_rvecDiff = std::min(rvecDiff, min_rvecDiff);
}
for (unsigned int i = 0; i < tvecs.size(); ++i) {
  double tvecDiff = norm(tvecs[i]-trueTvec);
  min_tvecDiff = std::min(tvecDiff, min_tvecDiff);
}
bool isTestSuccess = min_rvecDiff < epsilon[method] && min_tvecDiff < epsilon[method];

Minor comment, I think it is better to test if both rvec_est and tvec_est (test each solution) are well estimated as currently we return success if both best(rvec_est) and best(tvec_est) are well estimated (they could belong to two different solutions).
(Should be better to return success if (at least) one solution rvec_est_i and tvec_est_i are both well estimated.

@alalek alalek merged commit 8088d67 into opencv:master Jun 28, 2017
@tompollok
Copy link
Copy Markdown
Contributor

great work!

DINGWeiDavid added a commit to DINGWeiDavid/opencv that referenced this pull request Jul 8, 2017
* Compile fix for circlesgrid in debug.

* AVX and SSE optimizations for resize NN

* photo(test): fix MergeRobertson test for AARCH64 build

* Fixing buildbot's messages.

* TBB: fix build on ARM

* update convertFp16 using CV_CPU_CALL_FP16
 * avoid link error (move the implementation of software version to header)
 * make getConvertFuncFp16 local (move from precomp.hpp to convert.hpp)
 * fix error on 32bit x86

* build: fix PCH stub files generation optimization

* java: use module's public headers only

* Modify the pyrlk.cl to support winSize from 8*8 to 24*24 for optical flow

* cmake: add ENABLE_BUILD_HARDENING option

* build: fix errors for MSVS2010-2013, reduce default softfloat scope

* add tests for videostab;

* build: fix "ambiguous call" (MSVS2010)

* build: fix warning

C4189: 'clImageUV' : local variable is initialized but not referenced

* Merge pull request opencv#8816 from mshabunin:sprintf-fix

Fixed snprintf for VS 2013 (opencv#8816)

* Fixed snprintf for VS 2013

* snprintf: removed declaration from header, changed implementation

* cv_snprintf corrected according to comments

* update snprintf patch

* photo: fix integer overflow

There is no cast to wide integer type:
    std::numeric_limits<ST>::max() * std::numeric_limits<ST>::max()

* Update doc build instructions for doxygen

* 3rdparty: remove jinja2 source code

It used for Matlab binding only

* cmake: set minimal CPU instruction to SSE3 (x64)

* update CPU detection on ANDROID patch

* 3rdparty: cpufeatures workaround

* suppress unreachable code warning
 - fix the define condition based on the comment

* fixing models to resolve XML violation issue

* added v_reduce_sum4() universal intrinsic; corrected number of threads in cv::getNumThreads() in the case of GCD

* Updated alignment declarations to CV_DECL_ALIGNED macro

* Updated fix for accumulate performance test in case of multiple iterations

* calib3d: add CALIB_FIX_TANGENT_DIST flag

* calib3d: use calibration flags from the new enums

* flann: add normal assignment operator for cvflann::any

* Added Python Docstrings

* build: fix v_reduce_sum4 (requires SSE3)

* photo: add assertion on empty image in denoising

* removed MSVC warning suppression

* licence updated

* suppress warning on Jetson TK1

* suppress warning
 - check if compiler is Intel compiler
 - remove not referenced variables

* float constant replaced by int hex representations

* Refactor OpenCV Java Wrapping

* video: add one more constructor for VideoWriter

* Fixed gray window for gpu stereo BP and CSBP

compute() for BP and CSBP output 32-bit floating-point mat, and in cv::imshow() 32-bit floating-point is recognized as [0,1] and maped to [0,255], that causes gray window for BP and CSBP.

* Initial version of MediaSDK integration:

- cmake dependencies search (WITH_MFX option)
- raw H264, H265, MPEG2 encoding and decoding
- tests for supported formats

* build: added VERSIONINFO resource

* build: update modules descriptions

* Rewritten some tests in videoio and imgcodecs modules

general:
- all iterative tests have been replaced with parameterized tests
- old-style try..catch tests have been modified to use EXPECT_/ASSERT_ gtest macros
- added temporary files cleanup
- modified MatComparator error message formatting

imgcodecs:
- test_grfmt.cpp split to test_jpg.cpp, test_png.cpp, test_tiff.cpp, etc.

videoio:
- added public HAVE_VIDEO_INPUT, HAVE_VIDEO_OUTPUT definitions to cvconfig.h
- built-in MotionJPEG codec could not be tested on some platforms (read_write test was disabled if ffmpeg is off, encoding/decoding was handled by ffmpeg otherwise).
- image-related tests moved to imgcodecs (Videoio_Image)
- several property get/set tests have been combined into one
- added MotionJPEG test video to opencv_extra

* cmake: guard scanning of default MKL system-wide paths

- WITH_MKL option is enabled
- user doesn't specify MKLROOT/MKL_ROOT_DIR variables

* core(test): added cv::sortIdx accuracy tests

* core: fix IPP optimization for sortIdx

* android: make optional "cpufeatures", build fixes for NDK r15

* remove ARC and auto synthesize assumptions in cocoa_window.mm

* Merge pull request opencv#8869 from hrnr:akaze_part1

[GSOC] Speeding-up AKAZE, part #1 (opencv#8869)

* ts: expand arguments before stringifications in CV_ENUM and CV_FLAGS

added protective macros to always force macro expansion of arguments. This allows using CV_ENUM and CV_FLAGS with macro arguments.

* feature2d: unify perf test

use the same test for all detectors/descriptors we have.

* added AKAZE tests

* features2d: extend perf tests

* add BRISK, KAZE, MSER
* run all extract tests on AKAZE keypoints, so that the test si more comparable for the speed of extraction

* feature2d: rework opencl perf tests

use the same configuration as cpu tests

* feature2d: fix descriptors allocation for AKAZE and KAZE

fix crash when descriptors are UMat

* feature2d: name enum to fix build with older gcc

* Revert "ts: expand arguments before stringifications in CV_ENUM and CV_FLAGS"

This reverts commit 19538ca.

This wasn't a great idea after all. There is a lot of flags implemented as #define, that we don't want to expand.

* feature2d: fix expansion problems with CV_ENUM in perf

* expand arguments before passing them to CV_ENUM. This does not need modifications of CV_ENUM.
* added include guards to `perf_feature2d.hpp`

* feature2d: fix crash in AKAZE when using KAZE descriptors

* out-of-bound access in Get_MSURF_Descriptor_64
* this happened reliably when running on provided keypoints (not computed by the same instance)

* feature2d: added regression tests for AKAZE

* test with both MLDB and KAZE keypoints

* feature2d: do not compute keypoints orientation twice

* always compute keypoints orientation, when computing keypoints
* do not recompute keypoint orientation when computing descriptors

this allows to test detection and extraction separately

* features2d: fix crash in AKAZE

* out-of-bound reads near the image edge
* same as the bug in KAZE descriptors

* feature2d: refactor invariance testing

* split detectors and descriptors tests
* rewrite to google test to simplify debugging
* add tests for AKAZE and one test for ORB

* stitching: add tests with AKAZE feature finder

* added basic stitching cpu and ocl tests
* fix bug in AKAZE wrapper for stitching pipeline causing lots of
! OPENCV warning: getUMat()/getMat() call chain possible problem.
!                 Base object is dead, while nested/derived object is still alive or processed.
!                 Please check lifetime of UMat/Mat objects!

* cmake: add Halide support (opencv#8794)

* .gitignore: added ".cache" directory back

It is necessary for proper work of "git clean" command

* cmake: additional messages on download errors

* Catch SkipTestException in performance tests

* More accurate condition to detect emulator

Previous commit, 6f39f9a, tries to fix the color issue for emulator. But the condition for detecting emulator is incomplete, e.g. it stops working for emulators using Google Play, whose Build.BRAND=="google". https://stackoverflow.com/a/21505193 shows a more accurate condition for this.

* Fix possible uninitialized memory in libtiff

* 3rdparty: protobuf 3.1.0 sources

without tests, testdata, .proto files

* 3rdparty: update CMake scripts for protobuf

* cmake: fix typo

* fast_math.hpp: Use __asm__ rather than asm; fixes including with -std=c99

* videoio(macosx): fix array access exception in AVFoundation

* Add a note to morphologyEx documentation to clarify the behavior when iterations > 1.

* videoio: update VideoWriter apiPreference parameter position

* videoio: drop changes from legacy C-API header

* videoio: do not mix `CV_CAP` and `CAP_` APIs enum values

* build: disable AVX512

Currently it is not supported.
All builds are broken with enabled AVX512 option.

* dnn: move module from opencv_contrib

https://github.com/opencv/opencv_contrib/tree/e6f63c7a38ca40c5dc33e38736e3027e3528d6cb/modules/dnn

* core: forbid handling of the case when src=dst in cv::repeat

* dnn: fix public headers guards

* dnn: move samples

* dnn: remove unused README

* dnn: fix documentation links

* dnn: remove obsolete "build opencv_contrib with dnn module" tutorial

* dnn: fix dnn python test files

* Fixed clipLine evaluation for very long lines

* 3rdparty: add ittnotify sources

https://github.com/01org/IntelSEAPI/tree/master/ittnotify

* viz: fix tests build

* trace: initial support for code trace

* dnn: fix build warnings

* dnn: AVX2 fix invalid unaligned read

* fixed typo

* dnn: fix failed Torch tests

"Torch invalid argument 2: position must be smaller than LLONG_MAX"

These conditions are always true for "long position" argument.

* Compiling the Java tutorials codes using Apache Ant.

* build: fix viz tests

removed test_precomp.cpp

* build: eliminate warning

* dnn: fix build

- winpack
- opencv_world

* Fixing some static analysis issues

* Fixed some bugs from Halide tests

* flann: fix build with MSVC /sdl option

* videoio: synchronize ffmpeg open() call

* dispatch: added CV_TRY_${OPT} macro, fix dnn build

- 1: OPT is available directly or via dispatcher
- 0: optimization is not compiled at all

* dnn: fix LayerFactory initialization

* another round of dnn optimization (opencv#9011)

* another round of dnn optimization:
* increased malloc alignment across OpenCV from 16 to 64 bytes to make it AVX2 and even AVX-512 friendly
* improved SIMD optimization of pooling layer, optimized average pooling
* cleaned up convolution layer implementation
* made activation layer "attacheable" to all other layers, including fully connected and addition layer.
* fixed bug in the fusion algorithm: "LayerData::consumers" should not be cleared, because it desctibes the topology.
* greatly optimized permutation layer, which improved SSD performance
* parallelized element-wise binary/ternary/... ops (sum, prod, max)

* also, added missing copyrights to many of the layer implementation files

* temporarily disabled (again) the check for intermediate blobs consistency; fixed warnings from various builders

* Removed usage of std::map in DetectionOutput layer

* formating style and making changes accordingly to review

* dnn: added trace macros

* core: fix infinite recursion in compare

* Fixed python sample for googlenet in dnn

* Merge pull request opencv#8585 from tonyke1993:ap3p

Enable p3p and ap3p in solvePnPRansac (opencv#8585)

* add paper info

* allow p3p and ap3p being RANSAC kernel

* keep previous code

* apply catrees comment

* fix getMat

* add comment

* add solvep3p test

* test return value

* fix warnings

* core: add an ability to use cxx11 lambda as a parallel_for_ body

* core: add CV_CXX_11 flag to cvdef.h

* Align convolutional layer weights separately from origin ones

* Fixed several issues found by static analysis

* build: remove #define to prevent unexpected impact on user applications

* dnn: added "hidden" experimental namespace

Main purpose of this namespace is to avoid using of incompatible
binaries that will cause applications crashes.

This additional namespace will not impact "Source code API".
This change allows to maintain ABI checks (with easy filtering out).

* dnn: cleanup torch integration code

* gtk: check NULL before unref

* calib3d(perf): disable SGBM tests in debug mode

because they are too long (takes minutes)

* dnn: fix compilation of Halide tests

* Disabled logging in caffe parser in release

* Fix WinRT build breaks in highgui and videoio.

* Fixed some issues found by static analysis (4th round)

* cmake: don't add vs_version.rc for static modules (ts)

* hdr_parser: ignore lines with 'CV__' macros

* binding: fix headers processing

* a fix for open issue 4772

* Prevent crash when attempting to create training data without responses.

This is at least useful when using an SVM one-class linear classifier, so there are valid use cases.

* how_to_scan_images.markdown: fix grammer mistakes

Improve the readability of the tutorial.

* static build workaround

* Removed extra dependencies from videoio library

* canny: disallow broken inplace arguments

* Fix style

* Issues found by static analysis (5th round)

* Fix error message fisheye CALIB_CHECK_COND

The old error message was not giving any hint which input array (image)
led to an ill conditioned matrix. This made it near impossible to
identify poor images in a larger set.

A better approach would be to implement a checker function which gives
each image a rating before the real calibration is performed. This could
also include some image properties like sharpness, etc.

* Fix MKL linkage with enabled OpenMP

* Add 64-bit imshow behavior in the documentation.

* Fix ffmpeg detection with -D OPENCV_WARNINGS_ARE_ERRORS=ON option.

* add java wrappers to dnn module

* dnn: fix some tutorial links

* dnn: fix links

* Add a note about cxx11 range-based loop in Mat_ documentation

* core: add a test of iteration through the Mat_ with range-based for

* Fixed minor doc issue

* cmake: update CXX11 compiler flag

* version 3.3.0-rc

* Fix wrong mat access.

* Merge pull request opencv#9075 from TonyLianLong:master

Remove unnecessary Non-ASCII characters from source code (opencv#9075)

* Remove unnecessary Non-ASCII characters from source code

Remove unnecessary Non-ASCII characters and replace them with ASCII
characters

* Remove dashes in the @param statement

Remove dashes and place single space in the @param statement to keep
coding style

* misc: more fixes for non-ASCII symbols

* misc: fix non-ASCII symbol in CMake file

* cmake: fix linker flags

* ocl: rework events handling with clSetEventCallback

* ocl: async cl_buffer cleanup queue (for event callback)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants