Commit Graph

863 Commits

Author SHA1 Message Date
Vadim Pisarevsky
12d7429ff0 Merge pull request #8064 from terfendail:sgbm_bigbuffer 2017-02-23 20:11:26 +00:00
Vitaly Tuzov
4950f542d1 Fix for SGBM compute() buffer allocation failure on big images 2017-02-08 12:49:21 +03:00
Alexander Alekhin
124c4825a7 Merge pull request #8089 from hrnr:estimate_convert_fix
fix wrong conversion in estimateAffine2D* functions
2017-01-30 16:53:50 +03:00
Jiri Horner
4ee25c7e95 add test for convertions in estimateAffine2D* functions
test with integer points to cover conversion bugs.
2017-01-27 22:16:58 +01:00
Jiri Horner
9408a5ef5d fix conversion bug in estimateAffine2D* functions
functions support points to have other datatypes than floats.

* fix bug in coversion that overwrites src points with dst points
2017-01-27 16:55:29 +01:00
Alexander Alekhin
c1dec72fb6 java: force 64F in solvePnP test 2017-01-25 19:42:09 +03:00
Alexander Alekhin
3413c23b34 Merge pull request #8061 from tomoaki0705:universalIntrinsicStereoCalib3d 2017-01-25 16:08:02 +00:00
Pavel Rojtberg
3e708e015c solvePnP: use CV_32F for rvec, tvec if all PnP inputs are CV_32F 2017-01-24 18:17:46 +01:00
Tomoaki Teshima
b34ebc8cfe use universal intrinsic in stereo matching
- check SIMD availability before executing
2017-01-24 18:25:22 +09:00
Vadim Pisarevsky
c0cde75d54 Merge pull request #7975 from tomoaki0705:cleanupCalib3dStereo 2017-01-10 11:12:15 +00:00
Tomoaki Teshima
f1aae52daf clean up unused #if 2017-01-06 18:23:45 +09:00
Duncan Barber
1c3b9d7591 Tiny documentation fix in stereoCalibrate
Modified the (R2,T2) computation documentation in the stereoCalibrate function documentation to display on two lines for clarity
2017-01-04 21:24:25 +00:00
Alexander Alekhin
ca6beb9ca8 calib3d: fix InputArray -> CvMat 2016-12-22 04:22:46 +03:00
Alexander Alekhin
0e4dde1781 Merge pull request #7872 from alalek:merge-2.4 2016-12-16 16:03:14 +02:00
mshabunin
bfde5cdde0 SGBM: fixed uninitialized memory in cost buffer 2016-12-15 19:08:14 +03:00
Alexander Alekhin
8f83d97adc Merge pull request #7800 from paroj:fisheye_undist 2016-12-14 03:17:49 +00:00
Alexander Alekhin
a24ebc9952 Merge pull request #7840 from alalek:fix_test_rng 2016-12-13 11:29:53 +00:00
Alexander Alekhin
ec859ceb2c test: limit chessboard generator parameters 2016-12-12 18:09:52 +03:00
Vladislav Sovrasov
120531cb46 Fix error threshhold in SolvePnPRansac 2016-12-12 13:22:44 +03:00
catree
a93c70f533 Add note about solvePnP methods that cannot be used.
Add note: SOLVEPNP_EPNP will be used instead of SOLVEPNP_DLS and instead of SOLVEPNP_UPNP.
2016-12-09 13:15:52 +01:00
Pavel Rojtberg
2bfcbe1459 fisheye::undistortPoints: sanitize theta values
the current camera model is only valid up to 180° FOV for larger FOV the
undistort loop does not converge.
Clip values so we still get plausible results for super fisheye images >
180°.
2016-12-06 14:16:37 +01:00
Vadim Pisarevsky
a53f93ff8d Merge pull request #7710 from alalek:debug_check_matrelease 2016-11-25 14:24:23 +00:00
Pavel Rojtberg
e1503cc29e calibrateCamera: specifiy what kind of re-projection error is returned 2016-11-24 14:02:01 +01:00
Alexander Alekhin
a936cb087e calib3d: fix fisheye for test fisheyeTest.stereoCalibrateFixIntrinsic 2016-11-23 13:51:37 +03:00
Alexander Alekhin
30cdcfa554 warnings 2016-11-18 14:08:53 +03:00
Pavel Rojtberg
25061b4280 convertPointsToHomogeneous: fix output type for depth == CV_32S 2016-11-09 11:35:12 +01:00
Vadim Pisarevsky
bebd49d91b Merge pull request #7467 from tomoaki0705:featureCheckSimdUniversal 2016-11-02 12:30:55 +00:00
Vadim Pisarevsky
8944875258 Merge pull request #7526 from alalek:fix_arm_builds 2016-11-02 10:49:43 +00:00
abratchik
f978ee613e fix for #7510, #7511 and #7512 2016-10-31 11:07:56 +04:00
Alexander Alekhin
4c66772783 Merge pull request #7516 from sovrasov:find_contours_fix 2016-10-30 08:33:12 +00:00
Tomoaki Teshima
cba22349b7 add universal hardware support check function
* use hasSIMD128 rather than calling checkHardwareSupport
  * add SIMD check in spartialgradient.cpp
  * add SIMD check in stereosgbm.cpp
  * add SIMD check in canny.cpp
