opencv/modules
Jiri Horner bb6496d9e5 Merge pull request #8951 from hrnr:akaze_part2
[GSOC] Speeding-up AKAZE, part #2 (#8951)

* feature2d: instrument more functions used in AKAZE

* rework Compute_Determinant_Hessian_Response

* this takes 84% of time of Feature_Detection
* run everything in parallel
* compute Scharr kernels just once
* compute sigma more efficiently
* allocate all matrices in evolution without zeroing

* features2d: add one bigger image to tests

* now test have images: 600x768, 900x600 and 1385x700 to cover different resolutions

* explicitly zero Lx and Ly

* add Lflow and Lstep to evolution as in original AKAZE code

* reworked computing keypoints orientation

integrated faster function from https://github.com/h2suzuki/fast_akaze

* use standard fastAtan2 instead of getAngle

* compute keypoints orientation in parallel

* fix visual studio warnings

* replace some wrapped functions with direct calls to OpenCV functions

* improved readability for people familiar with opencv
* do not same image twice in base level

* rework diffusity stencil

* use one pass stencil for diffusity from https://github.com/h2suzuki/fast_akaze
* improve locality in Create_Scale_Space

* always compute determinat od hessian and spacial derivatives

* this needs to be computed always as we need derivatives while computing descriptors
* fixed tests of AKAZE with KAZE descriptors which have been affected by this

Currently it computes all first and second order derivatives together and the determiant of the hessian. For descriptors it would be enough to compute just first order derivates, but it is not probably worth it optimize for scenario where descriptors and keypoints are computed separately, since it is already very inefficient. When computing keypoint and descriptors together it is faster to do it the current way (preserves locality).

* parallelize non linear diffusion computation

* do multiplication right in the nlp diffusity kernel

* rework kfactor computation

* get rid of sharing buffers when creating scale space pyramid, the performace impact is neglegible

* features2d: initialize TBB scheduler in perf tests

* ensures more stable output
* more reasonable profiles, since the first call of parallel_for_ is not getting big performace hit

* compute_kfactor: interleave finding of maximum and computing distance

* no need to go twice through the data

* start to use UMats in AKAZE to leverage OpenCl in the future

* fixed bug that prevented computing determinant for scale pyramid of size 1 (just the base image)
* all descriptors now support writing to uninitialized memory
* use InputArray and OutputArray for input image and descriptors, allows to make use UMAt that user passes to us

* enable use of all existing ocl paths in AKAZE

* all parts that uses ocl-enabled functions should use ocl by now

* imgproc: fix dispatching of IPP version when OCL is disabled

* when OCL is disabled IPP version should be always prefered (even when the dst is UMat)

* get rid of copy in DeterminantHessian response

* this slows CPU version considerably
* do no run in parallel when running with OCL

* store derivations as UMat in pyramid

* enables OCL path computing of determint hessian
* will allow to compute descriptors on GPU in the future

* port diffusivity to OCL

* diffusivity itself is not a blocker, but this saves us downloading and uploading derivations

* implement kernel for nonlinear scalar diffusion step

* download the pyramid from GPU just once

we don't want to downlaod matrices ad hoc from gpu when the function in AKAZE needs it. There is a HUGE mapping overhead and without shared memory support a LOT of unnecessary transfers.

This maps/downloads matrices just once.

* fix bug with uninitialized values in non linear diffusion

* this was causing spurious segfaults in stitching tests due to propagation of NaNs
* added new test, which checks for NaNs (added new debug asserts for NaNs)
* valgrind now says everything is ok

* add nonlinear diffusion step OCL implementation

* Lt in pyramid changed to UMat, it will be downlaoded from GPU along with Lx, Ly
* fix bug in pm_g2 kernel. OpenCV mangles dimensions passed to OpenCL, so we need to check for boundaries in each OCL kernel.

* port computing of determinant to OCL

