Commit Graph

43 Commits

Author SHA1 Message Date
catree
1852d0b9b8 Add flags to set the camera intrinsic parameters as an initial guess (can allow converging to the correct camera intrinsic parameters).
Add -imshow-scale flag to resize the image when displaying the results.
Add -enable-k3 flag to enable or disable the estimation of the K3 distortion coefficient.
2022-08-30 00:45:47 +02:00
Sean McBride
35f1a90df7
Merge pull request #22149 from seanm:sprintf
Replaced sprintf with safer snprintf

* Straightforward replacement of sprintf with safer snprintf

* Trickier replacement of sprintf with safer snprintf

Some functions were changed to take another parameter: the size of the buffer, so that they can pass that size on to snprintf.
2022-06-25 06:48:22 +03:00
Quella Zhang (Beyondsoft Corporation)
5105a937d1 Add namespace specifier for format() 2021-04-21 14:08:52 +08:00
Alexander Alekhin
d4a17da7b2 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-03-04 20:49:09 +00:00
MoonChasing
98db891851 using argv[0] represent binary executable files' name in help() function
in sample codes instead of cpp files' name.
2020-02-28 20:36:56 +08:00
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
StevenPuttemans
6d34d6b47e update samples: waitKey() usage
Original commit is a5f19f7dd6
2016-12-15 15:39:47 +03:00
ValeryTyumen
297808e6b9 Feature #3957 2015-12-17 18:19:39 +03: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
vbystricky
d58f736935 Split highgui module to videoio and highgui 2014-07-14 23:16:47 +04:00
vbystricky
4286f60387 Extract imgcodecs module from highgui 2014-07-07 16:28:08 +04:00
Andrey Kamaev
e5a33723fc Move C API of opencv_calib3d to separate file 2013-04-11 21:00:17 +04:00
Andrey Kamaev
288a0634c2 Make imgproc.hpp independent from C API 2013-04-08 15:47:28 +04:00
Andrey Kamaev
89356ff16d Move non-CV functionality from core.hpp to separate utility.hpp header 2013-03-20 17:56:06 +04:00
Andrey Kamaev
9944282b09 Fix build with STLPort from NDK r8d 2012-12-22 00:59:56 +04:00
Andrey Kamaev
bd0e0b5800 Merged the trunk r8589:8653 - all changes related to build warnings 2012-06-15 13:04:17 +00:00
Vadim Pisarevsky
4985c1b632 fixed hundreds of warnings from MSVC 2010. 2012-03-16 21:21:04 +00:00
itsyplen
3876cf22e3 reverted samples with new command argument parser. will be continued after OpenCV release. 2011-06-09 12:01:47 +00:00
itsyplen
2e7e6ae84b Update sample: change help and added CommandLineParser using 2011-06-09 08:04:33 +00:00
Ilya Lysenkov
686063689c Fixed #886 2011-05-30 08:01:09 +00:00
Ilya Lysenkov
3474e37037 Fixed #1063 2011-05-30 06:18:52 +00:00
Gary Bradski
975ecaca7d added output camera id if it fails 2011-02-13 04:09:58 +00:00
Ilya Lysenkov
3e43bc579b Modified the calibration sample to work with asymmetric pattern 2011-02-07 07:59:01 +00:00
Ilya Lysenkov
bdf6f0258c Changed the camera calibration sample to support circles' grid pattern 2010-12-21 09:32:14 +00:00
Gary Bradski
3c57612f42 revamped 2010-12-04 08:24:28 +00:00
Vadim Pisarevsky
3fd07809c9 make cv::calibrateCamera, cv::stereoCalibrate and their C counterparts return the standard RMS error. 2010-11-30 10:27:34 +00:00
Vadim Pisarevsky
2b660bf554 added flag to treat input file as a videofile (patch by Ethan Rublee; ticket #392) 2010-11-29 23:16:41 +00:00
Vadim Pisarevsky
1286c1db45 fixed multiple warnings from VS2010. 2010-11-25 16:55:46 +00:00
Gary Bradski
d0d7ba9985 added and moved docs 2010-11-24 01:44:36 +00:00
Ethan Rublee
2e9136259d Adding two samples that deal with FileStorage - useful for creating image lists 2010-11-20 21:37:09 +00:00
Ethan Rublee
9ee954a0c6 Made calibration a bit faster in the absense of a checkboard and trying to fix
a crash with the libv4l capture code
2010-11-01 06:20:36 +00:00
Ethan Rublee
e842a0c816 change int to char so that keys are registered properly, maybe this breaks others though 2010-10-20 18:49:44 +00:00
Vadim Pisarevsky
31dbefc865 added 3-camera rectification and 8-coeff distortion model 2010-09-07 15:38:48 +00:00
Yannick Verdie
3746c48451 Bug in calibration.cpp sample
This was crashing my code:
    for( size_t i = 1; i < imagePoints.size(); i++ )
        objectPoints.push_back(objectPoints[0]);

Changed by:
objectPoints.resize(imagePoints.size(),objectPoints[0]);

Plus clean up on Qt code
2010-08-18 15:35:56 +00:00
Vadim Pisarevsky
9c94a96c40 repaired aspect ratio option; fixed comments 2010-08-03 11:28:39 +00:00
Vadim Pisarevsky
08cba33f9d fixed some more MSVC2010 warnings 2010-07-17 10:35:17 +00:00
Gary Bradski
730de4d8c3 Fixed crash if no chessboard problem 2010-07-14 00:32:35 +00:00
Vadim Pisarevsky
db82906067 fix build with GCC 3.3 on Ubuntu 8.04 2010-07-09 09:09:20 +00:00
Vadim Pisarevsky
4eda856cd5 squareSize renamed to square_size in the output xml/yml 2010-06-24 07:56:57 +00:00
Vadim Pisarevsky
b2244f87ac improved the calibration and select3dobj samples 2010-06-13 19:08:24 +00:00
Vadim Pisarevsky
654d447661 calibration sample rewritten using the C++ API 2010-06-13 03:50:29 +00:00