Commit Graph

2919 Commits

Author SHA1 Message Date
fegorsch
ddf0554fff Use colon in "%YAML:1.0" directive when persisting to YAML-files
In YAML 1.0 the colon is mandatory. See http://yaml.org/spec/1.0/#id2558635.

This also allows prior releases to read YAML files created with the current version.
2016-10-25 18:18:35 +02: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
Vincent Rabaud
a89aa8c90a Fix imageSize overflow in IplImage 2016-10-20 11:23:45 +02:00
Vadim Pisarevsky
4acda3f609 Merge pull request #7428 from alalek:cmake_fix_compiler_flags_detection 2016-10-12 19:38:25 +00:00
Alexander Alekhin
994c682b77 Merge pull request #7455 from tomoaki0705:featureUniversalLkPyramid 2016-10-12 09:57:53 +00:00
Tomoaki Teshima
1ef740fa2c use universal intrinsic implementation for calcSharrDeriv 2016-10-11 20:32:33 +09:00
Alexander Alekhin
fe8501c931 ocl: fix SVM code 2016-10-10 20:52:30 +03:00
Alexander Alekhin
5da8d65371 eliminate compiler warnings 2016-10-08 02:19:43 +03:00
Vadim Pisarevsky
fad0598634 normHamming done with AVX 2 intrinsics (ver 2) (#7405)
* normHamming done with AVX 2 intrinsics.

* fixed compiling AVX2-optimized norm hamming with MSVC
2016-10-05 21:23:32 +04:00
Alexander Alekhin
0f03f692a9 Merge pull request #7403 from tomoaki0705:fixDuplicateInclude 2016-10-05 17:20:45 +00:00
Vadim Pisarevsky
83f2eb79f1 make sure that the empty mat is copied to UMat properly - i.e. UMat becomes empty. Before the patch such copy operation crashed 2016-10-05 14:07:50 +03:00
Tomoaki Teshima
f6350bdfa8 remove duplicated include 2016-10-05 06:53:34 +09:00
Vadim Pisarevsky
706862d5ba Merge pull request #7382 from alalek:ocl_build_fix_warnings 2016-10-04 12:08:22 +00:00
Alexander Alekhin
cecc1857dd Merge pull request #7373 from tomoaki0705:featureCannyUniversalIntrinsic 2016-10-04 10:52:13 +00:00
Alexander Alekhin
fef677f51a fix defines typo 2016-10-03 18:29:11 +03:00
Tomoaki Teshima
841ccccada use universal intrinsic in canny
* add v_abs for universal intrinsic
  * add test of v_abs in test_intrin
  * fix compile error on gcc
  * fix bool OR operation
2016-10-03 13:23:43 +09:00
Alexander Alekhin
411e551335 ocl: autogenerated code 2016-10-02 02:43:02 +03:00
Alexander Alekhin
a0add98b30 ocl: eliminate build warning
Templates are replaced by macro
2016-10-02 02:43:02 +03:00
Alexander Alekhin
1c18b1d245 Merge pull request #7370 from souch55:Fixxn 2016-10-01 10:44:56 +00:00
Alexander Alekhin
12e00827be cuda: fix fp16 compilation 2016-09-30 23:55:39 +03:00
sourin
a34fbf7bb1 Fixed identifiers warns 2016-09-30 15:16:29 +05:30
Alexander Alekhin
a9ab629f60 build: fix aarch64 build with aarch64-linux-gnu-g++-4.8 2016-09-29 17:26:19 +03:00
Alexander Alekhin
d34f2cfefe Merge pull request #7317 from tomoaki0705:fixIfdefFp16 2016-09-26 10:59:32 +00:00
Tomoaki Teshima
c7cb116dc0 check FP16 build condition correctly
* use __GNUC_MINOR__ in correct place to check the version of GCC
  * check processor support of FP16 at run time
  * check compiler support of FP16 and pass correct compiler option
  * rely on ENABLE_AVX on gcc since AVX is generated when mf16c is passed
  * guard correctly using ifdef in case of various configuration
  * use v_float16x4 correctly by including the right header file
2016-09-23 11:04:22 +09:00
Alexander Alekhin
f50f34016e test: fix test crash (exception in destructor) 2016-09-22 15:18:32 +03:00
Alexander Alekhin
d5c202e46b Merge pull request #7294 from tomoaki0705:fixBuildCudaAarch64 2016-09-16 14:27:18 +00:00
Pavel Vlasov
0a9470bf09 Compatibility fix for Visual Studio 2012; 2016-09-16 10:03:42 +03:00
Tomoaki Teshima
0db4b7cebb fix build error on CUDA + Aarch64
* __fp16 doesn't exist on nvcc, but it slips through ifdef guard
2016-09-16 08:06:14 +09:00
Sean McBride
5357e28a2f Removed some extra semi-colons
Fixes clang -Wextra-semi warnings.
2016-09-14 16:22:35 -04:00
Maksim Shabunin
4e918fb987 Merge pull request #7165 from PkLab:doc_videoio 2016-09-09 18:01:41 +00:00
PkLab.net
be65701908 Large update of videoio doc and samples following mshabunin comments 2016-09-09 18:46:11 +02:00
Alexander Alekhin
d855608e6e instrumentation: fix build on Linux
- enable C++11
- fix macro
2016-09-08 16:13:46 +03:00
Alexander Alekhin
10d18a315c instrumentation: minor refactoring, wrap OpenCL
- calculate ticksTotal instead of ticksMean
- local / global width is based on ticksTotal value
- added instrumentation for OpenCL program compilation
- added instrumentation for OpenCL kernel execution
2016-09-08 16:13:44 +03:00
Alexander Alekhin
f6208e3dea Merge pull request #7247 from valeriyvan:matrix 2016-09-08 09:49:02 +00:00
Alexander Alekhin
125e2dcbba Merge pull request #7156 from sovrasov:hal_qr_decomp 2016-09-08 09:47:52 +00:00
Alexander Alekhin
c8d77fd961 Merge pull request #7233 from tomoaki0705:featureUniversalIntrinsicFp16 2016-09-07 14:42:46 +00:00
Valeriy Van
c562f0ad38 Minor fix in MatAllocator::download
Minor fix in MatAllocator::upload
Minor fix in MatAllocator::copy
Minor fix in setSize function
Minor fix in Mat::Mat
Minor fix in cvMatNDToMat function
Minor fix in _InputArray::getMatVector
Minor fix in _InputArray::getUMatVector
Minor fix in cv::hconcat
Minor fix in cv::vconcat
Minor fix in cv::setIdentity
Minor fix in cv::trace
Minor fix in transposeI_ template function
Minor fix in reduceC_ template function
Minor fix in sort_ template function
Minor fix in sortIdx_ template function
Minor fix in cvRange function
Minor fix in MatConstIterator::seek
Minor fix in SparseMat::create
Minor fix in SparseMat::copyTo
Minor fix in SparseMat::convertTo
Minor fix in SparseMat::convertTo
Minor fix in SparseMat::ptr
Minor fix in SparseMat::resizeHashTab
Fixes indentation
2016-09-07 17:25:36 +03:00
Vladislav Sovrasov
dfe4519c07 Add QR decomposition to HAL 2016-09-05 18:20:04 +03:00
Sergey Alexandrov
765dd30981 Add support for GpuMat in InputArray::isContinuous() 2016-09-05 09:27:35 +02:00
Tomoaki Teshima
903789f7af use universal intrinsic for FP16
* use v_float16x4 (universal intrinsic) instead of raw SSE/NEON implementation
  * define v_load_f16/v_store_f16 since v_load can't be distinguished when short pointer passed
  * brush up implementation on old compiler (guard correctly)
  * add test for v_load_f16 and round trip conversion of v_float16x4
  * fix conversion error
2016-09-05 08:13:52 +09:00
Alexander Alekhin
d102ea96c0 Merge pull request #7210 from mshabunin:fix-warnings 2016-09-02 12:50:45 +00:00
Maksim Shabunin
28db4a2207 Merge pull request #7175 from tomoaki0705:featureIntrinsic64 2016-09-02 10:16:44 +00:00
Maksim Shabunin
dc704d77ac Fixed several GCC 5.x warnings 2016-09-01 15:44:01 +03:00
Maksim Shabunin
595fd2757c Merge pull request #7182 from mself:two_channel_universal_intrinsics 2016-08-31 10:11:43 +00:00
Tomoaki Teshima
7fef96be1e add 64F intrinsic in HAL NEON
* use universal intrinsic for accumulate series using float/double
  * accumulate, accumulateSquare, accumulateProduct and accumulateWeighted
  * add v_cvt_f64_high in both SSE/NEON
  * add test for conversion v_cvt_f64_high in test_intrin.cpp
  * improve some existing universal intrinsic by using new instructions in Aarch64
  * add workaround for Android build in intrin_neon.hpp
2016-08-30 17:21:02 +09:00
Alexander Alekhin
4e8f8922e2 Merge pull request #7170 from alalek:fix_build 2016-08-29 10:15:58 +00:00
Alexander Alekhin
da0e07bc1b Merge pull request #7177 from alalek:msvs_layout 2016-08-29 09:36:49 +00:00
Matthew Self
9678d48e1a 2-channel interleaved load/store for universal intrinsics (float only)
* Added 2-channel ops to match existing 3-channel and 4-channel ops

* v_load_deinterleave() and v_store_interleave()

* Implements float32x4 only on SSE (but all types on NEON and CPP)

* Includes tests

* Will be used to vectorize 2D functions, such as estimateAffine2D()
2016-08-26 18:17:08 -07:00
Vadim Pisarevsky
4f0f5a24ef Merge pull request #7158 from sturkmen72:documentation_fix 2016-08-26 11:40:19 +00:00
Alexander Alekhin
db6d94a7b0 cmake: minimize MSVS projects layout
Also put "object" targets to off by default (they doesn't work well)
2016-08-26 13:40:16 +03:00