Commit Graph

93 Commits

Author SHA1 Message Date
Alexander Alekhin
22dbcf98c5 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-11-17 14:17:35 +00:00
Alexander Alekhin
c4c31f5bba samples: use findFile() in "cpp" 2018-11-16 18:08:22 +00:00
Wenfeng CAI
31be03a805 Merge pull request #12772 from xoox:calib-release-object
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
2018-10-25 19:38:55 +03:00
catree
d02ecff881 Clarify the Euler angles convention chosen. Replace rotation inverse with matrix transpose. 2018-05-12 01:11:13 +02:00
Steven
6f4e35cc0e fix tutorial on real time pose estimation 2018-02-15 15:48:52 +01:00
Maksim Shabunin
2200e13c71 cmake: refactored scripts with samples building:
- allow installing samples sources on all platforms
  even if BUILD_EXAMPLES is disabled,  fixed minor
  issues in sources installation process
- use 'example_<group>_<name>' scheme for target and binary file naming
- use single function for sample executable creation
2018-02-12 18:42:36 +03:00
Maksim Shabunin
633b0e56a5 Fixed compilation warnings in samples:
- use per-module includes instead of "opencv.hpp"
- unused function warnings
- undefined macro warning
2018-02-12 18:42:36 +03:00
luz.paz
dbb57cd0ae Misc. ./samples typos
Found via `codespell -q 3 --skip="./3rdparty" -I ../opencv-whitelist.txt`
2018-02-08 05:52:08 -05:00
Alexander Alekhin
35738bcadd samples: remove orphan documentation snippet: SBM_Sample.cpp 2018-01-31 18:54:08 +00:00
Alexander Alekhin
c95a97389d Merge pull request #9235 from sturkmen72:patch-3 2017-08-03 17:04:28 +00:00
Ryan Pavlik
5d699e9ba5 Honor fixing principal point in camera calib tutorial. 2017-08-01 10:35:18 -05:00
Suleyman TURKMEN
89480801b8 some improvements on tutorials 2017-07-29 20:08:19 +03:00
Tony Lian
c8783f3e23 Merge pull request #9075 from TonyLianLong:master
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
2017-07-03 16:14:17 +00:00
umbraclet16
17ece5861a Solve issue #8264
Fix bug in camera_calibration.cpp that the program tries to
parse input of type VIDEO_FILE as IMAGE_LIST which causes the
program to crash.
2017-02-28 13:31:24 +03:00
StevenPuttemans
6d34d6b47e update samples: waitKey() usage
Original commit is a5f19f7dd6
2016-12-15 15:39:47 +03:00
Vladislav Sovrasov
46c8b09453 Improvements in camera_calibration tutorial code 2016-08-08 12:07:04 +03:00
Suleyman TURKMEN
11ca1c95f8 update cpp samples and tutorials 2016-06-26 20:55:00 +03:00
Enes Ateş
769fe82743 XML file path correction
in documentation exact path is images/CameraCalibration/VID5
2015-09-23 13:19:17 +02:00
Vadim Pisarevsky
6208ab4e49 Merge pull request #5304 from paroj:calib_feye 2015-09-09 11:00:40 +00:00
Pavel Rojtberg
d0e16b21d4 add support for fisheye camera model 2015-09-04 15:54:34 +02:00
berak
dc265071d0 Update PnPProblem.cpp 2015-09-04 10:57:33 +02:00
Pavel Rojtberg
7c5084e385 - update documentation
* correct the part about fixed aspect
    * improve formatting
    * add snippet markers to source
    * replace inline code by @snippet
  - do not run calibration twice when using a imageList
  - make output consistent in itself (CamelCase vs no_camel_case) as well as with old camera calibrate sample
  - respect write extrinsic/ points flags
  - set the aspectRatio value when specified
  - fix writing of calibration settings. also update grammar.
  - fix intendation and remove some size_t -> int casts by using size_t
2015-03-31 15:45:57 +02:00
Vadim Pisarevsky
d2b9dc5530 quickly corrected the previous refactoring of features2d: moved from set(SOME_PROP, val) to setSomeProp(val) 2014-10-18 20:44:26 +04:00
Vadim Pisarevsky
d36b546df8 trying to fix strange compiler bug 2014-10-17 14:56:58 +04:00
Vadim Pisarevsky
06d4aa6060 now all the samples and opencv_contrib compile! 2014-10-17 14:56:58 +04:00
edgarriba
7e2bb63378 Merge branch 'master' of https://github.com/Itseez/opencv 2014-08-18 22:30:00 +02:00
Adil Ibragimov
8a4a1bb018 Several type of formal refactoring:
1. someMatrix.data -> someMatrix.prt()
2. someMatrix.data + someMatrix.step * lineIndex -> someMatrix.ptr( lineIndex )
3. (SomeType*) someMatrix.data -> someMatrix.ptr<SomeType>()
4. someMatrix.data -> !someMatrix.empty() ( or !someMatrix.data -> someMatrix.empty() ) in logical expressions
2014-08-13 15:21:35 +04:00
edgarriba
301ed34142 removed old headers 2014-08-12 17:36:23 +02:00
edgarriba
7da9800694 removed old headers 2014-08-12 17:22:35 +02:00
edgarriba
4a214c08e5 removed old code 2014-08-12 17:07:38 +02:00
edgarriba
afdb67b462 SOLVEPNP_* flags 2014-08-11 16:28:09 +02:00
edgarriba
b7a19a9a5f Removed Timer 2014-08-11 11:06:05 +02:00
edgarriba
c7f6c0cb9f Fixed warnings + RANSAC confidence to double 2014-08-11 10:17:42 +02:00
edgarriba
bc250c2e3f bug fixed 2014-08-09 19:15:46 +02:00
edgarriba
80b4f99b1e bug fixed 2014-08-09 18:16:44 +02:00
edgarriba
d09b404178 tutorial update 2014-08-09 17:32:52 +02:00
edgarriba
7ecad71ab0 fixed warnings 2014-08-09 17:18:47 +02:00
edgarriba
8c4b8cc0b4 fixed warnings 2014-08-09 17:14:24 +02:00
edgarriba
3f5d3b2d40 video opening path modified 2014-08-08 15:36:27 +02:00
edgarriba
7d8a16ae39 remove unused tutorials 2014-08-08 14:45:43 +02:00
edgarriba
8b732e086d updated ransanc model 2014-08-08 13:52:15 +02:00
edgarriba
c07cd007eb Multi class tutorial compilation 2014-08-08 11:46:26 +02:00
edgarriba
8c08258cf2 moved headers 2014-08-07 13:06:24 +02:00
edgarriba
837f001789 update cmake 2014-08-07 11:55:17 +02:00
edgarriba
381574bdb7 Modified cmake 2014-08-07 11:33:32 +02:00
edgarriba
f1b6809eee Updated Utils functions 2014-08-06 10:05:26 +02:00
edgarriba
2881f2a096 Fixed warnings 2014-08-06 09:21:38 +02:00
edgarriba
d2665b655e Fixed warnings 2014-08-06 08:41:14 +02:00
edgarriba
e14f91dd37 Update headers 2014-08-06 08:18:11 +02:00
edgarriba
ddf5c86f3a Added code 2014-08-06 08:12:55 +02:00