2016-10-29 13:24:31 +09:00
Tomoaki Teshima
b823c8e95c add universal intrinsic in StereoSGBM
* add 8 elements version of reduce operation
  * add tests for new universal intrinsic
2016-10-28 21:47:13 +09:00
Vladislav Sovrasov
c55890f637 Enable chessboard detector test on Ubuntu 2016-10-25 11:53:53 +03:00
Alexander Alekhin
de35c59ba4 Merge pull request #7517 from paroj:pp_dpdf 2016-10-22 16:16:24 +00:00
Jiri Horner
c17afe0fab Merge pull request #6933 from hrnr:gsoc_all
[GSOC] New camera model for stitching pipeline

* implement estimateAffine2D

estimates affine transformation using robust RANSAC method.

* uses RANSAC framework in calib3d
* includes accuracy test
* uses SVD decomposition for solving 3 point equation

* implement estimateAffinePartial2D

estimates limited affine transformation

* includes accuracy test

* stitching: add affine matcher

initial version of matcher that estimates affine transformation

* stitching: added affine transform estimator

initial version of estimator that simply chain transformations in homogeneous coordinates

* calib3d: rename estimateAffine3D test

test Calib3d_EstimateAffineTransform rename to Calib3d_EstimateAffine3D. This is more descriptive and prevents confusion with estimateAffine2D tests.

* added perf test for estimateAffine functions

tests both estimateAffine2D and estimateAffinePartial2D

* calib3d: compare error in square in estimateAffine2D

* incorporates fix from #6768

* rerun affine estimation on inliers

* stitching: new API for parallel feature finding

due to ABI breakage new functionality is added to `FeaturesFinder2`, `SurfFeaturesFinder2` and `OrbFeaturesFinder2`

* stitching: add tests for parallel feature find API

* perf test (about linear speed up)
* accuracy test compares results with serial version

* stitching: use dynamic_cast to overcome ABI issues

adding parallel API to FeaturesFinder breaks ABI. This commit uses dynamic_cast and hardcodes thread-safe finders to avoid breaking ABI.

This should be replaced by proper method similar to FeaturesMatcher on next ABI break.

* use estimateAffinePartial2D in AffineBestOf2NearestMatcher

* add constructor to AffineBestOf2NearestMatcher

* allows to choose between full affine transform and partial affine transform. Other params are the as for BestOf2NearestMatcher
* added protected field

* samples: stitching_detailed support affine estimator and matcher

* added new flags to choose matcher and estimator

* stitching: rework affine matcher

represent transformation in homogeneous coordinates

affine matcher: remove duplicite code
rework flow to get rid of duplicite code

affine matcher: do not center points to (0, 0)
it is not needed for affine model. it should not affect estimation in any way.

affine matcher: remove unneeded cv namespacing

* stitching: add stub bundle adjuster

* adds stub bundle adjuster that does nothing
* can be used in place of standard bundle adjusters to omit bundle adjusting step

* samples: stitching detailed, support no budle adjust

* uses new NoBundleAdjuster

* added affine warper

* uses R to get whole affine transformation and propagates rotation and translation to plane warper

* add affine warper factory class

* affine warper: compensate transformation

* samples: stitching_detailed add support for affine warper

* add Stitcher::create method

this method follows similar constructor methods and returns smart pointer. This allows constructing Stitcher according to OpenCV guidelines.

* supports multiple stitcher configurations (PANORAMA and SCANS) for convenient setup
* returns cv::Ptr

* stitcher: dynamicaly determine correct estimator

we need to use affine estimator for affine matcher

* preserves ABI (but add hints for ABI 4)
* uses dynamic_cast hack to inject correct estimator

* sample stitching: add support for multiple modes

shows how to use different configurations of stitcher easily (panorama stitching and scans affine model)

* stitcher: find features in parallel