* computing of determinant is not a blocker, but with this change we don't need to download all spatial derivatives to CPU, we only download determinant
* make Ldet in the pyramid UMat, download it from CPU together with the other parts of the pyramid
* add profiling macros

* fix visual studio warning

* instrument non_linear_diffusion

* remove changes I have made to TEvolution

* TEvolution is used only in KAZE now

* Revert "features2d: initialize TBB scheduler in perf tests"

This reverts commit ba81e2a711.
2017-08-01 12:46:01 +00:00
..
calib3d Merge pull request #9225 from paroj:reproject_cpp 2017-07-31 14:11:37 +00:00
core Merge pull request #9274 from alalek:ipp_meanstddev 2017-07-31 12:02:59 +00:00
cudaarithm suppress warning on Jetson TK1 2017-06-15 18:28:13 +09:00
cudabgsegm Rewritten some tests in videoio and imgcodecs modules 2017-06-20 18:20:41 +03:00
cudacodec build: replace WIN32 => _WIN32 2017-07-25 13:30:48 +03:00
cudafeatures2d test: fix cuda build 2016-11-29 01:18:10 +03:00
cudafilters Remove redundant precomp.hpp and using-namespace 2017-05-14 21:35:53 +09:00
cudaimgproc Merge pull request #8367 from khnaba:cuda-calchist-with-mask 2017-03-15 09:34:00 +00:00
cudalegacy Rewritten some tests in videoio and imgcodecs modules 2017-06-20 18:20:41 +03:00
cudaobjdetect Merge pull request #9075 from TonyLianLong:master 2017-07-03 16:14:17 +00:00
cudaoptflow Merge pull request #9075 from TonyLianLong:master 2017-07-03 16:14:17 +00:00
cudastereo test: fix cuda build 2016-11-29 01:18:10 +03:00
cudawarping Fixed identifiers warns 2016-09-30 15:16:29 +05:30
cudev Use %% for inline assembly rather than % so this compiles with clang. 2017-04-05 10:57:50 -07:00
dnn Merge pull request #9188 from arrybn:mobilenet_ssd_sample 2017-08-01 11:12:54 +00:00
features2d Merge pull request #8951 from hrnr:akaze_part2 2017-08-01 12:46:01 +00:00
flann flann: fix out of buffer access 2017-07-26 18:17:03 +03:00
highgui build: replace WIN32 => _WIN32 2017-07-25 13:30:48 +03:00
imgcodecs build: replace WIN32 => _WIN32 2017-07-25 13:30:48 +03:00
imgproc Merge pull request #8951 from hrnr:akaze_part2 2017-08-01 12:46:01 +00:00
java java: update source files processing, maven stuff 2017-07-19 22:39:23 +03:00
ml Prevent crash when attempting to create training data without responses. 2017-06-30 15:36:47 +02:00
objdetect Merge pull request #9130 from alalek:android_define 2017-07-14 17:17:24 +00:00
photo remove some rand functions 2017-07-20 22:43:11 +09:00
python python: disable assertion in NumpyAllocator 2017-07-30 14:44:11 +03:00
shape Fixed several issues found by static analysis 2017-06-28 18:06:18 +03:00
stitching perf: skip stitching OpenCL test on Win32 platform 2017-07-20 14:14:22 +03:00
superres Fixed several issues found by static analysis 2017-06-28 18:06:18 +03:00
ts ts(perf): initialize ThreadPool 2017-07-31 16:51:08 +03:00
video build: replace WIN32 => _WIN32 2017-07-25 13:30:48 +03:00
videoio Merge pull request #9237 from alalek:fix_winrt_build 2017-07-26 10:42:49 +00:00
videostab Fixing some static analysis issues 2017-06-27 14:30:26 +03:00
viz static build workaround 2017-06-30 18:17:32 +03:00
world build: update modules descriptions 2017-06-20 15:45:23 +03:00
CMakeLists.txt