This is a fix to the signature of static function
collectCalibrationData() and clean-up for #12772. Since fallback scheme
in calibration method selection is not used anymore. As an input
parameter, iFixedPoint should be passed by value according to the OpenCV
coding style guide.
More accurate pinhole camera calibration with imperfect planar target (#12772)
43 commits:
* Add derivatives with respect to object points
Add an output parameter to calculate derivatives of image points with
respect to 3D coordinates of object points. The output jacobian matrix
is a 2Nx3N matrix where N is the number of points.
This commit introduces incompatibility to old function signature.
* Set zero for dpdo matrix before using
dpdo is a sparse matrix with only non-zero value close to major
diagonal. Set it to zero because only elements near major diagonal are
computed.
* Add jacobian columns to projectPoints()
The output jacobian matrix of derivatives with respect to coordinates of
3D object points are added. This might break callers who assume the
columns of jacobian matrix.
* Adapt test code to updated project functions
The test cases for projectPoints() and cvProjectPoints2() are updated to
fit new function signatures.
* Add accuracy test code for dpdo
* Add badarg test for dpdo
* Add new enum item for new calibration method
CALIB_RELEASE_OBJECT is used to whether to release 3D coordinates of
object points. The method was proposed in: K. H. Strobl and G. Hirzinger.
"More Accurate Pinhole Camera Calibration with Imperfect Planar Target".
In Proceedings of the IEEE International Conference on Computer Vision
(ICCV 2011), 1st IEEE Workshop on Challenges and Opportunities in Robot
Perception, Barcelona, Spain, pp. 1068-1075, November 2011.
* Add releasing object method into internal function
It's a simple extension of the standard calibration scheme. We choose to
fix the first and last object point and a user-selected fixed point.
* Add interfaces for extended calibration method
* Refine document for calibrateCamera()
When releasing object points, only the z coordinates of the
objectPoints[0].back is fixed.
* Add link to strobl2011iccv paper
* Improve documentation for calibrateCamera()
* Add implementations of wrapping calibrateCamera()
* Add checking for params of new calibration method
If input parameters are not qualified, then fall back to standard
calibration method.
* Add camera calibration method of releasing object
The current implementation is equal to or better than
https://github.com/xoox/calibrel
* Update doc for CALIB_RELEASE_OBJECT
CALIB_USE_QR or CALIB_USE_LU could be used for faster calibration with
potentially less precise and less stable in some rare cases.
* Add RELEASE_OBJECT calibration to tutorial code
To select the calibration method of releasing object points, a command
line parameter `-d=<number>` should be provided.
* Update tutorial doc for camera_calibration
If the method of releasing object points is merged into OpenCV. It will
be expected to be firstly released in 4.1, I think.
* Reduce epsilon for cornerSubPix()
Epsilon of 0.1 is a bigger one. Preciser corner positions are required
with calibration method of releasing object.
* Refine camera calibration tutorial
The hypothesis coordinates are used to indicate which distance must be
measured between two specified object points.
* Update sample calibration code method selection
Similar to camera_calibration tutorial application, a command line
argument `-dt=<number>` is used to select the calibration method.
* Add guard to flags of cvCalibrateCamera2()
cvCalibrateCamera2() doesn't accept CALIB_RELEASE_OBJECT unless overload
interface is added in the future.
* Simplify fallback when iFixedPoint is out of range
* Refactor projectPoints() to keep compatibilities
* Fix arg string "Bad rvecs header"
* Read calibration flags from test data files
Instead of being hard coded into source file, the calibration flags will
be read from test data files.
opencv_extra/testdata/cv/cameracalibration/calib?.dat must be sync with
the test code.
* Add new C interface of cvCalibrateCamera4()
With this new added C interface, the extended calibration method with
CALIB_RELEASE_OBJECT can be called by C API.
* Add regression test of extended calibration method
It has been tested with new added test data in xoox:calib-release-object
branch of opencv_extra.
* Fix assertion in test_cameracalibration.cpp
The total number of refined 3D object coordinates is checked.
* Add checker for iFixedPoint in cvCalibrateCamera4
If iFixedPoint is out of rational range, fall back to standard method.
* Fix documentation for overloaded calibrateCamera()
* Remove calibration flag of CALIB_RELEASE_OBJECT
The method selection is based on the range of the index of fixed point.
For minus values, standard calibration method will be chosen. Values in
a rational range will make the object-releasing calibration method
selected.
* Use new interfaces instead of function overload
Existing interfaces are preserved and new interfaces are added. Since
most part of the code base are shared, calibrateCamera() is now a
wrapper function of calibrateCameraRO().
* Fix exported name of calibrateCameraRO()
* Update documentation for calibrateCameraRO()
The circumstances where this method is mostly helpful are described.
* Add note on the rigidity of the calibration target
* Update documentation for calibrateCameraRO()
It is clarified that iFixedPoint is used as a switch to select
calibration method. If input data are not qualified, exceptions will be
thrown instead of fallback scheme.
* Clarify iFixedPoint as switch and remove fallback
iFixedPoint is now used as a switch for calibration method selection. No
fallback scheme is utilized anymore. If the input data are not
qualified, exceptions will be thrown.
* Add badarg test for object-releasing method
* Fix document format of sample list
List items of same level should be indented the same way. Otherwise they
will be formatted as nested lists by Doxygen.
* Add brief intro for objectPoints and imagePoints
* Sync tutorial to sample calibration code
* Update tutorial compatibility version to 4.0
- avoid updating of input image during equalizeHist() call
- avoid for() with double variable (use 'int' instead)
- more CV_Check*() macros
- use Mat_<T>, Matx
- static for local variables
findChessboardCornersSB: speed improvements (#12615)
* chessboard: fix do not modify const image
* chessboard: speed up scale space using parallel_for
* chessboard: small improvements
* chessboard: speed up board growing using parallel_for
* chessboard: add flags for tuning detection
* chessboard: fix compiler warnings
* chessborad: change flag name to CALIB_CB_EXHAUSTIVE
This also fixes a typo
* chessboard: fix const ref + remove to_string
Before this fix, the code would fail if only standard deviations of
extrinsic parameters are requested. While standard deviations matrix
should be computed if any set of standard deviations is requested. A
variable is added to represent this case.
* add new chessboard detector
The chessboar detector is based on the paper.
Accurate Detection and Localization of Checkerboard Corners for
Calibration Alexander Duda, Udo Frese
British Machine Vision Conference, o.A., 2018.
It utilizes point symmetry of checkerboard corners in combination with a
localized Radon transform approximated by box filters to achieve high
performance even on large images. Here, tests have shown that the
ability to localize checkerboard corners is close to the theoretical
limit of 1/100 of a pixel while being considerably less sensitive
to image noise than standard methods.
* chessboard: add reference to bibtex file
* chessboard: add dependency to opencv_flann
* fix: test chesscorners. It is valid to return an empty list
In case no chessboard was detected it should be valid for the detector
to return an empty list.
For simplifcation, it should be allowed to return any number of corners
if they are flagged as not found.
* fix: opencv.bib remove empty lines
* fix: doc findChessboardCorners replace cvSize with cv::Size
* chessboard tests: factor out logic selecting detector
* chessboard: add unit test for findChessboardCorners2
This is includes a new chessboard generator which supports subpix
corners with high accuracy by wrapping an optimal chessboard using
wrapPerspective.
* fix: chessboard unit test - overwrite of default parameter flag of findCirclesGrid
* chessboard: remove trailing whitespace
* chessboard: fix debug drawing
* chessboard: fix some issues during code review
* chessboard: normalize asymmetric chessboard
* chessboard: fix float double warning
* remove trailing whitespace
* chessboards: fix compiler warnings
* chessboards: fix compiler warnings
* checkerboard: some performance improvements
* chessboard: remove NULL macros for language bindinges from internal headers
* chessboard: shorten license terms
* chessboard: remove unused internal method
* chessboard: set helper functions to static
* chessboard: fix normalizePoints1D using unshifted points
* chessboard: remove wrongly copied text
* chessboard: use CV_CheckTypeEQ macro
* chessboard: comment all NaN checks
* chessboard: use consistent color conversion
* chessboard: use CheckChannelEQ macro
* chessboard: assume gray color image for internal methods
* chessboard: use std::swap
* chessboard: use Mat.dataend
* chessboard: fix compiler warnings
* chessboard: replace some checks witch CV_CHECK macro
* chessboard: fix comparison function for partial sort
* chessboard: small cleanup
* chessboard: use short license header
* chessboard: rename findChessboard2 to findChessboardSB
* chessboard: fix type in unit test
* trying to fix the custom AVX2 builder test failures (false alarms)
* fixed compile error with CPU_BASELINE=AVX2 on x86; raised tolerance thresholds in a couple of tests
* fixed compile error with CPU_BASELINE=AVX2 on x86; raised tolerance thresholds in a couple of tests
* fixed compile error with CPU_BASELINE=AVX2 on x86; raised tolerance thresholds in a couple of tests
* seemingly disabled false alarm warning in surf.cpp; increased tolerance thresholds in the tests for SolvePnP and in DNN/ENet
* Add HPX backend for OpenCV implementation
Adds hpx backend for cv::parallel_for_() calls respecting the nstripes chunking parameter. C++ code for the backend is added to modules/core/parallel.cpp. Also, the necessary changes to cmake files are introduced.
Backend can operate in 2 versions (selectable by cmake build option WITH_HPX_STARTSTOP): hpx (runtime always on) and hpx_startstop (start and stop the backend for each cv::parallel_for_() call)
* WIP: Conditionally include hpx_main.hpp to tests in core module
Header hpx_main.hpp is included to both core/perf/perf_main.cpp and core/test/test_main.cpp.
The changes to cmake files for linking hpx library to above mentioned test executalbles are proposed but have issues.
* Add coditional iclusion of hpx_main.hpp to cpp cpu modules
* Remove start/stop version of hpx backend
* Add functionality to filter homography decompositions
* documentation + small refactor
* fix comparing int to size_t (compiler warning)
* fix whitespace issues
* clarification of function return values in documentation
* refactor of function parameters and change in loop nesting
* cleanup useless .h, fix size_t to int compare, small refactor
* fix documentation and whitespace
* change output from return value to outputarray parameter
* update function docs to reflect changes in parameters
* whitespace
* failing test
* fixed warnings related to extended initialisers and improper types
* initialize vectors from arrays
* initialize vectors from arrays part 2
* fix whitespace
* fix trailing whitespace
* Include <inttypes.h> in test_filter_homography_decomp.cpp, should fix 'uint8_t' : undeclared identifier error
* updated the test (made it shorter and providing better diagnostic) and significantly improved implementation (get rid of heavy repeated and/or unnecessary operations)
* fixed compile warning; removed trailing whitespace
fixes handling of empty matrices in some functions (#11634)
* a part of PR #11416 by Yuki Takehara
* moved the empty mat check in Mat::copyTo()
* fixed some test failures
* make tmpRow proper size before copyTo to avoid reallocated tmpCol
* do the transposition without creating temporary array; replace TAB with spaces.
* revert the previous commit
- removed tr1 usage (dropped in C++17)
- moved includes of vector/map/iostream/limits into ts.hpp
- require opencv_test + anonymous namespace (added compile check)
- fixed norm() usage (must be from cvtest::norm for checks) and other conflict functions
- added missing license headers
* Newton's method can be more efficient
when we get the result of function distortPoint with a point (0, 0) and then undistortPoint with the result, we get the point not (0, 0). and then we discovered that the old method is not convergence sometimes. finally we have gotten the right values by Newton's method.
* modify by advice Newton's method...#10574
* calib3d(fisheye): fix codestyle, update theta before exit EPS check
If there are no OpenCL/UMat methods calls from application.
OpenCL subsystem is initialized:
- haveOpenCL() is called from application
- useOpenCL() is called from application
- access to OpenCL allocator: UMat is created (empty UMat is ignored) or UMat <-> Mat conversions are called
Don't call OpenCL functions if OPENCV_OPENCL_RUNTIME=disabled
(independent from OpenCL linkage type)
Remove unnecessary Non-ASCII characters from source code (#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
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.
Enable p3p and ap3p in solvePnPRansac (#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
New p3p algorithm (accepted by CVPR 2017) (#8301)
* add p3p source code
* indent 4
* update publication info
* fix filename
* interface done
* plug in done, test needed
* debugging
* for test
* a working version
* clean p3p code
* test
* test
* fix warning, blank line
* apply patch from @catree
* add reference info
* namespace, indent 4
* static solveQuartic
* put small functions to anonymous namespace
Use identity matrix if homography finding failed. Current behavior zeros out all points.
Update circlesgrid.cpp
Addressed comments
Update circlesgrid.cpp
removed whitespace