use new FeatureFinder API to find features in parallel. Parallelized using TBB.

* stitching: disable parallel feature finding for OCL

it does not bring much speedup to run features finder in parallel when OpenCL is enabled, because finder needs to wait for OCL device.

Also, currently ORB is not thread-safe when OCL is enabled.

* stitching: move matcher tests

move matchers tests perf_stich.cpp -> perf_matchers.cpp

* stitching: add affine stiching integration test

test basic affine stitching (SCANS mode of stitcher) with images that have only translation between them

* enable surf for stitching tests

stitching.b12 test was failing with surf

investigated the issue, surf is producing good result. Transformation is only slightly different from ORB, so that resulting pano does not exactly match ORB's result. That caused sanity check to fail.

* added size checks similar to other tests
* sanity check will be applied only for ORB

* stitching: fix wrong estimator choice

if case was exactly wrong, estimators were chosen wrong

added logging for estimated transformation

* enable surf for matchers stitching tests

* enable SURF
* rework sanity checking. Check estimated transform instead of matches. Est. transform should be more stable and comparable between SURF and ORB.
* remove regression checking for VectorFeatures tests. It has a lot if data andtest is the same as previous except it test different vector size for performance, so sanity checking does not add any value here. Added basic sanity asserts instead.

* stitching tests: allow relative error for transform

* allows .01 relative error for estimated homography sanity check in stitching matchers tests
* fix VS warning

stitching tests: increase relative error

increase relative error to make it pass on all platforms (results are still good).

stitching test: allow bigger relative error

transformation can differ in small values (with small absolute difference, but large relative difference). transformation output still looks usable for all platforms. This difference affects only mac and windows, linux passes fine with small difference.

* stitching: add tests for affine matcher

uses s1, s2 images. added also new sanity data.

* stitching tests: use different data for matchers tests

this data should yeild more stable transformation (it has much more matches, especially for surf). Sanity data regenerated.

* stitching test: rework tests for matchers

* separated rotation and translations as they are different by scale.
* use appropriate absolute error for them separately. (relative error does not work for values near zero.)

* stitching: fix affine warper compensation

calculation of rotation and translation extracted for plane warper was wrong

* stitching test: enable surf for opencl integration tests

* enable SURF with correct guard (HAVE_OPENCV_XFEATURES2D)
* add OPENCL guard and correct namespace as usual for opencl tests

* stitching: add ocl accuracy test for affine warper

test consistent results with ocl on and off

* stitching: add affine warper ocl perf test

add affine warper to existing warper perf tests. Added new sanity data.

* stitching: do not overwrite inliers in affine matcher

* estimation is run second time on inliers only, inliers produces in second run will not be therefore correct for all matches

* calib3d: add Levenberg–Marquardt refining to estimateAffine2D* functions

this adds affine Levenberg–Marquardt refining to estimateAffine2D functions similar to what is done in findHomography.

implements Levenberg–Marquardt refinig for both full affine and partial affine transformations.

* stitching: remove reestimation step in affine matcher

reestimation step is not needed. estimateAffine2D* functions are running their own reestimation on inliers using the Levenberg-Marquardt algorithm, which is better than simply rerunning RANSAC on inliers.

* implement partial affine bundle adjuster

bundle adjuster that expect affine transform with 4DOF. Refines parameters for all cameras together.

stitching: fix bug in BundleAdjusterAffinePartial

* use the invers properly
* use static buffer for invers to speed it up

* samples: add affine bundle adjuster option to stitching_detailed

* add support for using affine bundle adjuster with 4DOF
* improve logging of initial intristics

* sttiching: add affine bundle adjuster test

* fix build warnings

* stitching: increase limit on sanity check

prevents spurious test failures on mac. values are still pretty fine.

* stitching: set affine bundle adjuster for SCANS mode

* fix bug with AffineBestOf2NearestMatcher (we want to select affine partial mode)
* select right bundle adjuster

* stitching: increase error bound for matcher tests

* this prevents failure on mac. tranformation is still ok.

* stitching: implement affine bundle adjuster

* implements affine bundle adjuster that is using full affine transform
* existing test case modified to test both affinePartial an full affine bundle adjuster

* add stitching tutorial

* show basic usage of stitching api (Stitcher class)

* stitching: add more integration test for affine stitching

* added new datasets to existing testcase
* removed unused include

* calib3d: move `haveCollinearPoints` to common header

* added comment to make that this also checks too close points

* calib3d: redone checkSubset for estimateAffine* callback

* use common function to check collinearity
* this also ensures that point will not be too close to each other

* calib3d: change estimateAffine* functions API

* more similar to `findHomography`, `findFundamentalMat`, `findEssentialMat` and similar
* follows standard recommended semantic INPUTS, OUTPUTS, FLAGS
* allows to disable refining
* supported LMEDS robust method (tests yet to come) along with RANSAC
* extended docs with some tips

* calib3d: rewrite estimateAffine2D test

* rewrite in googletest style
* parametrize to test both robust methods (RANSAC and LMEDS)
* get rid of boilerplate

* calib3d: rework estimateAffinePartial2D test

* rework in googletest style
* add testing for LMEDS

* calib3d: rework estimateAffine*2D perf test

* test for LMEDS speed
* test with/without Levenberg-Marquart
* remove sanity checking (this is covered by accuracy tests)

* calib3d: improve estimateAffine*2D tests

* test transformations in loop
* improves test by testing more potential transformations

* calib3d: rewrite kernels for estimateAffine*2D functions

* use analytical solution instead of SVD
* this version is faster especially for smaller amount of points

* calib3d: tune up perf of estimateAffine*2D functions

* avoid copying inliers
* avoid converting input points if not necessary
* check only `from` point for collinearity, as `to` does not affect stability of transform

* tutorials: add commands examples to stitching tutorials

* add some examples how to run stitcher sample code
* mention stitching_detailed.cpp

* calib3d: change computeError for estimateAffine*2D

* do error computing in floats instead of doubles

this have required precision + we were storing the result in float anyway. This make code faster and allows auto-vectorization by smart compilers.

* documentation: mention estimateAffine*2D function

* refer to new functions on appropriate places
* prefer estimateAffine*2D over estimateRigidTransform

* stitching: add camera models documentations

* mention camera models in module documentation to give user a better overview and reduce confusion
2016-10-22 19:10:42 +03:00
Sean McBride
943ac96526 Eliminated use of obsolete 'register' keyword
Fixes clang warnings about uses of this obsolete keyword.
2016-10-20 20:19:14 -04:00
Alexander Alekhin
4439ba09f9 test: update condition for Calib3d_StereoCalibrate 2016-10-20 16:54:40 +03:00
Alexander Alekhin
db451f20df test: don't use points on single line for solvePnP 2016-10-20 16:54:38 +03:00
Pavel Rojtberg
01b592c8e1 calibrateCamera: mask f_x when using FIX_ASPECT_RATIO
this avoids a singular Jacobian such that LM converges when DECOMP_LU is
used.
2016-10-19 14:20:39 +02:00
catree
ce7811e5dd Add distortion example images for calib3d documentation. 2016-10-09 20:35:58 +02:00
StevenPuttemans
524c61279b replace principle by principal 2016-10-06 14:09:26 +02:00
Vadim Pisarevsky
3bd5055af1 Merge pull request #7336 from K-Shinotsuka:issue23 2016-10-04 12:29:46 +00:00
Alexander Alekhin
1c18b1d245 Merge pull request #7370 from souch55:Fixxn 2016-10-01 10:44:56 +00:00
k-shinotsuka
1a51a96de2 fixed the difference of the calculation result for findStereoCorrespondenceBM_SSE2() and findStereoCorrespondenceBM_(). 2016-10-01 16:26:35 +09:00
sourin
a34fbf7bb1 Fixed identifiers warns 2016-09-30 15:16:29 +05:30
Maksim Shabunin
b8bce55270 Several chessboard detector improvements:
- fixed uninitialized memory access and memory leaks
- extracted several code blocks to separate functions
- updated part of algorithm to use cv::Mat instead of CvMat and IplImage
2016-09-22 19:25:04 +03:00
Vadim Pisarevsky
fbc44bcb78 Merge pull request #6845 from jbosch:master 2016-09-22 11:57:06 +00:00
Vladislav Sovrasov
dfe4519c07 Add QR decomposition to HAL 2016-09-05 18:20:04 +03:00
Matthew Self
7de2e1e795 Improve perfomance of median calculation in LMedS algorithm
* Use `nth_element()` to find the median instead of `sort()` in `LMeDSPointSetRegistrator::run()`

* Improves performance of this part of LMedS from `n log(n)` to `n` by avoiding doing a full sort.

* Makes LMedS 2x faster for 100 points, 4x faster for 5,000 points in `EstimateAffine2D()`.

* LMedS is now never more than 2x slower than RANSAC and is faster in some cases.
2016-08-26 20:39:38 -07:00
Suleyman TURKMEN
fcc28fecb6 Make Up 2016-08-23 22:17:30 +03:00