Compare commits

..

4456 Commits

Author SHA1 Message Date
Alexander Alekhin
b2698f24b0 Merge pull request #7033 from tomoaki0705:brushUpFp16 2016-08-04 09:31:52 +00:00
Vadim Pisarevsky
7eee5cb724 Merge pull request #7026 from sovrasov:calib_points_number 2016-08-04 09:14:03 +00:00
Vadim Pisarevsky
b8d743bf50 Merge pull request #6970 from K-Shinotsuka:issue6 2016-08-03 18:50:00 +00:00
Vadim Pisarevsky
0a7e53da0a Merge pull request #7010 from K-Shinotsuka:issue10 2016-08-03 18:44:02 +00:00
Vadim Pisarevsky
03d6c5e473 Merge pull request #7011 from K-Shinotsuka:issue11 2016-08-03 18:34:08 +00:00
Alexander Alekhin
6a69852df1 Merge pull request #7030 from jpaveggio:patch-1 2016-08-03 10:20:23 +00:00
k-shinotsuka
1a18a33688 improve SumSqr_SIMD<schar, int, int>() 2016-08-03 19:17:51 +09:00
Tomoaki Teshima
87ca607fd4 brush up convertFp16
* raise an error when wrong bit depth passed
  * raise an build error when wrong depth is specified for cvtScaleHalf_
  * remove unnecessary safe check in cvtScaleHalf_
  * use intrinsic instead of direct pointer access
  * update the explanation
2016-08-03 17:27:45 +09:00
Juan Pablo Aveggio
ba5f9d68c4 Update bagofwords.cpp 2016-08-02 20:53:05 -03:00
k-shinotsuka
0b4e06ad3c improve SumSqr_SIMD<uchar, int, int>() 2016-08-02 23:46:03 +09:00
k-shinotsuka
5775ace5e0 improve thresh_8u() 2016-08-02 23:35:14 +09:00
Vadim Pisarevsky
fc742da6e3 Merge pull request #6959 from LeoBras:Better_StereoBM 2016-08-02 14:30:02 +00:00
Jeff McBride
562c15cbe9 Don't assume all images have the same number of calibration points
Cast to (int) to avoid warnings

Add test for different points number case in fisheye calibration function
2016-08-02 17:21:17 +03:00
Alexander Alekhin
da2810918c Merge pull request #6991 from tomoaki0705:featureGpuMatFp16 2016-08-02 08:39:25 +00:00
Alexander Alekhin
4f7b3e8a56 Merge pull request #7018 from catree:add_camera_model_doc 2016-08-01 13:27:34 +00:00
catree
6e931aaab7 Add pinhole camera model illustration in calib3d documentation. 2016-08-01 02:25:45 +02:00
Tomoaki Teshima
2974b049e7 cudev: add feature to convert FP32(float) from/to FP16(half) on GPU
* add feature of Fp16 on GPU (cudev)
  * add test
  * leave template function as unimplemented to raise error
2016-08-01 00:55:16 +09:00
Alexander Alekhin
f2e9588c93 Merge pull request #6999 from tomoaki0705:featureCmakeFp16 2016-07-29 10:35:54 +00:00
Tomoaki Teshima
c57f8780e9 show CPU feature correctly when FP16 is available
* make sure that CV_FP16 has the correct meaning
  * check FP16 feature correctly
2016-07-29 14:10:33 +09:00
Vadim Pisarevsky
3b1803f6b1 Merge pull request #6989 from mself:gftt-deterministic-sort 2016-07-28 15:27:39 +00:00
Vadim Pisarevsky
f96b5652ce Merge pull request #6984 from K-Shinotsuka:issue9 2016-07-28 12:05:13 +00:00
Vadim Pisarevsky
b721269c29 Merge pull request #6996 from juliendehos:merge_debevec 2016-07-28 11:51:12 +00:00
Vadim Pisarevsky
8124b5600f Merge pull request #7007 from tomoaki0705:fixDocTypo 2016-07-28 11:42:07 +00:00
Vadim Pisarevsky
f9e02aa612 Merge pull request #6986 from Wing0:master 2016-07-28 11:35:07 +00:00
Tomoaki Teshima
bae8b2a9b0 doc: fix typo and grammar 2016-07-28 18:35:16 +09:00
Alexander Alekhin
8cdd91cd23 Merge pull request #7006 from derlunz:fix-qtopengl-build 2016-07-27 20:10:38 +00:00
Alexander Alekhin
6cff909bc8 Merge pull request #7004 from StevenPuttemans:cmd_parser_opencv_annotation 2016-07-27 18:24:17 +00:00
Alexander Alekhin
328da251ed Merge pull request #7000 from StevenPuttemans:fix_master_build 2016-07-27 18:17:37 +00:00
Alexander Alekhin
085ea5049b Merge pull request #7002 from StevenPuttemans:add_extra_limits_to_help 2016-07-27 18:16:37 +00:00
Christian Kapeller
81e6ef2958 highgui: window QT+OpenGL mouse wheel support, another build fix
amends work done in pull request #6976.
2016-07-27 16:14:57 +02:00
StevenPuttemans
e0f19ec48a change parameter input to the CommandLineParser interface 2016-07-27 14:02:28 +02:00
k-shinotsuka
ecfd4ad11e improve MomentsInTile_SIMD<ushort, int, int>() 2016-07-27 20:27:30 +09:00
StevenPuttemans
6df12a0507 add limits of tool to help message 2016-07-27 11:42:22 +02:00
StevenPuttemans
64dbf6c987 fix build #6993 2016-07-27 11:21:08 +02:00
Your Name
718891d937 Tabs -> Whitespaces. 2016-07-26 23:46:58 -03:00
Your Name
c6f790ce12 Fixed using local variable instead of global var.
- Still need to change SSE_2
2016-07-26 23:29:05 -03:00
Alexander Alekhin
9ad0dcb57f Merge pull request #6987 from tomoaki0705:fixTypoCalib3d 2016-07-26 20:15:45 +00:00
Julien Dehos
e072fa8121 fix a bug in MergeDebevec (modify input times) 2016-07-26 18:01:36 +02:00
Matthew Self
72672c293f Make goodFeaturesToTrack() return deterministic results
When using OCL, the results of goodFeaturesToTrack() vary slightly from
run to run. This appears to be because the order of the results from
the findCorners kernel depends on thread execution and the sorting
function that is used at the end to rank the features only enforces are
partial sort order.

This does not materially impact the quality of the results, but it
makes it hard to build regression tests and generally introduces noise
into the system that should be avoided.

An easy fix is to change the sort function to enforce a total sort on
the features, even in cases where the match quality is exactly the same
for two features.
2016-07-25 21:17:54 -07:00
Tomoaki Teshima
ce66de8e3d calib3d: fix typo 2016-07-26 12:56:10 +09:00
Oskari Vinko
31fb82176d Corrected tutorial grammar and sentences 2016-07-25 20:25:38 +02:00
Alexander Alekhin
52444bf8d0 Merge pull request #6982 from tfauck:master 2016-07-25 11:39:10 +00:00
Thierry Fauck
0df9cbc954 Non existent definition of _FPU_EXTENDED definition prevent compilation when WITH_CUDA set
Non  existence of _FPU_EXTENDED definition on powerpc64 (like it is for apple and arm)
    prevent compilation when WITH_CUDA is set. Adding powerpc64 as case to not use these
    definitions

        modifié:         modules/cudalegacy/test/TestHaarCascadeApplication.cpp
        modifié:         modules/cudalegacy/test/test_precomp.hpp

Signed-off-by: Thierry Fauck <tfauck@free.fr>
2016-07-25 11:30:50 +02:00
Alexander Alekhin
23fd32056e Merge pull request #6980 from tomoaki0705:fixNanUndeclared2 2016-07-25 08:09:19 +00:00
Tomoaki Teshima
891c83ff35 fix build error
* NAN is not defined on some platform
  * follow the comment on PR
2016-07-25 15:42:09 +09:00
Alexander Alekhin
1001b05def Merge pull request #6975 from tomoaki0705:fixNanUndeclared 2016-07-24 16:53:01 +00:00
Tomoaki Teshima
70dcd107d0 follow the comment
* test build on VS2012
2016-07-24 23:34:12 +09:00
Alexander Alekhin
941090861e Merge pull request #6976 from theg4sh:linux-window-mouse-wheel-support 2016-07-24 10:11:39 +00:00
Alexandr Kondratev
d394d26b46 highgui: window QT+OpenGL mouse wheel support, build fix 2016-07-23 18:06:46 +03:00
Tomoaki Teshima
4423a5edad fix build error
* NAN is not defined on some platform
2016-07-23 23:11:57 +09:00
Alexander Alekhin
df9120768d Merge pull request #6929 from catree:hitrate_doc 2016-07-22 13:19:35 +00:00
Alexander Alekhin
5f33d0c75b Merge pull request #6968 from tomoaki0705:addDocsCudaRequirement 2016-07-22 12:56:52 +00:00
Tomoaki Teshima
531b8e2320 add note of minimum requirement of CUDA 2016-07-22 07:04:37 +09:00
Vadim Pisarevsky
80951bd091 Merge pull request #6966 from theg4sh:linux-window-mouse-wheel-support 2016-07-21 21:22:02 +00:00
Vadim Pisarevsky
134154ec6d Merge pull request #6963 from ilya-lavrenov:vec2i_fs 2016-07-21 20:55:05 +00:00
Alexandr Kondratev
ecfabd7aac Merge branch 'master' of https://github.com/Itseez/opencv into linux-window-mouse-wheel-support 2016-07-21 18:16:41 +03:00
Alexandr Kondratev
13aef2c0cf highgui: window_QT mouse wheel support 2016-07-21 18:13:42 +03:00
Alexandr Kondratev
82e4e1816f highgui: removed excessed variable orient in window_gtk 2016-07-21 17:51:19 +03:00
Ilya Lavrenov
313f54bc39 read/write vec2i from/to filestorage 2016-07-21 10:58:49 +03:00
Vadim Pisarevsky
371096493c Merge pull request #6962 from alalek:fix_build_log_macro 2016-07-21 07:40:35 +00:00
Vadim Pisarevsky
6b09ada5d4 Merge pull request #6899 from alalek:ffmpeg_update 2016-07-21 07:31:11 +00:00
Vadim Pisarevsky
167a4e6592 Merge pull request #6942 from alalek:fix_android_pack 2016-07-21 07:30:15 +00:00
Vadim Pisarevsky
1fc655a58f Merge pull request #6964 from tomoaki0705:fixTypoImgproc 2016-07-21 07:27:48 +00:00
Your Name
440ba2e4a7 Passing Disparity Shift as a parameter. 2016-07-20 22:57:55 -03:00
Tomoaki Teshima
57d1591957 imgproc: fix typo
* indent line
2016-07-21 06:42:11 +09:00
Alexander Alekhin
daf1879a2e test: ffmpeg: change resolution for H264 test 2016-07-21 00:20:18 +03:00
Alexander Alekhin
2acfb263bb Merge pull request #6910 from ilya-lavrenov:clone 2016-07-20 15:32:22 +00:00
Alexander Alekhin
60676dbbe8 fix build: move LOG macro from stitching public headers 2016-07-20 18:10:26 +03:00
Alexander Alekhin
2ec63e4dd1 fix android pack build 2016-07-20 16:49:57 +03:00
Vadim Pisarevsky
c4cc54e5da Merge pull request #6953 from ilya-lavrenov:arithm 2016-07-20 13:42:30 +00:00
Vadim Pisarevsky
cc5c5f7da9 Merge pull request #6795 from tomoaki0705:accelerateBilateralFilterNeon 2016-07-20 13:19:06 +00:00
Vadim Pisarevsky
a455858dd9 Merge pull request #6878 from alalek:canny_custom_gradient 2016-07-20 13:16:53 +00:00
Vadim Pisarevsky
848c66babd Merge pull request #6879 from savuor:fix/RNG_corrupts_stack 2016-07-20 13:13:40 +00:00
Ilya Lavrenov
71cbd6f02e fixed bug #5775 2016-07-20 11:38:15 +03:00
Tomoaki Teshima
b436f4b995 accelerate bilateralFilter using NEON
* clean up some lines
2016-07-20 08:28:49 +09:00
Leonardo Brás
0e9c8e2dd5 'resolves' 6898
I have seen that you can input a Mat_<float> on StereoBM, but the value seems the same as CV_16S.
I changed it so, only if you input a Mat_<float> it makes use of a previously truncated 4 bits, giving more resolution to Disparity Matrix. (The algorithm stays the same, it's not more precise).
If any other input Mat is given, it changes nothing.
2016-07-19 20:11:41 -03:00
Vadim Pisarevsky
b34272f8a2 Merge pull request #6787 from theg4sh:linux-window-mouse-wheel-support 2016-07-19 19:06:03 +00:00
Vadim Pisarevsky
abbc988fb5 Merge pull request #6812 from aleksandaratanasov:master 2016-07-19 17:21:09 +00:00
Alexander Alekhin
6d65f7a261 Merge pull request #6954 from ilya-lavrenov:typo 2016-07-19 16:25:26 +00:00
Vadim Pisarevsky
705e776f09 Merge pull request #6816 from phunsukwangdu:devbranch1 2016-07-19 15:50:11 +00:00
Vadim Pisarevsky
b0cc495698 Merge pull request #6822 from saedrna:master 2016-07-19 15:37:31 +00:00
Rostislav Vasilikhin
96edb270a6 fixed memory corruption when normal dist. params have less channels than target matrix; test added 2016-07-19 17:26:39 +03:00
Alexander Alekhin
e20a93f7d6 imgproc test: Canny with custom gradient 2016-07-19 17:15:36 +03:00
Alexander Alekhin
575de89ee2 imgproc: Canny: enable IPP & OpenCL optimization code path 2016-07-19 17:15:36 +03:00
Alexander Alekhin
460b1dc2fa imgproc: Canny with custom gradient 2016-07-19 17:15:36 +03:00
Alexander Alekhin
a2921fdede Merge pull request #6951 from kurenai:fix_macro 2016-07-19 14:05:17 +00:00
Ilya Lavrenov
6c42ad5b90 fixed typo 2016-07-19 16:18:48 +03:00
Vadim Pisarevsky
5d3860703d Merge pull request #6895 from mshabunin:check-6851 2016-07-19 12:11:23 +00:00
Alexander Alekhin
22919c39ad Merge pull request #6950 from tomoaki0705:fixMf16cBuildError 2016-07-19 11:53:28 +00:00
kurenai
2dec662ebf Fix error when compiling with clang 2016-07-19 18:05:07 +08:00
Tomoaki Teshima
d5179b8218 let the test Video_AccSquared.accuracy pass on linux x64 debug 2016-07-19 18:29:37 +09:00
catree
5ee61219c8 Add bib reference for overall hitrate and max false alarm rate formulas in train cascade tutorial.
Remove useless backslash.
2016-07-19 10:58:33 +02:00
Maksim Shabunin
644c0dd5f4 Merge pull request #6940 from andy-held:cuda_pyrlk_static_const_init 2016-07-19 08:47:57 +00:00
Ilya Lavrenov
87ae4e0564 fixed clone of empty matrix 2016-07-19 11:31:53 +03:00
Vadim Pisarevsky
ce05d6cb89 Merge pull request #6773 from acinader:add-mask-to-match-template-demo 2016-07-18 21:14:19 +00:00
Vadim Pisarevsky
26bf5b5de3 Merge pull request #6797 from tomoaki0705:featureSIMDHog 2016-07-18 18:34:21 +00:00
Vadim Pisarevsky
1e17ffe9ac Merge pull request #6839 from thierrylamarre:better_png_transparency 2016-07-18 18:24:34 +00:00
Vadim Pisarevsky
34d68edd1a Merge pull request #6924 from K-Shinotsuka:issue3 2016-07-18 18:16:02 +00:00
Vadim Pisarevsky
b6f21a6cac Merge pull request #6813 from mshabunin:gdcm-cmake-search 2016-07-18 16:00:43 +00:00
Vadim Pisarevsky
48b747903b Merge pull request #6830 from tomoaki0705:featureSupportFp16 2016-07-18 15:56:00 +00:00
Vadim Pisarevsky
a86a5c798b Merge pull request #6836 from vicproon:rectify_correct_principal_point 2016-07-18 15:53:35 +00:00
Vadim Pisarevsky
b28194addc Merge pull request #6860 from IshankGulati:svm-error-message 2016-07-18 15:44:40 +00:00
Vadim Pisarevsky
77f9bb7b76 Merge pull request #6831 from bobpaulin:master 2016-07-18 15:24:35 +00:00
Vadim Pisarevsky
d62b0bd363 Merge pull request #6849 from alcinos:optflow_interface 2016-07-18 15:05:13 +00:00
Vadim Pisarevsky
4da91f9e6d Merge pull request #6861 from teng88:patch-1 2016-07-18 14:43:23 +00:00
Alexander Alekhin
89c9e7c2e6 Merge pull request #6928 from K-Shinotsuka:issue4 2016-07-18 13:51:55 +00:00
Alexander Alekhin
b747633584 Merge pull request #6915 from arrybn:bugs_4515_6544_tests 2016-07-18 13:46:48 +00:00
Alexander Alekhin
55d0945149 Merge pull request #6932 from philippefoubert:bugfix_issue_6931 2016-07-18 13:23:56 +00:00
Andreas Franek
13d1ee10be replaced static const members with static functions for msvc
cpmpatability
2016-07-18 14:41:55 +02:00
Maksim Shabunin
0015a09987 Merge pull request #6827 from jtkb:cmake-maven-release 2016-07-18 08:56:26 +00:00
Maksim Shabunin
070f0f8445 Merge pull request #6936 from catree:fix_NAryMatIterator_code_example 2016-07-18 08:38:49 +00:00
Maksim Shabunin
474868a892 Merge pull request #6884 from alalek:migration 2016-07-18 07:49:38 +00:00
Maksim Shabunin
1efa7f4d27 Merge pull request #6911 from ilya-lavrenov:push_back 2016-07-18 07:33:12 +00:00
arybnikov
2deda0e868 Added tests for issues ##4515, 6544 2016-07-18 10:01:13 +03:00
k-shinotsuka
a25dba001d improve SymmRowSmallVec_8u32s(). 2016-07-18 13:58:11 +09:00
catree
7f64f31f66 Fix NAryMatIterator code example. 2016-07-17 23:21:15 +02:00
Philippe FOUBERT
d9a56f6590 Resolves issue #6931 2016-07-17 12:22:37 +02:00
k-shinotsuka
6f8695c178 improve RowVec_8u32s(). 2016-07-17 18:35:34 +09:00
Alexander Alekhin
69c4e84dad Merge pull request #6918 from jet47:gpu-opengl-sample-build 2016-07-15 16:52:42 +00:00
Maksim Shabunin
464aa5e555 Merge pull request #6803 from alalek:issue_6720 2016-07-15 13:58:39 +00:00
Arthur Cinader
bd7c21d83e Fix explanation to refelect how matching currently works. 2016-07-15 09:57:12 -04:00
Alexander Alekhin
bfb4ebfa03 Merge pull request #6916 from ilya-lavrenov:qt5 2016-07-15 13:43:33 +00:00
Alexander Alekhin
99b0845cd5 ffmpeg windows wrapper 2.7.1=>3.1.1, openh264 1.4.0=>1.5.0, vpx 1.5.0 2016-07-15 16:31:57 +03:00
Alexander Alekhin
0e6aa189cb Merge pull request #6905 from alalek:ffmpeg_fix_get_fps 2016-07-15 12:58:19 +00:00
Maksim Shabunin
91d80d0309 Merge pull request #6798 from tomoaki0705:featureSSEvideoAcc 2016-07-15 12:31:18 +00:00
Maksim Shabunin
63d8290491 Merge pull request #6779 from alalek:python_dynamic_lookup 2016-07-15 12:28:30 +00:00
Vladislav Vinogradov
9f3b1f7e50 use HAVE_OPENGL instead of WITH_OPENGL for GPU opengl sample
in this case the sample will not be built if OpenGL is not found
2016-07-15 15:14:56 +03:00
Ilya Lavrenov
957bf1452c added some tests for push_back 2016-07-15 14:48:22 +03:00
Ilya Lavrenov
3bf16da92d added condition for Qt5 2016-07-15 14:01:36 +03:00
Maksim Shabunin
2d964f800d Merge pull request #6909 from jet47:fix-gpu-examples-compilation 2016-07-15 09:08:21 +00:00
Maksim Shabunin
b0fa477614 Merge pull request #6908 from ilya-lavrenov:reduce 2016-07-15 09:07:56 +00:00
Maksim Shabunin
154d61edf9 Merge pull request #6907 from ilya-lavrenov:typo 2016-07-15 09:07:19 +00:00
Maksim Shabunin
9e7124127f Merge pull request #6906 from jet47:goodFeaturesToTrack-maxCorners-docs 2016-07-15 09:06:55 +00:00
Maksim Shabunin
b542914057 Merge pull request #6904 from ilya-lavrenov:minmaxloc 2016-07-15 09:06:15 +00:00
Tomoaki Teshima
3c2f7ecc97 speed up accumulate, accumulateSquare, accumulateProduct and accumulateWeighted using SIMD
* use SSE and/or AVX based on configuration
  * revise the test to verify the implementation
2016-07-15 08:09:24 +09:00
Alexander Alekhin
f3494647c5 Merge pull request #6762 from maff91:master 2016-07-14 16:17:03 +00:00
Maksim Shabunin
fc890bd941 Merge pull request #6815 from smigielski:fix_6605 2016-07-14 14:36:45 +00:00
Maksim Shabunin
f695d4f04b Merge pull request #6903 from jet47:cuda-stream-thread-safety-notes 2016-07-14 14:29:08 +00:00
Ilya Lavrenov
0af3947468 added note about cv::reduce output type for MIN/MAX 2016-07-14 17:22:08 +03:00
Vladislav Vinogradov
033c01afe2 fix video_reader GPU sample compilation after latest changes in master 2016-07-14 16:18:43 +03:00
thierry
ea911d34c6 remove 2-channel png encoder/decoder support 2016-07-14 14:58:05 +02:00
Ilya Lavrenov
c634e39299 removed extra semicolon 2016-07-14 15:50:35 +03:00
Vladislav Vinogradov
1c8b1b2d2b add note about "maxCorners <= 0" case in goodFeaturesToTrack 2016-07-14 15:48:08 +03:00
Alexander Alekhin
9bda0546f8 Merge pull request #6769 from andy-held:cuda_optflow_error_calc 2016-07-14 12:24:24 +00:00
Alexander Alekhin
df5d51f1c0 Merge pull request #6900 from mshabunin:fix-python-hal 2016-07-14 12:23:05 +00:00
thierry
d40e46bc9b Merge branch 'master' into better_png_transparency
* master: (468 commits)
  added suppression for TBB valgrind issue
  update CUDA architecture flags initialization
  increase minimal supported CUDA toolkit to 6.5
  check the CPU flag correctly
  opencv_visualization: check cmdline args
  provide better error messages
  stop search of markers in Exif reader to prevent infinite loop
  Fix calibration fail on python with CALIB_THIN_PRISM_MODEL flag
  clarify CUDA arithm operations usage with mask
  fixed empty image condition in resize
  fixed memory leak in flann tests
  fisheye: add CALIB_FIX_PRINCIPAL_POINT
  get/put: more type-safety and code unification using templates
  py_tutorials: fix cv2.findContours return val
  imgproc: speed up threshold of 64F version using NEON and SSE   * use NEON under aarch64 only   * check 64F version correctly
  bigdata: add test, resolve split/merge issue
  Improved Carotene library linear resize evaluation precision and enabled it as HAL implementation.
  persistence: fixing crash with space-only values
  Removed unnecessary check for Android API level and unused flags.
  Fix for median blur of 2-channel images
  ...
2016-07-14 14:05:16 +02:00
Alexander Alekhin
998c43ffea videoio: ffmpeg: fix get_fps() implementation 2016-07-14 15:00:54 +03:00
Ilya Lavrenov
c4b57d0ded disable ippiMinMaxIndx_32f_C1R usage since it crashes on Nans 2016-07-14 14:52:58 +03:00
Maksim Shabunin
bb41df9d5f Merge pull request #6901 from ilya-lavrenov:valgrind-tbb-suppression 2016-07-14 11:46:37 +00:00
Maksim Shabunin
a00f0c44ae Merge pull request #6821 from sturkmen72:TickMeter_class_addition 2016-07-14 11:40:46 +00:00
Maksim Shabunin
7d007d212c Merge pull request #6828 from paroj:cmatvals_cpp 2016-07-14 11:31:48 +00:00
Maksim Shabunin
79f8e516b8 Merge pull request #6891 from snosov1:fix-5311 2016-07-14 11:25:58 +00:00
Vladislav Vinogradov
bfd6ae77f5 Add note that cv::cuda::Stream class is not thread safe 2016-07-14 14:20:37 +03:00
Maksim Shabunin
4d053405cf Merge pull request #6809 from K-Shinotsuka:master 2016-07-14 09:37:53 +00:00
Maksim Shabunin
07b18b0e8a Merge pull request #6863 from SorcererX:patch-1 2016-07-14 09:34:13 +00:00
Ilya Lavrenov
9e8d060314 added suppression for TBB valgrind issue 2016-07-14 12:16:52 +03:00
Maksim Shabunin
f698bc1cc2 Fixes header filtering for python bindings generator 2016-07-13 19:49:38 +03:00
Alexander Alekhin
3e77731f7e Merge pull request #6824 from dozyc:tapi_hog_sample 2016-07-13 15:18:14 +00:00
Alexander Alekhin
525e04cfcc Merge pull request #6794 from jet47:cuda-modules-fixes 2016-07-13 15:13:55 +00:00
Maksim Shabunin
95da5ec245 Restored check chessboard parameters 2016-07-13 16:03:47 +03:00
Maksim Shabunin
3bfe76e24c Ported PR #4187 to master 2016-07-13 15:46:48 +03:00
Maksim Shabunin
b000663a88 Cleanup 2016-07-13 15:45:48 +03:00
Alexander Alekhin
e871045b46 Merge pull request #6896 from jet47:cuda-arch-update 2016-07-13 12:26:52 +00:00
Alexander Alekhin
9c92f65c0b Merge pull request #6808 from sturkmen72:patch-14 2016-07-13 11:54:11 +00:00
Alexander Alekhin
a9353ad2ec Merge pull request #6880 from berak:fix_opencv_visualization 2016-07-13 11:51:29 +00:00
Alexander Alekhin
53f4eaa7a7 Merge pull request #6892 from ioxp:fsSpace 2016-07-13 11:46:50 +00:00
Alexander Alekhin
6c4b634cfe Merge pull request #6814 from tomoaki0705:featureThreshold64fSimd 2016-07-13 11:45:28 +00:00
Vladislav Vinogradov
d76f258aeb update CUDA architecture flags initialization
* remove obsolete paths
* add Pascal arch support
2016-07-13 13:03:16 +03:00
Vladislav Vinogradov
112903c2bd increase minimal supported CUDA toolkit to 6.5 2016-07-13 13:02:13 +03:00
Maksim Shabunin
8215d20dbf fixup! Fixed several merge issues 2016-07-13 12:11:44 +03:00
Maksim Shabunin
2a350b11dd Fixed several merge issues 2016-07-13 11:48:28 +03:00
Tomoaki Teshima
9fca953e62 check the CPU flag correctly 2016-07-13 07:34:49 +09:00
Kerry Billingham
b2dd128ec5 Creation of Maven POM project and documentation.
This commit introduces a POM.xml file to allow the build of OpenCV and Java bundles using Maven.

An additonal directory has been created  'platforms/maven' to contain the POM and scripts used during the build process. An additional Markdown file is included to give instructions on how to build with Maven.
2016-07-12 21:59:12 +01:00
berak
20b9ff4ff6 opencv_visualization: check cmdline args 2016-07-12 19:40:46 +02:00
Alexander Alekhin
f75f894d73 Merge pull request #6889 from ilya-lavrenov:exif 2016-07-12 15:12:19 +00:00
Sergei Nosov
dce310e03c provide better error messages 2016-07-12 18:03:28 +03:00
Alexander Alekhin
3c1a002dab Merge pull request #6883 from ilya-lavrenov:resize 2016-07-12 14:35:25 +00:00
Alexander Alekhin
5e94243222 Merge pull request #6887 from sovrasov:calib_dist_coeffs_check 2016-07-12 14:34:19 +00:00
Alexander Alekhin
07ef396fbb Merge pull request #6886 from ilya-lavrenov:cuda_docs 2016-07-12 13:53:08 +00:00
Ilya Lavrenov
91d8405e52 stop search of markers in Exif reader to prevent infinite loop 2016-07-12 16:01:12 +03:00
Oliver Schreer
74b83cfce5 Modified and improved the method for chessboard detection. It is now faster and detects chessboards under difficult lighting condition as well as when the chessboard has strong out of plane rotations 2016-07-12 15:50:49 +03:00
Vladislav Sovrasov
ee9a42e9cd Fix calibration fail on python with CALIB_THIN_PRISM_MODEL flag 2016-07-12 15:30:02 +03:00
Alexander Alekhin
3590c3c48e Merge pull request #6882 from ilya-lavrenov:flann 2016-07-12 10:49:17 +00:00
Ilya Lavrenov
491b6543da clarify CUDA arithm operations usage with mask 2016-07-12 13:32:58 +03:00
Alexander Alekhin
1f26e73478 ffmpeg: try to load ffmpeg wrapper dll from the current module directory 2016-07-12 13:29:36 +03:00
Ilya Lavrenov
5bc10ef796 fixed empty image condition in resize 2016-07-12 13:23:19 +03:00
Alexander Alekhin
ddc0b42bc3 migration: github.com/opencv/opencv 2016-07-12 12:51:12 +03:00
Maksim Shabunin
6c6badb6a6 Merge pull request #6818 from Dikay900:template_patch 2016-07-12 09:35:22 +00:00
Ilya Lavrenov
bcc9010630 fixed memory leak in flann tests 2016-07-12 11:53:51 +03:00
Arthur Cinader
0ed250cb5d Implement PR feedback:
1. Explain grayscale input still read as three channel
2. Fix typo
3. Add more details to image match explanation to include the use of masks
2016-07-11 15:21:47 -04:00
Alexander Alekhin
02aabcca87 Merge pull request #6829 from paroj:fixpp_fe 2016-07-11 16:34:37 +00:00
Alexander Alekhin
39acd4a3fd Merge pull request #6866 from alalek:gnu_toolchain 2016-07-11 16:32:23 +00:00
Pavel Rojtberg
c1b90a1c22 fisheye: add CALIB_FIX_PRINCIPAL_POINT 2016-07-11 16:16:37 +02:00
Alexander Alekhin
a6b33c3590 Merge pull request #6846 from mbarnach:6086-cuda-initialization 2016-07-11 14:01:51 +00:00
Alexander Alekhin
7176c1327e Merge pull request #6850 from alalek:bigdata_test 2016-07-11 14:01:06 +00:00
Alexander Alekhin
9b3d65c5e4 Merge pull request #6867 from alalek:fix_lapack 2016-07-11 14:00:22 +00:00
Alexander Alekhin
f9ab93bf0f Merge pull request #6876 from janstarzy:jni-as-template-redone 2016-07-11 13:06:00 +00:00
Alexander Alekhin
c48e237dd0 Merge pull request #6874 from berak:fix_py_tutorials 2016-07-11 10:51:26 +00:00
Alexander Alekhin
88da03722f Merge pull request #6786 from terfendail:median_fix 2016-07-11 10:02:43 +00:00
Alexander Alekhin
9ed1474340 Merge pull request #6790 from terfendail:linearresize_accuracy 2016-07-11 10:02:06 +00:00
Alexander Alekhin
88e3d07178 Merge pull request #6791 from terfendail:carotene4android_buildfix 2016-07-11 09:57:49 +00:00
Alexander Alekhin
c8693f01a3 Merge pull request #6792 from paroj:jaccard_distance 2016-07-11 09:57:20 +00:00
Jan Starzynski
479f933970 get/put: more type-safety and code unification using templates 2016-07-11 09:27:59 +02:00
berak
e233f7d199 py_tutorials: fix cv2.findContours return val 2016-07-10 11:17:00 +02:00
Tomoaki Teshima
1095076d7f imgproc: speed up threshold of 64F version using NEON and SSE
* use NEON under aarch64 only
  * check 64F version correctly
2016-07-09 17:05:29 +09:00
Tomoaki Teshima
59fabb2767 use NEON as same as SSE 2016-07-09 16:53:01 +09:00
Andrey Pavlenko
d06bdd5bf6 Merge pull request #6771 from sovrasov:log_doc_fix 2016-07-08 15:20:42 +00:00
Andrey Pavlenko
67a7826da3 Merge pull request #6782 from LaurentBerger:I6780 2016-07-08 15:18:22 +00:00
Andrey Pavlenko
dcaac98569 Merge pull request #6775 from janstarzy:histo-ipp-fix 2016-07-08 15:15:17 +00:00
Alexander Alekhin
5f269d08b4 bigdata: add test, resolve split/merge issue 2016-07-08 18:05:53 +03:00
Maksim Shabunin
f3bd508e6d GDCM: several improvements
- fixed width and height order
- removed unused methods
- simplified signature matching
- rewrote pixel format matching in more compact form
- added dimensions number check (only 2 is allowed)
- added target buffer size check
- added debug messages in all failing points
2016-07-08 16:08:55 +03:00
Maksim Shabunin
0fd0acf2e3 GDCM: modified compilation scheme
- renamed source files
- guard the contents - always include
2016-07-08 16:08:55 +03:00
look4pritam
6f22f49c02 Grassroots DiCoM i.e. GDCM based DICOM image reader is added. 2016-07-08 16:08:55 +03:00
Vitaly Tuzov
04c7d03188 Improved Carotene library linear resize evaluation precision and enabled it as HAL implementation. 2016-07-08 14:47:30 +03:00
Philipp Hasper
00112bbe10 persistence: fixing crash with space-only values 2016-07-08 12:41:05 +02:00
Vitaly Tuzov
e3f5bbd217 Removed unnecessary check for Android API level and unused flags. 2016-07-08 13:31:26 +03:00
Alexander Alekhin
627e2b15b3 Merge pull request #6770 from ealbuz:master 2016-07-08 09:49:09 +00:00
Vitaly Tuzov
c61f7e5334 Fix for median blur of 2-channel images 2016-07-08 12:03:28 +03:00
Alexander Alekhin
630406e006 Merge pull request #6785 from alalek:android_native_level 2016-07-07 15:48:01 +00:00
Alexander Alekhin
3e649895e5 android: increase default native API level 8=>9 2016-07-07 15:57:59 +03:00
Alexander Alekhin
c0fe374490 cmake: python, allow dynamic symbols lookup from libpython.so 2016-07-07 14:23:35 +03:00
LaurentBerger
62a87ce38c Issue 6780 2016-07-07 09:29:41 +02:00
Vladislav Vinogradov
4382302a6b fix matrix type for keypoints buffer in CUDA FAST
use CV_32FC1 instead of CV_16SC2 since detectAsync uses CV_32FC1
to reallocate the matrix
2016-07-06 14:27:08 +03:00
Jan Starzynski
7f896643e9 fix for buffer-overflow in IPPCalcHistInvoker::operator() 2016-07-06 09:54:28 +02:00
Arthur Cinader
a6ade2b914 Add the mask to the template matching demo documentation. 2016-07-05 13:20:30 -04:00
Vladislav Sovrasov
a2ec23c112 Update cv::log documentation 2016-07-05 17:28:53 +03:00
Alexandr Kondratev
f5b96eb828 Merge branch 'master' of https://github.com/Itseez/opencv 2016-07-05 13:34:11 +03:00
Alexandr Kondratev
179998a8a2 highgui module: window_QT mouse wheel reuse variable delta instead call evnt->delta() 2016-07-05 12:02:16 +03:00
Elif Albuz
8f91529edf Add Carotene - NVIDIA Hardware-Abstraction-Layer for ARM platforms 2016-07-04 23:56:15 -07:00
Elif Albuz
c65d2a0d86 Add Carotene - NVIDIA Hardware-Abstraction-Layer for ARM platforms 2016-07-04 23:45:07 -07:00
Andreas Franek
8d43e2b945 fixed the cuda optical flow error normalization factor
texture channels were not considered correctly, nor was the cuda texture
normalization
2016-07-04 16:13:31 +02:00
Alexander Alekhin
22682f933a Merge pull request #6760 from alalek:issue_6653 2016-07-04 14:03:05 +00:00
Alexander Alekhin
da69cd08db Merge pull request #6768 from tomoaki0705:fixEstimateAffine3DThreshold 2016-07-04 12:17:16 +00:00
Alexandr Kondratev
4e63bd04e5 highgui module: mouse wheel - modification keys fixed, wheel event value is CV_EVENT_MOUSEWHEEL or CV_EVENT_MOUSEHWHEEL 2016-07-04 15:02:05 +03:00
Tomoaki Teshima
0e380ff15d calib3d: compare error and threshold both in square
* resolve #5183
2016-07-04 19:34:47 +09:00
Alexander Alekhin
96919156e7 Merge pull request #6761 from alalek:fix_warnings 2016-07-04 09:52:03 +00:00
Alexandr Kondratev
040409aac5 Merge branch 'master' of https://github.com/Itseez/opencv 2016-07-03 15:54:35 +03:00
Alexandr Kondratev
1f2e159054 highgui module: using event->scroll.delta_{x,y} instead parsing direction and added widget event mask GDK_SMOOTH_SCROLL_MASK for GTK>=3.4 2016-07-03 15:52:59 +03:00
Alexandr Kondratev
7dcac647e5 highgui module: a bit readable onMouse flags mapping 2016-07-03 13:31:25 +03:00
Dikay900
61390e407d Rephrase parts of the templates and use comments 2016-07-02 17:33:06 +02:00
Michael Shtutman
3f2ab5d3b5 Fix bug #6682 (Can't change resolution for YUY2 camera with DShow) 2016-07-02 18:10:04 +03:00
Alexander Alekhin
3844ee780c build: fix compiler warnings (GCC 5.3.1) 2016-07-01 20:17:16 +03:00
Alexander Alekhin
7dc5332a92 Merge pull request #6745 from alalek:viz_samples 2016-07-01 15:27:01 +00:00
Alexander Alekhin
8b05a4bf93 cvtColor: fix inplace processing 2016-07-01 17:09:12 +03:00
Andrey Pavlenko
330e4bb48a Merge pull request #6734 from PkLab:doc_videoio_enums 2016-07-01 13:24:05 +00:00
Arthur Cinader
2b08f29543 Allow for an optional mask for MatchTemplate_Demo 2016-06-30 17:04:25 -07:00
Alexander Alekhin
ee4f409584 cmake: lapack optimized code requires cblas.h 2016-06-30 20:25:08 +03:00
Alexander Alekhin
b23527bf02 core: fix arguments types for cblas calls 2016-06-30 20:25:08 +03:00
Vadim Pisarevsky
7fea7e0629 Merge pull request #6697 from wiryls:FileStorageBase64 2016-06-30 17:17:03 +00:00
Andrey Pavlenko
e4cd24537e Merge pull request #6740 from tomoaki0705:fixNeonCheckSmooth 2016-06-30 15:47:45 +00:00
Alexander Alekhin
8184535de1 samples: repair viz tutorial 2016-06-30 17:21:31 +03:00
Alexander Alekhin
5346870920 Merge pull request #6558 from lletourn:master 2016-06-30 13:44:16 +00:00
Alexander Alekhin
639c8fc6d6 Merge pull request #5870 from IshankGulati:VideoCapture-fix 2016-06-30 13:20:51 +00:00
Alexander Alekhin
b7735b3400 Merge pull request #6731 from jokereactive:viz_sample 2016-06-30 12:41:52 +00:00
Maksim Shabunin
4aa9b230b8 Merge pull request #6603 from debjan:patch-1 2016-06-30 11:35:22 +00:00
Alexander Alekhin
e98c1bfb53 Merge pull request #6747 from ludv1x:master 2016-06-30 08:02:19 +00:00
Alexandr Kondratev
81c69ecd16 highgui: window_gtk.cpp directive boolean operations or/and replaced by ||/&& to keep compatible with older systems 2016-06-29 23:01:57 +03:00
Vitaliy Lyudvichenko
930d96f684 Fixing of AutoBuffer::allocate(nsz) method
AutoBuffer::allocate(nsz) didn't work properly when
(sz < nsz < fixed_size). In this case sz remained unchanged.
2016-06-29 19:50:51 +03:00
Alexander Alekhin
69bd6dad1f Merge pull request #6029 from sturkmen72:patch-7 2016-06-29 11:55:09 +00:00
Alexander Alekhin
cb48183d02 Merge pull request #6711 from Dubrzr:vs_compile_cuda_fix 2016-06-29 11:03:47 +00:00
Alexander Alekhin
c7fc9dc42f Merge pull request #6707 from tech2077:master 2016-06-29 11:00:49 +00:00
Tomoaki Teshima
78a5aacb22 make NEON more similart to SSE2 2016-06-29 12:11:10 +09:00
Alexander Alekhin
73e16dbc3f cmake: update arm toolchain 2016-06-28 20:06:59 +03:00
Alexander Alekhin
bbc327aaed Merge pull request #6736 from alalek:cmake_fix_install_path 2016-06-28 16:53:45 +00:00
PkLab.net
adcdab394b Merge branch 'master' of git://github.com/Itseez/opencv into doc_videoio_enums
# Resolved Conflicts:
#	modules/videoio/include/opencv2/videoio.hpp
2016-06-28 16:40:30 +02:00
Alexander Alekhin
c5a8619493 cmake: fix install path
CMake doesn't work with empty paths ("") or paths which contains "./"
2016-06-28 13:29:00 +03:00
Alexander Alekhin
02edfc8df2 Merge pull request #6730 from sturkmen72:patch-16 2016-06-28 05:36:15 +00:00
Alexander Alekhin
6b511751f5 Merge pull request #6619 from Slonegg:openni2_ir_stream 2016-06-28 05:21:25 +00:00
PkLab.net
f274c592e4 Use copydoc for the list of valid property identifier in VideoCapture and VideoWriter docs 2016-06-27 19:17:51 +02:00
PkLab.net
6c3d8abe2c Doxygen documentation for CAP_* enums (using current comments in code) 2016-06-27 19:09:23 +02:00
Dmitry Trifonov
f9e6741807 added support for OpenNI2 IR stream #4366 2016-06-27 10:04:59 -07:00
Alexander Alekhin
86b54a52f0 Merge pull request #6733 from simonhaenisch:simonhaenisch-improve-watershed.py-example 2016-06-27 16:44:24 +00:00
Simon Hänisch
6489d8a96f update watershed.py: check if windows are still open
change the `while` loop to check if the two windows created by this example still exist, stop the program otherwise
2016-06-27 17:03:37 +02:00
Suleyman TURKMEN
e7ec580318 Update imgcodecs.hpp 2016-06-27 16:38:47 +03:00
Alexandr Kondratev
a4e9712006 Compilate switch-case with GTK_SCROLL_SMOOTH since GTK>=3.4 2016-06-27 13:34:41 +03:00
sarthak
43dca117b9 opencv viz bug
removed binary

update
2016-06-27 14:12:55 +05:30
Suleyman TURKMEN
11ca1c95f8 update cpp samples and tutorials 2016-06-26 20:55:00 +03:00
Suleyman TURKMEN
1b22783d46 Update grfmt_png.cpp 2016-06-26 20:03:03 +03:00
Alexandr Kondratev
fd78e2cc6c highgui module: removed unused type_mouse_event mouse_wheel 2016-06-25 00:47:22 +03:00
Alexandr Kondratev
3cbd14d61a pull highgui mouse wheel changes linux into master 2016-06-25 00:42:47 +03:00
Alexandr Kondratev
6020dacc11 highgui module: implemented QT and GTK mouse wheel callback support in linux 2016-06-25 00:18:07 +03:00
MYLS
df5a7c8ee9 build again for OpenCL.
I could not find the cause of the error:

```
C:\builds_ocv\precommit_opencl\opencv\modules\ts\src\ts_perf.cpp(361):
error: The difference between expect_max and actual_max is
8445966.0000002384, which exceeds eps, where

expect_max evaluates to 0.9999997615814209,

actual_max evaluates to 8445967, and

eps evaluates to 1.0000000000000001e-005.

Argument "dst0" has unexpected maximal value
```

Hope this is a false alarm.
2016-06-25 02:24:33 +08:00
MYLS
677d4d20ce fixed an error in the test... 2016-06-25 00:37:13 +08:00
MYLS
959002fb96 solve warnings and errors in test. 2016-06-24 23:41:40 +08:00
MYLS
7c92ee2e6e Split cvWriteRawData_Base64 into three functions
The three new functions:

```cpp
void cvStartWriteRawData_Base64(::CvFileStorage * fs, const char* name,
int len, const char* dt);
void cvWriteRawData_Base64(::CvFileStorage *
fs, const void* _data, int len);
void
cvEndWriteRawData_Base64(::CvFileStorage * fs);
```

Test is also updated. (And it's remarkable that there is a bug in
`cvWriteReadData`.)
2016-06-24 22:27:42 +08:00
Alexander Alekhin
0e436c3fe9 Merge pull request #6721 from alalek:tbb_update 2016-06-24 12:54:55 +00:00
Suleyman TURKMEN
d2bad6febb cv::TickMeter class addition 2016-06-23 19:06:57 +03:00
Vitaly Tuzov
eaec95dcf2 Update TBB 2016-06-23 11:48:48 +03:00
Alexander Alekhin
0ebe387cb2 Merge pull request #6713 from alalek:cmake_install_fix 2016-06-22 20:35:15 +00:00
Alexander Alekhin
f0dc7a25e7 Merge pull request #6712 from alalek:cmake_export_fix 2016-06-22 20:34:46 +00:00
Alexander Alekhin
f57e3ce5f3 cmake: don't use absolute paths with/without CMAKE_INSTALL_PREFIX
CPack can't work with absolute paths.
2016-06-22 16:38:54 +03:00
Alexander Alekhin
09ce987552 cmake: fix export issue
opencv_ts is static internal library and in case of exporting
it requires all static dependencies (include HAL files)
2016-06-22 15:34:46 +03:00
Matthew Skolaut
f861d0d643 merge #ifs in highgui bindings 2016-06-21 17:16:16 -05:00
Alexander Alekhin
a76fd43599 Merge pull request #6709 from alalek:cmake_hal_fix 2016-06-21 19:27:02 +00:00
Julien Dubiel
33ab236ed3 Use CMAKE_LIBRARY_PATH_FLAG variable instead of -L. 2016-06-21 20:00:50 +02:00
Alexander Alekhin
09c2a8b7ad cmake: fix HAL dependencies for core module
Linker dependencies are transitive for non-private
2016-06-21 19:50:32 +03:00
Alexander Alekhin
be38a524a8 Merge pull request #6705 from alalek:fix_hal_imgproc 2016-06-21 16:24:29 +00:00
Alexander Alekhin
61492ea0dc Merge pull request #6708 from alalek:pr6477 2016-06-21 15:38:41 +00:00
Alexander Alekhin
96937bac74 Merge pull request #6581 from mshabunin:hal_mag 2016-06-21 13:16:17 +00:00
Alexander Alekhin
89cd74093e Merge pull request #6704 from alalek:cmake_cmp0042 2016-06-21 10:46:08 +00:00
Matthew Skolaut
7284a77cd3 fix casting warning in python createButton binding 2016-06-20 21:07:24 -05:00
Matthew Skolaut
e8bfb48490 Merge branch 'master' of https://github.com/Itseez/opencv
Added python binding for createButton
2016-06-20 16:24:23 -05:00
Matthew Skolaut
9b959072a2 added python binding for createButton 2016-06-20 16:24:15 -05:00
Alexander Alekhin
2fb670cf09 hal: fix missing include "opencv2/imgproc/hal/interface.h" 2016-06-20 19:25:49 +03:00
Alexander Alekhin
f5306a0740 cmake: change CMP0042 policy value 2016-06-20 18:28:12 +03:00
Alexander Alekhin
4597b94099 Merge pull request #5980 from alalek:cmake_opencv_config 2016-06-20 15:27:43 +00:00
Alexander Alekhin
c6c651212c cmake: refactoring of OpenCVConfig
- removed OpenCV_LIB_DIR* vars (they are broken and not required anymore)
- OpenCVConfig.cmake doesn't contain ANDROID/CUDA code if there is no such support
- removed OpenCV2_INCLUDE_DIRS_CONFIGCMAKE, merged into OpenCV_INCLUDE_DIRS_CONFIGCMAKE
- fix hard-coded relative paths for OpenCV_INSTALL_PATH
- removed OpenCV_TBB_ARCH
- switch OpenCVConfig.cmake into 2-level mode for Android SDK
2016-06-20 15:15:21 +03:00
Alexander Alekhin
7188e6e2ac android: update build scripts 2016-06-20 15:15:21 +03:00
MYLS
29921d055d change the parameter to CvMat and CvMatND
```cpp
cvWriteMat_Base64(::cv::FileStorage & fs, ::cv::String const & name,
::cv::Mat const & mat)
```
becomes:
```cpp
CV_EXPORTS void cvWriteMat_Base64(::CvFileStorage* fs, const char* name,
const ::CvMat* mat);
CV_EXPORTS void
cvWriteMatND_Base64(::CvFileStorage* fs, const char* name, const
::CvMatND* mat);
```
2016-06-20 16:59:58 +08:00
MYLS
9faa2a7fd0 solve warning for IOS
Two test are still needed:

1. Verify the Base64 data.
2. Read an old YML file for compatibility test.
2016-06-19 02:44:39 +08:00
MYLS
958263d245 Solve warnings, and adjusted the test case. 2016-06-19 02:00:32 +08:00
MYLS
882e4221e7 fix errors from test.
Two other test are still needed.

1. Verify the Base64 data.
2. Read an old YML file for compatibility test.
2016-06-19 00:45:51 +08:00
MYLS
d1b097f409 fix most coding style warnings and errors 2016-06-18 23:28:12 +08:00
MYLS
7b1f7c8d8e Add Base64 support for FileStorage
1. Add Base64 support for reading and writing XML\YML file.

The two new functions for writing:

```cpp
void cvWriteRawData_Base64(cv::FileStorage & fs, const void* _data, int
len, const char* dt);
void cvWriteMat_Base64(cv::FileStorage & fs, cv::String const & name,
cv::Mat const & mat);
```

2. Change YML file header form `YAML:1.0` to `YAML 1.0`. (standard
format)

3. Add test for Base64 part.
2016-06-18 22:14:11 +08:00
MYLS
ecd827fc8e Add Base64 support for FileStorage
[GSoC] FileStorage:
Add base64 support for reading and writting XML\YML file.
The two new functions:
```
void cvWriteRawData_Base64(cv::FileStorage & fs, const void* _data, int
len, const char* dt);
void cvWriteMat_Base64(cv::FileStorage & fs, cv::String const & name,
cv::Mat const & mat);
```
2016-06-18 21:40:29 +08:00
Alexander Alekhin
31952fbf1c Merge pull request #6675 from pnordhus:matconstiterator_reference 2016-06-17 10:12:51 +00:00
Alexander Alekhin
bd9cc2dfc6 Merge pull request #6668 from yadavankit:master 2016-06-17 10:11:49 +00:00
Vadim Pisarevsky
547a2d29c3 Merge pull request #6535 from sovrasov:lapack-hal 2016-06-16 20:09:47 +00:00
Vadim Pisarevsky
4142e737b0 Merge pull request #6453 from sovrasov:extend_calibrateCamera 2016-06-16 18:28:49 +00:00
Alexander Alekhin
7fadf570b8 Merge pull request #6690 from alalek:cmake_fix_android_samples 2016-06-16 15:56:19 +00:00
Alexander Alekhin
777e1d38ba cmake: fix JNI configuration problem for Android samples
Some CMake 3.x (2.8.12.2 is fine) provides broken build configurations
with following build error message:
    ld: fatal error: -soname: must take a non-empty argument

Linker command line sample contains this:
"-shared -Wl,-soname, -o"
2016-06-16 14:32:07 +03:00
Tomoaki Teshima
addb15383a fix run time error 2016-06-16 18:14:53 +09:00
Alexander Alekhin
c3456c0754 Merge pull request #6685 from ioxp:dofDocu 2016-06-15 20:43:11 +00:00
Alexander Alekhin
68c63188eb Merge pull request #6683 from alalek:cmake_hal 2016-06-15 17:18:56 +00:00
Philipp Hasper
45bd56e28a rigidTransform: only four DoF
combinations of translation, rotation, and uniform scaling equals four degrees of freedom
2016-06-15 16:41:39 +02:00
Alexander Alekhin
f4ebc504d1 cmake: refactor HAL attaching process 2016-06-15 17:34:30 +03:00
Aleksandar Atanasov
0637ca21dc Update houghlines.py 2016-06-13 09:00:42 +02:00
Aleksandar Atanasov
4fa86dad26 Update houghcircles.py 2016-06-13 09:00:29 +02:00
Aleksandar Atanasov
445349dd7d Same fix as with the houghcircles
Moved second `imshow()` inside the if-statement to prevent error when no lines have been found and the function is called with an empty `cdst`.
2016-06-12 12:55:29 +02:00
Aleksandar Atanasov
c5bbc0353c Added small fix when circles are not detected
I noticed that I missed the fact that `cimg` is used in the second `imshow()` call. Changed the scope of the second function call to be within the if-statement. Otherwise in cases where have not been detected the second `imshow()` will attempt to use `cimg` which will be empty leading to an error.
2016-06-12 12:54:16 +02:00
Philipp Nordhus
4a529cd641 Return reference on iterator indirection/subscript 2016-06-11 15:17:52 +02:00
Ankit Yadav
c62eda023d Fix typo 2016-06-11 17:56:58 +05:30
Tomoaki Teshima
87d0c91dcf fix warning of build 2016-06-09 18:24:00 +09:00
Aleksandar Atanasov
25e2e8aa3c Removed trailing spaces at line 32 2016-06-09 07:18:47 +02:00
Tomoaki Teshima
d0a8390963 fix run time error on Mac
* integrate HW version and SW version to same function
2016-06-09 08:41:37 +09:00
Alexander Alekhin
e3844e0f26 Merge pull request #6649 from adamrankin:msmf_crash_fix 2016-06-08 16:30:55 +00:00
Adam Rankin
2577194c70 Correcting return type from videoDevice::findType to be int thus allowing detection of failed device init request 2016-06-07 15:18:40 -04:00
Alexander Alekhin
1b6e02793c Merge pull request #6645 from tomoaki0705:fixTypoEigen 2016-06-07 13:51:30 +00:00
Tomoaki Teshima
fd76ed5c0f fix to support wider compiler
* check compiler more strictly
  * use gcc version of fp16 conversion if it's possible (gcc 4.7 and later)
  * use current SW implementation in other cases
2016-06-07 18:32:47 +09:00
Tomoaki Teshima
6f6eebbcb9 fix warning 2016-06-07 18:31:18 +09:00
Vladislav Sovrasov
46fb46c54e Add an extended version of CalibrateCamera function 2016-06-07 12:31:11 +03:00
Vladislav Sovrasov
055f5c7395 Change names of some internal functions 2016-06-07 10:58:12 +03:00
Tomoaki Teshima
d1c1c01761 fix typo 2016-06-07 14:53:04 +09:00
Tomoaki Teshima
fbfd3158a7 fix corner case when number is small 2016-06-07 08:59:28 +09:00
Tomoaki Teshima
15f8bc6f37 fix cmake
* enable fp16 feature correctly with gcc on x86/x86_64
2016-06-06 21:48:18 +09:00
Maksim Shabunin
532885c12b Merge pull request #6607 from alalek:issue_6604 2016-06-06 09:20:58 +00:00
Maksim Shabunin
89a1e806b7 Merge pull request #6628 from sovrasov:hal_samples_update 2016-06-06 09:18:27 +00:00
Tomoaki Teshima
4239bac4ed fix warning of doc
* update the comment to real header
2016-06-06 18:06:23 +09:00
Tomoaki Teshima
eccf2fa4c3 follow other interface
* remove useHW option
  * update test
2016-06-06 08:56:37 +09:00
k-shinotsuka
43d5988df6 improve to calculate norm 2016-06-05 16:55:02 +09:00
Suleyman TURKMEN
7c5b981c17 Update drawing.cpp 2016-06-05 01:06:55 +03:00
Vladislav Sovrasov
901e1e4608 Update HAL samples 2016-06-03 11:52:30 +03:00
Vladislav Sovrasov
a2d0cc878c Implement internal HAL for GEMM and matrix decompositions 2016-06-03 10:38:30 +03:00
Louis Letourneau
c03d778ec7 This fixes the seeking in h264 B-Frame enabled video issue. #4890 2016-06-02 11:24:37 -04:00
Susmit
d913463932 Terrible bugs in the tutorial code in py_pose.markdown
There were two bugs that were solved here.Changes were done after extreme testing.
1.replaced cv2.solvePnPRansac() with cv2.solvePnP() previous fc was giving terrible errors.
2.The code was incapable of saving edited pics;Now fixed with little code mods.
2016-06-02 17:47:45 +05:30
Aleksandar Atanasov
14deab252b Fix houghlines.py when no lines found
In the C++ equivalent of this example a check is made whether the vector (here in Python we have a list) actually has any lines in it that is whether the Hough lines function has managed to find any in the given image. This check is missing for the Python example and if no lines are found the application breaks.
2016-06-02 11:00:23 +02:00
Aleksandar Atanasov
cf0df733da Fix houghcircles.py when no circles found
In the C++ equivalent of this example a check is made whether the vector (here in Python we have a list) actually has any circles in it that is whether the Hough circles function has managed to find any in the given image. This check is missing for the Python example and if no circles are found the application breaks.
2016-06-02 10:58:46 +02:00
Aleksandar Atanasov
5d4f22e096 Merge pull request #1 from Itseez/master
Updating own opencv fork to 3.x
2016-06-02 10:53:22 +02:00
Susmit
98dce911ca Update py_calibration.markdown
In the camera calibration code { cv2.cornerSubPix() } will be of no use.In the updated code it is assigned to the (corners2) variable 
which is passed down to { cv2.drawChessboardCorners() }
2016-06-02 01:06:17 +05:30
Alexander Alekhin
e1ba4399e8 Merge pull request #6611 from tomoaki0705:fixPerformanceSplitAarch64 2016-06-01 10:34:33 +00:00
Tomoaki Teshima
070e4d754e let the performance test of split pass on 64bit ARM
* loosen the threshold only under aarch64
  * fix #6610
2016-05-31 23:57:49 +09:00
Alexander Alekhin
d3930cdee1 Merge pull request #6482 from paroj:filestorage_py 2016-05-31 11:53:34 +00:00
Vadim Pisarevsky
a2d8e7fa6e Merge pull request #6485 from vagran:vagran-patch-1 2016-05-31 10:58:18 +00:00
Vadim Pisarevsky
7f9319924b Merge pull request #6537 from Slonegg:opeeni2_multiple_devices 2016-05-31 10:35:44 +00:00
Vadim Pisarevsky
40686415f9 Merge pull request #6593 from bramton:documentation-update 2016-05-31 10:32:18 +00:00
Vadim Pisarevsky
904cfa576c Merge pull request #6597 from sturkmen72:issue_4678 2016-05-31 10:31:15 +00:00
Alexander Alekhin
ff0601cda5 core: prevent changes in 'std' namespace 2016-05-31 13:02:15 +03:00
Maksim Shabunin
1e667de1f3 HAL math interfaces: fastAtan2, magnitude, sqrt, invSqrt, log, exp 2016-05-31 11:54:52 +03:00
Alexander Alekhin
f6fa1cee2b Merge pull request #6008 from amroamroamro:fix_sparse_snippet 2016-05-31 08:19:38 +00:00
Marek Smigielski
ef45005056 Adding support for pointer generation. Fixes #6605 2016-05-31 08:35:50 +02:00
Maksim Shabunin
c344435378 Merge pull request #6602 from berak:patch-1 2016-05-30 14:19:19 +00:00
debjan
7f52a553d4 Update gen_pattern.py
Save method should save, instead trying to run inkview
2016-05-30 10:47:59 +02:00
berak
a2b353d178 Update non_linear_svms.cpp
fix for #6598
2016-05-30 06:56:28 +02:00
Suleyman TURKMEN
e59da10bf1 Update highgui.hpp 2016-05-28 05:25:25 +03:00
Bram Ton
dfd5191e8b Minor additions to the documentation. 2016-05-26 16:35:20 +02:00
Maksim Shabunin
eca752368b Merge pull request #6592 from guysoft:fix_6500_fix2 2016-05-26 14:15:15 +00:00
Alexander Alekhin
4547427946 Merge pull request #6589 from tomoaki0705:fixThresh64fTest 2016-05-26 12:44:56 +00:00
Guy Sheffer
0a48b9ae77 Fix #6500 cmake bug that adds D_FORCE_INLINES to NVCC 2016-05-26 13:45:50 +03:00
Maksim Shabunin
60f799ada5 Merge pull request #6583 from mshabunin:doc-warnings-fix 2016-05-26 09:54:26 +00:00
Tomoaki Teshima
bbeac745ca Update test case for 64F version 2016-05-26 08:38:29 +09:00
Maksim Shabunin
cbf2b79e1f Fixed documentation warnings produced by updated doxygen 2016-05-25 18:04:32 +03:00
Pavel Rojtberg
bf688da50b FileStorage: add simplified API for bindings
at least it is possible to read/ write calibration files. Fixes #4282.

Also add CPP method for writing comments.
2016-05-25 16:01:55 +02:00
Vadim Pisarevsky
0cb1e96472 Merge pull request #6546 from atinfinity:pullreq/160517-threshold-64F 2016-05-25 13:19:50 +00:00
Vadim Pisarevsky
0fc26f80d7 Merge pull request #6547 from mshabunin:python-vector-pair-int-double 2016-05-25 13:17:15 +00:00
Vadim Pisarevsky
90b844792d Merge pull request #6548 from fnorf:master 2016-05-25 13:16:07 +00:00
Vadim Pisarevsky
98c9d47537 Merge pull request #6551 from mshabunin:fix-old-cmake 2016-05-25 13:13:50 +00:00
Maksim Shabunin
a191c043ae Merge pull request #6573 from dharezlak:patch-1 2016-05-24 15:28:27 +00:00
Maksim Shabunin
64a5126ff8 Merge pull request #6018 from sturkmen72:patch-2 2016-05-23 11:57:26 +00:00
dharezlak
308b47ce58 Improved Java wrapper generation
While generating Java JNI wrappers package names with an underscore (`_`) character where not properly escaped according to https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/design.html#resolving_native_method_names (see also: https://github.com/Itseez/opencv_contrib/issues/652).

This fix replaces all the occurrences of `_` with `_1` resulting in proper JNI method names.
2016-05-23 11:13:18 +02:00
Maksim Shabunin
c393a7a98f Merge pull request #6564 from jlguardi:ml_load_empty_ptr 2016-05-23 08:41:05 +00:00
Maksim Shabunin
5c54360fb9 Merge pull request #6565 from jlguardi:ann_64f_bug 2016-05-23 08:39:25 +00:00
Maksim Shabunin
e2939f7788 Merge pull request #6570 from sturkmen72:patch-14 2016-05-23 08:36:16 +00:00
Tomoaki Teshima
b2ad7cd9c0 add feature to convert FP32(float) to FP16(half)
* check compiler support
  * check HW support before executing
  * add test doing round trip conversion from / to FP32
  * treat array correctly if size is not multiple of 4
  * add declaration to prevent warning
  * make it possible to enable fp16 on 32bit ARM
  * let the conversion possible on non-supported HW, too.
  * add test using both HW and SW implementation
2016-05-21 21:31:33 +09:00
Suleyman TURKMEN
c6e6d4c822 Update pca.cpp 2016-05-21 14:23:45 +03:00
Suleyman TURKMEN
abab67b574 Update imgproc.hpp
update documentation of calcBackProject() calcHist() compareHist()
2016-05-21 14:08:14 +03:00
Alexander Alekhin
60dc8bcf8e Merge pull request #6554 from CSBVision:patch-1 2016-05-20 19:42:15 +00:00
Alexander Alekhin
b07944df23 Merge pull request #6561 from tomoaki0705:fixMulSpectrumAarch64 2016-05-20 19:39:09 +00:00
Alexander Alekhin
a0a8acadb7 Merge pull request #6559 from OzgrCn:cuda-ORB-useProvidedKeypoints 2016-05-20 19:38:31 +00:00
Jose Luis Guardiola
a812989436 Fixed #6563: Incorrect management for invalid files/filestorage/filenode in ml module 2016-05-20 13:18:02 +02:00
Jose Luis Guardiola
2bb520e277 Fixed #6562: Incorrect CV_64F management in ANN 2016-05-20 13:16:59 +02:00
Özgür Can
4951543441 Fix issue #6473
Enable "useProvidedKeypoints" flag on cuda::ORB's detectAndCompute function in order to able to describe provided keypoints.

* additional author : Ender Tunç <endertunc@yahoo.com>

resolves #6473

 * Enable "useProvidedKeypoints" flag on cuda::ORB's detectAndCompute function in order to able to describe provided keypoints.

   Update for using 'const' reference to avoid array copy on each iteration.

resolves #6473

	Update for 'const' reference to avoid array copy on each iteration.
2016-05-20 13:19:14 +03:00
Maksim Shabunin
16f4baa3f6 Merge pull request #6498 from berak:python_size_t 2016-05-20 09:45:52 +00:00
Tomoaki Teshima
bfcb40ad77 fix Core_MulSpectrum test on 64bit ARM + release mode
* fix issue #6536
  * increase threshold in particular tests due to the difference of fmsub and fsub
2016-05-20 18:25:32 +09:00
DozyC
6c4aae98f7 tapi examples - Removing defaults from all command line switches accessed with has() 2016-05-19 23:27:05 -07:00
Han Hu
e646f9d2f1 Fix subpixel problem of akaze.
This is found in the original akaze repo. Previous sub pixel localization method assumes the coordinate (0, 0) is the up-left corner of the up-left pixel. But as far as I know, opencv uses the center of the up-left corner, in this case it should be done in this way.

35aeb83a71
db3dc22981
2016-05-20 11:45:46 +08:00
CSBVision
d72625d506 neural_network.cpp added 2016-05-19 15:40:42 +02:00
Maksim Shabunin
d043a61897 Restored cmake 2.8.7 support 2016-05-18 13:20:21 +03:00
Maksim Shabunin
c3d1f94ee6 Merge pull request #6446 from kevin-coder:bugfix_6445 2016-05-18 09:40:26 +00:00
atinfinity
1f1464c925 remove unnecessary cast 2016-05-18 08:32:29 +09:00
Hannes
66549414dd fixed "tot_error" to "mean_error" & nicer whitespace 2016-05-17 20:00:28 +02:00
Hannes
3b2a194c30 fixed "corners2" to "corners" & nicer whitespace 2016-05-17 19:36:32 +02:00
atinfinity
ef0931be44 fixed compilation warning 2016-05-18 00:34:51 +09:00
Maksim Shabunin
8011be2810 Python bindings: added std::vector< std::pair< int, double > > type read support 2016-05-17 17:26:27 +03:00
atinfinity
6930325847 Added test case of cv::threshold(CV_64F) 2016-05-17 22:57:05 +09:00
atinfinity
e4f207c4b4 Changed cv::threshold() to support CV_64F 2016-05-17 22:56:03 +09:00
Alexander Alekhin
764a1f5947 Merge pull request #6543 from tomoaki0705:cudaThresholdMultiChannels 2016-05-16 13:18:01 +00:00
Maksim Shabunin
3092a0982a Merge pull request #6541 from mshabunin:disable-pch-for-gcc6 2016-05-16 13:12:23 +00:00
Tomoaki Teshima
b6a093fba1 accept multiple channels image for threshold on cuda
* modify test, too
2016-05-16 06:45:35 +09:00
Maksim Shabunin
a0fdc91a14 Disabled PCH support for gcc >= 6.0.0
Command line generation routine uses "-isystem" to include headers outside of "<opencv>/modules" folder, but GCC 6 does not work when passed "-isystem /usr/include" option.
2016-05-13 13:32:09 +03:00
Maksim Shabunin
d6b8563530 Merge pull request #6460 from m039:fix/add_extra_modules_path_to_build_sdk 2016-05-13 09:01:46 +00:00
Maksim Shabunin
925d8c1dec Merge pull request #6522 from tomoaki0705:fixVSqrtAarch64 2016-05-13 09:00:12 +00:00
Dmitry Trifonov
688ebd8960 add support for multiple OpenNI2 devices 2016-05-12 18:12:51 -07:00
Dmitry Mozgin
03e4b7552e Added --extra_modules_path to build_sdk.py 2016-05-12 12:36:42 +03:00
Tomoaki Teshima
7077d1de63 fix hal_intrin test on 64bit ARM
* fix issue 6521
  * use correct comparison
2016-05-12 18:30:09 +09:00
Alexander Alekhin
72ec643129 Merge pull request #6483 from StevenEWright:patch-1 2016-05-11 10:41:09 +00:00
Alexander Alekhin
79134b6ae6 Merge pull request #6354 from StevenPuttemans:add_model_visualisation_tool 2016-05-11 08:38:11 +00:00
StevenPuttemans
02fe93a399 add a cascade classifier model visualisation tool for master branch 2016-05-11 08:56:42 +02:00
DozyC
3db19c046b Fix command line argument handling, fixes #6525 2016-05-10 17:20:59 -07:00
Alexander Smorkalov
af64ecdf25 Merge pull request #6510 from jet47:cuda-8.0-build-fix 2016-05-06 10:07:28 +00:00
Vladislav Vinogradov
10896129b3 GraphCut deprecated in CUDA 7.5 and removed in 8.0 2016-05-06 11:37:32 +03:00
Alexander Alekhin
855c058d6e Merge pull request #6489 from serval2412:master 2016-05-03 13:43:39 +00:00
berak
11e563fd5d python: support for size_t args (default value) 2016-05-03 09:50:08 +02:00
Julien Nabet
a29c814bd8 cppcheck: fix some reports
All of these: (performance) Prefer prefix ++/-- operators for non-primitive types.
[modules/calib3d/src/fundam.cpp:1049] -> [modules/calib3d/src/fundam.cpp:1049]: (style) Same expression on both sides of '&&'.
2016-04-29 15:41:39 +02:00
Artyom Lebedev
8ceac4b73b Update fisheye.cpp
Fix for inconsistent asserts in cv::fisheye::initUndistortRectifyMap() which prevents from passing empty matrices in debug build (which is allowed according to the code bellow the asserts and the docs).
2016-04-28 12:50:09 +03:00
Steven E Wright
39f7eccdb0 Fixes minor typos. 2016-04-27 18:02:49 -07:00
Pavel Rojtberg
8ed1945ccd calibrationMatrixValues: consider principalPoint in FOV computation
The FOV depends on the principal point location. Use formula of
viz::Camera.
2016-04-27 14:47:52 +02:00
Pavel Rojtberg
86959310f9 calibrationMatrixValues: bind C++ function in C instead of vice versa 2016-04-27 11:39:19 +02:00
Alexander Alekhin
6e5e5d87df Merge pull request #6448 from alalek:merge-2.4 2016-04-25 16:56:51 +00:00
Vadim Pisarevsky
5ed4e1b887 Merge pull request #6459 from eliao:Fix6457 2016-04-25 13:07:51 +00:00
Vadim Pisarevsky
df6eb101e1 Merge pull request #6467 from ohnozzy:Doc-for-ocl-Kernel-Run 2016-04-25 13:07:34 +00:00
Vadim Pisarevsky
e587721d1c Merge pull request #6422 from iclemens:master 2016-04-25 13:06:42 +00:00
Vadim Pisarevsky
8cfddcfeb7 Merge pull request #6454 from paroj:fisheye_py 2016-04-25 12:54:44 +00:00
Vadim Pisarevsky
681fd7f214 Merge pull request #6455 from belgraviton:bugfix_5953 2016-04-25 12:50:45 +00:00
Vadim Pisarevsky
25e0c12274 Merge pull request #6458 from eliao:Fix6456 2016-04-25 12:49:16 +00:00
Vadim Pisarevsky
f4e00bd60f Merge pull request #6463 from ohnozzy:ocl-linearpolar-and-logpolar 2016-04-25 12:42:40 +00:00
Vadim Pisarevsky
cef45bd2ad Merge pull request #6364 from sovrasov:interactive_calibration_app 2016-04-25 12:39:56 +00:00
Vadim Pisarevsky
904381c602 Merge pull request #6020 from mshabunin:hal_dxt 2016-04-25 11:37:18 +00:00
Pavel Rojtberg
ccadad4222 fisheye: allow using transposed image and object point arrays 2016-04-25 11:16:26 +02:00
Pavel Rojtberg
8d4cebe077 fisheye: create rvecs, tvecs before writing 2016-04-25 11:16:26 +02:00
Vladislav Sovrasov
5a0c04409b Add interactive calibration app 2016-04-25 11:58:19 +03:00
ohnozzy
d66ed313cb Add Comment
Add documentation for Kernel::run
2016-04-25 11:30:12 +08:00
ohnozzy
db9f611767 Add OpenCL support to linearPolar & logPolar
Add OpenCL  support to linearPolar & logPolar.
The OpenCL code use float instead of double, so that it does not require
cl_khr_fp64 extension, with slight precision lost.

Add explicit conversion

Add explicit conversion from double to float to eliminate warning during
compilation.
2016-04-24 08:37:56 +08:00
Eric Liao
f87b175a19 Fix 6457
Allow configuration of the square size in stereo_calib.
2016-04-22 14:49:43 -07:00
Eric Liao
d3aaf8acf3 Change hardcoded relative path for instrinsics file to current path, matching the extrinsics file.
https://github.com/Itseez/opencv/issues/6456
2016-04-22 14:14:25 -07:00
Vadzim Piatrou
43f854bc5f fixing CLAHE crash with pixels value > 12 bit 2016-04-22 18:55:22 +03:00
Alexander Alekhin
67a734ce73 Merge branch '2.4' into master
Commits:
67fe57a add fixed video
db0ae2c Restore 2.4 source branch for bug fix 6317.
97ac59c Fix a memory leak indirectly caused by cvDestroyWindow
eb40afa Add a workaround for FFmpeg's color conversion accessing past the end of the buffer
421fcf9 Rearrange CvVideoWriter_FFMPEG::writeFrame for better readability
912592d Remove "INSTALL_NAME_DIR lib" target property
bb1c2d7 fix bug on border at pyrUp
2016-04-21 20:15:08 +03:00
Bob Paulin
bb8faec885 #6443 Cast maxscale from double to float for scale calculation. 2016-04-21 07:47:13 -05:00
Zhenqing, Hu
94a9e16943 Fix bug 6445
Root cause: when calling imread to read the pgm file, when returning with success reading file, the destructor will free the resource which used by memcpy, but in the code, the resource calculation was not correct, therefore, it will cause memory corruption during resource free.
2016-04-21 14:39:55 +08:00
Bob Paulin
b973b73ae7 Add -maxscale parameter to limit the amount sample images can scale in background images 2016-04-20 21:53:52 -05:00
Alexander Alekhin
59975db6a4 Merge pull request #6441 from asmorkalov:version++ 2016-04-20 14:21:19 +00:00
Alexander Alekhin
ec2ff7f0c0 Merge branch '2.4.12.x-prep' into 2.4 2016-04-20 16:26:12 +03:00
Alexander Alekhin
5d038686b1 Merge pull request #6401 from StevenPuttemans:add_model_visualisation_tool_2.4 2016-04-20 13:24:25 +00:00
Alexander Smorkalov
6084901610 OpenCV version++. 2016-04-20 16:03:47 +03:00
Maksim Shabunin
ec63343f34 Merge pull request #6420 from ioxp:foreachDoc 2016-04-20 11:55:03 +00:00
Alexander Alekhin
9ebe29a8f1 Merge pull request #6433 from schenker:master 2016-04-19 16:06:35 +00:00
Alexander Alekhin
e58c28974b Merge pull request #6431 from StevenPuttemans:add_fixed_video_2.4 2016-04-19 14:19:41 +00:00
Alexander Alekhin
1b4bd6a905 Merge pull request #6432 from kevin-coder:bugfix_6317_Restore_2.4 2016-04-19 13:32:44 +00:00
StevenPuttemans
67fe57a0a3 add fixed video 2016-04-19 15:30:49 +02:00
Thomas Schenker
76ced14b3b fix typo 2016-04-19 15:09:27 +02:00
Maksim Shabunin
5a938309c1 More compilation warnings fixed 2016-04-19 16:08:48 +03:00
Maksim Shabunin
11378fcb17 Fixed compiation problems 2016-04-19 14:50:07 +03:00
Kevin, Hu
db0ae2ca50 Restore 2.4 source branch for bug fix 6317. 2016-04-19 19:27:42 +08:00
Alexander Alekhin
289b6ff2a5 Merge pull request #6393 from paroj:v4l_exposure 2016-04-18 15:14:21 +00:00
Alexander Alekhin
9e9165c25e Merge pull request #5516 from AVshokurov:master 2016-04-18 15:13:14 +00:00
Alexander Alekhin
de164b0ccf Merge pull request #6421 from alalek:backport_6417 2016-04-18 15:12:17 +00:00
Maksim Shabunin
5e9192287d Added HAL cvtColor interface 2016-04-18 16:34:25 +03:00
Ivar Clemens
3287ab386c Fixed typo in BRISK feature detector. 2016-04-18 13:04:04 +01:00
Alexander Alekhin
d02f17c39d Merge pull request #6397 from ioxp:androidCamLog 2016-04-18 11:56:18 +00:00
Suleyman TURKMEN
194f1beae8 fix for writing 16-bit jpeg2000 2016-04-18 14:51:55 +03:00
Philipp Hasper
c52759432d Fixing doc for cv::Mat::forEach
image.forEachWithPosition does not exist
2016-04-18 13:51:07 +02:00
Alexander Alekhin
08761f5fb5 Merge pull request #6410 from alalek:issue_6403 2016-04-18 11:43:14 +00:00
Alexander Alekhin
68b7323b4e Merge pull request #6417 from sturkmen72:patch-14 2016-04-18 10:35:28 +00:00
Alexander Alekhin
c02d89bf2d Merge pull request #6408 from dtmoodie:InputOutputArray_constructor_fix 2016-04-18 10:34:43 +00:00
Alexander Alekhin
a513f482c0 Merge pull request #6406 from ohnozzy:Bug-Fix-for-Issue-6377 2016-04-18 10:29:29 +00:00
Alexander Alekhin
9393a0c5bb cmake: don't use -isystem for opencv_contrib paths 2016-04-18 12:48:14 +03:00
Maksim Shabunin
809c159e11 Merge pull request #6414 from mshabunin:fix-macosx-warnings 2016-04-17 22:11:57 +00:00
Maksim Shabunin
ba3b1de93f Updates for XCode 7.3 2016-04-17 20:21:29 +03:00
Alexander Alekhin
169b5e9fde Merge pull request #6359 from alalek:videocapture_exceptions 2016-04-17 09:30:43 +00:00
Suleyman TURKMEN
98239664f6 fix for writing 16-bit jpeg2000 2016-04-17 00:37:28 +03:00
Maksim Shabunin
3bd6912e01 Merge pull request #6415 from mshabunin:fix-xcode-warnings-24 2016-04-16 06:39:00 +00:00
Maksim Shabunin
1a41ed2fda Updates for XCode 7.3 2016-04-15 21:56:50 +03:00
Dan
e9461d3feb templated std::vector<T> constructor was being called instead of const std::vector<cv::cuda::GpuMat>. 2016-04-14 15:50:24 -04:00
Alexander Alekhin
0df901b389 Merge pull request #6404 from solosuper:bugfix/issue6315 2016-04-14 14:27:59 +00:00
Alexander Alekhin
ccff20328d Merge pull request #6407 from StevenPuttemans:fix_ts_perf_warnings 2016-04-14 14:27:27 +00:00
Alexander Alekhin
ac32450c38 Merge pull request #6405 from StevenPuttemans:fix_gstreamer_cap_linux 2016-04-14 14:27:12 +00:00
StevenPuttemans
88c0d64b4e fixing gstreamer cap 2016-04-14 14:16:05 +02:00
StevenPuttemans
c34bb0ed03 remove warnings generated during TS module tests 2016-04-14 13:48:11 +02:00
ohnozzy
9be6b4f2d1 Bug Fix for 6377
Rewrite linearPolar & logPolar so that they do not depend on the
deprecated API CvMat. Issue 6377 is resolved in this way because the two
routines do not convert UMat to CvMat anymore.
2016-04-14 19:39:02 +08:00
solosuper
372890f1d7 fix #6315 2016-04-14 11:57:49 +02:00
StevenPuttemans
9d71c19939 add visualisation tool for 2.4 branch 2016-04-14 11:33:37 +02:00
Maksim Shabunin
fc5e32c7ac Merge pull request #6305 from rishirajsurti:master 2016-04-14 08:42:40 +00:00
rishirajsurti
4a9170ba42 Thresholding Tutorial using inRange function on a video 2016-04-14 11:55:52 +05:30
Alexander Alekhin
5b73f3a316 Merge pull request #6373 from terfendail:vt/stereobm_valgrind 2016-04-13 13:38:53 +00:00
Maksim Shabunin
ed508dc8ed Merge pull request #6399 from mshabunin:fix-flann-memleak 2016-04-13 11:34:58 +00:00
Alexander Alekhin
fc55e54aa1 Merge pull request #6318 from paroj:gst_cap_props 2016-04-13 10:05:40 +00:00
Maksim Shabunin
98763528ab Merge pull request #6382 from StevenPuttemans:update_annotation_tool 2016-04-13 10:05:26 +00:00
Maksim Shabunin
96d747f030 Merge pull request #6384 from StevenPuttemans:update_annotation_tool_2.4 2016-04-13 10:02:56 +00:00
Maksim Shabunin
b99d010977 Fixed memory leak in flann KMeansIndex 2016-04-13 12:08:42 +03:00
StevenPuttemans
b922d49a28 vectorize process + enable early quitting/storage + enable delete annotion option 2016-04-13 10:20:18 +02:00
Maksim Shabunin
49b4af1e5c Merge pull request #6395 from Tauranis:master 2016-04-13 07:53:33 +00:00
Maksim Shabunin
d8629b0fa4 Merge pull request #6335 from themightyoarfish:canny_kernel_sz_fix 2016-04-13 07:52:05 +00:00
Maksim Shabunin
fc9f7cc925 Merge pull request #6375 from ohnozzy:Bug-Fix-for-Issue-6288 2016-04-13 07:51:33 +00:00
Philipp Hasper
cc7a1a2ab7 Deactivated two noisy camera-retrieval log messages in android
They were issued for every frame retrieved - even in a release build.
2016-04-13 09:17:33 +02:00
StevenPuttemans
5164c4ba31 vectorize process + enable early quitting/storage + enable delete annotation option 2016-04-13 09:10:24 +02:00
Tauranis
edb6a0e889 Bug fix for MLP predict for small values to avoid nan responses. 2016-04-12 15:59:32 -03:00
Alexander Alekhin
9744073b95 videoio: give chance for all enabled backends
"Eat" unexpected backend exceptions
2016-04-12 20:05:21 +03:00
Maksim Shabunin
36477fdefa Merge pull request #6344 from anatolix:kalmanpyfix 2016-04-12 15:55:55 +00:00
Maksim Shabunin
ee9f88902c Merge pull request #6352 from fraserharris:patch-1 2016-04-12 15:23:43 +00:00
Maksim Shabunin
8f6e102331 Merge pull request #6345 from eduardohenriquearnold:master 2016-04-12 15:22:32 +00:00
Vitaly Tuzov
13858cd561 Cost estimation boundaries description updated 2016-04-12 17:31:12 +03:00
Vitaly Tuzov
772d9689e9 Backport of StereoBM uninitialized memory access problem fix from master branch 2016-04-12 17:27:16 +03:00
ohnozzy
9dd962ca1a Bug Fix for Issue 6288
Added 2 inline functions in persistence.hpp
So that the '>>' operator works correctly for std::Vector<KeyPoint> and
std::Vector<DMatch>
2016-04-12 21:40:50 +08:00
Maksim Shabunin
1307bb1d03 Merge pull request #6314 from mvukad:bugfix_dtreeswrite 2016-04-12 13:26:25 +00:00
Alexander Alekhin
2b29db860c Merge pull request #6391 from virtuald:v4l-device-name 2016-04-12 12:57:21 +00:00
Pavel Rojtberg
91678ff828 cap_v4l: allow manually controlling exposure 2016-04-12 12:10:54 +02:00
Maksim Shabunin
ff3bb9f4e6 Merge pull request #6383 from alalek:backport_6381 2016-04-12 08:40:01 +00:00
Maksim Shabunin
e90b697cb0 Merge pull request #6386 from mshabunin:fix-python-test-issue 2016-04-12 08:29:44 +00:00
Dustin Spicuzza
e489f29d0f v4l/libv4l: allow opening device by name
- Allows using non-default device names such as /dev/v4l/by-path/pci-0000:00:1d.0-usb-0:1.1:1.0-video-index0
2016-04-12 01:25:34 -04:00
Alexander Alekhin
2f0676fb88 Merge pull request #6298 from andy-held:master 2016-04-11 17:19:11 +00:00
Maksim Shabunin
70bc268c1a Fixed problem with nonfree python test: could not find local test images 2016-04-11 18:45:14 +03:00
Andreas Franek
1b3a967223 Enable directly writing jpeg-encoded streams with GStreamer
CvVideoWriter_GStreamer assumes a JPEG encoded stream if the height of
the given frame size is 1.
2016-04-11 17:10:57 +02:00
Philipp Hasper
b6d8c9d990 operator<< handles keys starting with underscore 2016-04-11 12:43:58 +03:00
Alexander Alekhin
78286f3a44 Merge pull request #6381 from ioxp:persistenceFix 2016-04-11 09:40:09 +00:00
Philipp Hasper
47c4ee974a operator<< handles keys starting with underscore 2016-04-11 09:55:33 +02:00
Maksim Shabunin
233612efd7 Reworked HAL dft/dct interface, added replacement documentation 2016-04-08 16:03:51 +03:00
Maksim Shabunin
f40d701427 DFT: renamed HAL functions 2016-04-08 11:19:28 +03:00
Maksim Shabunin
15783cf668 Always use hal::dft in crossCorr function 2016-04-08 11:19:28 +03:00
Maksim Shabunin
008abd28fd Extracted HAL interfaces for DFT/DCT, added new test 2016-04-08 11:19:28 +03:00
Vitaly Tuzov
a7ce9a176b Fixed uninitialized memory errors in stereoBM 2016-04-07 23:58:17 +03:00
mvukad
695e33b25b Fix missing format when writing Algorithm-based objects
Added a writeFormat() method to Algorithm which must be called by the
write() method of derived classes.
2016-04-07 13:49:42 -07:00
Maksim Shabunin
5877debb6f HAL resize, warpAffine, warpPerspective interface
- added HAL documentation support
- added documentation to HAL replacement interface
- updated several HAL functions in imgproc module
2016-04-07 18:47:24 +03:00
Alexander Alekhin
06ea0aa02b Merge pull request #6367 from shengyu7697:fix_quote 2016-04-06 11:17:35 +00:00
shengyu
2d41321ca0 fix quote 2016-04-06 14:31:06 +08:00
Alexander Alekhin
7783836fff Merge pull request #6265 from huang-qiao:master 2016-04-06 04:51:59 +00:00
qiao
a7fe73f284 fix OpenCV_CONFIG_PATH get null value after CMake 2.8.11
syntax of cmake "get_filename_component" changed after version 2.8.11

for cmake version < 2.8.11
  get_filename_component(<VAR> <FileName> PATH [CACHE])

for cmake version >= 2.8.11
  get_filename_component(<VAR> <FileName> DIRECTORY [CACHE])

Update OpenCVConfig.cmake

Update OpenCVConfig.cmake.in
2016-04-06 11:33:53 +08:00
Alexander Alekhin
52ba3778e3 Merge pull request #6363 from alalek:ffmpeg_fix_timeout_24 2016-04-05 16:29:15 +00:00
Alexander Alekhin
c7b6353a3c Merge pull request #6365 from terfendail:vt/nonlocal_testdata 2016-04-05 15:25:15 +00:00
Alexander Alekhin
1f7fea9092 Merge pull request #6244 from dreifachstein:topic-cmake-install 2016-04-05 15:23:55 +00:00
Vitaly Tuzov
34b3d31f54 Fix for nonlocal data requirement in test2.py 2016-04-05 16:47:29 +03:00
Alexander Alekhin
6f139b4f8e ffmpeg: interrupt callback fix
backport from master
2016-04-05 14:19:44 +03:00
Alexander Alekhin
7d4a8bc437 Merge pull request #6358 from alalek:ffmpeg_fix_timeout 2016-04-05 11:07:00 +00:00
Alexander Alekhin
7d9a480597 ffmpeg: interrupt callback fix 2016-04-04 13:17:04 +03:00
Vadim Pisarevsky
46d218bcec Merge pull request #6312 from KnockSoftware:split-float-epsilon 2016-04-03 23:10:10 +00:00
Maksim Shabunin
0c068768a5 Merge pull request #6351 from mshabunin:fix_java_moments 2016-04-01 09:19:09 +00:00
Maksim Shabunin
fbbe75895a Merge pull request #6353 from shengyu7697:fix_right_quote 2016-04-01 09:18:41 +00:00
shengyu
21513caf3f missing right quote 2016-04-01 11:03:50 +08:00
Fraser Harris
0634808bf3 Added description of the AR model 2016-03-31 17:57:55 -07:00
Alexander Alekhin
873884aa47 Merge pull request #6346 from filipsladek:box_filter_32FC1 2016-03-31 17:06:52 +00:00
Alexander Alekhin
ab3fb8b2f8 Merge pull request #6340 from BloodAxe:parallel_logistic_regression 2016-03-31 17:06:20 +00:00
Maksim Shabunin
a5af69de6a Java wrapper for moments: do not truncate values in set method 2016-03-31 12:57:10 +03:00
filipsladek
a821fde44e add performance test for CV_32FC1 2016-03-31 09:05:02 +02:00
Alexander Alekhin
a056c9b113 Merge pull request #6329 from paroj:window_gui_cpp 2016-03-30 14:34:55 +00:00
filipsladek
f635381662 add testcase for CV_32FC1 2016-03-30 10:38:22 +02:00
filipsladek
493ac1df37 code style 2016-03-29 22:44:03 +02:00
filipsladek
9c3f790edb Box filter implemented for CV_32FC1 2016-03-29 22:30:49 +02:00
Eduardo Arnold
d046602ea4 Enforced DecisionFunction vector indexes to be saved on SVM save/load methods 2016-03-29 16:35:27 -03:00
Anatoly Orlov
1740218ee0 small platform compatability fix for ESC key 2016-03-29 20:02:35 +03:00
Alexander Alekhin
86a725933a Merge pull request #6343 from terfendail:vt/python_rng_seed_backport 2016-03-29 16:06:27 +00:00
Anatoly Orlov
2be805ce29 kalman.py was broken totally
1. Following condition is True on each iteration becuase -1 % 0xFF is 255 not -1

code = cv2.waitKey(100) % 0x100
if code != -1:
   break

this were resetting point position on each cycle not on key press as intended

2. Previous small bug were masking serious bug with matrix operation on matrices of incorrect size.
   As the result on 2nd iteration of internal cycle program has crushed.

   I have fixed it too, matrix operation was taken from examples/cpp/kalman.cpp where it looks like
   randn( processNoise, Scalar(0), Scalar::all(sqrt(KF.processNoiseCov.at<float>(0, 0))));
   which is something totally different from previous code here.

   Example behave as it should now, i.e. point moving by circle trajectory as in C++ example.
2016-03-29 18:27:35 +03:00
Vitaly Tuzov
64f02aa72d Backport of setRNGSeed implementation and python test randomness fix 2016-03-29 18:05:28 +03:00
Alexander Alekhin
ff0d115800 Merge pull request #6332 from sovrasov:python_rng_seed 2016-03-29 14:23:26 +00:00
Alexander Alekhin
12a8f5486d Merge pull request #6341 from SpecLad:destroy-leak 2016-03-29 12:36:51 +00:00
Roman Donchenko
97ac59cb73 Fix a memory leak indirectly caused by cvDestroyWindow 2016-03-29 14:06:05 +03:00
Eugene Khvedchenya
ee92a36123 Added parallel implementation of compute_gradient method. 2016-03-29 11:09:54 +03:00
Vladislav Sovrasov
72ed4173df Change setRNGSeed implementaion 2016-03-29 10:54:42 +03:00
Evan Heidtmann
0712bccf52 Fix epsilon comparison when splitting 2016-03-28 14:16:32 -07:00
Прун Виктор
93ff1fb2f2 Correct image borders and principal point computation in cv::stereoRectify 2016-03-28 15:59:18 +03:00
themightyoarfish
68d97502fe Error message for wrong kernel size was insufficient.
When setting a wrong kernel size, the error message only tells the user that it
must be odd, however the conditions for rejection include values > 7 which must
be communicated. Without that, the message would be incorrect and confusing if
the user is unaware that only values 3, 5, 7 are accepted.
2016-03-28 14:06:55 +02:00
Vadim Pisarevsky
1e1dc1429f Merge pull request #6321 from mshabunin:hal_cmake 2016-03-27 08:06:24 +00:00
Vadim Pisarevsky
481473eb12 Merge pull request #6326 from sovrasov:python_samples_update 2016-03-27 08:03:28 +00:00
Alexander Alekhin
ee123b8a9e Merge pull request #6311 from peters:master 2016-03-26 19:55:17 +00:00
Vladislav Sovrasov
362d52a3cb Fix doxygen warnings 2016-03-25 16:34:45 +03:00
Vladislav Sovrasov
a490b64e9b Add function setRNGSeed and seed setup in python tests 2016-03-25 16:17:58 +03:00
Alexander Alekhin
05384f05cc Merge pull request #6313 from amannababanana:master 2016-03-25 11:31:17 +00:00
Maksim Shabunin
50edaae06c Merge pull request #6322 from berak:fix_linux_eclipse_tutorial 2016-03-25 07:39:19 +00:00
Pavel Rojtberg
0ac31a0bd7 highgui: add CV_GUI_* flags to enum in cpp so they appear in bindings 2016-03-24 23:58:47 +01:00
Alexander Smorkalov
762965897a Merge pull request #6320 from terfendail:vt/pytestarm64 2016-03-24 17:16:52 +00:00
Vladislav Sovrasov
1f8fd5382c Replace of some synthetic scenes in python samples 2016-03-24 20:05:26 +03:00
berak
0b389b24f6 fix changed libraries in eclipse tutorial 2016-03-24 16:09:14 +01:00
Maksim Shabunin
79ffaa8ce9 Fixed cutom_hal.hpp file generation 2016-03-24 17:39:16 +03:00
Maksim Shabunin
727743809e Using find_package to import custom HAL library 2016-03-24 17:05:54 +03:00
Vitaly Tuzov
ea3746bd15 Made texture flow python test less strict to fix it on AARCH64 2016-03-23 20:07:42 +03:00
Pavel Rojtberg
9dc14b3efc cap_gst: inspect sink instead of videoconvert to find out properties
videoconvert might not be present on a manual pipeline, but appsink must
be.
2016-03-23 16:24:10 +01:00
Vadim Pisarevsky
e792ee89de Merge pull request #6243 from mshabunin:hal_morph 2016-03-23 13:09:19 +00:00
Vadim Pisarevsky
e547916e88 Merge pull request #6285 from sovrasov:python_tests_cleanup 2016-03-23 13:07:00 +00:00
Lucas Solomon
d2d5d32fe0 remove trailing whitespace 2016-03-22 22:31:16 -07:00
Lucas Solomon
688b4d9d7a return 0 from VideoCapture::read() when cannot connect to camera 2016-03-22 19:03:28 -07:00
Peter Rekdal Sunde
278747ba45 Add support for ffmpeg 3.0. 2016-03-22 22:52:35 +01:00
Alexander Smorkalov
ef2a376baf Merge pull request #6297 from terfendail:vt/pytestarm 2016-03-21 15:01:04 +00:00
Maksim Shabunin
dc8bb23a7d Merge pull request #6287 from StevenPuttemans:add_num_features_info_2.4 2016-03-21 14:09:21 +00:00
Maksim Shabunin
fd1b66b37d Merge pull request #6286 from StevenPuttemans:add_num_features_info 2016-03-21 14:08:49 +00:00
Maksim Shabunin
26416343c4 Merge pull request #6300 from berak:fix_akaze_sample 2016-03-21 14:01:17 +00:00
Maksim Shabunin
f3127521f3 Merge pull request #6214 from vonnieda:java_features2d 2016-03-21 11:51:11 +00:00
Alexander Alekhin
a4e35d83ff Merge pull request #6267 from dtmoodie:issue_5918 2016-03-21 09:37:11 +00:00
Maksim Shabunin
3b6190dfad Merge pull request #6150 from lvv:fix-6149-applColorMap 2016-03-21 09:20:52 +00:00
Maksim Shabunin
83379695a0 HAL interface for morphology operations 2016-03-21 09:32:06 +03:00
Leonid Volnitsky
bebab8d647 fix: 6149 (through CV_Error on wrong image type) 2016-03-19 19:57:05 +02:00
berak
e0c65499fd remove opencv_contrib dependancy from planar_tracking.cpp 2016-03-19 10:29:22 +01:00
Xiaolei Yu
40eb613bbf Make install paths relative to CMAKE_INSTALL_PREFIX 2016-03-19 16:41:51 +08:00
Vitaly Tuzov
24361733e4 Fixed face detection python test 2016-03-18 17:44:45 +03:00
Alexander Alekhin
4e479d58f8 Merge pull request #6290 from dtmoodie:thrust_allocator_usage_pr 2016-03-18 12:14:20 +00:00
Vladislav Sovrasov
fd61978795 Add goodfeatures python test and cleanup in test directory 2016-03-18 11:16:08 +03:00
Dan
da189ce1e0 Fixed regression in cv::VideoCapture with gstreamer back end that prevented viewing of rtsp streams. 2016-03-17 13:03:48 -04:00
StevenPuttemans
2a0a27d3f2 add cascade classifier info - total number of unique features passed to boosting process 2016-03-17 13:34:01 +01:00
StevenPuttemans
b5fbb2b1c8 add cascade classifier info - total number of unique features passed to boosting process 2016-03-17 13:33:11 +01:00
Alexander Smorkalov
b8ce65bec8 Merge pull request #6279 from terfendail:vt/pythontest_data 2016-03-17 12:27:12 +00:00
Alexander Alekhin
2f4e38c831 Merge pull request #6283 from jlubawy:vfw-surface4-fix 2016-03-17 11:08:12 +00:00
Vitaly Tuzov
96903dc4ad Test data necessary for python samples added to test package.
Test launch script updated to run new tests as well.
2016-03-17 11:38:40 +03:00
Alexander Smorkalov
da669569e1 Merge pull request #6281 from SpecLad:videowriter-oob 2016-03-17 08:09:13 +00:00
Josh Lubawy
1bd8bcbdd9 Remove cstdio debug 2016-03-17 01:00:49 -07:00
Josh Lubawy
f715e5b0b2 Add support for YUV 4:2:0 NV12 frame format in VFW camera capture 2016-03-16 23:38:17 -07:00
Alexander Alekhin
00ea7fe99c Merge pull request #6273 from Bleach665:vs2010_mser_sampl 2016-03-16 21:32:41 +00:00
Roman Donchenko
eb40afa26a Add a workaround for FFmpeg's color conversion accessing past the end of the buffer
I delete the LIBAVFORMAT_BUILD < 5231 branch, because I couldn't even find FFmpeg with
such a small build number, let alone test with it.
2016-03-16 20:04:33 +03:00
Bleach666
93e50dabcd fix build detect_mser sample in vc2010 2016-03-16 16:51:20 +02:00
Alexander Alekhin
d6060bbb7f Merge pull request #6270 from robbertkl:patch-2 2016-03-16 13:50:03 +00:00
Alexander Alekhin
08d5ab577c Merge pull request #6274 from Bleach665:cmake_policy_0020 2016-03-16 13:49:32 +00:00
Roman Donchenko
421fcf9e35 Rearrange CvVideoWriter_FFMPEG::writeFrame for better readability 2016-03-16 16:28:59 +03:00
Alexander Smorkalov
d142c05d61 Merge pull request #6276 from SpecLad:bp-3813 2016-03-16 11:41:27 +00:00
Bleach666
150a9e8e14 suppress warning while generating solution in cmake 2016-03-16 13:12:44 +02:00
Robbert Klarenbeek
81b11ee463 Replace deprecated malloc.h 2016-03-16 11:37:27 +01:00
Alexander Alekhin
74490399db Merge pull request #6268 from robbertkl:patch-1 2016-03-16 09:59:36 +00:00
Roman Donchenko
9a5d7f1a0b Backport PR #3813 to 2.4
It has already been partially backported by #6199; this commit completes
the backport.
2016-03-16 12:34:41 +03:00
Robbert Klarenbeek
dd510e1de9 Fix incompatibility with some C++11 implementations 2016-03-15 17:21:05 +01:00
Dan
1d21493302 Merge branch 'issue_6251' of http://github.com/dtmoodie/opencv into thrust_allocator_usage_pr 2016-03-15 11:18:41 -04:00
Dan
a21ede9452 Thrust allocator usage. 2016-03-15 11:14:47 -04:00
Dan
7a934f9ee0 Compatibility and bug fixes. 2016-03-15 11:14:42 -04:00
Dan
a8ca560684 Fixed more missing async calls. 2016-03-15 11:14:42 -04:00
Dan
79ecefb51f Implemented async calls. 2016-03-15 11:14:41 -04:00
Alexander Alekhin
97d8ca3464 Merge pull request #6266 from gongzg:master 2016-03-15 12:51:20 +00:00
Zhigang Gong
0b08d2559e fix potential race condition in canny.cl.
See the below code snippet:

while(l_counter != 0)
{
    int mod = l_counter % LOCAL_TOTAL;
    int pix_per_thr = l_counter / LOCAL_TOTAL + ((lid < mod) ? 1 : 0);

    for (int i = 0; i < pix_per_thr; ++i)
    {
        int index = atomic_dec(&l_counter) - 1;
        ....
    }
    ....
    barrier(CLK_LOCAL_MEM_FENCE);
}

If we don't put a barrier before the for loop, then there is a possiblity
that some work item enter this loop but the others are not, the the l_counter
will be reduced in the for loop and may be changed to zero, and the other
work items may can't enter the while loop. If this happens, it breaks the
barrier's rule which requires all the work items reach the same barrier.
And it may hang the GPU depends on the implementation of opencl platform.

This issue is raised at:
https://github.com/Itseez/opencv/issues/5175

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2016-03-15 19:11:15 +08:00
Alexander Alekhin
947307baae Merge pull request #6261 from dtmoodie:issue_6251 2016-03-15 07:51:24 +00:00
Dan
42c36c0c80 Linux bug fix for ThrustAllocator. 2016-03-14 11:09:52 -04:00
Alexander Alekhin
7783206934 Merge pull request #6259 from polevoy-d-v:move_sematics_fix 2016-03-14 14:46:21 +00:00
Alexander Alekhin
5517ea0adb Merge pull request #6255 from delftswa2016:fix-5002 2016-03-14 14:46:06 +00:00
Прун Виктор
a90a576d76 fixed incorrect behaviour of move semantics for cv::Ptr, cv::Mat, cv::UMat in case when rvalue-reference references to *this. 2016-03-14 16:10:23 +03:00
Alexander Alekhin
695a430007 Merge pull request #6254 from berak:patch-2 2016-03-14 11:27:55 +00:00
Alexander Alekhin
708761b219 Merge pull request #6253 from berak:patch-1 2016-03-14 11:27:11 +00:00
Alexander Alekhin
4f9e1a9a58 Merge pull request #6249 from sturkmen72:patch-15 2016-03-14 11:26:51 +00:00
Alexander Alekhin
9d49cef29e Merge pull request #6245 from delftswa2016:fix-for-issue-4375 2016-03-14 11:26:33 +00:00
Alexander Alekhin
cc3433f349 Merge pull request #6045 from matthieu-ft:master 2016-03-14 11:25:23 +00:00
renu285
45f9d32866 Removed older libraries pointing to 2.4 in eclipse tutorial docs 2016-03-14 12:09:56 +01:00
berak
79ac072e6c train_svmsgd.cpp : float response
responses must be float, else we trigger an assertion in line 150
2016-03-14 08:09:36 +01:00
berak
4555f9ac25 svmsgd.cpp, fix #6248
add a cast to double, to make vs compilers happy
2016-03-14 08:02:09 +01:00
Suleyman TURKMEN
826b5a2ef1 Update lda.cpp
typo correction
2016-03-13 21:11:34 +02:00
shruthikashyap
1fbc6ab05d Adding the syntax and usage for cv2.undistortPoints(). 2016-03-13 13:32:24 +01:00
Vadim Pisarevsky
fbc221d334 Merge pull request #6096 from mnoskova:mn/SVMSGD_to_opencv3_0 2016-03-12 17:16:35 +00:00
Vadim Pisarevsky
cd1426ba8d Merge pull request #6025 from sovrasov:new_python_tests 2016-03-12 17:11:19 +00:00
Vadim Pisarevsky
c186f424c5 Merge pull request #6119 from mshabunin:hal_filter2d 2016-03-12 17:08:10 +00:00
Vadim Pisarevsky
c9db05de22 Merge pull request #6137 from dtmoodie:thrust_allocator 2016-03-12 17:07:03 +00:00
Vadim Pisarevsky
bad09e5f58 Merge pull request #6206 from alalek:polar_fix 2016-03-12 16:40:35 +00:00
Vadim Pisarevsky
93c4dfb16d Merge pull request #6236 from alalek:backport_6232 2016-03-12 16:38:56 +00:00
Vadim Pisarevsky
da82acda6b Merge pull request #6241 from cbalint13:agast 2016-03-12 16:38:39 +00:00
Balint Cristian
f819323296 Fix AGAST keypoint declared size. 2016-03-12 16:49:14 +02:00
Alexander Alekhin
52b9207105 Merge pull request #6237 from mshabunin:fix-vtk-on-2.4 2016-03-11 14:20:16 +00:00
Maksim Shabunin
d2e451e877 Ported VTK cmake detection from master branch 2016-03-11 16:25:47 +03:00
Alexander Alekhin
c41dc915fd Merge pull request #6232 from piotr-semenov:semenovp_fixes 2016-03-11 12:23:41 +00:00
Piotr Semenov
00e91fd3d0 Fix that corrects the OpenCV's random access iterator distance: d(x,y) = -d(y,x) 2016-03-11 15:20:36 +03:00
Alexander Alekhin
afc62f076a Merge pull request #6234 from asmorkalov:as/deb_version_check 2016-03-11 10:06:25 +00:00
Alexander Smorkalov
9c4204b89e Added check if debian package version matches version from version.hpp 2016-03-11 11:59:15 +03:00
Alexander Alekhin
bcca213b88 Merge pull request #6224 from alalek:fix_java_binary 2016-03-10 17:03:43 +00:00
Maksim Shabunin
508c382673 Merge pull request #6208 from alalek:templates 2016-03-10 11:35:30 +00:00
Maksim Shabunin
3afb5a6006 Merge pull request #6171 from terfendail:vt/new_python_tests_backport 2016-03-10 09:09:32 +00:00
Piotr Semenov
108ddc199a Fix that corrects the OpenCV's random access iterator distance: d(x,y) = -d(y,x) 2016-03-10 11:58:32 +03:00
Maksim Shabunin
7e44faf635 Merge pull request #6228 from wangguoqin1001:2.4 2016-03-10 08:10:19 +00:00
WANG Guoqin
8cfc87cf01 MacOSX / QTKit capture: trying to fix invalid timer call 2016-03-10 02:49:10 +08:00
Alexander Alekhin
a7d28f3b1f Merge pull request #6217 from krrishnarraj:master 2016-03-09 09:42:17 +00:00
Alexander Alekhin
cbd0ee21d5 revert: java bindings become CMake modules (loadable plugins)
This reverts part of commit 0db10a3052a33c7326517e8140e36d46d430a3f5
2016-03-09 12:13:46 +03:00
Vladislav Sovrasov
e2434ab7c3 Use AKAZE detector instead of ORB in feature_homography test 2016-03-09 11:37:25 +03:00
Matthieu FT
78475a47a5 fix: bg substraction for float images with OpenCL 2016-03-07 16:23:05 +01:00
Krishnaraj Bhat
9b8013d193 gcc6: fix misleading indentation warning
cosmetic changes to fix this warning.
real bugs not found
2016-03-07 17:06:16 +05:30
Jason von Nieda
f4b502dd03 Adds supports for the majority of features2d to the Java wrappers:
* Adds the main features2d header to the parse list for the generator.
* Removes the manual definition of drawKeypoints and drawMatches since these are now included in the main header.
* Updates the generator to ignore SimpleBlobDetector, FlannBasedMatcher and DescriptorMatcher as these cause conflicts with the generator. This is okay since these were not previously included in the distribution anyway, so no harm is done.
2016-03-07 00:14:53 -08:00
Alexander Alekhin
2144afd836 move GitHub templates into .github folder 2016-03-04 14:20:25 +03:00
Alexander Alekhin
9ebbfc7bdb Merge pull request #6207 from StevenPuttemans:fix_annotation 2016-03-04 11:02:20 +00:00
StevenPuttemans
b47f2600cd missing break statement 2016-03-04 09:41:13 +01:00
Alexander Alekhin
ea049e147d Merge pull request #6199 from alalek:ffmpeg_backport 2016-03-03 17:25:33 +00:00
Alexander Alekhin
05a68fd82b Merge pull request #6118 from Emoters:hotfix/planar_tutorial_fixes 2016-03-03 17:24:08 +00:00
Alexander Alekhin
eeec404b9a Merge pull request #6144 from Dikay900:patch-2 2016-03-03 17:23:00 +00:00
Alexander Alekhin
e587c24f9e Merge pull request #6145 from Dikay900:patch-3 2016-03-03 17:17:25 +00:00
Alexander Alekhin
8266903ee9 Merge pull request #6205 from Aravind-Suresh:vs-za-option-bug-fix 2016-03-03 16:23:47 +00:00
Alexander Alekhin
ec66a3700f logPolar/linearPolar: more accurate processing near zero angle slice 2016-03-03 19:08:08 +03:00
Maksim Shabunin
98fff4a601 Added separate hal::SepFilter2D class 2016-03-03 18:56:12 +03:00
Maksim Shabunin
17cd1dac06 HAL Filter2D interface: Updated according to comments 2016-03-03 18:56:12 +03:00
Maksim Shabunin
85b2c2ae58 Fixed build with older standalone IPP versions 2016-03-03 18:56:12 +03:00
Maksim Shabunin
8414c6518f Fixed build with older ippicv 2016-03-03 18:56:12 +03:00
Maksim Shabunin
27abd4d3a3 Filter2D HAL interface 2016-03-03 18:56:12 +03:00
Alexander Alekhin
275bfcf99c fix logPolar/linearPolar 2016-03-03 18:33:11 +03:00
aravind
dccbf50059 Fixed VS 2010 and option Za bug. 2016-03-03 18:01:05 +05:30
Alexander Alekhin
60f73eee7e Merge pull request #6204 from alalek:minor_fix_break 2016-03-03 12:07:16 +00:00
Philip
7842c0d792 add link to http://answers.opencv.org for questions 2016-03-03 12:40:16 +01:00
Alexander Alekhin
88a33a4e4f Merge pull request #6201 from paroj:gst_noconvert 2016-03-03 11:36:05 +00:00
Alexander Alekhin
c1f3c41bab apps: add missed 'break' 2016-03-03 14:23:59 +03:00
Vitaly Tuzov
d29eb2938c Calibration test temporary disabled 2016-03-03 13:38:08 +03:00
Vladislav Sovrasov
22b028b64b Fix warnings in python3 2016-03-03 11:06:21 +03:00
Vladislav Sovrasov
e4fed417d2 Add segmentation and object tracking python tests 2016-03-03 11:06:21 +03:00
Vladislav Sovrasov
0c6e09f060 Changes in facedetect test 2016-03-03 11:06:21 +03:00
Vladislav Sovrasov
87fc75c6d7 Improvements in tests, bugfix in digits_video sample 2016-03-03 11:06:21 +03:00
Vladislav Sovrasov
4e3a6328ba Fixes in calibration and camshift tests 2016-03-03 11:06:21 +03:00
Vladislav Sovrasov
54c07ba0ff Add 2 new tests, bugfixed in old tests 2016-03-03 11:06:21 +03:00
Vladislav Sovrasov
86868176a2 Fix py3 comatibility 2016-03-03 11:06:21 +03:00
Vladislav Sovrasov
e90dc20361 Update letter_recog sample to current version of opencv interfaces 2016-03-03 11:06:21 +03:00
Vladislav Sovrasov
d579f08093 Fix mouse control in asift and find_obj samples 2016-03-03 11:06:21 +03:00
Vladislav Sovrasov
3a51cae208 Fix rectangle selection in some of python samples 2016-03-03 11:06:21 +03:00
Vladislav Sovrasov
cb7cc81653 Add dft python test, fix platform depended result in morphology test 2016-03-03 11:06:21 +03:00
Vladislav Sovrasov
aaa43dc84f Add morphology python test, fix python3 compabtibility in kmeans test 2016-03-03 11:06:20 +03:00
Vladislav Sovrasov
56571561b4 Add k-means python test, fix loading images in calibration test 2016-03-03 11:06:20 +03:00
Vladislav Sovrasov
5625d79508 Fix loading images in python tests 2016-03-03 11:06:20 +03:00
Vladislav Sovrasov
ab4d375349 Add new tests on python 2016-03-03 11:06:20 +03:00
Pavel Rojtberg
ff77f4d9ef GStreamer: allow reading raw MJPEG data 2016-03-02 17:31:20 +01:00
Alexander Alekhin
a61b19b524 backport ffmpeg fixes 2016-03-02 18:42:53 +03:00
Alexander Alekhin
bc6ed1467b Merge pull request #6193 from trombipeti:Fix_#6192 2016-03-02 15:19:01 +00:00
Vadim Pisarevsky
7f4a1bcac7 Merge pull request #6160 from paroj:fe_distort 2016-03-02 13:34:32 +00:00
Vadim Pisarevsky
77f54e0f3e Merge pull request #6161 from mshabunin:fix-mac-sliders 2016-03-02 13:33:45 +00:00
Vadim Pisarevsky
5e631d5cd7 Merge pull request #6194 from eladj:subdiv2d_documentation 2016-03-02 13:31:43 +00:00
Elad Joseph
238b47dfce Added param documentation
Added param description to remove doxygen warning
2016-03-02 08:55:53 +02:00
Elad Joseph
2234016a22 Added Subdiv2D class documentation
Added documentation to the Subdiv2D documentation, based on the previous
C API.
2016-03-01 23:08:48 +02:00
Péter Trombitás
410eb30c26 Fix for #6192 (Mismatching delete) 2016-03-01 21:40:05 +01:00
Alexander Alekhin
cb012010c6 Merge pull request #6190 from berak:fix_ml_python_tutorial 2016-03-01 14:05:42 +00:00
berak
fa1426f123 fix python ml tutorials 2016-02-29 22:37:59 +01:00
Elad Joseph
34b8f1d595 Merge remote-tracking branch 'refs/remotes/Itseez/master' 2016-02-29 21:48:30 +02:00
Alexander Alekhin
318671d9b5 Merge pull request #6148 from Aravind-Suresh:cv-cuda-reduce-bug-fix 2016-02-29 19:07:05 +00:00
Alexander Alekhin
7600757d07 Merge pull request #6181 from delftswa2016:fix-for-issue-6146 2016-02-29 15:13:39 +00:00
Alexander Alekhin
cd1aef77ea Merge pull request #6174 from alalek:fix_python_msvs 2016-02-29 11:51:34 +00:00
shruthikashyap
d64b35f11d Fix for issue 6146 and some grammar corrections 2016-02-27 23:26:23 +01:00
shruthikashyap
23ba94140e Fix for issue 6146 2016-02-27 23:16:52 +01:00
aravind
f4f1561781 Fixed cv::cuda::reduce bug. 2016-02-27 08:30:10 +05:30
Alexander Alekhin
d2e5f90f32 cmake: fix cv2.lib conflict for python2/3 bindings (MSVS) 2016-02-26 17:08:07 +03:00
Marina Noskova
3f0a51bda1 Fixed documentation. 2016-02-26 14:40:23 +03:00
Vitaly Tuzov
25b4d8a1b5 Added images necessary for tests 2016-02-26 12:42:35 +03:00
Vitaly Tuzov
aaa30dc5b6 Make some tests less strict due to improvement of related algorithms in master branch 2016-02-26 12:42:35 +03:00
Vitaly Tuzov
e0f426f78b Backport of new python tests from master branch(PR https://github.com/Itseez/opencv/pull/6025).
At the moment tests requre samples/data copied to source location from master branch.
2016-02-26 12:42:18 +03:00
Marina Noskova
53711ec29d Deleted default value for parameters in docs.
Added some asserts.
2016-02-25 19:12:54 +03:00
Marina Noskova
d484893839 Deleted functions makeTrainData() and makeTestData() in test_svmsgd.cpp.
Added function makeData() in test_svmsgd.cpp.
2016-02-25 16:57:03 +03:00
Marina Noskova
74c87a26a5 Delete function areClassesEmpty(). 2016-02-25 15:31:07 +03:00
Alexander Alekhin
81f21e6e6c Merge pull request #6139 from ioxp:master 2016-02-25 11:41:49 +00:00
Alexander Alekhin
171541777e Merge pull request #6166 from mshabunin:fix-exif-fds-leak 2016-02-25 11:11:28 +00:00
Maksim Shabunin
3a92371b60 EXIF reader: fixed file descriptor leak in case of broken tags 2016-02-25 12:19:11 +03:00
Maksim Shabunin
3cc234588a Added build warnings in case of macro definition conflicts 2016-02-25 11:51:02 +03:00
Maksim Shabunin
ee2f8d006f Cocoa backend: added checks before accessing sliders dictionary 2016-02-25 11:51:01 +03:00
Pavel Rojtberg
bb605279b6 clarify how to use fisheye::distortPoints 2016-02-24 16:18:13 +01:00
Marina Noskova
068677ad50 Fixed documentation. 2016-02-24 14:41:51 +03:00
Marina Noskova
9d9a5bbbfd Fixed documentation. 2016-02-24 13:33:43 +03:00
Marina Noskova
f3c4a6aab8 Rename parameters lambda, gamma0 and c. 2016-02-24 13:22:07 +03:00
Philip
7ff93600b8 Create a Pull Request template
In addition to the Issue template which is far more important i would like to add this so issues will get closed after merging related PRs rather than being reliant on the reviewer.
If someone want to add something here feel free.
2016-02-19 14:29:59 +01:00
Philip
74ee9ac572 Add an Issue template for new issues
Since we've got a new feature here on github i would like to use it to get all relevant information into the reported issues.
https://help.github.com/articles/creating-an-issue-template-for-your-repository/

I started a file but i would like to hear some other options about what to add.

add "steps to reproduce" if no code example is applicable

change to comments from alalek
2016-02-19 14:08:58 +01:00
Alexander Alekhin
177aef05b6 Merge pull request #6141 from Aravind-Suresh:fisheye-documentation-fix 2016-02-19 07:29:19 +00:00
Dan
95608b1b84 free -> deallocate 2016-02-18 15:05:13 -05:00
aravind
7ad849718c Fixed Fisheye Camera model documentation. 2016-02-19 01:17:39 +05:30
Philipp Hasper
3f1eeba39d findHomography sets output mask to all zeros in case of no inlier 2016-02-18 17:58:28 +01:00
Alexander Alekhin
46662ccd99 Merge pull request #6136 from mbarnach:6135-Fix-upperbody_xml_in_cuda 2016-02-18 13:20:45 +00:00
Mathieu Barnachon
9a44e92193 Fix the missing - in file. 2016-02-18 11:28:41 +01:00
Dan
c0e34934c8 Merge branch 'thrust_allocator' of https://github.com/dtmoodie/opencv 2016-02-18 00:43:18 -05:00
Dan
da93a5527d Thrust allocator for temporary storage used with thrust algorithms. 2016-02-18 00:23:20 -05:00
Alexander Alekhin
06ea7094f5 Merge pull request #6129 from mzajko:xi_new_param 2016-02-17 15:47:59 +00:00
Marian Zajko
e55a053d71 ximea new param
- added CAP_PROP_XI_SENSOR_BOARD_TEMP parameter
- added acquisition resetting for paramters that require it
2016-02-17 11:18:49 +01:00
Alexander Alekhin
2549bafe4f Merge pull request #6121 from mshabunin:fix-check-imencode-exif 2016-02-17 00:45:49 +00:00
Maksim Shabunin
03d6d2041a Merge pull request #6113 from rahulchhabra07:patch-1 2016-02-16 09:04:38 +00:00
Maksim Shabunin
a54870aace Added filename emptyness check to the Exif reader, fixes 6120 2016-02-16 11:37:36 +03:00
Alexander Alekhin
8c591ebd77 Merge pull request #6060 from alalek:fix_opencl_opengl_sharing_6052 2016-02-16 07:10:02 +00:00
Alexander Alekhin
8a09d95eab Merge pull request #6106 from ilya-lavrenov:compilation-warning 2016-02-15 15:12:49 +00:00
Maksim Shabunin
d1a2c73228 Merge pull request #6090 from alalek:feature_6089 2016-02-15 14:17:15 +00:00
Maksim Shabunin
1aeff45631 Merge pull request #6103 from mshabunin:add-get-samples 2016-02-15 13:11:28 +00:00
Maksim Shabunin
8c29380471 Merge pull request #6105 from mshabunin:tutorial-folder-correction 2016-02-15 13:10:45 +00:00
Marina Noskova
02cd8cf039 Deleted illegal type values. 2016-02-15 15:09:59 +03:00
Eric Zavesky
77fa8d9d5a - fix windows-based warnings for type casts 2016-02-15 05:37:54 -06:00
Marina Noskova
ff54952769 Corrected spelling mistakes 2016-02-15 14:35:36 +03:00
Eric Zavesky
335f7e7916 - trim whitespace, as required by build machine 2016-02-15 05:33:37 -06:00
Eric Zavesky
d7e57f2152 - fix typo from last minute change 2016-02-15 04:54:59 -06:00
Eric Zavesky
4c5af4f361 - add ROI selection, allow device input, use BB for area exclusion
- previously BB was ignored for first frame, now masks analysis area
  - also allow real-time feedback of processing
2016-02-15 04:27:28 -06:00
Eric Zavesky
4546139844 - remove zero threshold that prevents ORB from finding any local features 2016-02-15 04:26:03 -06:00
Maksim Shabunin
28dd315ef3 Merge pull request #6104 from alalek:issue_6102 2016-02-15 09:59:35 +00:00
Alexander Alekhin
84bf7680c7 Merge pull request #6100 from alalek:fix_5934 2016-02-15 02:52:07 +00:00
Rahul Chhabra
232f564011 Update imgproc.hpp
In reference to Issue #6110, the order of markerType and color is changed.
2016-02-14 10:18:14 +05:30
Ilya Lavrenov
068769263e fixed compilation warning 2016-02-12 18:12:20 +03:00
Maksim Shabunin
6c0c0466c6 Tutorials: moved Megamind.avi files to samples/data folder 2016-02-12 13:44:14 +03:00
Maksim Shabunin
359acc0d33 Tutorials: moved imgcodecs and videoio tutorials to separate pages 2016-02-12 13:35:46 +03:00
Alexander Alekhin
f48cda2f95 test: initialize test data in test_umat.cpp (6102) 2016-02-12 13:15:15 +03:00
Maksim Shabunin
54abb83c82 ml: moved getTestSamples implementation to src 2016-02-12 12:32:26 +03:00
ahb
15793b1301 add TestData::getTestSamples() 2016-02-12 12:11:10 +03:00
Alexander Alekhin
80102b76f9 Merge pull request #6074 from alalek:ffmpeg_interrupt_callback_compatibility 2016-02-11 15:00:52 +00:00
Alexander Alekhin
b2ca10a81f cmake: fix find_library() for bzip2 2016-02-11 12:57:10 +03:00
Alexander Alekhin
c7bdbef504 ocl: fix OpenGL sharing detection (6052)
Apple OpenCL framework hasn't OpenGL sharing extension
2016-02-11 12:46:22 +03:00
Alexander Alekhin
87bbaa2c27 ocl: OpenCL headers are located in "CL" subfolder (3rdparty/include) 2016-02-11 12:44:45 +03:00
Alexander Alekhin
2c4ed7f8a5 Merge pull request #6051 from mshabunin:fix-cap-qtkit 2016-02-10 17:35:20 +00:00
Alexander Alekhin
5efadcb335 Merge pull request #6042 from Dmitry-Me:reduceVariablesScope 2016-02-10 17:33:43 +00:00
Alexander Alekhin
8ac96eecd2 Merge pull request #6073 from alalek:fix_5897 2016-02-10 17:33:12 +00:00
Marina Noskova
5496dedd6a Fixed warnings. 2016-02-10 19:46:24 +03:00
Marina Noskova
0307dd19fd Minor fix in declaration of SVMSGD::setOptimalParameters 2016-02-10 18:21:45 +03:00
Marina Noskova
617dd5db5b Fixed doc/opencv.bib 2016-02-10 17:57:36 +03:00
Marina Noskova
c522172367 Fixed small bug in SVMSGD::clear(). 2016-02-10 16:59:12 +03:00
Marina Noskova
05353a1492 Removed trailing whitespaces 2016-02-10 16:59:12 +03:00
Marina Noskova
41c0a38344 Fixed test samples for tests with different borders
Added new test (separating two points)
2016-02-10 16:59:12 +03:00
Marina Noskova
bfdca05f25 Added margin type, added tests with different scales of features.
Also fixed documentation, refactored sample.
2016-02-10 16:59:12 +03:00
Marina Noskova
acd74037b3 Increasing the dimension of features space in the SVMSGD::train function. 2016-02-10 16:59:11 +03:00
Marina Noskova
40bf97c6d1 Refactored SVMSGD class 2016-02-10 16:56:14 +03:00
joao.faro
a2f0963d66 SVMSGD class added 2016-02-10 16:53:15 +03:00
Mathieu Barnachon
6a0d3b3e42 Called after setDevice.
Wrap in a cudaSafeCall.
2016-02-09 14:40:09 +01:00
Alexander Alekhin
b529b37d06 Merge pull request #6032 from mzajko:ximea_getprop_update 2016-02-09 12:07:17 +00:00
Alexander Alekhin
9ac35173e3 cmake: remove non-ascii symbols 2016-02-09 14:44:05 +03:00
Alexander Alekhin
1dac67f013 cmake: add version control revision info for extra modules 2016-02-09 14:39:05 +03:00
Alexander Alekhin
de8b3ee231 cmake: add timestamp into build info log (6089) 2016-02-09 14:39:04 +03:00
Marian Zajko
c21657336b ximea interface update
- fixed getProperty call definition
- added new parameter defitions

removed whitespaces

Reworked enumerators to keep values from previous commit

ximea enums fixes

- fixed whitespaces issue
- fixed duplicate enum values error

ximea enum definitions update

- fixed videioio.hpp code style
- fixed ABI violation in enums
- added new parameter handlers to cpp

XIMEA setProperty update

Added acquisition resetting to buffer size adjustment parameters.
2016-02-09 10:36:22 +01:00
Alexander Alekhin
e4dc479e95 Merge pull request #6088 from mshabunin:fix-exif-parsing 2016-02-08 16:01:07 +00:00
Alexander Alekhin
afdcfccdae Merge pull request #6082 from alekcac:alekcac-readme-changes 2016-02-08 15:57:55 +00:00
Maksim Shabunin
21e9edd1a3 Merge pull request #6083 from alekcac:alekcac-removed-gittip-link-in-2.4 2016-02-08 15:32:41 +00:00
Maksim Shabunin
7ba9b4fd1a Merge pull request #6085 from StevenPuttemans:add_at_matrix_info 2016-02-08 15:30:17 +00:00
Maksim Shabunin
112aa49104 ExifReader::getFormat : check buffer length before accessing, fixes 6059 2016-02-08 17:14:55 +03:00
Steven Puttemans
cd96df1407 Update mat.hpp 2016-02-08 13:26:06 +01:00
Mathieu Barnachon
b030ac0433 Ensure the Cuda context is initialized correctly as long as the setDevice is not called in a multi-thread environment. 2016-02-08 13:17:08 +01:00
Steven Puttemans
a70c54f2c5 Added suggestions from PR6068
As discussed here: https://github.com/Itseez/opencv/pull/6068#issuecomment-180797723
2016-02-08 10:20:08 +01:00
Alexander Shishkov
544824ffc1 Removed gittip link
This project is dead from the 1st September last year
2016-02-08 11:07:58 +03:00
Alexander Shishkov
4f5497837a Removed gittip link
This project is dead from 1st September last year
2016-02-08 11:04:19 +03:00
Alexander Alekhin
f9f5313670 Merge pull request #6075 from pranavg189:master 2016-02-07 09:41:29 +00:00
Pranav Ganorkar
4a5ed70175 removed dirname variable 2016-02-07 03:09:21 +05:30
Alexander Alekhin
c09b6000c6 ffmpeg: compatibility guard for interrupt callback feature 2016-02-06 15:20:36 +03:00
Alexander Alekhin
c10c8db97d cmake: skip checks for host paths on cross-compilation (5897) 2016-02-06 15:19:28 +03:00
Alexander Alekhin
e04f372083 Merge pull request #6068 from StevenPuttemans:add_at_matrix_info 2016-02-05 14:03:22 +00:00
Alexander Alekhin
0e909aa676 Merge pull request #6067 from StevenPuttemans:adapt_cmake 2016-02-05 12:51:00 +00:00
StevenPuttemans
873399705d add clarification on the acces paramter of the at operator 2016-02-05 13:21:40 +01:00
StevenPuttemans
6cdf3116c4 deactivate build options by default that are not supposed the be ON by default 2016-02-05 11:01:21 +01:00
Alexander Alekhin
b148ef2b1f Merge pull request #6053 from peters:master 2016-02-04 19:33:20 +00:00
Peter Rekdal Sunde
da48061910 Add interrupt callback with default timeout of 30s. Fixes #5730.
Fix docs build failure by re-indenting with spaces instead of tabs.

Trailing whitespace fixes. http://pullrequest.opencv.org/buildbot/builders/precommit_docs/builds/5152/steps/whitespace/logs/stdio

mingw build fix.
2016-02-04 18:09:14 +01:00
Alexander Alekhin
b2d44663fd Merge pull request #6058 from sturkmen72:documentation_fix_cv_repeate 2016-02-04 15:14:02 +00:00
Alexander Alekhin
ea8f9b032f Merge pull request #6062 from StevenPuttemans:fix_cascade_detect 2016-02-04 14:04:53 +00:00
StevenPuttemans
89df7923a7 revert PR 5362 2016-02-04 13:20:21 +01:00
Vadim Pisarevsky
56c89e0a98 Merge pull request #6014 from alalek:fix_5991 2016-02-04 09:54:27 +00:00
Vadim Pisarevsky
dabce70325 Merge pull request #6057 from alalek:fix_opencl_load_threadsafe 2016-02-04 09:31:36 +00:00
Suleyman TURKMEN
194b865daf update documentation of cv::repeat 2016-02-03 23:36:30 +02:00
Alexander Alekhin
7e472fbf68 ocl: thread-safe OpenCL loading (6056) 2016-02-03 18:30:40 +03:00
Alexander Alekhin
6f51dd1258 Merge pull request #6009 from patricksnape:flann_python_fix 2016-02-02 16:03:54 +00:00
Maksim Shabunin
a2bda99921 MacOSX / QTKit capture: trying to fix invalid timer call 2016-02-02 14:30:37 +03:00
Alexander Alekhin
35014a9742 Merge pull request #6048 from philippefoubert:ximea_bugfix 2016-02-02 07:25:34 +00:00
Alexander Alekhin
d6e2097435 Merge pull request #6037 from atinfinity:pullreq/160130-enable-nvcuvid-2.4 2016-02-02 07:09:20 +00:00
Alexander Alekhin
e0baa02193 Merge pull request #6036 from atinfinity:pullreq/160130-enable-nvcuvid 2016-02-02 07:08:49 +00:00
Philippe FOUBERT
43a1874e33 Bug correction:
The "CvCaptureCAM_XIMEA::getProperty" method had not the same signature as "CvCapture::getProperty" so it was not called when we use the "VideoCapture::get" method (the "const" specifier was missing).
2016-02-01 19:19:52 +01:00
atinfinity
cf43790a27 added cmakedefine to cmake/templates/cvconfig.h.in 2016-02-01 21:15:28 +09:00
atinfinity
db6e095fcc added cmakedefine to cmake/templates/cvconfig.h.in 2016-02-01 20:59:11 +09:00
Dmitry-Me
bf604f1780 Reduce variables scope 2016-02-01 11:10:13 +03:00
atinfinity
69eaa89e22 fixed to use NVCUVID in 'cudacodec' module. 2016-01-31 01:56:45 +09:00
atinfinity
ed8368fed7 fixed to use NVCUVID in 'cudacodec' module. 2016-01-31 01:28:15 +09:00
Alexander Alekhin
a4692a0da5 Merge pull request #6035 from ogreen:master 2016-01-30 08:23:00 +00:00
Oded Green
1a0282df21 CUDA median filtering using histograms 2016-01-29 20:05:40 -05:00
Alexander Alekhin
4894aac50d Merge pull request #6012 from mzajko:xi_cmake_update 2016-01-29 09:41:42 +00:00
alcinos
e22b838af8 Wrap SparseOptFlow class around PyrLK optical flow computation 2016-01-29 01:47:51 +01:00
alcinos
9b70c44f00 Adding interface for Sparse flow computation 2016-01-28 20:03:28 +01:00
alcinos
6e3b90de9b Add static creator for TVL1 optical flow class 2016-01-28 20:03:28 +01:00
alcinos
be4312ec3d Wrap DenseOptFlow class around Farneback optical flow computation 2016-01-28 20:03:27 +01:00
Alexander Alekhin
2978a16c85 core: preserve sizes values (fixes #5991)
_sizes can point to internal structure which is destroyed
by release() call
2016-01-26 14:11:53 +03:00
Alexander Alekhin
96f5a930f4 test: regression 5991 2016-01-26 14:11:53 +03:00
Marian Zajko
a387d6fa26 - removed whitespaces 2016-01-25 13:13:13 +01:00
Marian Zajko
34c006fcc4 Fixed ximea cmake settings
Fixed ximea cmake settings for 32bit win build and linux.
2016-01-25 11:05:55 +01:00
Patrick Snape
05cfe28612 Fix parsing of training vecs for FlannBasedMatcher
FlannBasedMatcher::add is overloaded, but the style of parsing the
InputArrayOfArrays does not match the style from
DescriptorMatcher::add. The issue is that InputArrayOfArrays
must be properly marshalled so that the data can be read
correctly. In this case, the method expects the training
descriptors to be either a vector of matrices or a single matrix
(as is shown in DescriptorMatcher::add). These code
replicates that for the case of the FlannBasedMatcher::add.

In fact, a similar commit to this was added by 26d9a7c but was
ultimately not accepted in #4111. This is likely due to the
fact that the input arrays were not parsed properly and the
case of a single matrix was being improperly handled. I believe
this commit to be correct given the logic from
DescriptorMatcher::add.
2016-01-23 15:58:16 +00:00
Patrick Snape
2f5ea3437e Update indentation to match rest of file
Very cosmetic, but was analyzing code and just wanted to make it
consistent.
2016-01-23 15:57:46 +00:00
Amro
c35b00a97e fix code snippet showing how to use SparseMat
generate indices within the size limit (modulo)
2016-01-23 17:28:49 +02:00
Alexander Alekhin
e835878661 Merge pull request #6006 from mleotta:fix-install-name-dir 2016-01-23 06:41:51 +00:00
Matt Leotta
912592de4c Remove "INSTALL_NAME_DIR lib" target property
The INSTALL_NAME_DIR property of a target specifies how a dynamic library should
be found on OS X.  If INSTALL_NAME_DIR is not specified the loader will search
relative to the standard search paths.  If specified it should either be
an absolute path or relative path prefixed with either @executable_path,
@load_path, or @rpath.  Specifying "lib" does not make sense here and
causes linking error as documented here:

http://answers.opencv.org/question/4134/cmake-install_name_tool-absolute-path-for-library-on-mac-osx/

and here

http://stackoverflow.com/questions/26978806/dyld-library-not-loaded-lib-libopencv-core-3-0-dylib-reason-image-not-found

This patch removes INSTALL_NAME_DIR everywhere it is set to "lib".
An alternate solution would be to set an absolute path like
"${CMAKE_INSTALL_PREFIX}/lib" or relative path like
"@executable_path/../lib".  However, if there is not specific need for
specifying a path, it is probably best left unset.
2016-01-21 16:07:56 -05:00
Alexander Alekhin
85793d0138 Merge pull request #6001 from terfendail:pyrsegmentation_valgrind 2016-01-21 15:03:46 +00:00
Alexander Alekhin
a57b03c356 Merge pull request #5993 from asmorkalov:linitian_signed_packages 2016-01-21 15:03:31 +00:00
Alexander Smorkalov
5a5378b3bf Added lintian overrides for package signature entry. 2016-01-21 17:04:28 +03:00
Maksim Shabunin
1cd3c6f364 Merge pull request #6000 from alalek:fix_python_detection 2016-01-21 11:30:58 +00:00
Alexander Alekhin
c5531a7a2f Merge pull request #5985 from Entodi:patch-1 2016-01-21 10:02:55 +00:00
Vitaly Tuzov
f01f1bc5e6 Fixed "Conditional jump or move depends on uninitialised value(s)" valgrind issue due to wrong pointer recalculation for zero level of pyramid. 2016-01-21 12:54:08 +03:00
Alexander Alekhin
75b709328e Merge pull request #5994 from alalek:fix_include_opencv 2016-01-21 05:17:36 +00:00
Alexander Alekhin
85c7190e41 Merge pull request #5995 from alalek:fix_include_opencv_24 2016-01-21 05:16:37 +00:00
Alexander Alekhin
5c8907c0e1 Merge pull request #5992 from ejoebstl:master 2016-01-20 16:31:41 +00:00
Alexander Alekhin
9bee835dac cmake: fix python detection 2016-01-20 19:01:00 +03:00
Alexander Alekhin
f2e4bec925 Merge pull request #5996 from ElenaGvozdeva:pyrUp_fix 2016-01-20 15:50:59 +00:00
emiswelt
b6c5936704 Removed trailing whitespace.
Note: Force push to force a re-run of build tests. The previous tests
failed in an unrelated module. I assume it's a bug that occured
randomly.
2016-01-20 12:04:42 +00:00
Alexander Alekhin
4a8d1147c2 include available modules only 2016-01-20 13:14:20 +03:00
Alexander Alekhin
24bbdeb0c8 include available modules only 2016-01-20 13:07:46 +03:00
Elena Gvozdeva
bb1c2d71a8 fix bug on border at pyrUp 2016-01-20 13:07:07 +03:00
emiswelt
cc3b2f6197 Added a helpful comment on the scale parameter of the spherical
warper.
2016-01-19 15:39:07 +00:00
Vadim Pisarevsky
347ffbb0eb Merge pull request #5983 from pra85:patch-1 2016-01-19 10:51:21 +00:00
Vadim Pisarevsky
be565c2235 Merge pull request #5984 from terfendail:2.4 2016-01-19 10:49:56 +00:00
thierry
bdb9cf4d47 fix inversed grayscale conditional 2016-01-18 17:56:26 +01:00
thierry
1b5352688f better png transparency handling 2016-01-18 16:10:02 +01:00
Alexander Fedorov
474c53ac71 Fixed parser for img1_filename and img2_filename.
Without fixes after 68 line (img1_filename = parser.get<std::string>(0);) OpenCV Error:
./stereo_matching im0.png im1.png --max-disparity=16 --blocksize=17

OpenCV Error: Bad argument (undeclared position 0 requested) in getByIndex, file /home/entodi/opencv/modules/core/src/command_line_parser.cpp, line 169
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/entodi/opencv/modules/core/src/command_line_parser.cpp:169: error: (-5) undeclared position 0 requested in function getByIndex
2016-01-18 15:34:41 +03:00
Alexander Alekhin
3f8d5be56f Merge pull request #5971 from AlexeyAB:correct_lighting_3d_reconstruct 2016-01-18 10:05:45 +00:00
Alexander Alekhin
8203b82f86 Merge pull request #5981 from IshankGulati:feature_homography 2016-01-18 10:05:14 +00:00
Vitaly Tuzov
389f176a67 Removed ioctl calls to query for VIDIOC_G_INPUT and VIDIOC_ENUMINPUT since information returned by the calls is never used.
Fixed icvCaptureFromCAM_V4L return value in case of V4L2 camera initialization failure.
2016-01-18 12:54:53 +03:00
Prayag Verma
9a783d2a8e Update license year range to 2016 2016-01-18 10:11:01 +05:30
Maksim Shabunin
68eab8ea00 Merge pull request #5884 from alalek:cmake_vars 2016-01-17 09:43:17 +00:00
Ishank gulati
5312db93b4 added equality 2016-01-17 09:46:23 +05:30
Alexander Alekhin
64057965f5 Merge pull request #5979 from alalek:world_disable_pch 2016-01-15 17:28:48 +00:00
Alexander Alekhin
ec1e1c6fe9 Merge pull request #5976 from alalek:fix_cmake_opencl 2016-01-15 16:52:47 +00:00
Alexander Alekhin
c75f9c80c7 cmake: turn off precompiled headers in case of opencv_world builds 2016-01-15 19:43:24 +03:00
Alexander Alekhin
5c21ca2697 Merge pull request #5975 from terfendail:2.4 2016-01-15 11:45:10 +00:00
Alexander Alekhin
8f37a3a37c cmake: make ocv_cmake_dump_vars() case insensitive 2016-01-15 14:38:25 +03:00
Alexander Alekhin
9cd6731894 cmake: add DEBUG_PRE/DEBUG_POST commands handling
Useful for debug purposes:
    cmake -DDEBUG_POST="ocv_cmake_dump_vars(CUDA)" .
    cmake -DCMAKE_PRE="ocv_cmake_dump_vars(\"OPENCL|opencl\")" .
2016-01-15 14:36:03 +03:00
Alexander Alekhin
9d4ee2f54d cmake: added generation of CMakeVars.txt
related: #5845
2016-01-15 13:54:28 +03:00
Alexander Alekhin
c35ddcba1a cmake: refactor OpenCL detection, allow custom configurations 2016-01-15 13:05:16 +03:00
Vitaly Tuzov
4f5d585184 Update call to Tegra optimized morphology filtering 2016-01-15 11:48:29 +03:00
Alexander Alekhin
243c513eea Merge pull request #5969 from alalek:fix_cuda_world 2016-01-15 06:57:19 +00:00
AlexeyAB
fcbb57a63f Added ability to disable lighting in the viz-module.
When I reconstructed the 3D scene I want to show it as viz::WMesh with an initial value of lighting. For this I disable lighting and shadows:
cv::viz::Viz3d viz_3d_window("3D");
viz_3d_window.setRenderingProperty("mesh", cv::viz::LIGHTING, 0);

Most of the examples show the 3D reconstruction using the point cloud, but using  the mesh one part of it creates a shadow on other parts of it if lighting ON.
Using a 3D mesh with disabled lighting gives the most realistic picture of the reconstructed 3D scene.
2016-01-14 19:02:18 +03:00
Alexander Alekhin
df89e76fb1 Merge pull request #5922 from DarwinsBuddy:fix_no_py_load_svm_bug 2016-01-14 14:44:27 +00:00
Alexander Alekhin
bc46682b28 Merge pull request #5893 from dtmoodie:vtk 2016-01-14 14:44:07 +00:00
Alexander Alekhin
c8ff7a4867 build: fix opencv_world with CUDA 2016-01-14 17:23:55 +03:00
Alexander Alekhin
c3ad8af42a Merge pull request #5968 from alalek:fix_5967 2016-01-14 13:18:38 +00:00
Alexander Alekhin
cb0b2bd1af Merge pull request #5965 from amroamroamro:fix_concentric_spheres 2016-01-14 12:09:25 +00:00
Alexander Alekhin
a1d7e38adb Merge pull request #5964 from amroamroamro:fix_lr 2016-01-14 12:08:53 +00:00
Alexander Alekhin
0655a2dc20 Merge pull request #5963 from KeySecure:master 2016-01-14 12:08:28 +00:00
Alexander Alekhin
d6134a0089 Merge pull request #5962 from BinMatrix:patch-4 2016-01-14 12:08:06 +00:00
Alexander Alekhin
cda8e449ec Merge pull request #5954 from smidm:patch-1 2016-01-14 12:07:37 +00:00
Alexander Alekhin
7494fa33c6 Merge pull request #5923 from powderluv:master 2016-01-14 12:07:02 +00:00
Alexander Alekhin
c7ccde69a8 fix TLS implementation (closes #5967) 2016-01-14 14:38:37 +03:00
Amro
47cdb041f2 fix assignment of class labels
by using the indices from the sorted distance vector of pairs.
2016-01-14 02:56:34 +02:00
Amro
542f2b2e3c clean up code for train and predict methods of LR 2016-01-13 20:47:07 +02:00
Amro
e67178c696 fix LR predict with raw output in 2-class case
In case of binary class, pred_m is initialized as zero vector and later
returned when raw outputs are requested, but it is never filled.
2016-01-13 19:48:21 +02:00
Alexander Alekhin
3d2fc6c2fd Merge pull request #5952 from alalek:ffmpeg_alloc_buffer 2016-01-13 17:31:32 +00:00
KeySecure
e6ac2ca3c9 make Xcode 7.2 happy. 2016-01-13 20:19:19 +08:00
BinMatrix
c7481c55f7 Fix the mouse bug and the problem of collapse 2016-01-13 19:04:17 +08:00
Alexander Alekhin
e3690db4bd Merge pull request #5949 from akarsakov:fixed_solvePnPRansac_input_handling 2016-01-12 17:58:07 +00:00
Alexander Alekhin
5a998335a6 Merge pull request #5943 from alalek:regression_5908 2016-01-12 17:15:15 +00:00
Matěj Šmíd
3e176bbfa0 fisheye documentation typo 2016-01-12 16:33:34 +01:00
Alexander Alekhin
285eb0a539 videoio ffmpeg: fix buffer allocation for unaligned frame sizes 2016-01-12 17:57:43 +03:00
Alexander Karsakov
e784ea7178 Fixed getSubset method to support Nx3 1-channel matrices as input (3xN 1-channel matrices doesn't supported at all). 2016-01-12 13:26:17 +03:00
Alexander Karsakov
0c9c7d5f3b Added test for checking that solvePnPRansac accepts vector<Point3f> and Nx3 1-channel or 1xN/Nx1 3-channel matrices as input. 2016-01-12 12:13:28 +03:00
Alexander Alekhin
70cb17bf64 Merge pull request #5947 from takacsd:patch-2 2016-01-12 08:09:20 +00:00
Alexander Alekhin
c01fd16291 Merge pull request #5946 from takacsd:patch-1 2016-01-12 08:08:58 +00:00
Alexander Alekhin
49d3e39bc4 test: added regression test for convexityDefects (#5908) 2016-01-11 19:47:36 +03:00
takacsd
1e0928633d Add missing implementation to one of the Mat_<_Tp> constructor. (#5945) 2016-01-11 16:11:50 +01:00
takacsd
537d1322b4 Add missing implementation to one of the Mat_<_Tp> constructor. (#5945) 2016-01-11 16:05:22 +01:00
Alexander Alekhin
7a62a8213b Merge pull request #5914 from LaurentBerger:I5908 2016-01-11 13:00:17 +00:00
Alexander Alekhin
43033f0b1d ts: move PARAM_TEST_CASE and GET_PARAM into ts.hpp 2016-01-11 15:36:52 +03:00
Alexander Alekhin
ec466ed1e0 Merge pull request #5936 from ejoebstl:master 2016-01-11 11:13:06 +00:00
Alexander Alekhin
8a803865cf Merge pull request #5942 from akarsakov:fix_memcpy_empty_vector 2016-01-11 11:12:31 +00:00
Alexander Alekhin
22acd964cb Merge pull request #5924 from Photonomie:release/3.1.0-patched 2016-01-11 11:11:45 +00:00
Alexander Alekhin
a8b27ae303 Merge pull request #5910 from rokm:cuda-warnings 2016-01-11 11:11:27 +00:00
Christoph Spörk
3f172731b2 added wrapped load function for python as suggested by gat3way 2016-01-11 10:59:15 +01:00
Alexander Karsakov
6e22020dad Fixed pnpTask: don't copy inliers vector in case it's empty. 2016-01-11 11:39:18 +03:00
Emanuel Jöbstl
4e469f2866 Changed parameter order in documentation
Changed parameter order in documentation of findEssentialMat, because threshold and probability were switched.
2016-01-08 14:46:17 +00:00
Kai Hugo Hustoft Endresen
551b5d3e1a StereoSGBM.cpp - use SSE2 for pass 2 using MODE_HH
With a test image set of 2800x1400 bytes on a Intel Core i7 5960X this improves runtime of MODE_HH with about 10%. (this particular replaced code segment is approx 3 times faster than the non-SSE2 variant). I was able to reduce runtime by 130 ms by this simple fix.

The second part of the SSE2 optimized part could probably be optimized further by using shift SSE2 operations, but I imagine this would improve performance 10-20 ms at best.
2016-01-08 00:32:52 +01:00
Christoph Spörk
66eda72f66 fixed a doxygen issue 2016-01-07 08:19:06 +01:00
Christoph Spörk
6c8bc6a25b fixed ABI incompatibilities as proposed by alalek
related to issue 4969
fixes issue 5891
fixes issue 5922
2016-01-07 08:00:01 +01:00
Pierre Dulac
262a52f306 Enable NEON for the arm64 architecture too
and fix the compilation for iOS in the same time
2016-01-05 15:34:39 +01:00
Anush Elangovan
3405a865c4 Add LLVM c++_static c++_shared STL targets
The Android NDK would be moving to Clang as its default compiler
in the future. This patch allows OpenCV to build with the default
c++_shared / c++_static

TEST=Builds OpenCV with -DANDROID_TOOLCHAIN_NAME=
aarch64-linux-android-clang3.6 -DANDROID_STL=c++_shared
2016-01-04 20:48:16 -08:00
Christoph Spörk
a7aa198b4c fixing issue #4969 of Itseez/opencv.
Someone forgot to wrap the load function for SVMs in the
corresponding ml python module. Fixed that.
2016-01-04 15:47:26 +01:00
Alexander Alekhin
345678770b Merge pull request #5771 from dtmoodie:pyrlk 2016-01-04 14:28:31 +00:00
Alexander Alekhin
430e2f205e Merge pull request #5916 from berak:NormalBayesClassifier_bulk_prediction 2016-01-04 14:25:53 +00:00
berak
5afd0e211e ml: fix NormalBayesClassifier bulk prediction(#5911) 2016-01-04 11:47:08 +01:00
Alexander Alekhin
fade402899 Merge pull request #5861 from alalek:fix_pkgconfig 2016-01-04 06:58:19 +00:00
Alexander Alekhin
1e4ad333a1 Merge pull request #5906 from berak:fix_marker 2016-01-04 05:31:00 +00:00
Alexander Alekhin
c06eaf83da Merge pull request #5904 from GregoryMorse:master 2016-01-04 05:30:28 +00:00
Alexander Alekhin
290b4d61b5 Merge pull request #5902 from alalek:fix_gpu_samples 2016-01-04 05:29:57 +00:00
Alexander Alekhin
76c9714516 Merge pull request #5883 from alalek:fix_5876 2016-01-04 05:28:41 +00:00
Alexander Alekhin
512e73db89 Merge pull request #5881 from alalek:fix_5878 2016-01-04 05:27:37 +00:00
Alexander Alekhin
9012ff4711 Merge pull request #5880 from alalek:fix_5863 2016-01-04 05:27:22 +00:00
Alexander Alekhin
f9e2b036a5 Merge pull request #5873 from paroj:cpprodrigues 2016-01-04 05:27:00 +00:00
LaurentBerger
8531e6d9fc May be it can solve issue 5908 2016-01-02 21:06:51 +01:00
Rok Mandeljc
029dfbc89d opencv_core: CUDA: check if __CUDA_ARCH__ is defined before comparing it
Changed statements of type "#if __CUDA_ARCH__ >= 200" to
"#if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 200" in order to
avoid warnings about __CUDA_ARCH__ being undefined.
2016-01-01 23:48:57 +01:00
berak
2d1cb14e61 fix cv::MARKER_TRIANGLE_UP 2016-01-01 10:10:01 +01:00
Gregory Morse
5427ede6a1 WinRT consistency 2015-12-31 14:31:26 +01:00
Alexander Alekhin
cdb9c60dcb gpu samples: fix REMOVE_ITEM error 2015-12-31 02:24:54 +03:00
Dan Moodie
66738d748f Modified sparse pyrlk optical flow to allow input of an image pyramid which thus allows caching of image pyramids on successive calls.
Added unsigned char support for 1, 3, 4 channel images.
2015-12-29 10:48:14 -05:00
Dan Moodie
64a57f7c38 Support for opengl2 in vtk 7.1 2015-12-28 14:04:02 -05:00
Ishank gulati
24da1ba3dc added videoio docs and tutorials 2015-12-26 10:48:01 +05:30
Alexander Alekhin
17e4d33b0e added regression test for #5876 2015-12-25 16:16:34 +03:00
Pavel Rojtberg
4db6d9986d also port Rodrigues in Affine to Matx expressions
so results are numerically equivalent
2015-12-25 13:47:10 +01:00
Alexander Alekhin
6997d423c8 fix normalize in case of inplace operations
fixes #5876
2015-12-25 15:33:06 +03:00
HMM@T430s-x64
6b4d4a85b5 solve videoio/src/cap_mjpeg_decoder.cpp compiling problem using VS 2008
fixes #5878
2015-12-25 13:57:26 +03:00
Alexander Alekhin
3d85e7ac0d features2d agast: clear in/out keypoints container
fixes #5863
2015-12-25 13:49:24 +03:00
Pavel Rojtberg
ac481e6174 calib3d: port Rodrigues to cpp primitives 2015-12-24 21:34:34 +01:00
Alexander Alekhin
8d79285d02 Merge pull request #5840 from paroj:v4ldefault 2015-12-24 10:08:59 +00:00
Alexander Alekhin
5fa64235b1 Merge pull request #5860 from Dikay900:patch-1 2015-12-24 09:08:06 +00:00
Alexander Alekhin
f91ada572a Merge pull request #5858 from mshabunin:fix-arm-cross-warnings 2015-12-24 09:07:29 +00:00
Teng Cao
25b044e6c3 fix a bug in updateTrainingSet
In case fillPassedSamples find zero passed negatives and leafFA is achieved, function updateTrainingSet will return false and print misleading information, this PR fix the case.
2015-12-24 10:26:42 +08:00
Ishank gulati
e607a85df6 png-image-compatibility 2015-12-23 23:37:32 +05:30
Alexander Alekhin
f7c8f74ac1 Merge pull request #5869 from atinfinity:pullreq/151223-FindTBB-VS2015-2.4 2015-12-23 16:16:57 +00:00
Alexander Alekhin
9c58741dba Merge pull request #5868 from atinfinity:pullreq/151223-FindTBB-VS2015 2015-12-23 16:16:31 +00:00
Alexander Alekhin
a4aeba37fb Merge pull request #5866 from Dikay900:patch-2 2015-12-23 16:14:53 +00:00
Alexander Alekhin
8c545c055d Merge pull request #5865 from Dikay900:fix_matcopy_shape 2015-12-23 16:14:36 +00:00
Alexander Alekhin
f26d0c5857 Merge pull request #5856 from Dikay900:fix_rgb2luv_doc 2015-12-23 16:14:06 +00:00
atinfinity
d16723f493 changed to find TBB library(VS2015) 2015-12-23 23:45:33 +09:00
atinfinity
c4e80952ce changed to find TBB library(VS2015) 2015-12-23 23:43:01 +09:00
Pavel Rojtberg
b3bbe7704d add jaccardDistance measure for rectangle overlap
computes the complement of the Jaccard Index as described in
https://en.wikipedia.org/wiki/Jaccard_index. For rectangles this reduces
to computing the intersection over the union.
2015-12-23 13:12:45 +01:00
Philip
1ba2286c6d fix uninitialized matrix in EM::predict fixes #5443
fixes #5443
2015-12-23 11:19:48 +01:00
Dikay900
bb78b01ace fix mat copy in shape
fixes #5643
2015-12-23 10:48:36 +01:00
Dikay900
a7d3e30404 fix probably copy paste like error in rgb2luv doc
fixes #5689
2015-12-22 22:45:51 +01:00
Alexander Alekhin
178ed63e1a Merge pull request #5846 from mshabunin:backports-3 2015-12-22 17:31:20 +00:00
Alexander Alekhin
f550ddb3fd Merge pull request #5854 from Dikay900:em_predict_fix 2015-12-22 15:15:53 +00:00
Alexander Alekhin
24dbb43c09 pkg-config: modules list contains only OpenCV modules (fixes #5852) 2015-12-22 17:28:38 +03:00
Philip
e85b23573b [master] Fixed PCH warning during ARM crosscompilation
#5858 for master
2015-12-22 15:24:02 +01:00
Maksim Shabunin
46edb54ac3 Fixed PCH warning during ARM crosscompilation 2015-12-22 15:58:39 +03:00
Ishank gulati
9636b5e821 reduce k_fold parameter 2015-12-22 15:47:11 +05:30
Dikay900
4f3b58d1e7 fix reshape call not being an inplace method
fixes #5853 #4740
2015-12-21 21:10:35 +01:00
Alexander Alekhin
afdbd855ee Merge pull request #5843 from jia-kai:disable-dlopen-opencl 2015-12-21 15:47:15 +00:00
Alexander Alekhin
923632272f Merge pull request #5848 from IshankGulati:broken-link-fix 2015-12-21 15:46:41 +00:00
Maksim Shabunin
7cb78451d1 Backported several changes from master branch:
- #3771 - inline round on ARM
- #5633 - documentation for MSER
- #5666 - run.py fixes
2015-12-21 18:20:37 +03:00
Ishank gulati
fb63cbb74b path to videocapture-get changed 2015-12-21 19:30:37 +05:30
Alexander Alekhin
4cfe2b4dea Merge tag '3.1.0'
OpenCV 3.1.0
2015-12-21 14:24:46 +03:00
jiakai
22599a2812 define g_haveOpenCL only when HAVE_OPENCL is set 2015-12-21 16:42:38 +08:00
jiakai
387214a3c5 do not open libopencl by dlopen if HAVE_OPENCL is not set 2015-12-21 12:04:00 +08:00
Pavel Rojtberg
96654f0084 make sure cap_v4l is used by default on Linux
cap_v4l is better maintained and generally the code is in
better shape than cap_libv4l.
2015-12-20 01:19:48 +01:00
Maksim Shabunin
92387b1ef8 Fix java version++ 2015-12-18 18:02:16 +03:00
Maksim Shabunin
8d1f5b5490 Version++ for android 2015-12-18 17:57:07 +03:00
Alexander Alekhin
4e669f59a0 fix android pack 2015-12-18 17:38:04 +03:00
Alexander Alekhin
2f4b334ef2 fix MSVS2010 builds 2015-12-18 17:23:17 +03:00
Alexander Alekhin
94e4498cfd Version for 3.1.0 release 2015-12-18 16:08:05 +03:00
Alexander Alekhin
b4432c4fd7 Merge pull request #5835 from alalek:fix_winpack 2015-12-18 13:02:18 +00:00
Alexander Alekhin
3ee90a1ff4 ffmpeg: install both 32/64-bit versions (required for java/python 32/64-bit bindings) 2015-12-18 15:59:02 +03:00
Alexander Alekhin
613b289325 python: add launch script for winpack python demo 2015-12-18 15:59:02 +03:00
Alexander Alekhin
4fa91e468b Merge pull request #5834 from alalek:fix_winpack_include_path 2015-12-18 11:55:57 +00:00
Alexander Alekhin
34957bcfed Merge pull request #5832 from alalek:python_samples 2015-12-18 11:38:27 +00:00
Alexander Alekhin
d34297b516 fix include path for windows package 2015-12-18 13:50:35 +03:00
Vadim Pisarevsky
97dc5be841 Merge pull request #5821 from alalek:build_framework 2015-12-18 10:12:55 +00:00
Alexander Alekhin
ec0e43a95b Merge pull request #5801 from enpe:matlab-switch 2015-12-18 09:34:36 +00:00
Alexander Alekhin
a8e2922467 rename samples/{python2 -> python} 2015-12-18 11:00:32 +03:00
Alexander Alekhin
323e24e3ef change links from samples/python2 to samples/python 2015-12-18 11:00:30 +03:00
Vadim Pisarevsky
2ecb48921b Merge pull request #5802 from bastelflp:py3samples_docstr 2015-12-18 07:20:53 +00:00
Vadim Pisarevsky
d02627ea89 Merge pull request #5825 from GregoryMorse:master 2015-12-18 07:17:29 +00:00
flp
0c5d9e18d1 Removed outdated tutorial link 2015-12-18 01:34:57 +01:00
Gregory Morse
af5bec70cd merge Win10/VS2015 changes 2015-12-17 21:15:59 +01:00
Alexander Alekhin
03e74330fa Merge pull request #5828 from mshabunin:CommandLineArgs 2015-12-17 17:46:37 +00:00
Vadim Pisarevsky
9aeb8c8d5a Merge pull request #5810 from mshabunin:hal_interface 2015-12-17 16:48:02 +00:00
Alexander Alekhin
5021350082 Merge pull request #5829 from mshabunin:fix-version-check 2015-12-17 16:31:59 +00:00
ValeryTyumen
297808e6b9 Feature #3957 2015-12-17 18:19:39 +03:00
Vincent Rabaud
932043fdc2 Properly check for version in find_package
If I ask for version 2, the current trunk version (version 3), will say it is compatible, which is erroneous.

Do not consider different major versions compatible in cmake config file
2015-12-17 17:00:30 +03:00
Alexander Alekhin
be23846c4e update osx and ios build_framework.py 2015-12-17 16:17:31 +03:00
Maksim Shabunin
c04d62db8b HAL samples readme file updated 2015-12-17 16:09:36 +03:00
Alexander Alekhin
437fbe2594 Merge pull request #5817 from alalek:fix_ocl_buffer_pool 2015-12-17 11:54:28 +00:00
Alexander Alekhin
ddd1a816a0 Merge pull request #5818 from alalek:android_set_visible 2015-12-17 11:53:39 +00:00
Alexander Alekhin
1f6893e4dc Merge pull request #5827 from alalek:winrt_build_fixup 2015-12-17 10:28:34 +00:00
Maksim Shabunin
d214770d5b HAL samples: renamed and added readme 2015-12-17 13:25:47 +03:00
Alexander Alekhin
0862e8e34c fix build 2015-12-17 13:25:10 +03:00
Maksim Shabunin
84f37d352f HAL moved back to core 2015-12-17 12:33:23 +03:00
flp
32737df1b5 Print found calibration data 2015-12-16 22:01:18 +01:00
Nils Plath
4474845dd5 Simplified status update. 2015-12-16 21:53:34 +01:00
Maksim Shabunin
3c6aa650a1 Merge pull request #5811 from mshabunin:fix-java-moments 2015-12-16 13:12:01 +00:00
Alexander Alekhin
491a3fdebc android samples: force setVisibility (see #5812) 2015-12-16 14:31:49 +03:00
Alexander Alekhin
6f2632ca2e ocl: fix buffer pool small allocations issue (fixes #5815) 2015-12-16 14:31:26 +03:00
Alexander Smorkalov
2897da037e Merge pull request #5763 from ilya-lavrenov:lintian 2015-12-16 11:27:59 +00:00
Vadim Pisarevsky
b2bb7d075a Merge pull request #5781 from jet47:fix-cuda-createContinuous 2015-12-16 10:37:56 +00:00
Vadim Pisarevsky
3bbd22cb63 Merge pull request #5808 from cedrou:hdr.mergemertens.fixalgo 2015-12-16 10:36:29 +00:00
Alexander Alekhin
3b87e3fa20 Merge pull request #5812 from qubick:master 2015-12-16 10:05:34 +00:00
Alexander Alekhin
74cb74dc0a Merge pull request #5813 from alalek:fix_warning 2015-12-16 07:54:51 +00:00
Maksim Shabunin
5ebc7f0b72 Simple Moments class for Java 2015-12-16 10:53:14 +03:00
qubick
5502f0b45d surfaceview import 2015-12-15 12:35:21 -07:00
Alexander Alekhin
8f60740205 fix build warning (unreachable code) and exit error codes 2015-12-15 22:06:11 +03:00
qubick
1434f55cb9 camera view was enabled to visible when the app launched 2015-12-15 11:38:56 -07:00
Alexander Alekhin
0d9938dab5 Merge pull request #5809 from alalek:fixup 2015-12-15 13:52:56 +00:00
Alexander Alekhin
31d0dcf28e fixup 2015-12-15 15:54:45 +03:00
Maksim Shabunin
574280cd3a Merge pull request #5784 from alalek:distrib_fix 2015-12-15 12:24:36 +00:00
Cédric Rousseau
76e4b0a8fe Reverts "Set the default value of exposure_weight in createMergeMertens to 1.0" because it breaks source code compatibility and tests
This reverts commit dbfd6a3dde93a36f90756a8b4a64f37f34869edf.
2015-12-15 13:16:15 +01:00
Vadim Pisarevsky
1e443a6ea6 Merge pull request #5800 from taketwo:fix-merge-debevec 2015-12-15 10:26:00 +00:00
Vadim Pisarevsky
f93a4dfbc9 Merge pull request #5799 from alalek:fix_5066 2015-12-15 10:24:39 +00:00
Vadim Pisarevsky
34129d8e83 Merge pull request #5806 from IshankGulati:cv-merge-documentation 2015-12-15 10:16:21 +00:00
Cédric Rousseau
dbfd6a3dde Set the default value of exposure_weight in createMergeMertens to 1.0 2015-12-15 11:12:10 +01:00
Vadim Pisarevsky
c5d4ecae37 Merge pull request #5588 from T-Dunker:ScheimpflugModel 2015-12-15 10:11:59 +00:00
Cédric Rousseau
d19189e80f Fixed the formula to compute the well-exposedness weight map. 2015-12-15 10:30:06 +01:00
Ishank gulati
d1ac75cabd corrected cv::merge documentation 2015-12-15 11:02:08 +05:30
flp
b6ce4a527e added docstring to python files 2015-12-15 01:03:50 +01:00
flp
14c5ef8db4 Added .gitignore for tmp files created by examples 2015-12-15 01:03:50 +01:00
flp
006d5ac0a5 Adapted for py2/py3 compatibility 2015-12-15 01:03:50 +01:00
Nils Plath
a1173dfa27 Added switch to CMakeLists.txt in order to enable/disable Matlab. 2015-12-14 23:30:28 +01:00
Sergey Alexandrov
08b30580b7 Do not modify input parameter in MergeDebevec
MergeDebevec takes camera response function as an optional input
parameter. Despite being clearly marked as input, this matrix is
overwritten during processing.

This commit adds a temporary matrix to store the log response and avoid
modification of the input.
2015-12-14 22:24:27 +01:00
Vadim Pisarevsky
aee03cd5e5 Merge pull request #5796 from alalek:fix_5019 2015-12-14 19:52:32 +00:00
Vadim Pisarevsky
d366cb960d Merge pull request #5798 from vpisarev:fixed_digits_py 2015-12-14 19:51:07 +00:00
Vadim Pisarevsky
5ac1d8323e Merge pull request #5797 from alalek:fix_5018 2015-12-14 16:54:22 +00:00
Vadim Pisarevsky
e4fea5abab Merge pull request #5793 from alalek:precomp_add_cvconfig 2015-12-14 16:50:40 +00:00
Alexander Alekhin
1305962af7 fixes #5066: laplacian: "y" may contain negative values 2015-12-14 18:13:57 +03:00
Alexander Alekhin
fd0773eb32 Merge pull request #5795 from alalek:fix_5095 2015-12-14 14:35:17 +00:00
Thomas Dunker
6882c10b45 Extension of the camera distortion model for tilted image sensors (Scheimpflug condition) including test 2015-12-14 15:20:34 +01:00
Vadim Pisarevsky
ba71caca04 fixed digits.py sample 2015-12-14 16:37:19 +03:00
Alexander Alekhin
0db10a3052 fixes #5019: python and java bindings become CMake modules (loadable plugins) 2015-12-14 16:20:18 +03:00
Vadim Pisarevsky
4c1c0b108d Merge pull request #5790 from bastelflp:py3compatibility 2015-12-14 12:47:19 +00:00
Alexander Alekhin
f0c14888d5 fixes #5018: fix framework links in opencv.pc (MacOS) 2015-12-14 15:14:23 +03:00
Alexander Alekhin
5c15461595 UMat access flags (fixes #5095) 2015-12-14 14:26:43 +03:00
Alexander Alekhin
5d346128f7 workaround: cvconfig.h doesn't work with hal at this moment 2015-12-14 13:52:02 +03:00
Alexander Alekhin
e37a58df3c include "cvconfig.h" 2015-12-14 13:34:30 +03:00
flp
4ed2d6328b Python samples adapted for Python3 compatibility
Common fixes:
- print function
- int / float division
- map, zip iterators in py3 but lists in py2

Known bugs with opencv 3.0.0
- digits.py, called via digits_video.py: https://github.com/Itseez/opencv/issues/4969
- gaussian_mix.py: https://github.com/Itseez/opencv/pull/4232
- video_v4l2.py: https://github.com/Itseez/opencv/pull/5474

Not working:
- letter_recog.py due to changed ml_StatModel.train() signature
2015-12-13 02:49:54 +01:00
Alexander Alekhin
2bfad68812 pkg-config: remove $<LINK_ONLY:...> expressions 2015-12-12 15:23:31 +03:00
Alexander Alekhin
a153871940 disable ts module if it is not used: BUILD_TESTS=OFF and BUILD_PERF_TESTS=OFF 2015-12-12 15:23:31 +03:00
Alexander Alekhin
7afce8e003 world build: fix modules instantiation order
opencv_hal before opencv_world
opencv_world before opencv_ts
2015-12-12 15:23:31 +03:00
Alexander Alekhin
1836d41b5c warning fix (MSVS2015) 2015-12-12 15:23:31 +03:00
Alexander Alekhin
fe2f5c175a distrib: remove useless static files from shared distribution package 2015-12-12 15:23:31 +03:00
Alexander Alekhin
8f732f2cfe fix samples deps
some tutorials depends on contrib modules
2015-12-12 15:23:31 +03:00
Alexander Alekhin
5053aeeb19 cmake: DOWNLOAD_EXTERNAL_TEST_DATA option 2015-12-12 15:23:31 +03:00
Vadim Pisarevsky
5cdf0e3e89 Merge pull request #5351 from paroj:calibout 2015-12-11 16:21:06 +00:00
Vadim Pisarevsky
c22673e999 Merge pull request #5782 from alalek:update_libpng 2015-12-11 16:13:40 +00:00
Vadim Pisarevsky
e0395a79ec Merge pull request #5616 from afriesen:lr_predict 2015-12-11 12:22:56 +00:00
Pavel Rojtberg
60c06e551a calibrateCamera: do not require rvec and tvec to be vector<Mat>
if they are not we also do not need to allocate a local copy of the rvec
and tvec
2015-12-11 11:01:57 +01:00
Pavel Rojtberg
205775ed52 calibrateCamera: only allocate and compute rvecs, tvecs when needed
also replace C defines with C++ enums
2015-12-11 10:58:26 +01:00
Alexander Alekhin
c2a86a6a84 NEON flags fix 2015-12-11 12:06:24 +03:00
Alexander Alekhin
dbc0aa6c7b libpng: re-apply patch 2015-12-11 12:06:24 +03:00
Alexander Alekhin
0831bd3990 libpng: update 1.6.19 - November 12, 2015 2015-12-11 12:06:24 +03:00
Vadim Pisarevsky
21b415f6be Merge pull request #5691 from paroj:levmarqLU 2015-12-11 08:39:05 +00:00
Vadim Pisarevsky
286ba8cffd Merge pull request #5783 from vpisarev:ml_fixes 2015-12-11 06:25:15 +00:00
Pavel Rojtberg
b5ddaae427 calib3d: add CALIB_USE_LU to use LU decomposition in solver 2015-12-10 23:26:37 +01:00
Pavel Rojtberg
4c251bd260 CvLevMarq: add solve method to interface 2015-12-10 23:02:18 +01:00
Pavel Rojtberg
22b64e2c28 CvLevMarq: remove fixed rows instead of setting them to zero
use the same approach like in fisheye calibration: instead of setting
masked out rows to zero, remove them from the equation system.
This way JtJ does not become singular and we can use the much faster LU
decomposition instead of SVD.

This results in a speedup of the Calibrate unit tests of 3x-10x.
2015-12-10 23:02:18 +01:00
Pavel Rojtberg
9d89c369f8 update SOLVEPNP documentation 2015-12-10 23:02:17 +01:00
Vadim Pisarevsky
7a7b0bcfcb fixed the upper boundary when calling checkRange (thanks to alalek) 2015-12-10 20:17:17 +03:00
Deanna Hood
0d706f6796 Return uncompressed support vectors for getSupportVectors on linear SVM (Bug #4096) 2015-12-10 18:31:02 +03:00
Vadim Pisarevsky
544990e377 couple of small fixes in rtrees variable importance calculation 2015-12-10 18:13:54 +03:00
Vadim Pisarevsky
fda17273de applying patch by rxtsolar: https://github.com/Itseez/opencv/pull/5422 for the master branch (even though it's actually not that important here) 2015-12-10 18:10:27 +03:00
niederb
d8e3971e7f Fixed variable importance in rtrees 2015-12-10 18:09:15 +03:00
Vadim Pisarevsky
d2e169929c Merge pull request #5767 from dtmoodie:cpu_mat_memory_allocator 2015-12-10 14:32:04 +00:00
Vadim Pisarevsky
bb4b4acce5 Merge pull request #5776 from alalek:checkRange_fixes 2015-12-10 13:26:46 +00:00
Vadim Pisarevsky
bfe5ed23cd Merge pull request #5657 from tianzhi0549:fixed-the-type-inconsistent-with-document 2015-12-10 13:24:13 +00:00
Vladislav Vinogradov
5576c0866a fix #5780 : cv::cuda::createContinuouseffectively ignores its cols argument 2015-12-10 14:20:28 +03:00
Vadim Pisarevsky
a0f6cd8df5 Merge pull request #5362 from Dikay900:cascade_reject_stage 2015-12-10 10:51:42 +00:00
Vadim Pisarevsky
6ead99985f Merge pull request #4086 from IgnasD:cameraMat_five-point 2015-12-10 09:37:43 +00:00
Alexander Alekhin
5aa4b74115 Merge pull request #5723 from dtmoodie:win_gst 2015-12-10 07:19:10 +00:00
Vadim Pisarevsky
3c8bd19e56 Merge pull request #5309 from paroj:sampsonDist 2015-12-10 07:08:18 +00:00
Vadim Pisarevsky
5d6292fc97 Merge pull request #5675 from paroj:fisheyecalib 2015-12-10 07:07:12 +00:00
Alexander Alekhin
b26580cc7b checkRange fixes
1) fix multichannel support
2) remove useless bad_value, read value from original Mat directly
3) add more tests
4) fix docs for cvCeil and checkRange
2015-12-09 18:31:27 +03:00
Dan
46ec9c386b Gstreamer 1.0 on windows. 2015-12-09 09:11:45 -05:00
Vadim Pisarevsky
8e67f0ba84 Merge pull request #5774 from mshabunin:coverity_fixes 2015-12-09 13:32:44 +00:00
Vadim Pisarevsky
05531cd7c4 Merge pull request #5768 from cbalint13:kaze_akaze 2015-12-09 13:18:25 +00:00
Vadim Pisarevsky
919fc443fb Merge pull request #5770 from emiswelt:master 2015-12-09 12:19:53 +00:00
Vadim Pisarevsky
35d4f998fd Merge pull request #5748 from songyuncen:fix#5745 2015-12-09 12:17:41 +00:00
Maksim Shabunin
2cda78ffac Valgrind: fixed uninitialized image usage in descriptors regression tests 2015-12-09 14:25:09 +03:00
Maksim Shabunin
832a03821d Valgrind: do not use uninitialized data in optflow 2015-12-09 14:25:08 +03:00
Maksim Shabunin
4a294775da Coverity: fixed uninitialized field in ExifReader 2015-12-09 14:25:08 +03:00
Maksim Shabunin
a9607c8531 Coverity: fixed uninitialized fields in test_goodfeaturetotrack 2015-12-09 14:25:08 +03:00
Maksim Shabunin
a921761d18 Coverity: memory leak in OpenEXR reader 2015-12-09 14:25:08 +03:00
Maksim Shabunin
f814218640 Coverity: uninitialized fields in Stitcher 2015-12-09 14:25:08 +03:00
Maksim Shabunin
715887fcd5 Coverity: fixed some negative argument issues 2015-12-09 14:25:08 +03:00
Maksim Shabunin
fc641e2bde Coverity: uninitialized values in ExifEntry_t structure 2015-12-09 14:17:46 +03:00
Vadim Pisarevsky
6dd5e7749b Merge pull request #5773 from GregoryMorse:master 2015-12-09 11:15:25 +00:00
Ilya Lavrenov
4fa14f75b8 suppress lintian warning in opencv.pc 2015-12-09 13:47:09 +03:00
Gregory Morse
bcf78daed2 Update CMakeLists.txt
WinRT parallels library is causing conflicts in VC++ due to inconsistent usage with C++/CX which is now present in parallels.cpp.  This support should be included in all projects with WinRT specific code except if doing special native C++ tasks.
2015-12-09 03:45:10 +01:00
Gregory Morse
1ab7acf015 Update CMakeLists.txt
Fix C++/CX support for all WINRT and bring back native-mode only support which was removed
2015-12-09 03:42:25 +01:00
songyuncen
02bb287802 Merge remote-tracking branch 'origin/fix#5745' into fix#5745 2015-12-09 08:03:51 +08:00
songyuncen
9d8118dee5 build failed, trailing whitespace. 2015-12-09 08:00:42 +08:00
emiswelt
2e9ef3f9e3 Changed parameter order of cv::stereoRectify in documentation,
so it matches the code.
2015-12-08 22:28:32 +00:00
Balint Cristian
0087c57e0d Fix KAZE/AKAZE descriptors to use angle instead radians. 2015-12-08 22:04:41 +02:00
Vadim Pisarevsky
d6f8a75e91 Merge pull request #5230 from PhilLab:patch-4 2015-12-08 18:46:34 +00:00
Dan
237f33d4f0 nullptr -> NULL 2015-12-08 12:19:15 -05:00
Vadim Pisarevsky
a15707bc57 Merge pull request #5765 from alalek:pthread_mutex_init 2015-12-08 16:49:41 +00:00
Vadim Pisarevsky
9d624f82c0 Merge pull request #5670 from askourik:opencv_agast_tree 2015-12-08 16:46:11 +00:00
songyuncen
893fa4cf84 build failed, trailing whitespace. 2015-12-08 23:18:53 +08:00
Dan
76760470f3 Cherry pick failed to grab interface changes. 2015-12-08 09:54:14 -05:00
Dan Moodie
4f373a4284 Clarified default allocator interface.
Conflicts:
	modules/core/src/matrix.cpp
2015-12-08 09:45:13 -05:00
songyuncen
e0b7389dc3 remove compile warnings in shapedescr.cpp 2015-12-08 22:23:23 +08:00
songyuncen
a69eeb6b1f change the algorithm of minimum enclosing circle with EMO Welzl's method 2015-12-08 21:38:59 +08:00
Vadim Pisarevsky
5d5cf32e22 Merge pull request #5758 from eladj:py_tutorial_hdr 2015-12-08 12:29:53 +00:00
Vadim Pisarevsky
0de6165863 Merge pull request #5660 from jet47:cuda-wrap-stream-3.0 2015-12-08 12:28:57 +00:00
Vadim Pisarevsky
9c0a5523e4 Merge pull request #5757 from alalek:merge-2.4 2015-12-08 11:51:29 +00:00
Vadim Pisarevsky
6c4232dcf3 Merge pull request #5755 from teng88:patch-4 2015-12-08 11:47:09 +00:00
Alexander Alekhin
78376c0f63 pthreads: remove usage of non-POSIX PTHREAD_RECURSIVE_MUTEX_INITIALIZER* defines
related issues: #5423 #5476
2015-12-08 13:55:02 +03:00
Vadim Pisarevsky
ffe0631518 Merge pull request #5735 from Astero92:angle_unit 2015-12-08 10:35:13 +00:00
Vadim Pisarevsky
f95203e93f Merge pull request #5759 from grundman:patch-1 2015-12-08 10:33:54 +00:00
Maksim Shabunin
387935e94c Merge pull request #5756 from mshabunin:smooth_neon_fix 2015-12-08 08:59:58 +00:00
Maksim Shabunin
878ec080c7 Merge pull request #3540 from AlexanderUsentsov:good_feature 2015-12-08 08:02:28 +00:00
Alexander Alekhin
d86d8ed909 Merge 2.4 into master
PR #2968: cce2d99 8578f9c
Fixed bug which caused crash of GPU version of feature matcher in stitcher

The bug caused crash of GPU version of feature matcher in stitcher when
we use ORB features.

PR #3236: 5947519
Check sure that we're not already below required leaf false alarm rate before continuing to get negative samples.

PR #3190
fix blobdetector

PR #3562 (part): 82bd82e
TBB updated to 4.3u2. Fix for aarch64 support.

PR #3604 (part): 091c7a3
OpenGL interop sample reworked not ot use cvconfig.h

PR #3792: afdf319
Add -L for CUDA libs path to pkg-config

Add all dirs from CUDA_LIBS_PATH as -L linker options to
OPENCV_LINKER_LIBS. These will end up in opencv.pc.

PR #3893: 122b9f8
Turn ocv_convert_to_lib_name into a function

PR #5490: ec5244a
fixed memory leak in findHomography tests

PR #5491: 0d5b739
delete video readers

PR #5574

PR #5202
2015-12-08 10:24:54 +03:00
Florent
056a111788 Fixed histogram substraction bug with NEON instructions (arguments in wrong order). 2015-12-08 09:48:17 +03:00
Elad Joseph
a87ae5910f fixed whitespace 2015-12-07 22:06:08 +02:00
grundman
2f0a598ac8 Update imgwarp.cpp
github editor does not show white space and inserts one for you ... great combination
2015-12-07 11:48:45 -08:00
Elad Joseph
eaa573f56a fixed whitespace 2015-12-07 21:39:01 +02:00
grundman
5772cb52e3 Update imgwarp.cpp
Check for identity resize => use copy instead (1.37 ms -> 0.07 ms on 720p)
2015-12-07 11:25:39 -08:00
Elad Joseph
421c922539 Add HDR tutorial to the python tutorials
Add py_hdr tutorial under py_tutorials\py_photo.
This tutorial is similar to the one which is given at the C++ tutorials.
2015-12-07 20:57:10 +02:00
ausentso
9abdf39c90 added test for goodFeaturesToTrack; 2015-12-07 15:24:38 +03:00
Teng Cao
efacf7b6de Update haarfeatures.cpp 2015-12-07 19:51:30 +08:00
Teng Cao
8a36402ec0 Update haarfeatures.cpp 2015-12-07 19:01:04 +08:00
Teng Cao
d68c392b42 calculate innTilted only for Haar::ALL mode
major time consuming part for training app is in function fillPassedSamples for negatives, 
this change make SetImage quicker, in a test of my own data, the total time for SetImage decrease from 9177666 to 5839263,
only help for Haar feature and non Haar::ALL mode which is the most commonly case
2015-12-07 18:50:54 +08:00
Vadim Pisarevsky
7172c16435 Merge pull request #5717 from jet47:cuda-maxwell-fixes 2015-12-07 10:16:48 +00:00
Vadim Pisarevsky
d19897b734 Merge pull request #5651 from hoangviet1985:fix_solvePoly_3.0.0 2015-12-07 10:12:54 +00:00
Vadim Pisarevsky
d4245aa45c Merge pull request #5704 from sturkmen72:patch-3 2015-12-07 10:09:57 +00:00
Vadim Pisarevsky
0886f6fe62 Merge pull request #5733 from teng88:patch-3 2015-12-07 10:08:23 +00:00
Vadim Pisarevsky
6423b366eb Merge pull request #5731 from teng88:patch-1 2015-12-07 10:07:43 +00:00
Vadim Pisarevsky
54c1637ba1 Merge pull request #5743 from mshabunin:hal_extend 2015-12-07 10:01:22 +00:00
Alexander Alekhin
4448cbffd2 Merge pull request #5747 from Sethur:patch-1 2015-12-07 09:40:01 +00:00
Vadim Pisarevsky
be8ca7ad81 Merge pull request #5751 from mikanbako:fix-document 2015-12-07 09:37:46 +00:00
Keita Kita
1621043bd2 Add documentation about detail of image type
connectedComponents and connectedComponentsWithStats in
imgproc accept 8-bit single channel image only for input.
2015-12-06 14:06:17 +09:00
songyuncen
b81598bc03 try to fix : enclosing circle always larger than 1.0
issue #5745
2015-12-05 10:57:29 +08:00
Sethur
c68d15bebe Fixed duplicate PATH in TBB_DEFAULT_INCLUDE_DIRS 2015-12-04 15:07:41 +01:00
Suleyman TURKMEN
8418d564a8 Documentation patch for cv::mixChannels 2015-12-03 22:49:28 +02:00
Maksim Shabunin
0e5c710757 Fix documentation warning 2015-12-03 17:30:45 +03:00
Maksim Shabunin
5c5d0e6743 Fixed NEON compilation issue 2015-12-03 15:41:23 +03:00
Maksim Shabunin
5473dbebed Fixed some build issues 2015-12-03 15:25:42 +03:00
Maksim Shabunin
b5d6d7016c Merge pull request #5741 from PolarNick239:master 2015-12-03 12:00:21 +00:00
Maksim Shabunin
98f5fcd86e HAL: fixed header path 2015-12-03 14:56:15 +03:00
Maksim Shabunin
b4bcdd10a1 HAL: improvements
- added new functions from core module: split, merge, add, sub, mul, div, ...
- added function replacement mechanism
- added example of HAL replacement library
2015-12-03 14:43:37 +03:00
Alexander Alekhin
e8742be30b Merge pull request #5742 from GabrieleDalmazzone:GabrieleDalmazzone-patch-1 2015-12-03 10:29:22 +00:00
Maksim Shabunin
681df84036 Merge pull request #5720 from asmorkalov:as/cuda_qnx 2015-12-03 07:41:23 +00:00
Nikolay Polyarniy
8026824563 ts module: includes moved out from cvtest namespace 2015-12-03 00:15:38 +03:00
Dominik Kleiser
0ba66aa5b9 Merge remote-tracking branch 'origin/master' into angle_unit 2015-12-02 18:39:12 +01:00
Alexander Alekhin
d5894ef2a8 Merge pull request #5572 from paroj:nov4l1 2015-12-02 16:49:59 +00:00
Dominik Kleiser
0c471515fd use float for CV_PI 2015-12-02 17:33:40 +01:00
Dominik Kleiser
c7cb028035 use floats for the calculation 2015-12-02 16:38:44 +01:00
Alexander Alekhin
8d921129a7 Merge pull request #5725 from alalek:ippicv_update_20151201 2015-12-02 14:22:30 +00:00
Dominik Kleiser
767bae44ae Fix the unit of angle for AKaze/Kaze KeyPoints
Convert the return value of getAngle from radian to degrees.
2015-12-02 11:51:37 +01:00
Teng Cao
07a58c47cb Update cascadeclassifier.cpp
minor fix since predict() returun int
2015-12-02 17:31:17 +08:00
Alexander Alekhin
84f9578fbb ippicv: update 20151201 (9.0.1) 2015-12-02 11:10:05 +03:00
teng88
8562bb7092 Update cascadeclassifier.cpp
minor fix since predict() returun int
2015-12-02 11:50:22 +08:00
Alexander Alekhin
38bbfe0bb8 Merge pull request #5727 from lupustr3:pvlasov/ipp_warnings_fix 2015-12-01 14:43:20 +00:00
Pavel Vlasov
2b27f7dbb3 Fixed warnings for IPP9+ build; 2015-12-01 16:10:29 +03:00
GabrieleDalmazzone
5a72be08fd Race condition bug-fix in hog.cu
See https://github.com/Itseez/opencv/issues/5721

COMMENTS:
* The second __syncthreads() is necessary, I am sure of that.
* The code works without the first __syncthreads() too, but I have however added it for symmetry. Anyway it doesn't affect time performances, I have checked it with some profiling with nvvp
2015-12-01 09:19:31 +01:00
Alexander Alekhin
a0f8645541 Merge pull request #5708 from comdiv:#5707 2015-11-30 09:52:16 +00:00
Alexander Alekhin
8524d46fee Merge pull request #5633 from mshabunin:doc-mser 2015-11-30 09:48:39 +00:00
Alexander Alekhin
e860ed7689 Merge pull request #5714 from ajbernal:OCL_HOG_Fix 2015-11-30 09:44:37 +00:00
Alexander Smorkalov
53ed1a8c03 Build fix for QNX 6.6 neitrino. 2015-11-30 10:28:04 +03:00
Vladislav Vinogradov
1bef1b8d16 disable sanity tests for AlphaComp and PyrLKOpticalFlowDense 2015-11-27 16:46:47 +03:00
Vladislav Vinogradov
2b26094cf5 increase epsilons in some tests:
* MulSpectrums
* StereoConstantSpaceBP
* BruteForceNonLocalMeans
2015-11-27 16:46:20 +03:00
Vladislav Vinogradov
2afb02fcb4 fix BORDER_WRAP processing on Maxwell generation 2015-11-27 16:45:26 +03:00
Alexander Smorkalov
4d598719da Merge pull request #5713 from ilya-lavrenov:lintian 2015-11-26 08:20:12 +00:00
Ariel Bernal
5c8683139f Fix for #5710. OpenCL HOG Object detect assigns the wrong SIMD size.
In oder to guarantee SIMDness between the two compilation steps we choose the
highest SIMD size that is optimized in the kernel for the first step.
2015-11-25 16:20:04 -08:00
Ilya Lavrenov
130d4b1bdf added suppression for python-script-but-no-python-dep 2015-11-25 23:38:44 +03:00
Pavel Rojtberg
16fcd78f03 add sampson distance error measure
the first order approximation of the geometric error
2015-11-25 16:39:49 +01:00
Alexander Alekhin
7ddc2cc073 Merge pull request #4110 from LaurentBerger:Bug4370 2015-11-24 20:03:49 +00:00
comdiv
81c746c2a8 32bit BITFIELDS compresion codec support #5707 Fixed
wsfixed
2015-11-25 00:03:35 +05:00
LaurentBerger
bef009c9dd fixed #5005: stitching_detailed.cpp 2015-11-23 21:55:59 +01:00
askourik
fedf064088 removing code duplicates and replace unsigned long by uint32_t 2015-11-23 23:47:23 +03:00
askourik
b3e8c65e5e removed code duplication for non-intel platforms 2015-11-23 22:41:35 +03:00
askourik
4cf7ddfd87 Added new function definition in AGAST module header for tree-optimized version 2015-11-23 22:11:01 +03:00
Vadim Pisarevsky
c4edd86aeb Merge pull request #5400 from dtmoodie:thrust_tutorial 2015-11-23 18:36:42 +00:00
Vadim Pisarevsky
152874eaed Merge pull request #5620 from paroj:calibratecpp 2015-11-23 18:35:25 +00:00
Vadim Pisarevsky
76f54b51c1 Merge pull request #5661 from mbarann:fix_msmf_write_vertically_flipped_video 2015-11-23 18:34:30 +00:00
Alexander Alekhin
c9cba6433e Merge pull request #5698 from lupustr3:pvlasov/ipp9_fixes 2015-11-23 16:28:03 +00:00
Vadim Pisarevsky
313dc32606 Merge pull request #5644 from hoangviet1985:splitError 2015-11-23 13:43:38 +00:00
Vadim Pisarevsky
42001234ab Merge pull request #5390 from StevenPuttemans:add_markers_2.4 2015-11-23 13:40:00 +00:00
Vadim Pisarevsky
6e885e5775 Merge pull request #5682 from ilya-lavrenov:lintian-overrides 2015-11-23 13:38:38 +00:00
Vadim Pisarevsky
d4d1d03455 Merge pull request #5635 from mzajko:xi_update 2015-11-23 13:34:23 +00:00
Pavel Vlasov
7375383d26 Canny IPP Sobel getBufferSize wrong func fix; 2015-11-23 14:31:22 +03:00
Maksim Shabunin
9a66191ea8 Merge pull request #5571 from jas0n1ee:master 2015-11-23 09:52:41 +00:00
Maksim Shabunin
bd53a30e76 Merge pull request #5658 from berak:akaze_fix 2015-11-23 09:51:23 +00:00
hoangviet1985
e679d97100 remove redundant code 2015-11-22 14:32:18 -05:00
Maksim Shabunin
04f70c92a8 Merge pull request #5449 from rokm:stereo-fixes 2015-11-22 18:30:16 +00:00
Maksim Shabunin
0d29774401 Merge pull request #5298 from slothspot:master 2015-11-22 18:08:21 +00:00
Maksim Shabunin
3ae21095df Merge pull request #5448 from Milania1:doc_normalize 2015-11-22 18:07:13 +00:00
Maksim Shabunin
626ccfe410 Merge pull request #5525 from Milania1:doc_normTypes 2015-11-22 18:05:46 +00:00
Maksim Shabunin
ddf293a081 Merge pull request #5649 from hoangviet1985:solve_pow(x,3)=0_opencv300 2015-11-22 18:02:40 +00:00
Pavel Rojtberg
cefa1dc5cb switch mask type from vector<int> to vector<uchar> 2015-11-21 00:45:45 +01:00
hoangviet1985
3e96b724c2 squash 2015-11-20 15:03:32 -05:00
hoangviet1985
b96def885f squash 2015-11-20 14:48:29 -05:00
Maksim Shabunin
5c0cdd4d2d Merge pull request #5650 from hoangviet1985:fix_bug_5623 2015-11-20 16:15:47 +00:00
Maksim Shabunin
f019de6900 Merge pull request #5666 from mshabunin:vs-run-py 2015-11-20 15:53:48 +00:00
Maksim Shabunin
51797d133a Merge pull request #5653 from jia-kai:fix-jpeg-exif 2015-11-20 15:37:50 +00:00
Maksim Shabunin
3cb76d5c66 Merge pull request #5663 from bertmsk:patch-1 2015-11-20 15:28:26 +00:00
Maksim Shabunin
047bda32d8 Merge pull request #5665 from paroj:matx_norm 2015-11-20 15:26:39 +00:00
Maksim Shabunin
3cfd7fcbbf Merge pull request #5681 from sturkmen72:patch-3 2015-11-20 15:18:25 +00:00
Alexander Alekhin
559e1f76f9 Merge pull request #5685 from lupustr3:pvlasov/ipp9_fixes 2015-11-20 12:11:09 +00:00
Pavel Vlasov
9acf93b7c6 IPP Sobel getBufferSize wrong func fix; 2015-11-19 18:38:47 +03:00
Ilya Lavrenov
969f0c4456 added lintian overrides for debian packages 2015-11-19 17:10:09 +03:00
Maksim Shabunin
c3cf1be344 fixup! run.py: issues with forced configuration fixed 2015-11-19 15:32:42 +03:00
Alexander Alekhin
e35959fad2 Merge pull request #5671 from PhilLab:patch-7 2015-11-19 10:10:13 +00:00
Rok Mandeljc
7452f9a56e cudastereo: document lack of fractional bits in 16-bit signed format for StereoBeliefPropagation 2015-11-19 11:05:13 +01:00
Rok Mandeljc
1c804124d1 cudastereo: updated documentation for reprojectImage3D and drawColorDisp
Updated the list of supported input formats, added note about 16-bit
signed format (no fractional bits).
2015-11-19 11:05:13 +01:00
Rok Mandeljc
980d84e4a2 calib3d: improve documentation of reprojectImageTo3D
Make a note about 16-bit signed format - the function assumes that
values have no fractional bits (so 16-bit disparity from StereoBM
and StereoSGBM cannot be directly used!)
2015-11-19 11:05:13 +01:00
Rok Mandeljc
bf5e930468 cudastereo: drawColorDisp: enabled CV_32S and CV_32F disparity formats 2015-11-19 11:05:13 +01:00
Rok Mandeljc
9f82ac18d4 cudastereo: reprojectImageTo3D: enabled CV_32S and CV_32F disparity formats
This is to achieve parity with the CPU equivalent.
2015-11-19 11:05:13 +01:00
Maksim Shabunin
739d7caa32 Merge pull request #5659 from jet47:cuda-wrap-stream-2.4 2015-11-19 09:25:36 +00:00
Maksim Shabunin
6148c3525e Merge pull request #5672 from ilya-lavrenov:npp-graphcut 2015-11-19 09:18:23 +00:00
askourik
a6bbe06379 Merge branch 'opencv_agast_tree' of https://github.com/askourik/opencv into opencv_agast_tree 2015-11-19 07:41:55 +03:00
askourik
cc5a1d612e added comments and test perl examples for agast tree version 2015-11-19 07:39:57 +03:00
askourik
ae66ce9d22 Add treelookups for nonintel 2015-11-19 07:06:20 +03:00
Suleyman TURKMEN
99a286ef24 Update imgcodecs.hpp 2015-11-19 00:25:36 +02:00
Vadim Pisarevsky
8b554d3c2d Merge pull request #5654 from mshabunin:ios-framework 2015-11-17 17:55:23 +00:00
Vadim Pisarevsky
df55aaec1e Merge pull request #5674 from mshabunin:mac-fix-2.4 2015-11-17 17:30:08 +00:00
Maksim Shabunin
eebd4cad66 Fix compilation problems with XCode 7.1.1 and cmake 3.3.2 2015-11-17 18:52:55 +03:00
Maksim Shabunin
e8bf4417ef New variant of iOS framework building, fixed some warnings for XCode 7.1.1 and cmake 3.3.2 2015-11-17 15:30:01 +03:00
Maksim Shabunin
7df392bfd8 run.py: issues with forced configuration fixed 2015-11-16 14:02:26 +03:00
Philipp Hasper
4d3915f69a Fixed mjpeg frame size attribution 2015-11-16 08:40:09 +01:00
Pavel Rojtberg
81e814d9ed clean up fisheye calibration code
improves performance by factor 1.2 to 2.0
2015-11-16 02:24:53 +01:00
Ilya Lavrenov
0050df8750 GraphCut deprecated in 7.5 and removed in 8.0 2015-11-15 00:56:56 +03:00
Maksim Shabunin
97878645bc Fix run.py test detection issues for debug VS configurations 2015-11-13 18:55:19 +03:00
Maksim Shabunin
01b5971c94 Merge pull request #5640 from mshabunin:restore-ts-gpu 2015-11-13 15:47:17 +00:00
Pavel Rojtberg
c209f795b5 support for NORM_L2SQR in norm(Matx<..>) 2015-11-13 14:29:56 +01:00
Bert
d3b0bda011 Update system.cpp
FreeBSD compilation fix
2015-11-13 11:03:34 +03:00
mbarann
b48b2d43b0 MSMF expects a bottom-up video frame, so the buffer pointer must point to the end of the data and the stride needs to be negative 2015-11-12 13:13:45 +01:00
berak
0baf0bdc24 AKAZE: check channels instead of type in detectAndCompute
add same CV_32F and CV_16U support for KAZE
2015-11-12 12:48:03 +01:00
Vladislav Vinogradov
39854ceda4 cuda::StreamAccessor::wrapStream and cuda::EventAccessor::wrapEvent
to import existed CUDA stream or CUDA event to OpenCV
2015-11-12 13:38:29 +03:00
Vladislav Vinogradov
8d3850ac02 add cv::gpu::StreamAccessor::wrapStream method
it allows to import existed CUDA stream to OpenCV
2015-11-12 13:07:30 +03:00
Alexander Alekhin
1862d1995f Merge pull request #5652 from jet47:core-test-math-warning-fix 2015-11-12 03:10:46 +00:00
Alexander Alekhin
fc1694c97c Merge pull request #5655 from janstarzy:2.4-canny-fix 2015-11-12 03:10:11 +00:00
Pavel Rojtberg
9233472bdd use cpp functions in CvLevMarq::step for better readability 2015-11-12 00:20:13 +01:00
Tian Zhi
f0434d60b0 fixed the type inconsistent with document.
Document say probs will have CV_64F type. But in effect, it has CV_32F type.
http://docs.opencv.org/3.0.0/d1/dfb/classcv_1_1ml_1_1EM.html#a2ea7da92a75bc7a7d665c241f547b9b9
2015-11-12 02:54:18 +08:00
Jan Starzynski
2799829bc9 fix potential buffer overflow as in 3.0 2015-11-11 16:19:20 +01:00
jiakai
933dfed4b8 check offset in ExifReader::getString 2015-11-11 20:17:24 +08:00
Vladislav Vinogradov
d5e6503fe5 fix signed/unsigned comparison warning in core/test/test_math.cpp 2015-11-11 11:53:39 +03:00
hoangviet1985
6441620f45 The right signs give the right results 2015-11-10 16:18:07 -05:00
Dan
aa14b6d2f3 Merge branch 'thrust_tutorial' of http://github.com/dtmoodie/opencv into thrust_tutorial 2015-11-10 12:29:51 -05:00
Dan
01f40cfafc Corrected the case where channel == -1 2015-11-10 12:29:29 -05:00
Vadim Pisarevsky
b4112a5878 Merge pull request #5480 from dtmoodie:vecgpumat 2015-11-10 17:02:21 +00:00
Vadim Pisarevsky
3942b1f362 Merge pull request #5340 from alalek:ocl_off 2015-11-10 16:53:36 +00:00
Marian Zajko
1eb9ef6bbf Fixed downsampling parameter enumerator backward compatibility. 2015-11-10 17:18:10 +01:00
Vadim Pisarevsky
38909d7959 Merge pull request #5597 from andy-held:cmakecudacross 2015-11-10 16:15:26 +00:00
Vadim Pisarevsky
18f4e55692 Merge pull request #5472 from StevenPuttemans:remove_unexisting_function 2015-11-10 16:14:43 +00:00
Vadim Pisarevsky
0f288d1082 Merge pull request #5605 from hoangviet1985:fix_bug_5599 2015-11-10 16:13:26 +00:00
Vadim Pisarevsky
82c1c68560 Merge pull request #5622 from LorenaGdL:hitAndMiss2.4 2015-11-10 16:03:48 +00:00
Vadim Pisarevsky
780b713016 Merge pull request #5638 from hoangviet1985:fix_bug_5623 2015-11-10 16:01:48 +00:00
Vadim Pisarevsky
9ab59fb22e Merge pull request #5645 from jia-kai:master 2015-11-10 15:56:23 +00:00
Vadim Pisarevsky
7b022371ea Merge pull request #5646 from brossetti:patch-1 2015-11-10 15:56:05 +00:00
Marian Zajko
286055b0d8 Removed trailing whitespace. 2015-11-10 12:25:57 +01:00
Marian Zajko
2cebe5a3b0 Fixed parameter enumrators list order to retain binary compatibility. 2015-11-10 12:07:19 +01:00
Marian Zajko
2998248dd3 Removed whitespaces reported by buildbot. 2015-11-09 13:30:08 +01:00
Marian Zajko
352b121202 Fixed whitespace issue
Removed tabulators from enumerators and ximea adapter source as reported
by precommit docs test.
2015-11-09 12:07:53 +01:00
brossetti
4194b7effe fixed bug on left mouse button click
Adding None as outImage in pos3 of cv2.drawKeypoints. Fixes bug that throws 'TypeError: Required argument 'outImage' (pos 3) not found' on left mouse button click
2015-11-09 04:37:59 -05:00
Pavel Rojtberg
742fb559f7 use cpp functions in cvCalibrateCamera2 to make it more readable 2015-11-08 19:25:38 +01:00
Pavel Rojtberg
955f489621 make CV_CAP_PROP_FORMAT consider the current channel count 2015-11-08 17:01:03 +01:00
Pavel Rojtberg
05f52b697f replace uyvy_to_rgb24 by tested and conformant cvtColor 2015-11-08 17:01:02 +01:00
Pavel Rojtberg
ad68b79630 replace yuv420p_to_rgb24 by tested and conformant cvtColor
Conversion was not ITU 601 conformant. Also add YVU420 format to allowed
zero copy access.
2015-11-08 17:01:02 +01:00
Pavel Rojtberg
8527d895bb replace rgb24_to_rgb24 by tested cvtColor
internally using ipp this conversion is now roughly 2x faster.
also add RGB/ BGR formats to allowed zero copy access.
2015-11-08 17:01:02 +01:00
Pavel Rojtberg
f50817120e v4l: remove needless CvCaptureCAM_V4L_CPP wrapper
possible source of memory leaks and unneeded complexity
2015-11-08 17:01:02 +01:00
Pavel Rojtberg
93d6e800b6 v4l: Fixed memory leaks and inconsistent status return values
by updating to c++ coding conventions

 - const correctness
 - use bool as return value
 - use explicit initialization instead of CLEAR macro/ memset
 - use cv namespace
2015-11-08 17:01:02 +01:00
Pavel Rojtberg
a581ddd896 remove support of Video4Linux1 API
the last kernel that allowed compiling this code was 2.6.37 which was
released almost 5 Years ago. So probably it does not get much testing
any more. Furthermore even back then one was better off using the V4L2
API.

The only change touching currently used code is the removal of the
global V4L2_SUPPORT variable.
2015-11-08 17:01:02 +01:00
Alexander Alekhin
1b6dd03fd7 Merge pull request #5641 from alalek:backport_5320 2015-11-07 05:21:31 +00:00
berak
28974e7290 remove usage of obsolete _dataAsRows flag 2015-11-06 19:59:25 +03:00
Maksim Shabunin
ffb9e877e9 Restore ts/gpu_perf.hpp, trying to compile with VS 2015 2015-11-06 13:26:58 +03:00
Viet Dinh
1e879e1ab1 clean up 2015-11-06 00:29:44 -05:00
Viet Dinh
57829d81ea mac compile error 2015-11-05 23:31:30 -05:00
Viet Dinh
a20a273982 Merge remote-tracking branch 'Itseez/2.4' into fix_bug_5599 2015-11-05 23:20:04 -05:00
Viet Dinh
e9b31a70bf mac osx compile errors 2015-11-05 21:44:36 -05:00
Viet Dinh
a1532582a6 optimize code 2015-11-05 19:38:24 -05:00
Viet Dinh
68bcff26fb fix solveCubic
The original solution did not handle correctly when delta = 0,
resulting as nan errors. I also wrote a test case to test solving
equation x^3 = 0 after fixing.
2015-11-05 19:19:56 -05:00
Marian Zajko
691fb1ffae XIMEA adapter update
- replaced m3api/m3apiX64 binaries with latest xiapi32/xiapi64 to
support latest camera models
- added new parameter definitions to videoio_c.h and
SetProperty/GetProperty calls
- added acquisition resetting for specific parmateters in SetProperty
call
- added new error return value evaluators
2015-11-05 15:56:47 +01:00
Maksim Shabunin
7392ce0a81 Added some documentation for MSER 2015-11-05 17:17:18 +03:00
jiakai
80df9ddedb check for exifSize 2015-11-05 18:32:51 +08:00
jiakai
1260060d7d check boundary in ExifReader 2015-11-05 17:58:35 +08:00
Viet Dinh
433bc81b30 std::cbrt could not be found 2015-11-03 21:40:52 -05:00
Viet Dinh
c8bf176558 casting warning 2015-11-03 21:10:38 -05:00
Viet Dinh
cfd5caf29d deal with type casting issues 2015-11-03 16:19:41 -05:00
Viet Dinh
f461d0cb7a fix compile errors
some functions were not found in namespace std
2015-11-03 15:37:25 -05:00
Viet Dinh
09b0193186 even more correct
calculates cube root of complex number to give more correct results.
2015-11-03 15:17:49 -05:00
Lorena García
252feb4774 Hit and Miss morphological op 2015-11-03 19:42:22 +01:00
Viet Dinh
537a978dcf update test_math.cpp 2015-11-03 12:52:49 -05:00
Andreas Franek
01c5a0ed12 Simplifies cross compilation with CUDA for ARM boards. CUDA arch is set for all ARM targets, --unresolved-symbols=ignore-in-shared-libs is set when cross-compiling for ARM and FindCUDA.cmake was adjusted to find shared library stubs within the CUDA toolkit. 2015-11-03 12:30:34 +01:00
Vadim Pisarevsky
b3ac274617 Merge pull request #5455 from michaelveth:matlab_cmake_unix_fix 2015-11-03 10:59:45 +00:00
Vadim Pisarevsky
de49ed3c15 Merge pull request #5388 from alalek:disable_invalid_string_usage 2015-11-03 10:58:57 +00:00
Vadim Pisarevsky
33dc41056f Merge pull request #5392 from elenash:fisheye_fix 2015-11-03 10:57:36 +00:00
Alexander Alekhin
4514158e43 Merge pull request #5617 from lupustr3:pvlasov/ipp9_fixes 2015-11-03 10:18:44 +00:00
Abe Friesen
5a918986cc Merge branch 'lr_predict' of https://github.com/afriesen/opencv into lr_predict 2015-11-02 17:49:52 -08:00
Abe Friesen
9c6ff4d955 - LogisticRegressionImpl::predict() was changed to return the predicted value and to only write to the OutputArray results if specified (no longer segfaults).
- Refactored batch and mini_batch training to use a common gradient computation function (removed duplicate code).
- Altered the cost computation so that NAN is not computed unnecessarily.
- Greatly simplified (and sped up) the code that appends a column of 1s to the data.
- Minor code cleanup.

Removed unused variables.

Added cast to float to remove warning
2015-11-02 17:49:06 -08:00
Abe Friesen
d367e159c1 Added cast to float to remove warning 2015-11-02 17:36:27 -08:00
Abe Friesen
db78fcd11a Removed unused variables. 2015-11-02 17:17:35 -08:00
Abe Friesen
dc1b01e002 - LogisticRegressionImpl::predict() was changed to return the predicted value and to only write to the OutputArray results if specified (no longer segfaults).
- Refactored batch and mini_batch training to use a common gradient computation function (removed duplicate code).
- Altered the cost computation so that NAN is not computed unnecessarily.
- Greatly simplified (and sped up) the code that appends a column of 1s to the data.
- Minor code cleanup.
2015-11-02 16:16:49 -08:00
Vadim Pisarevsky
979f88f6db Merge pull request #5518 from Bovaz:master 2015-11-02 15:58:58 +00:00
Vadim Pisarevsky
8512ca7490 Merge pull request #5484 from PolarNick239:master 2015-11-02 15:45:59 +00:00
Vadim Pisarevsky
67ef84d883 Merge pull request #5386 from StevenPuttemans:add_markers 2015-11-02 15:45:38 +00:00
Pavel Vlasov
4d7f9e06e8 Fix for copy with mask 32s and 8u; 2015-11-02 18:00:22 +03:00
Viet Dinh
b6e8a47fca fix whitespace errors 2015-11-02 09:28:37 -05:00
Viet Dinh
ed0065266e update fixing bug #5599 2015-11-02 08:38:05 -05:00
Vadim Pisarevsky
b5fd7868a8 Merge pull request #5487 from Wangyida:python 2015-11-02 12:26:53 +00:00
Vadim Pisarevsky
c21ed69731 Merge pull request #5586 from mshabunin:run-py-changes-2.4 2015-11-02 12:05:00 +00:00
Vadim Pisarevsky
7ca9e49749 Merge pull request #5607 from n3011:patch-1 2015-11-02 11:55:12 +00:00
Vadim Pisarevsky
a69fd6029a Merge pull request #5512 from edgarriba:gdal_lan 2015-11-02 11:53:08 +00:00
Vadim Pisarevsky
3c31d6add3 Merge pull request #5515 from LorenaGdL:hitAndMiss 2015-11-02 11:49:37 +00:00
Vadim Pisarevsky
7323823b38 Merge pull request #5582 from sizeofvoid:master 2015-11-02 11:39:43 +00:00
Vadim Pisarevsky
b2f6aedec9 Merge pull request #5587 from lupustr3:pvlasov/ipp_cond_update 2015-11-02 11:38:02 +00:00
Vadim Pisarevsky
46dd502f4a Merge pull request #5602 from ChrisKitching:clearerMatErrors 2015-11-02 11:37:34 +00:00
Vadim Pisarevsky
39346f3204 Merge pull request #5592 from berak:python_rect2d 2015-11-02 11:36:03 +00:00
Vadim Pisarevsky
32b44173e7 Merge pull request #5595 from mshabunin:fix-bitonal-tif 2015-11-02 11:32:17 +00:00
Vadim Pisarevsky
00f222a9b4 Merge pull request #5598 from ajbernal:ocl_bilateral_bugfix 2015-11-02 11:22:25 +00:00
Vadim Pisarevsky
920427af5e Merge pull request #5600 from grundman:patch-3 2015-11-02 11:15:08 +00:00
Vadim Pisarevsky
d55e44f0b7 Merge pull request #5608 from n3011:patch-2 2015-11-02 11:14:39 +00:00
Vadim Pisarevsky
92298c88bd Merge pull request #5609 from n3011:patch-3 2015-11-02 11:14:24 +00:00
Vadim Pisarevsky
c963757b43 Merge pull request #5610 from n3011:patch-4 2015-11-02 11:13:49 +00:00
Ishant Mrinal Haloi
47b2511f07 Update driver_api_stereo_multi.cpp 2015-11-02 15:08:27 +08:00
Ishant Mrinal Haloi
52b4fe63c1 Update cascadeclassifier_nvidia_api.cpp 2015-11-02 15:07:45 +08:00
Ishant Mrinal Haloi
46be45b4f7 Update driver_api_multi.cpp 2015-11-02 15:06:38 +08:00
Ishant Mrinal Haloi
64eb69cb15 Update multi.cpp 2015-11-02 15:05:45 +08:00
Viet Dinh
03e7b71707 fix whitespace errors 2015-11-02 00:50:05 -05:00
Viet Dinh
e06c696b3c fix whitespace errors 2015-11-02 00:20:13 -05:00
Viet Dinh
40ce9f97d6 fix whitespace errors 2015-11-02 00:04:51 -05:00
Viet Dinh
0bc44376a5 fix bug #5599
solves equations more correctly, eliminates “nan” error.
2015-11-01 23:30:28 -05:00
Viet Dinh
fdf549b921 fix bug #5599 2015-11-01 11:08:01 -05:00
edgarriba
f50858dd24 set GA_ReadOnly flag again since test error 2015-11-01 12:07:05 +01:00
Chris Kitching
0f8a266787 Make Mat assertion failures more helpful
Instead of chaining a bunch of sanity checks together with "&&", let's just have several asserts. That way, when an assert fails, you don't get a monsterous "<huge evil expression>
failed" error, but only the bit you care about, making your life rather a lot easier.
2015-11-01 01:02:15 +00:00
edgarriba
a242556b1d Merge branch 'master' of https://github.com/Itseez/opencv into gdal_lan
Conflicts:
	modules/imgcodecs/include/opencv2/imgcodecs.hpp
2015-10-31 20:18:41 +01:00
edgarriba
decdae515b set GA_Update flag in order remove ERROR 8: band 1: Attempt to write to read only dataset inGDALRasterBand::Fill() 2015-10-31 20:11:05 +01:00
edgarriba
9ff14bc411 add support for float32 and float 64 2015-10-31 20:00:39 +01:00
grundman
f609ddba05 Fix incorrect FPS value returned by cap.get(CV_CAP_PROP_FPS)
Current implementation returns NaN for some configs of FFMPEG, call default get_fps() instead (as also used by PROP_POS_MSEC)
2015-10-30 17:48:04 -07:00
Ariel Bernal
cc903d0605 Fix for #5590. OpenCL BilateralFilter implementation failes to
build for some OCL drivers.
Some OCL vendors treat implicit scalar-vector conversions for
operators as errors when type conversion is required.
2015-10-30 09:39:11 -07:00
Hajo Nils Krabbenhöft
a8e550f5bf Fixed crash when reading b/w tif images (fixes #5579) 2015-10-30 17:41:52 +03:00
Maksim Shabunin
021ff0efa6 Merge pull request #5575 from mshabunin:fix-vs2015-2.4 2015-10-30 13:47:18 +00:00
Maksim Shabunin
6e2a68fdf3 Merge pull request #5384 from mshabunin:run-py-changes 2015-10-30 13:45:59 +00:00
berak
1048b235bf add Rect2d to python bindings 2015-10-30 10:02:33 +01:00
Pavel Vlasov
5ae3693567 Condition update for 8u IPP in GaussianBlur. Bug was fixed in 9.0.1; 2015-10-29 13:21:13 +03:00
Maksim Shabunin
1e869c5e49 ts: refactor run.py script
Conflicts:
	modules/ts/misc/run.py
2015-10-29 13:04:05 +03:00
Maksim Shabunin
f49936a849 Fixed cmake and build issues when using Visual Studio 2015 2015-10-29 11:50:48 +03:00
Maksim Shabunin
90c74e3be0 ts: refactor run.py script 2015-10-29 11:28:12 +03:00
Wangyida
ca599eee40 python modification for Point3D 2015-10-29 10:24:49 +08:00
Rafael Sadowski
e38b54a786 fix cmake OpenBSD linker libs
OpenBSD needs m and pthread like Net- and FreeBSD.
2015-10-28 22:47:00 +01:00
Anton V. Shokurov
b9b40a73ba Exposure and autofocus properties fixed/added.
Exposure can now be manually controlled (implemented only in libv4l).
Will work only with a kernel version >= 4.5.
Autofocus can be enabled/disabled.
2015-10-28 07:37:51 -04:00
Alexander Alekhin
4552ca98c4 Merge pull request #5574 from ilya-lavrenov:image-sequence-videocapture 2015-10-27 15:41:59 +00:00
Ilya Lavrenov
9e2395e7e0 return false in grabFrame failed in open method 2015-10-27 16:56:31 +03:00
Ilya Lavrenov
05945bf00e fixed case when grabbing failed 2015-10-27 16:26:24 +03:00
Ilya Lavrenov
9d78a1ea9f allow to retrieve videocapture properties before first frame reading 2015-10-26 14:37:38 +03:00
Alexander Alekhin
dfec99691b Merge pull request #5370 from berak:fix_svm_autoTrain 2015-10-26 10:47:29 +00:00
Alexander Smorkalov
8e40becab1 Debian packages with legacy C headers added to list of conflicts, relpaces, etc.
(cherry picked from commit e245aed6bbebd69a63a00d45a66b358df4153888)
2015-10-26 10:56:34 +03:00
Alexander Alekhin
60eda6f25c export simple libs from OPENCV_LINKER_LIBS (fix #5541)
(cherry picked from commit 937a096bf10bedd2d10803f67716393f9065abe8)
2015-10-26 10:55:38 +03:00
Alexander Smorkalov
2e78a3e5e9 Fixed samples build with nonfree.
(cherry picked from commit 341e7b3be24f921cdf0a63793afc2e694b4e98b6)
2015-10-26 10:55:24 +03:00
Alexander Smorkalov
966d35a9fb Made samples build independent from nonfree module.
(cherry picked from commit bba8c0beacf34143509b60aaf5321c56b2a21013)
2015-10-26 10:55:14 +03:00
Alexander Smorkalov
42447a7610 Set of lintain warning fixes for -samples debian package.
(cherry picked from commit ff002203029220cd63bbb383b3f286a1ee7c35f3)
2015-10-26 10:55:00 +03:00
Aaron Simmons
ca50969c2b brining over fix in master (#4140) for libz import on 64-bit android
(cherry picked from commit 55a9fdf0512a6bd3fd82591f48db0942cbd4fc38)
2015-10-26 10:54:44 +03:00
a-andre
2d3e170370 install opencv2/highgui.hpp header
(cherry picked from commit d16fb3051296feebd04cdd7a372e0049629c155f)
2015-10-26 10:54:29 +03:00
Alexander Smorkalov
8a37fc8223 Added missing copyright headers.
(cherry picked from commit 408107ce6d16ae118167ffe22fda6bdcdb9514cb)
2015-10-26 10:53:52 +03:00
Alexander Smorkalov
a5c20f8592 Debian formatted copyright file added to all debian packages.
(cherry picked from commit 9d24b3c3b0133c29a642aa5a0d2a0634333287f3)
2015-10-26 10:53:38 +03:00
Ilya Lavrenov
96a2edb375 delete video readers
(cherry picked from commit 0d5b739d35e7a0c2d2b88db58994397ae969f468)
2015-10-26 10:53:23 +03:00
Ilya Lavrenov
15b313ce4b fixed memory leak in findHomography tests
(cherry picked from commit ec5244a73abf36014fdd2763ff1f16e5e986cbb4)
2015-10-26 10:52:57 +03:00
Alexander Smorkalov
1ea6568951 Fixed wrong-name-for-changelog-of-native-package warning for deb packages.
(cherry picked from commit cb1dc7cb6e8886f02864467aeae6c584a7eccc76)
2015-10-26 10:51:22 +03:00
Ilya Lavrenov
56654ae360 added some property setting and getting
(cherry picked from commit 75fcedf0edbc83a900918de1a25195eaefc214f5)
2015-10-26 10:50:00 +03:00
Ilya Lavrenov
9a3e53e738 repaired GStreamer 0.10 version
(cherry picked from commit c19ed39a785d7ac9e39c117cfacc3827024619f7)
2015-10-26 10:49:43 +03:00
Ilya Lavrenov
2243bfa181 repaired gstreamer camera capture:
1. Enabled property retrieval: height, width, FPS
2. Fixed issue when isOpened returns always true even for non-existing devices
3. Ability to work with non-0 device. Camera capture index is taken into account

(cherry picked from commit dbd7912b88e36a045d1086d54f77467de5ab006f)
2015-10-26 10:49:32 +03:00
robertxwu
33cd7f38a8 re-submit
(cherry picked from commit 4a68cc1675990c46cf53a66f137cb8da09022e4b)
2015-10-26 10:49:02 +03:00
Hajo Nils Krabbenhöft
2fc0ce5c24 buffer_size should be in bytes, not bits
(cherry picked from commit 7825cbeb7d70c2e1e558808d7433ece414394177)
2015-10-26 10:46:33 +03:00
Hajo Nils Krabbenhöft
c5d009d6c4 fix crash for large BW tif images
(cherry picked from commit d38fee759928d631ea2947c67e5ee9eb347693b6)
2015-10-26 10:46:23 +03:00
Roman Donchenko
7d28541bbe test2.py: fail if a downloaded image can't be decoded
(cherry picked from commit 56f17e4921a379317a0602d92d7ca3677cabe9d6)
2015-10-26 10:45:22 +03:00
Alexander Alekhin
8c2d712fb0 Merge pull request #5538 from micalan:JpegExif 2015-10-25 15:18:08 +00:00
Alexander Alekhin
c3eb1254cf Merge pull request #5570 from paroj:qsliderfix 2015-10-24 14:38:38 +00:00
Alexander Alekhin
89697310b0 Merge pull request #5553 from pletessier:aspect-ratio 2015-10-24 14:38:02 +00:00
Pierre Letessier
e6615c5825 Changed CV_FFMPEG_CAP_PROP_SAR_* values 2015-10-24 11:22:18 +02:00
Lorena García
7cff60f4f6 Changed src matrix complement computation 2015-10-24 00:33:36 +02:00
jisli
251610f6a1 fix header problem(can't find cstdint) on OSX platform 2015-10-23 15:25:26 -07:00
Lorena García
fb03330ea3 Fixed CV_Assert 2015-10-24 00:22:50 +02:00
Pavel Rojtberg
cfd498a8eb fix compilation with qt
QSlider does not have getMinimum/Maximum getters. Probably was not
compile tested.
2015-10-23 21:42:11 +02:00
Pierre Letessier
baa21484a1 Added CV_CAP_PROP_SAR properties to videoio module 2015-10-23 21:14:22 +02:00
micalan
0a306f8804 Camera orientation handling is added for jpeg files 2015-10-23 21:19:35 +03:00
Alexander Alekhin
9a0beda037 Merge pull request #5489 from paroj:v4l2noconvert 2015-10-23 16:35:36 +00:00
Alexander Alekhin
09e6c82190 Merge pull request #5474 from paroj:v4l2ctrls 2015-10-23 16:28:26 +00:00
Alexander Alekhin
95d6002f16 Merge pull request #5568 from asmorkalov:as/legacy_c_deb_pack_dep 2015-10-23 15:37:26 +00:00
Alexander Smorkalov
e245aed6bb Debian packages with legacy C headers added to list of conflicts, relpaces, etc. 2015-10-23 16:09:04 +03:00
Maksim Shabunin
e9ec52368f Merge pull request #5562 from rodrigob:patch-2 2015-10-23 10:58:10 +00:00
Rodrigo Benenson
0ef7387298 mush -> must
fixed typo
2015-10-22 23:27:55 +02:00
Alexander Alekhin
debe99f1a4 Merge pull request #5531 from mshabunin:fix-vs2015 2015-10-22 16:28:42 +00:00
Alexander Alekhin
031568831c Merge pull request #5513 from jet47:ctest-extended-support 2015-10-22 12:37:40 +00:00
Maksim Shabunin
497d92e7d1 Merge pull request #5533 from sturkmen72:patch-12 2015-10-22 12:30:38 +00:00
Maksim Shabunin
1cb0dfa669 Merge pull request #5500 from StevenPuttemans:fix_mask_notice_copyTo_2.4 2015-10-22 12:28:54 +00:00
Maksim Shabunin
4e7a14355d Merge pull request #5499 from StevenPuttemans:fix_mask_notice_copyTo 2015-10-22 12:27:45 +00:00
Maksim Shabunin
490b327be9 Merge pull request #5365 from sturkmen72:patch-2 2015-10-22 12:25:48 +00:00
Maksim Shabunin
ff35726fc3 Merge pull request #5432 from sturkmen72:patch-11 2015-10-22 12:24:47 +00:00
Maksim Shabunin
31e0d90da6 Enable temp objects destruction test for VS versions less than 2015 2015-10-22 12:44:03 +03:00
Vadim Pisarevsky
b34f0d99bb Merge pull request #5539 from sturkmen72:patch-14 2015-10-21 11:54:52 +00:00
Vadim Pisarevsky
66f2000548 Merge pull request #5532 from grundman:patch-2 2015-10-21 11:54:30 +00:00
Vadim Pisarevsky
91e9e6489b Merge pull request #5542 from renatoGarcia:matx_constructors 2015-10-21 11:46:27 +00:00
Vadim Pisarevsky
f820df2ea0 Merge pull request #5543 from aman11dhanpat:master 2015-10-21 11:44:35 +00:00
Vadim Pisarevsky
a91dcb015d Merge pull request #5548 from berak:patch-2 2015-10-21 11:41:25 +00:00
berak
781931a671 update python features2d tutorials 2015-10-21 08:22:22 +02:00
Alexander Alekhin
4dc2313527 Merge pull request #5552 from hyunkim9123:camshift-2.4 2015-10-21 06:13:38 +00:00
Suleyman TURKMEN
fd4761ba31 Update face detection samples 2015-10-20 19:09:21 +03:00
Maksim Shabunin
3119f0a61b Merge pull request #5519 from hyunkim9123:camshift_py 2015-10-20 14:43:33 +00:00
Maksim Shabunin
6e9d0d9a0c Visual Studio 2015 warning and test fixes 2015-10-20 12:48:37 +03:00
Alexander Alekhin
938d42a89f Merge pull request #5545 from alalek:fix_linker_libs 2015-10-19 15:29:02 +00:00
Alexander Alekhin
1648e9292c Merge pull request #5431 from MiguelAlgaba:em_one_cluster 2015-10-19 15:27:35 +00:00
Aman Verma
d5e314e728 Fixing compilation errors in windows and mac 2015-10-19 10:58:43 +00:00
Alexander Alekhin
937a096bf1 export simple libs from OPENCV_LINKER_LIBS (fix #5541) 2015-10-19 13:49:41 +03:00
Aman Verma
b0209ad7f7 Fix for #5495 : add setTrackbarMin 2015-10-19 08:44:06 +00:00
Renato Florentino Garcia
f5b98bea41 Fix behavior of Matx 12 and 16 args constructors.
The 12 and 16 arguments Matx constructors differs from all others,
leaving values initialized and requiring the argument number to be equal
to the channels number.
2015-10-18 23:16:21 -02:00
Suleyman TURKMEN
51e687f7a9 Update imgproc.hpp 2015-10-18 15:53:15 +03:00
Pavel Rojtberg
eac5cab5cb cap_v4l: implement PROP_CONVERT_RGB
allows disabling automatic conversion to RGB for certain formats. If
conversion is disabled the returned image just points to the underlying
buffer, so no memcpy is performed.

Note that we do not check image size in retrieve frame any more as it
can not possibly while the device is streaming.
Furthermore this code was disabled altogether by the wrong ifdef in the
previous commit.
2015-10-18 14:14:20 +02:00
Pavel Rojtberg
5e62e71b13 fix wrong ifdef bracketing
in the case of HAVE_CAMV4L2 && !HAVE_CAMV4L there was no body for the if
statement.
2015-10-18 14:13:44 +02:00
Pavel Rojtberg
54e7f08760 add python sample to test/ showcase new cap_v4l2 features 2015-10-18 14:13:44 +02:00
Pavel Rojtberg
838947bb8e replace custom yuyv_to_rgb24 implementation by cvtColor 2015-10-18 13:51:20 +02:00
Pavel Rojtberg
80747088e3 avoid needless copies during mjpeg decoding 2015-10-18 13:51:20 +02:00
Pavel Rojtberg
56dd7eda0d remove additional V4L2 pixelformat defines
they are upstream since at least linux 2.6.8 (10 Years)
http://lxr.oss.org.cn/ident?v=2.6.8&i=V4L2_PIX_FMT_SBGGR8
2015-10-18 13:51:20 +02:00
Pavel Rojtberg
588eba3b37 simplify autosetup_capture_mode_v4l2 by using a for loop 2015-10-18 13:51:20 +02:00
Pavel Rojtberg
5525cc4d09 implement CAP_PROP_MODE, CAP_PROP_FOURCC and CAP_PROP_FORMAT
do not use a custom enum instead of the V4L2 fourcc defines for palette.
This way we can easily implement CAP_PROP_FOURCC and CAP_PROP_MODE.
2015-10-18 13:51:20 +02:00
Pavel Rojtberg
c0fe522c9d allow changing FPS and Image Size using V4L2
use logic similar to cap_libv4l: replace icvSetVideoSize by v4l2_reset
as it was not used for V4L1, the actual frame format is negotiated in
try_palette_v4l2 and the stream has to restarted anyway.
2015-10-18 13:51:16 +02:00
Pavel Rojtberg
18034a5138 allow icvGetPropertyCAM_V4L to return zero
now icvGetPropertyCAM_V4L behaves the same as in cap_libv4l. This also
fixes passing boolean values.
2015-10-18 13:48:15 +02:00
Pavel Rojtberg
f7981a8ae8 support setting focus and autofocus with V4L2
also refactor property range handling and opencv property to V4L2
translation.
2015-10-18 12:56:09 +02:00
paul.kim
78a566611d Fix the issue in mouse click event 2015-10-17 10:42:48 +09:00
Suleyman TURKMEN
73240b736b Update camera_calibration_and_3d_reconstruction.rst 2015-10-16 22:30:00 +03:00
grundman
f260b13a6f Fix racy modification of ForThread::m_state during invocation of stop() 2015-10-16 11:19:27 -07:00
Jan S. (Milania1)
3e0b1f2845 Added example to the documentation for the NormTypes enum (L1, L2, INF) 2015-10-15 19:16:07 +02:00
Alexander Smorkalov
bf41e791ff Merge pull request #5514 from asmorkalov:as/nonfree-independent-samples 2015-10-15 10:56:23 +00:00
Alexander Smorkalov
bac151675a Merge pull request #5501 from asmorkalov:as/samples_lintian_fixes 2015-10-15 10:52:46 +00:00
paul.kim
d5d16bb3b1 Fix the issue in mouse click event 2015-10-15 11:09:31 +09:00
Bovaz
aeb260a3f9 Merge pull request #1 from Bovaz/Bovaz-patch-1
sqrtf to std::sqrt
2015-10-14 19:02:41 -07:00
Bovaz
7be3d3ab2c sqrtf to std::sqrt 2015-10-14 18:57:33 -07:00
Matteo Piovanelli
216baf5b11 Speedup of arcLength
By my tests, this version of cv::arcLength is almost 10% faster than the
one using a buffer it replaces.
2015-10-14 13:37:48 -07:00
Alexander Smorkalov
341e7b3be2 Fixed samples build with nonfree. 2015-10-14 16:19:37 +03:00
Alexander Alekhin
37ce3b8cfe Merge pull request #5478 from alalek:fix_android_pack_build 2015-10-14 13:05:18 +00:00
Lorena García
33f77774c5 Hit&Miss morphological operation 2015-10-14 14:01:53 +02:00
Alexander Alekhin
98c26d95e5 Merge pull request #5511 from paleozogt:android-64-bit 2015-10-14 11:35:05 +00:00
Alexander Smorkalov
bba8c0beac Made samples build independent from nonfree module. 2015-10-14 12:56:58 +03:00
Alexander Alekhin
885ce6b348 Merge pull request #5507 from rodrigob:patch-1 2015-10-14 09:14:43 +00:00
Alexander Alekhin
dcca0b499c Merge pull request #5509 from spmallick:master 2015-10-14 09:14:10 +00:00
Alexander Alekhin
bd34f6dd98 Merge pull request #5505 from a-andre:highguiheader 2015-10-14 09:11:21 +00:00
Alexander Alekhin
d8c352d20d Merge pull request #5504 from aman11dhanpat:master 2015-10-14 09:10:30 +00:00
Alexander Alekhin
c1545c6f2a Merge pull request #5502 from AlexanderStohr:file-handle-volatile-fix 2015-10-14 09:09:30 +00:00
edgarriba
1e9bd59f07 load multi/hyperspectral images with using gdal 2015-10-14 09:16:04 +02:00
Aaron Simmons
55a9fdf051 brining over fix in master (#4140) for libz import on 64-bit android 2015-10-13 17:42:40 -06:00
spmallick
066c775321 Update window_QT.h
QPushButton was included twice.
2015-10-13 15:51:43 -07:00
Rodrigo Benenson
d8e470fc30 CommandLineParser missing gpu option
As is it was not possible to use CUDA.
2015-10-13 19:04:06 +02:00
a-andre
d16fb30512 install opencv2/highgui.hpp header 2015-10-13 18:16:14 +02:00
Vladislav Vinogradov
02c48ab7d6 add CTest support to build tree 2015-10-13 17:34:08 +03:00
Vladislav Vinogradov
d81d51d155 assing labels to targets and sources 2015-10-13 17:33:26 +03:00
Alexander Alekhin
466a98f7c3 Merge pull request #5493 from lupustr3:pvlasov/ipp9_fixes 2015-10-13 14:24:09 +00:00
Alexander Alekhin
8b23d1ec64 Merge pull request #5498 from asmorkalov:as/copyright_headers 2015-10-13 14:22:57 +00:00
AlexanderStohr
0098c4b571 fix VS2010 error with type mismatch due to volatile qualifier 2015-10-13 16:15:49 +02:00
Alexander Stohr
7e3d7677ae not only print file-not-found as a warning but also print the name of the problematic file and the uri used for the open attempt 2015-10-13 16:15:48 +02:00
Alexander Smorkalov
ff00220302 Set of lintain warning fixes for -samples debian package. 2015-10-13 16:32:53 +03:00
StevenPuttemans
8ed25ad75f adding extra explanation for mask parameter 2015-10-13 15:21:35 +02:00
StevenPuttemans
0a708e4070 adding extra explanation for mask parameter 2015-10-13 15:19:50 +02:00
Alexander Smorkalov
408107ce6d Added missing copyright headers. 2015-10-13 15:02:38 +03:00
Pavel Vlasov
40b2dfae09 Fix for filter2D and IPP < 900 2015-10-13 14:10:32 +03:00
Alexander Alekhin
3558da9ab7 Merge pull request #5494 from asmorkalov:as/deb_copyright 2015-10-13 08:54:20 +00:00
Alexander Smorkalov
9d24b3c3b0 Debian formatted copyright file added to all debian packages. 2015-10-13 09:09:07 +03:00
Alexander Alekhin
0d791189ee Merge pull request #5486 from amroamroamro:fix_ml_randMVNormal 2015-10-12 17:44:02 +00:00
Aman Verma
411be4fde8 Fix for #5481, removing repeated/useless assignment in contours.cpp 2015-10-12 16:16:27 +00:00
Alexander Alekhin
ddd91bcebf android: add targetSdkVersion="21" 2015-10-12 18:12:34 +03:00
Dan
1e1f20cfee Improved consistency. 2015-10-12 09:21:53 -04:00
Alexander Alekhin
a21be6706d android: force OpenCV library target to "android-21" 2015-10-12 14:27:05 +03:00
Alexander Alekhin
779dad12fb Merge pull request #5491 from ilya-lavrenov:video-writers-delete 2015-10-12 10:48:16 +00:00
Alexander Alekhin
297a92cd94 Merge pull request #5490 from ilya-lavrenov:mem-leak-calib3d 2015-10-12 10:47:50 +00:00
Pavel Vlasov
89eee6ca99 Fixes for IPP integration:
dotProd_16s - disabled for IPP 9.0.0;
filter2D - fixed kernel preparation;
morphology - conditions fix and disabled FilterMin and FilterMax for IPP 9.0.0;
GaussianBlur - disabled for CV_8UC1 due to buffer overflow;
integral - disabled for IPP 9.0.0;

IppAutoBuffer class was added;
2015-10-12 10:51:28 +03:00
Ilya Lavrenov
0d5b739d35 delete video readers 2015-10-12 00:40:23 +03:00
Ilya Lavrenov
ec5244a73a fixed memory leak in findHomography tests 2015-10-12 00:11:45 +03:00
Amro
13a0a37e63 fix randMVNormal in ML (#5469)
Fix the failed assertion by replacing the GEMM call.

Also random numbers are generated from normal distribution ~N(0,1),
instead of uniform distribution ~U(0,1).
2015-10-11 01:54:11 +03:00
Nickolay Polyarniy
846e6f731a stereoRectifyUncalibrated: assertion of input points shape fixed
Fix for https://github.com/Itseez/opencv/issues/4426
Documentation says that input points format is the same to input for findFundamentalMat
2015-10-10 14:00:31 +03:00
Dikay900
7b0b12de58 appropriate logic behind last accepted stage when rejectingLevels is true 2015-10-09 23:19:42 +02:00
Dan Moodie
3d1355efc1 Updated input / output array to support std::vector<cv::cuda::GpuMat>
Expanded support for std::vector<cv::cuda::GpuMat>.

Whitespace fix.
2015-10-09 15:12:57 -04:00
Alexander Alekhin
dbcc55a196 cleanup <build>/src|gen folders to remove stalled/unused Java files 2015-10-09 17:28:50 +03:00
Alexander Alekhin
0f1fdd885d Merge pull request #5471 from StevenPuttemans:add_images_python_tutorials 2015-10-09 11:31:32 +00:00
Alexander Alekhin
441eeef319 Merge pull request #5470 from apavlenko:android_camera_gl_view 2015-10-08 13:31:51 +00:00
Alexander Alekhin
a8d0c18248 Merge pull request #5468 from AVshokurov:master 2015-10-08 12:37:57 +00:00
Anton V. Shokurov
bbe007159a The latest version (5.1.1) of the gnu compiler returns just its major version ("5") when given the "-dumpversion" argument. Gnu compiler developers don't consider this to be an error. A workaround for this case has been made. 2015-10-08 07:22:20 -04:00
Andrey Pavlenko
24ca6aaada fix build with CMake
now it builds by the command:
`cmake.exe -Wno-dev -GNinja -DCMAKE_MAKE_PROGRAM="path\to\ninja\ninja.exe" -DCMAKE_TOOLCHAIN_FILE=../opencv3/platforms/android/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a with NEON" -DANDROID_SDK_TARGET=21 -DANDROID_NATIVE_API_LEVEL=14 -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DBUILD_ANDROID_EXAMPLES=ON -DINSTALL_ANDROID_EXAMPLES=ON -DWITH_OPENCL=YES -DANDROID_OPENCL_SDK=path\to\OpenCL ../opencv`
2015-10-08 13:48:46 +03:00
StevenPuttemans
913c266b4a adding missing images from python tutorials, like chessboard.png, simple.jpg, home.jpg, fly.png, ... 2015-10-08 11:59:54 +02:00
Andrey Pavlenko
23fea91e84 minor fixes 2015-10-08 12:37:59 +03:00
StevenPuttemans
47db20eced removing unexisting functionality in ML header 2015-10-08 11:10:05 +02:00
Andrey Pavlenko
a041105491 refactoring Tutorial-4 using new OpenCV CameraGLSurfaceView 2015-10-08 01:26:54 +03:00
Alexander Alekhin
484c68cbb8 Merge pull request #5460 from sergiud:highgui-autosize-gtk3 2015-10-07 14:47:16 +00:00
Alexander Alekhin
56e8827ce0 Merge pull request #5456 from sergiud:ffmpeg-capture-varying-frame-size 2015-10-07 14:42:29 +00:00
Alexander Alekhin
ea535abd50 Merge pull request #5462 from alalek:fix_x86_detection 2015-10-07 14:41:44 +00:00
Andrey Pavlenko
15db8243ef refactored; added Camera2, notify callbacks, front/back maxCamera sizes; disable new stuff if target API < 21 2015-10-07 15:01:32 +03:00
Alexander Alekhin
fe00689757 workaround for 32-bit OS on 64-bit x86 CPU 2015-10-06 20:42:21 +03:00
Alexander Alekhin
454e5e5fa4 Merge pull request #5461 from berak:fix_putText_24 2015-10-06 17:12:25 +00:00
Alexander Alekhin
706b8a6266 Merge pull request #5459 from aman11dhanpat:master 2015-10-06 17:12:03 +00:00
Alexander Alekhin
559b538be8 Merge pull request #5458 from berak:fix_putText 2015-10-06 17:11:47 +00:00
berak
bb9bd3132a fix zero length std::string in putText() 2015-10-06 18:31:00 +02:00
berak
f2decec3e8 fix zero length std::string in putText() 2015-10-06 17:07:40 +02:00
Sergiu Dotenco
514b202d7b highgui: CV_WINDOW_AUTOSIZE does not resize with GTK3 2015-10-06 17:01:28 +02:00
Aman Verma
dff7037156 Adding fix for issue 5451 "putText fails with empty std::string" 2015-10-06 14:23:27 +00:00
Sergiu Dotenco
9da4fe4b02 videoio: fixed segmentation fault at frame size change 2015-10-06 15:09:31 +02:00
Alexander Alekhin
6025738b8b Merge pull request #5454 from alalek:fix_ffmpeg_priv_data 2015-10-06 10:01:59 +00:00
Alexander Alekhin
7a4b2e18a7 Merge pull request #5441 from alalek:fix_ffmpeg_frame_creation 2015-10-06 10:01:39 +00:00
michaelveth
a3fda24597 Update OpenCVFindMatlab.cmake
Added fix to OpenCVFindMatlab.cmake to properly locate modern versions of unix- MATLAB.  Tested with MATLAB R2015a and Ubuntu 14.04.
2015-10-06 04:17:40 -05:00
Dan Moodie
f332f98757 Removed last trailing whitespace. Can't believe I missed it. 2015-10-05 20:21:46 -04:00
Alexander Alekhin
4760d32937 ffmpeg: fix invalid NULL pointer access
Catched on Ubuntu 12.04 with FFMPEG:
  codec:                     YES (ver 53.35.0)
  format:                    YES (ver 53.21.1)
  util:                      YES (ver 51.22.3)
  swscale:                   YES (ver 2.1.0)
  resample:                  NO
  gentoo-style:              YES
2015-10-05 19:28:35 +03:00
Alexander Alekhin
33f5ac5c15 Merge pull request #5429 from PhilLab:patch-6 2015-10-05 12:50:17 +00:00
Alexander Alekhin
59a41c1c51 Merge pull request #5453 from paroj:capgstleak 2015-10-05 12:47:11 +00:00
Pavel Rojtberg
345cd1242f do not leak GstMapInfo
it is new'ed but never deleted. However it does not need to be global or
heap allocated in the first place.
2015-10-05 12:28:47 +02:00
Jan S. (Milania1)
3d2a24f61d Added example to the documentation for the normalize() method 2015-10-04 20:23:45 +02:00
Alexander Alekhin
50a0a167f0 fix ffmpeg frame creation (fix #5439) 2015-10-02 18:27:18 +03:00
Alexander Alekhin
e2e25e9af3 Merge pull request #5399 from alalek:fix_5264 2015-10-02 12:51:09 +00:00
Alexander Alekhin
76afd9a1b5 Merge pull request #5436 from jet47:fix-cuda-normalize 2015-10-02 12:50:38 +00:00
Alexander Alekhin
b37387ef90 Merge pull request #5425 from lupustr3:pvlasov/ipp_initialization_changes 2015-10-02 12:49:37 +00:00
Suleyman TURKMEN
21c0acff24 Update imgcodecs.hpp 2015-10-02 14:00:24 +03:00
Vladislav Vinogradov
1bf811c3f1 fix cuda::normalize (dtype < 0) case 2015-10-02 11:41:01 +03:00
StevenPuttemans
587dca9b1c adding markers to OpenCV 2015-10-02 08:48:15 +02:00
Elena Shipunova
e539a9632d Fix in fisheye calibrate function: #5389 2015-10-01 19:03:26 +03:00
Pavel Vlasov
6a0d3b06f2 IPPInitSingelton initialization guards; 2015-10-01 17:48:49 +03:00
Miguel Algaba
b71a27b96c Assert fix: allow one cluster as valid parameter 2015-10-01 16:45:59 +02:00
StevenPuttemans
406cfc48c9 adding markers to OpenCV for 2.4 branch 2015-10-01 16:08:25 +02:00
Vadim Pisarevsky
d69b7c332a Merge pull request #5385 from alalek:fix_android_camera_datarace 2015-10-01 13:58:01 +00:00
Philipp Hasper
05846438e3 Typo in CameraBridgeViewBase.java
Corrected typo and unused imports
2015-10-01 15:09:14 +02:00
Vadim Pisarevsky
af5e631a7a Merge pull request #5402 from sturkmen72:patch-10 2015-10-01 13:01:26 +00:00
Vadim Pisarevsky
c29b09d093 Merge pull request #5408 from alalek:move_ippicv_binaries 2015-10-01 12:54:11 +00:00
Vadim Pisarevsky
c2caea4818 Merge pull request #5409 from kauevestena:patch-1 2015-10-01 12:52:28 +00:00
Pavel Vlasov
e837d69f8f IPPInitSingelton was added to contain IPP related global variables;
OPENCV_IPP env var now allows to select IPP architecture level for IPP9+;
IPP initialization logic was unified across modules;
2015-10-01 09:58:48 +03:00
Alexander Alekhin
34e4e66bf1 Merge pull request #5419 from lupustr3:pvlasov/ipp9_integration 2015-09-30 17:36:43 +00:00
Alexander Alekhin
9b6424e0c6 Merge pull request #5415 from lupustr3:pvlasov/ipp_version_change 2015-09-29 17:11:30 +00:00
Pavel Vlasov
62854dcc0d Enables support of IPP 9.0.0;
HAVE_IPP_ICV_ONLY will be undefined if OpenCV was linked against ICV packet from IPP9 or greater. ICV9+ packets will be aligned with IPP in OpenCV APIs
This will ease code management between IPP and ICV
2015-09-29 17:27:13 +03:00
Pavel Vlasov
75c7917643 IPP_VERSION_X100 was changed to:
IPP_VERSION_MAJOR * 100 + IPP_VERSION_MINOR*10 + IPP_VERSION_UPDATE
to manage changes between updates more easily.

IPP_DISABLE_BLOCK was added to ease tracking of disabled IPP functions;
2015-09-29 17:24:18 +03:00
Alexander Alekhin
ddf82d0b15 Merge pull request #5405 from lupustr3:pvlasov/ipp_functions_refactoring 2015-09-28 17:20:41 +00:00
Alexander Alekhin
59082c8ee8 Merge pull request #5398 from asmorkalov:as/wrong-name-for-changelog-of-native-package 2015-09-28 13:41:46 +00:00
Dan
e4184195a2 Looks like something automatically added tabs back in after I already fixed the white space. :/ 2015-09-28 09:37:10 -04:00
Alexander Alekhin
f4c9bc8bc4 Merge pull request #5406 from cbalint13:master 2015-09-28 12:13:54 +00:00
Alexander Smorkalov
cb1dc7cb6e Fixed wrong-name-for-changelog-of-native-package warning for deb packages. 2015-09-28 12:30:26 +03:00
Suleyman TURKMEN
7c226ed7a2 adding new flags to imread to load image reduced 2015-09-28 02:00:02 +03:00
Kauê de Moraes Vestena
1bd18836d7 little fixes and correction of a conceptual error
Previously, there's no way to the user see the found corners, i've changed that.

In a cout, are write that: "average reprojection err = "
But it isn't a "reprojection error" at all, it is a mean of each EPIPOLAR error, wich occur when the product x' * F * x is not equal to zero.
(x and x' are the same points in the right and left scene)
(the RMS that explain the average absolute reprojection error is given by the return of the stereoCalibrate() function)

At least, i think it's interesting to initialize the camera matrices before.

Thank you all for this amazing code. Apologize my weak english.
2015-09-27 15:53:30 -03:00
Alexander Alekhin
dd9da53860 disable String(int) ctor
MSVC and GCC compilers interprets cv::String a(0) as a valid
statement with conversion of "int" argument to "const char*".
This patch forbids this expected behaviour.
2015-09-27 14:54:11 +03:00
Balint Cristian
fdbed4a473 Speedup AGAST nonmax-suppression. 2015-09-26 04:43:07 +03:00
Pavel Vlasov
14b006e808 IPP_VERSION_X100 was changed to:
IPP_VERSION_MAJOR * 100 + IPP_VERSION_MINOR*10 + IPP_VERSION_UPDATE
to manage changes between updates more easily.

IPP_DISABLE_BLOCK was added to ease tracking of disabled IPP functions;
2015-09-25 17:50:15 +03:00
Pavel Vlasov
2177c7c5a8 Some IPP functions were encapsulated;
Minor changes to IPP implementations;
2015-09-25 17:30:26 +03:00
Alexander Alekhin
750162acb3 move IPPICV binaries to GitHub opencv_3rdparty repository 2015-09-25 16:50:50 +03:00
Dan
3efe131480 Merge branch 'thrust_tutorial' of http://github.com/dtmoodie/opencv into thrust_tutorial
Conflicts:
	samples/cpp/tutorial_code/gpu/gpu-thrust-interop/Thrust_interop.hpp
2015-09-25 08:58:53 -04:00
Dan
ab84de967e More whitespace fixes. 2015-09-25 08:56:37 -04:00
Alexander Alekhin
58a11ac079 Merge pull request #5403 from sturkmen72:patch-9 2015-09-25 12:08:13 +00:00
Suleyman TURKMEN
69d84c8f3e Update how_to_scan_images.cpp 2015-09-25 14:32:58 +03:00
Alexander Alekhin
3a3f4038bf Merge pull request #5391 from paroj:parser_nonempty 2015-09-25 11:01:09 +00:00
Maksim Shabunin
09ba5a28d0 Merge pull request #5393 from enesates:patch-1 2015-09-25 07:35:47 +00:00
Maksim Shabunin
79ab6567ee Merge pull request #5395 from enesates:patch-2 2015-09-25 07:35:14 +00:00
Dan Moodie
7376c5311b Fixed tabs in whitespace. 2015-09-24 14:29:17 -04:00
Pavel Rojtberg
46ada3886f fix wrong parsing of values containing '='
fixes #5074
2015-09-24 17:27:07 +02:00
Alexander Alekhin
60a689d27c Merge pull request #5202 from ilya-lavrenov:gstreamer-v4l2 2015-09-24 14:46:23 +00:00
Alexander Alekhin
7d7f5c196d Merge pull request #5295 from LorenaGdL:ml-svm_tutorials 2015-09-24 14:13:07 +00:00
Dan
12dcb1555e Missed one conversion of CV_TYPE to cv::DataType 2015-09-24 10:01:26 -04:00
Dan
00c2930709 improved comments. 2015-09-24 09:32:46 -04:00
Dan
23fc5930b7 Improved thrust interop tutorial. 2015-09-24 09:32:38 -04:00
Dan
09d392f09d Added thrust tutorial. 2015-09-24 09:32:27 -04:00
Dan
a80e0cf8bd Added tutorials for using thrust. 2015-09-24 09:32:18 -04:00
Alexander Alekhin
f52cac9d47 fix #5264 2015-09-24 15:56:47 +03:00
Alexander Alekhin
9633e2c93e Merge pull request #5396 from alalek:pr_5377_squashed 2015-09-24 12:33:42 +00:00
Alexander Alekhin
acec99876d Merge pull request #5363 from avershov:opencl-vaapi-detect 2015-09-24 12:32:03 +00:00
robertxwu
db78de9c3b findChessboardCorners causes crash due to out-of-bounds memory corruption.
Refer to the following issue for detail:
https://github.com/Itseez/opencv/issues/5145
2015-09-24 12:59:00 +03:00
Enes Ateş
5df2713b16 XML file path correction
in documentation exact path is images/CameraCalibration/VID5

see also PR #5393
2015-09-24 10:34:42 +02:00
Alexey Ershov
5feca50f58 changed device detection procedure, added resizing surface to bigger size
removed unused context_id2; changed blur size 7x7 to 3x3; added short comments
removed unnecessary call to convertFromVASurface()
replaced dumpSurface() with writeImage()
added infile cmdline parameter, input image loaded by imread()
2015-09-23 17:35:49 +03:00
Pavel Rojtberg
1dd7f546af CommandLineParser: add special <none> value to disallow empty strings
some mandatory string keys like paths must not be empty. Add the special
default value `<none>` so the CommandLineParser can enforce this and
generate an according error message for us.
2015-09-23 15:43:46 +02:00
Enes Ateş
769fe82743 XML file path correction
in documentation exact path is images/CameraCalibration/VID5
2015-09-23 13:19:17 +02:00
Alexander Alekhin
e5ece03db1 Merge pull request #5382 from paroj:parserthrow 2015-09-23 10:18:00 +00:00
Alexander Alekhin
6f04385a0e Merge pull request #5379 from sturkmen72:patch-9 2015-09-23 10:15:03 +00:00
Alexander Alekhin
134a3f165d Merge pull request #5381 from robertxwu:Bugfix_for_issue_#_of_5145 2015-09-23 09:58:24 +00:00
berak
74fc9acdd1 initialize temp_train_samples in SVM::autoTrain
add smoke test
2015-09-23 11:08:48 +02:00
Pavel Rojtberg
a388806555 enable additional CommandLineParser tests 2015-09-22 18:37:51 +02:00
Pavel Rojtberg
2ced3ba276 CommandLineParser: throw on programmer error
requesting a previously undeclared key is most likely an programming
error. e.g. a typo "--unused vs --unsued".
So throw in those cases.

Add an according failure testcase.
2015-09-22 18:35:49 +02:00
Alexander Alekhin
eb2e061e3f fix Android camera datarace (mCameraFrameReady) 2015-09-22 17:03:09 +03:00
Alexander Alekhin
d430e802f2 cmdparser: allow empty strings 2015-09-22 16:34:37 +03:00
Alexander Alekhin
12f01b778b fix perf tests 2015-09-22 15:20:40 +03:00
Alexander Alekhin
21e38f2949 Merge pull request #5383 from alalek:fix_tests 2015-09-22 12:11:22 +00:00
Alexander Alekhin
be507b20cd fix perf tests 2015-09-22 15:02:43 +03:00
Vadim Pisarevsky
9f697510ca Merge pull request #5320 from berak:lda_fix 2015-09-22 10:38:46 +00:00
Alexander Alekhin
4bb4c92f68 Merge pull request #5376 from lupustr3:pvlasov/compare_16s_fix 2015-09-22 10:19:52 +00:00
robertxwu
4a68cc1675 re-submit 2015-09-21 13:57:25 -07:00
Pavel Vlasov
33e659786f Fix for cmp16s condition during IPP compare type convert; 2015-09-21 18:11:20 +03:00
Vadim Pisarevsky
f838a832b2 Merge pull request #5357 from fxtentacle:ha-2.4.11 2015-09-21 14:31:13 +00:00
Alexander Alekhin
d945aff132 Merge pull request #5371 from Dikay900:ports_to_master 2015-09-21 13:52:45 +00:00
Alexander Alekhin
a9b91bb400 Merge pull request #5372 from alalek:cmd_tests 2015-09-21 13:52:26 +00:00
Vadim Pisarevsky
c9ccf3b55d Merge pull request #5346 from art-programmer:art-programmer-patch-1 2015-09-21 12:06:46 +00:00
Vadim Pisarevsky
706828a6d9 Merge pull request #5324 from mshabunin:hal-tests 2015-09-21 12:04:01 +00:00
Vadim Pisarevsky
01345fc159 Merge pull request #5344 from psalvaggio:master 2015-09-21 11:53:41 +00:00
Vadim Pisarevsky
6f2fb383e6 Merge pull request #5359 from StevenPuttemans:contributing_guidelines_2.4 2015-09-21 11:53:06 +00:00
Alexander Alekhin
44ab680613 Merge pull request #5341 from blebo:py3compat 2015-09-21 11:47:26 +00:00
Vadim Pisarevsky
ddf220e136 Merge pull request #5358 from StevenPuttemans:contributing_guidelines_master 2015-09-21 11:45:29 +00:00
Dikay900
32a4ec156b changes to reflect 3.0 status 2015-09-21 13:44:39 +02:00
Roman Donchenko
2eab5eb6c0 Only conflict with packages corresponding to modules that are built 2015-09-21 13:44:38 +02:00
Roman Donchenko
7749eb5d1f Add missing packages to the Debian conflict list
And refactor the code to make sure that the dev and runtime package lists are
in sync.
2015-09-21 13:44:37 +02:00
Alexander Smorkalov
bd5a222d84 Debian packages header update to fix conflict with OpenCV from deb repo. 2015-09-21 13:44:36 +02:00
Alexander Smorkalov
c7bfdc2063 Added explicit deb package dependency from libtbb-dev if TBB is enabled. 2015-09-21 13:44:36 +02:00
Dikay900
55df326589 PR #4003 2015-09-21 13:44:35 +02:00
Vladislav Vinogradov
6282ff0887 exclude dates from report names 2015-09-21 13:44:34 +02:00
Vladislav Vinogradov
ea35fee5b8 save tests console output to separate log files 2015-09-21 13:44:33 +02:00
Vladislav Vinogradov
0e5fec288c check that current directory has write access 2015-09-21 13:44:32 +02:00
Roman Donchenko
c0cc51cb4b Add ARM64 packaging support 2015-09-21 13:44:31 +02:00
Roman Donchenko
5dd76a4791 Set CPACK_DEBIAN_PACKAGE_ARCHITECTURE instead of CPACK_DEBIAN_ARCHITECTURE
Because that's the variable actually used by CPack.
2015-09-21 13:44:30 +02:00
Gleb Gladilov
2bc4486966 Added test of minMaxLoc on filling with maximums of int 2015-09-21 13:44:30 +02:00
Gleb Gladilov
344d9fd83f Fixed minMaxLoc and test functions 2015-09-21 13:44:29 +02:00
Vitaly Tuzov
4a0152c731 Resize area result verification moved to the separate function
fix position of assert expected/actual parameter
2015-09-21 13:44:28 +02:00
Vitaly Tuzov
7d245e0f29 Added more resize_area tests to ensure right rounding behavior for half and quarter downscaling 2015-09-21 13:44:27 +02:00
Elena Shipunova
5de01fde53 do not proceed with removing zero-length slice 2015-09-21 13:44:26 +02:00
Alexander Alekhin
108bb75430 Merge pull request #5361 from alalek:update_ffmpeg_support 2015-09-21 10:48:42 +00:00
Alexander Alekhin
4613d37eba Merge pull request #5366 from taketwo:use-stream-in-bilateral-filter 2015-09-21 10:47:12 +00:00
Alexander Alekhin
05b1636780 Merge pull request #5329 from paroj:cliparser 2015-09-21 09:46:54 +00:00
berak
2f7c926670 remove usage of obsolete _dataAsRows flag 2015-09-21 07:59:09 +02:00
Suleyman TURKMEN
dff9d2288b Update window_w32.cpp 2015-09-21 00:34:15 +03:00
Alexander Alekhin
d3071db0d7 add some CommandLineParser tests 2015-09-20 13:14:41 +03:00
Andrey Pavlenko
8e088d38a5 draft implementation of alternative CameraBridge via GLES
a simple sample will look like:

```java
public class MainActivity extends Activity implements CameraGLSurfaceView.CameraTextureListener {

	CameraGLSurfaceView mView;
	ByteBuffer buf;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
                WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

        mView = new CameraGLSurfaceView(this, null);
        mView.setCameraTextureListener(this);
        setContentView(mView);
        buf = ByteBuffer.allocateDirect(1920*1080*4);
    }

    @Override
    protected void onPause() {
        mView.onPause();
        super.onPause();
    }

    @Override
    protected void onResume() {
        super.onResume();
        mView.onResume();
    }

	@Override
	public void onCameraViewStarted(int width, int height) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onCameraViewStopped() {
		// TODO Auto-generated method stub

	}

	@Override
	public boolean onCameraFrame(int texIn, int texOut, int width, int height) {
		Log.i("MAIN", "onCameraFrame");
		int w=width, h=height;
		/*
		// option 1:
		// just return 'false' to display texIn on screen
		retutn false;
		*/

		/*
		// option 2:
		// fast copy texIn to texOut
		GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
    	GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texOut);
		GLES20.glCopyTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, 0, 0, w, h, 0);
		return true;
		*/

		// option 3:
		// read, modify and write back pixels
		GLES20.glReadPixels(0, 0, w, h, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, buf);

		buf.rewind();
		// red line
		for(int i=0; i<h; i++) {
			buf.position(w*4*i+i*4);
			buf.put((byte) -1);
			buf.position(w*4*i+i*4+4);
			buf.put((byte) -1);
		}
		buf.rewind();

		GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
    	GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texOut);
		GLES20.glTexSubImage2D(GLES20.GL_TEXTURE_2D, 0, 0, 0, w, h, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, buf);
		return true;
	}
}
```
2015-09-19 16:18:02 +03:00
Pavel Rojtberg
31da833574 ts/ts_perf: fix wrong has() usage
`has()` only tests for an argument presence which is always true for
arguments with default values. Use `get<bool>()` to check the value
instead.
2015-09-18 18:42:14 +02:00
Pavel Rojtberg
96cc618410 has() should only test for the presence of the argument
and not consider its value. treat arguments with a set default value as
present.
2015-09-18 18:42:14 +02:00
Pavel Rojtberg
08dd126f08 do not parse empty default values and improve error messages 2015-09-18 18:42:14 +02:00
Alexander Alekhin
0051208684 Merge pull request #5349 from lupustr3:pvlasov/tls_update 2015-09-18 14:39:08 +00:00
Alexander Alekhin
d2b10d8aa1 Merge pull request #5355 from renatoGarcia:master 2015-09-18 13:38:29 +00:00
Alexander Alekhin
e1b0d341e4 Merge pull request #5360 from SpecLad:test2-fail-on-failed-download 2015-09-18 12:10:52 +00:00
Alexander Alekhin
1b2c11e7b3 Merge pull request #5343 from paroj:boolean_algebra 2015-09-18 12:06:31 +00:00
Sergey Alexandrov
4094b2d7a5 Use stream argument when launching bilateral filter kernel 2015-09-18 13:12:58 +02:00
Alexander Alekhin
af0942c78f Merge pull request #5335 from Dikay900:ports_to_master 2015-09-18 11:06:08 +00:00
Pavel Rojtberg
f0282337e3 simplify error conditions
`A || !A` is `true` so write `(A && B) || !A` as `B || !A`
2015-09-18 12:12:49 +02:00
jisli
f88e9a748a update ffmpeg support
Migration have been done for these ffmpeg/libav changes:

2013-12-11 - 29c83d2 / b9fb59d,409a143 / 9431356,44967ab / d7b3ee9 - lavc 55.45.101 / 55.28.1 - avcodec.h
  av_frame_alloc(), av_frame_unref() and av_frame_free() now can and should be
  used instead of avcodec_alloc_frame(), avcodec_get_frame_defaults() and
  avcodec_free_frame() respectively. The latter three functions are deprecated.

2012-10-08 - ae77266 / 78071a1 - lavu 51.74.100 / 51.42.0 - pixfmt.h
  Rename PixelFormat to AVPixelFormat and all PIX_FMT_* to AV_PIX_FMT_*.
  To provide backwards compatibility, PixelFormat is now #defined as
  AVPixelFormat.
  Note that this can break user code that includes pixfmt.h and uses the
  'PixelFormat' identifier. Such code should either #undef PixelFormat
  or stop using the PixelFormat name.
2015-09-17 20:24:37 +03:00
Roman Donchenko
08ad3b500b test2.py: switch from urllib to urllib2
urllib2 raises an exception if an HTTP request produces an error code,
making the test fail earlier.
2015-09-17 18:24:30 +03:00
Roman Donchenko
56f17e4921 test2.py: fail if a downloaded image can't be decoded 2015-09-17 18:17:06 +03:00
Roman Donchenko
293ea03dcc test2.py: remove unused imports 2015-09-17 18:14:49 +03:00
Pavel Vlasov
aa485ccd75 TLS keys leak fix;
Disables TLS copy constructor and operator, as they can lead to errors and reservation of too much keys in TLS storage;

gather method was added to TLS to gather data from all threads;
2015-09-17 15:49:20 +03:00
StevenPuttemans
e9037644c3 add link to contributing guidelines 2015-09-17 14:15:20 +02:00
StevenPuttemans
bef1b5322e add link to contributing guidelines 2015-09-17 14:14:21 +02:00
Alexander Smorkalov
e6f3f3c029 OpenCV version++. 2015-09-17 14:02:36 +03:00
Ilya Lavrenov
7746d9b7cc fix for corrent modules dependencies
(cherry picked from commit 1c3d83df54d2f39c9403126bf3c1374eaf749dee)
2015-09-17 13:45:08 +03:00
Vladislav Vinogradov
3494d640df add extra checks to data_step_down to prevent out-of-border access
(cherry picked from commit 3ef067cc65cd548a968588f72d3b9ecc92a0e9bb)
2015-09-17 13:44:56 +03:00
Vladislav Vinogradov
c22cc67ba8 revert previous change in gpu::StereoBeliefPropogation
(cherry picked from commit f903192c17b1c70182c0c25bb156900ea82b731b)
2015-09-17 13:44:33 +03:00
Vladislav Vinogradov
558054a53d fix for gpu::StereoBeliefPropogation:
use continuous memory for internal buffers

(cherry picked from commit e2a9df408f712f694206974a1f24a864881371c3)
2015-09-17 13:44:17 +03:00
Elena Shipunova
c7b471f10f do not proceed with removing zero-length slice
(cherry picked from commit 036c3b4e6d45dcf81181bb2658601f758c976088)
2015-09-17 13:43:54 +03:00
Ilya Lavrenov
f4ffcae8d9 initialize padding of CvString with zeros
(cherry picked from commit 7b1eb3af7bb82dfd9258f6abdec350688cf65b51)
2015-09-17 13:43:37 +03:00
Ilya Lavrenov
0422054aa1 fixed warnings in gpu module
(cherry picked from commit 6a05939e1ce552008ecf95451ddf362f2be7a4c3)
2015-09-17 13:41:51 +03:00
Ilya Lavrenov
a81f0a5123 fixed uninitialized memory writing/reading in flann
(cherry picked from commit 3934d61de7d34e9ac8040cf5ced349a51ad2e520)
2015-09-17 13:41:31 +03:00
Ilya Lavrenov
c36582d2df fixed memory leak in flann index
(cherry picked from commit 32d7c1950a562d038ff6f8b810ee46298a83fc39)
2015-09-17 13:41:16 +03:00
Ilya Lavrenov
d50c07e303 fixed "Conditional jump or move depends on uninitialised value(s)" in GBD
(cherry picked from commit 887736bcd4365cff0531e6f763b604a1c6e92e25)
2015-09-17 13:41:03 +03:00
Ilya Lavrenov
54693b3fa7 fixed memory leak in GBTrees
(cherry picked from commit 1b8c2589c057f862008cd1a3be5c8802b7bf1994)
2015-09-17 13:40:50 +03:00
Ilya Lavrenov
3c3bc123fc release filestorage before exception
(cherry picked from commit 3a1bb933401446b442348026b9cb680d35f3f449)
2015-09-17 13:40:36 +03:00
Ilya Lavrenov
ac33cd688c fixed memory leak in ANN
(cherry picked from commit dfb49097e3013fa279d5882700601f5cabd6cbd8)
2015-09-17 13:40:14 +03:00
Ilya Lavrenov
b5e42d8cc1 fixed memory leak in ml module
(cherry picked from commit d7bb1025f32ed268da7230cae3e8cb413dbab282)
2015-09-17 13:40:02 +03:00
Ilya Lavrenov
7e4e8921bc fixed memory leak in descriptor regression tests 2015-09-17 13:39:44 +03:00
Ilya Lavrenov
6dcd455ac4 fixed memory leaks in modules/features2d/test/test_nearestneighbors.cpp 2015-09-17 13:39:34 +03:00
Vladislav Vinogradov
1d58e1a14a fix potential out-of-border access in gpu StereoBeliefPropagation 2015-09-17 13:39:17 +03:00
Roman Donchenko
d122510c4f Only conflict with packages corresponding to modules that are built 2015-09-17 13:39:03 +03:00
Roman Donchenko
6613d14261 Add missing packages to the Debian conflict list
And refactor the code to make sure that the dev and runtime package lists are
in sync.
2015-09-17 13:38:52 +03:00
a-andre
a14e524b32 fix documentation builder warnings 2015-09-17 13:38:25 +03:00
a-andre
226ff93917 install new headers like "opencv2/core.hpp" 2015-09-17 13:38:11 +03:00
Ilya Lavrenov
d28e6c9b36 fixed memory leak caused by illegal memory access
(cherry picked from commit 4722b2d0e5b2caf053e53612ea277451c5cc53a0)
2015-09-17 13:37:52 +03:00
Ilya Lavrenov
c16f465ff5 fixed "Conditional jump or move depends on uninitialised value" warning
(cherry picked from commit f100cdb6d4373c93abc2b5613fae505ed3ce876d)
2015-09-17 13:37:38 +03:00
Roman Donchenko
3231c2f995 NearestNeighborTest: use ts->get_rng() instead of (implicit) theRNG()
This ensures that test data is not dependent on the order the tests are
executed in.

(cherry picked from commit 1245cd175283b11800bbbdc52287957cc3d76417)
2015-09-17 13:37:26 +03:00
Ilya Lavrenov
16bcc30e42 typo
(cherry picked from commit 793bdaada7f170cf3fbaf3b421bb3054f37e8a63)
2015-09-17 13:37:12 +03:00
Ilya Lavrenov
69c50e0181 fixed typo
(cherry picked from commit 370d1ff21a99046021da39b74f4081a5b69ce57e)
2015-09-17 13:37:02 +03:00
Ilya Lavrenov
486c40f578 fixed uninitialized values warning in bad arg test class
(cherry picked from commit 47cee8715bb086f6b0ca0f5b301d2eec87ce9f2a)
2015-09-17 13:36:51 +03:00
Ilya Lavrenov
08e38e9ff9 fixed memory leaks in warpAffine tests
(cherry picked from commit b70e27e076a7eea6a1ccc6bb5f367e539e1aa51c)
2015-09-17 13:36:35 +03:00
Ilya Lavrenov
ba3b902da7 fixed memory leaks in floodfill tests
(cherry picked from commit d1b882ddcf54e52ac70bb17540c84c4a93553add)
2015-09-17 13:36:24 +03:00
Ilya Lavrenov
bf94e6a91c fixed memory leaks in cvtyuv tests
(cherry picked from commit b2489d31d66599ac2aaa79af2b753a24649776aa)
2015-09-17 13:36:14 +03:00
Ilya Lavrenov
ecc53dd7a4 fixed memory leak in core ds tests
(cherry picked from commit 7719da95526b81af0195a3576774eaac605cd045)
2015-09-17 13:35:51 +03:00
Ilya Lavrenov
fc0e0239b8 fixed valgrind warning in polylines
(cherry picked from commit 855765986e9cd5c730730dd1f45175b182e737fa)
2015-09-17 13:35:25 +03:00
Renato Florentino Garcia
1a18fa1c94 Correct a typo. 2015-09-16 21:16:23 -03:00
Hajo Nils Krabbenhöft
7825cbeb7d buffer_size should be in bytes, not bits 2015-09-16 22:19:51 +02:00
Hajo Nils Krabbenhöft
d38fee7599 fix crash for large BW tif images 2015-09-16 22:04:42 +02:00
art-programmer
e0ef293645 Update em.cpp
Fix a bug. When reading from a saved model, function decomposeCovs() will be called. And if covMatType is COV_MAT_DIAGONAL, covsEigenValues is computed using SVD and eigen values are sorted so that the order of eigen values is not preserved. This would lead to different result when calling function predict2. This issues is discussed here: http://stackoverflow.com/questions/23485982/got-different-empredict-results-after-emread-saved-model-in-opencv.
2015-09-14 19:35:53 -05:00
Philip Salvaggio
fcf971bded Improved documentation for connectedComponentsWithStats. 2015-09-14 09:25:32 -04:00
Vadim Pisarevsky
9533982729 Merge pull request #5272 from avershov:opencl-vaapi-fallback 2015-09-14 11:54:20 +00:00
Vadim Pisarevsky
fb4b4cbf58 Merge pull request #5334 from UnaNancyOwen:fix2_LineAA 2015-09-14 11:49:48 +00:00
Vadim Pisarevsky
21d06f5ab2 Merge pull request #5333 from UnaNancyOwen:fix3_LineAA 2015-09-14 11:49:14 +00:00
Vadim Pisarevsky
07a4f571d9 Merge pull request #5337 from Dikay900:tbb_cmake_visibility 2015-09-14 11:47:04 +00:00
Vadim Pisarevsky
5e2c578b50 Merge pull request #5339 from blebo:patch-1 2015-09-14 11:46:35 +00:00
Alexander Alekhin
bf42b9603b fix "unreachable code" warning 2015-09-14 13:11:12 +03:00
Maksim Shabunin
603864dba2 Warning fix 2015-09-14 12:15:56 +03:00
Adam Gibson
4f2612fcfd Removed trailing whitespace from squares.py compatibility comment. 2015-09-14 13:03:16 +08:00
Adam Gibson
a413423ff6 Reverted _doc.py to Python 2-only version. Interim measure to prevent docs from failing during build, until all samples are updated with Python 2/3 compatibility. 2015-09-14 12:24:08 +08:00
Alexander Alekhin
1a8d7f9587 ocl: temporary restore OpenCL tls data (ocl.cpp without fix) 2015-09-13 20:28:24 +03:00
Alexander Alekhin
7213e5f68a ocl: correct disabling of OpenCL code 2015-09-13 20:28:23 +03:00
Adam
37d300f250 Correction of minor typo. 2015-09-14 00:12:06 +08:00
Adam Gibson
b57be28920 Various Python samples updated for Python 2/3 compatibility. 2015-09-14 00:00:22 +08:00
Ilya Lavrenov
5eb67cc2cb fix for corrent modules dependencies 2015-09-13 12:44:35 +02:00
Ilya Lavrenov
3143f2fb50 fixed uninitialized memory writing/reading in flann 2015-09-13 12:43:44 +02:00
Ilya Lavrenov
df21a24f81 initialize padding of CvString with zeros 2015-09-13 12:38:10 +02:00
Ilya Lavrenov
ee2008abe8 fixed "Conditional jump or move depends on uninitialised value(s)" in GBD 2015-09-13 12:36:57 +02:00
Ilya Lavrenov
1d77d697ef fixed memory leak in GBTrees 2015-09-13 12:15:30 +02:00
Ilya Lavrenov
cf0f47f589 fixed memory leak in descriptor regression tests 2015-09-13 12:14:30 +02:00
Ilya Lavrenov
f7d36bbad5 fixed memory leaks in modules/features2d/test/test_nearestneighbors.cpp 2015-09-13 12:08:19 +02:00
Dikay900
274b361ca3 proposed change by psyill 2015-09-12 12:19:44 +02:00
Ilya Lavrenov
d81a0df489 fixed memory leak caused by illegal memory access 2015-09-11 19:07:20 +02:00
Ilya Lavrenov
e7ac52d17a fixed "Conditional jump or move depends on uninitialised value" warning 2015-09-11 19:03:33 +02:00
Ilya Lavrenov
7e26cf569f typo 2015-09-11 19:01:18 +02:00
Ilya Lavrenov
e390c8c728 fixed typo 2015-09-11 18:59:33 +02:00
Tsukasa Sugiura
b23e536894 Fix LineAA in case of 4 channel
Fix bug when enter 4 channel image to LineAA function.
2015-09-12 01:48:28 +09:00
Ilya Lavrenov
5547398786 fixed memory leaks in warpAffine tests 2015-09-11 18:47:30 +02:00
Ilya Lavrenov
7eba9055e0 fixed memory leaks in floodfill tests 2015-09-11 18:47:20 +02:00
Ilya Lavrenov
2a8ef1d065 fixed memory leaks in cvtyuv tests 2015-09-11 18:47:11 +02:00
Ilya Lavrenov
0303e8067e fixed memory leak in core ds tests 2015-09-11 18:46:52 +02:00
Ilya Lavrenov
11981c31f0 fixed valgrind warning in polylines 2015-09-11 18:45:01 +02:00
Tsukasa Sugiura
cd13b30fde Fix LineAA in case of 4 channel
Fix bug when enter 4 channel image to LineAA function.
2015-09-12 01:42:25 +09:00
Roman Donchenko
ec0508269a NearestNeighborTest: use ts->get_rng() instead of (implicit) theRNG()
This ensures that test data is not dependent on the order the tests are
executed in.
2015-09-11 18:39:32 +02:00
Roman Donchenko
a3b515c524 flann: fix AutotunedIndex crashing if a KDTree index is selected
Backport of mariusmuja/flann@f8ca6df3.
2015-09-11 18:37:51 +02:00
Roman Donchenko
e1be6d0888 Refactor a section of icvRotatingCalipers to work around a GCC bug
https://bugs.launchpad.net/ubuntu/+source/gcc-4.9/+bug/1474304
2015-09-11 18:34:16 +02:00
Maksim Shabunin
a275489f0a HAL universal intrinsics tests and documentation 2015-09-11 18:36:13 +03:00
Alexander Alekhin
190d00ea3e Merge pull request #5317 from alalek:workaround 2015-09-11 11:42:33 +00:00
Maksim Shabunin
31fbe8caeb Merge pull request #5255 from berak:java_videowriter 2015-09-11 11:09:16 +00:00
Vadim Pisarevsky
1862c5fbb2 Merge pull request #5327 from mshabunin:mingw-fix 2015-09-11 10:19:46 +00:00
Alexander Alekhin
8b33c6fa8f Merge pull request #5290 from ilya-lavrenov:cmake_bug 2015-09-11 09:49:42 +00:00
Ilya Lavrenov
1c3d83df54 fix for corrent modules dependencies 2015-09-11 11:30:10 +03:00
Alexey Ershov
22bb5d1fcc implemented sample build in fallback mode without interop 2015-09-10 19:30:19 +03:00
Alexander Alekhin
b29cde552a Merge pull request #5325 from jet47:gpu-stereobp-fix 2015-09-10 14:40:05 +00:00
Maksim Shabunin
10d8e956f4 Enabled pthreads backend for mingw 2015-09-10 17:12:22 +03:00
Alexey Ershov
f533c05644 sample changed to execute only one mode (interop on/off) per run 2015-09-10 15:41:04 +03:00
Alexey Ershov
933ad0e710 changed call to getDefault: false to true in fallback initialization 2015-09-10 14:36:40 +03:00
Maksim Shabunin
d2add41b6b Merge pull request #5321 from alalek:copy_if_different 2015-09-10 09:41:49 +00:00
Maksim Shabunin
0a6e93dd3a Merge pull request #5258 from sturkmen72:patch-6 2015-09-10 09:22:07 +00:00
Vladislav Vinogradov
3ef067cc65 add extra checks to data_step_down to prevent out-of-border access 2015-09-10 10:05:25 +03:00
Vladislav Vinogradov
f903192c17 revert previous change in gpu::StereoBeliefPropogation 2015-09-10 10:05:04 +03:00
Vladislav Vinogradov
e2a9df408f fix for gpu::StereoBeliefPropogation:
use continuous memory for internal buffers
2015-09-10 09:55:46 +03:00
Alexander Alekhin
ad70ab404c ocl: workaround for getUMat() 2015-09-09 18:56:14 +03:00
Andrey Pavlenko
cea2dafa0f man/unmap, preventing getMat/getUMat from temp object, fix thread-unsafe code in UMat::getMat() 2015-09-09 18:05:29 +03:00
Alexander Alekhin
536634b1fe Merge pull request #5293 from alalek:tapi_custom_ptr_perf 2015-09-09 14:59:17 +00:00
Alexander Alekhin
cdfdf29eca Merge pull request #5292 from alalek:tapi_custom_ptr 2015-09-09 14:58:28 +00:00
Vadim Pisarevsky
32c386786e Merge pull request #5294 from LorenaGdL:master 2015-09-09 13:41:39 +00:00
Vadim Pisarevsky
6208ab4e49 Merge pull request #5304 from paroj:calib_feye 2015-09-09 11:00:40 +00:00
Vadim Pisarevsky
79100efec6 Merge pull request #5301 from vtsatskin:patch-1 2015-09-09 10:39:53 +00:00
Vadim Pisarevsky
cba401fe53 Merge pull request #5313 from sturkmen72:patch-5 2015-09-09 10:39:25 +00:00
Vadim Pisarevsky
8660d550d3 Merge pull request #5302 from berak:patch-2 2015-09-09 10:34:29 +00:00
Vadim Pisarevsky
666de1b087 Merge pull request #5312 from sturkmen72:patch-2 2015-09-09 10:30:22 +00:00
Vadim Pisarevsky
f3af90c6c7 Merge pull request #5315 from elenash:core_remove_slice 2015-09-09 10:25:45 +00:00
Alexander Alekhin
b15a9d675e cmake: use copy_if_different 2015-09-08 22:42:05 +03:00
Alexey Ershov
e0b3751c17 added run iteration without timing to complete internal initializations 2015-09-08 21:01:57 +03:00
Alexander Alekhin
894f922cfb Merge pull request #5316 from mshabunin:fix-contrib-tests 2015-09-08 16:52:43 +00:00
Alexey Ershov
5937e58a11 fixed argument in call to {Input|Output}Array.getMat() 2015-09-08 19:29:19 +03:00
Alexey Ershov
949410b347 separated UMat & Mat usage in interop/copy paths 2015-09-07 21:11:05 +03:00
Maksim Shabunin
5618f4a0ac Fixed: Concurrency static scheduler release failed 2015-09-07 18:59:07 +03:00
Elena Shipunova
036c3b4e6d do not proceed with removing zero-length slice 2015-09-07 13:50:30 +03:00
Suleyman TURKMEN
9df5400200 Update drawing.cpp
https://github.com/Itseez/opencv/issues/4791
2015-09-07 11:33:29 +03:00
Suleyman TURKMEN
c63f443bba Update drawing.cpp
https://github.com/Itseez/opencv/issues/4791
2015-09-07 11:30:14 +03:00
Suleyman TURKMEN
e15dabf1db documentation patch 2015-09-05 10:41:01 +03:00
Alexander Alekhin
abf30e44cd Merge pull request #5303 from berak:patch-3 2015-09-04 16:49:41 +00:00
berak
602bd60c3a Update cloning_gui.cpp 2015-09-04 17:13:58 +02:00
Alexander Alekhin
6fefc53e56 Merge pull request #5299 from ilya-lavrenov:core_hog 2015-09-04 14:30:17 +00:00
Pavel Rojtberg
d0e16b21d4 add support for fisheye camera model 2015-09-04 15:54:34 +02:00
Alexander Alekhin
76235cbb70 Merge pull request #5300 from ilya-lavrenov:cuda_warnings 2015-09-04 10:21:44 +00:00
Alexander Alekhin
9d006f6a1d Merge pull request #5297 from ilya-lavrenov:flann 2015-09-04 10:21:00 +00:00
berak
dc265071d0 Update PnPProblem.cpp 2015-09-04 10:57:33 +02:00
Alexey Ershov
68a0347ff9 fallback path & sample timing implemented
fixed trailing whitespaces
renamed files *vaapi* to *va_intel*
changed names vaapi* to va_intel*
2015-09-04 02:42:49 +03:00
Valentin Tsatskin
a28a556f60 Fix variable names in python color spaces tutorial 2015-09-03 15:45:36 -04:00
Lorena García
f034320731 Change in links
Explicit link to 2.4 docs
2015-09-03 18:16:29 +02:00
Ilya Lavrenov
6a05939e1c fixed warnings in gpu module 2015-09-03 19:13:00 +03:00
Ilya Lavrenov
7b1eb3af7b initialize padding of CvString with zeros 2015-09-03 18:33:15 +03:00
Dmitry Melnichenko
319b6a447f Change SURF to ORB in Java-Sbt sample to remove dependency on external non-free modules 2015-09-03 17:16:59 +03:00
Dmitry Melnichenko
b484f377dd Fix build of Java-Sbt sample 2015-09-03 15:18:42 +03:00
Ilya Lavrenov
3934d61de7 fixed uninitialized memory writing/reading in flann 2015-09-03 13:25:29 +03:00
Alexander Alekhin
4ecc023219 UMat: add perf test for custom ptr 2015-09-03 10:48:07 +03:00
Alexander Alekhin
8694ba0978 update custom_ptr test 2015-09-03 10:46:38 +03:00
Lorena García
c1392f64a4 ml_svm_tutorials version note added
Added note to point out code is for version 3.0 despite compatibility of
tutorial > version 2.0
2015-09-03 07:38:25 +02:00
Lorena García
4e7bd86fad TrainData doc update
Update docs according to PR #5127
2015-09-03 05:52:04 +02:00
Alexander Alekhin
9c3f95782d Merge pull request #5282 from mshabunin:mingw-51 2015-09-02 13:19:52 +00:00
Alexander Alekhin
a98ee0d3b2 Merge pull request #5289 from ilya-lavrenov:flann 2015-09-02 11:41:03 +00:00
Alexander Alekhin
73a8e65cbd Merge pull request #5285 from ilya-lavrenov:ml5 2015-09-02 11:39:07 +00:00
Alexander Alekhin
ae0d428b62 Merge pull request #5281 from ilya-lavrenov:ml2 2015-09-02 11:38:45 +00:00
Ilya Lavrenov
32d7c1950a fixed memory leak in flann index 2015-09-01 16:58:35 +03:00
Vadim Pisarevsky
5603617b7c Merge pull request #5284 from ilya-lavrenov:ml4 2015-09-01 12:31:46 +00:00
Vadim Pisarevsky
43aae3fee8 Merge pull request #5283 from ilya-lavrenov:ml3 2015-09-01 12:31:05 +00:00
Vadim Pisarevsky
a7a4a2ae30 Merge pull request #5280 from ilya-lavrenov:ml 2015-09-01 12:30:36 +00:00
Ilya Lavrenov
1b8c2589c0 fixed memory leak in GBTrees 2015-09-01 14:38:11 +03:00
Maksim Shabunin
8c65f8a0d1 fixup! Some changes to support mingw-w64 2015-09-01 13:49:23 +03:00
Ilya Lavrenov
887736bcd4 fixed "Conditional jump or move depends on uninitialised value(s)" in GBD 2015-09-01 13:22:49 +03:00
Alexander Alekhin
5b1967f80c Merge pull request #5274 from ilya-lavrenov:features2d 2015-09-01 10:14:29 +00:00
Ilya Lavrenov
3a1bb93340 release filestorage before exception 2015-09-01 13:04:33 +03:00
Ilya Lavrenov
dfb49097e3 fixed memory leak in ANN 2015-09-01 12:29:52 +03:00
Maksim Shabunin
e009d79cc8 fixup! Some changes to support mingw-w64 2015-09-01 12:14:40 +03:00
Ilya Lavrenov
d7bb1025f3 fixed memory leak in ml module 2015-09-01 11:26:25 +03:00
Maksim Shabunin
771af4f32d Some changes to support mingw-w64
- IPP is disabled by default when compiler is mingw (couldn't make it
work)
- fixed some warnings
- fixed some `__GNUC__` version checks (for correctness and convenience)
- removed UTF-8 BOM from hough.cpp (fixes #5253)
2015-09-01 00:59:08 +03:00
Ilya Lavrenov
dc441f50cd fixed memory leak in descriptor regression tests 2015-08-31 17:30:42 +03:00
Ilya Lavrenov
be499b42d9 fixed memory leaks in modules/features2d/test/test_nearestneighbors.cpp 2015-08-31 17:21:55 +03:00
Vadim Pisarevsky
c223c05b82 Merge pull request #5261 from apavlenko:android_ocl_sample_improvements 2015-08-31 11:09:41 +00:00
Vadim Pisarevsky
84850ae714 Merge pull request #5269 from eladj:patch-1 2015-08-31 11:09:09 +00:00
Elad Joseph
7c16ad3f49 Update documentation in calib3d.hpp
Fixed small mistake in documentation.
The prism coefficients in y'' equation were mistakenly written as s1,s2 instead of s3,s4
2015-08-30 12:42:30 +03:00
Alexander Alekhin
74f5eaf70c Merge pull request #5262 from jet47:gpu-stereobp-fix 2015-08-28 10:05:19 +00:00
Vadim Pisarevsky
faa6684373 Merge pull request #5098 from powderluv:master 2015-08-27 14:31:35 +00:00
Vadim Pisarevsky
a78da45fec Merge pull request #5242 from apavlenko:fix_releasing_temp_umat 2015-08-27 14:29:52 +00:00
Vladislav Vinogradov
7ddc0bdd37 fix potential out-of-border access in gpu StereoBeliefPropagation 2015-08-27 16:09:37 +03:00
Andrey Pavlenko
74fcefedcb giving a chance for OpenCL 1.1 devices 2015-08-27 14:05:32 +03:00
Andrey Pavlenko
8031742817 unused imports clean-up 2015-08-27 14:05:31 +03:00
Andrey Pavlenko
43b76e548b adding NO_PROCESSING (i.e. just preview) mode 2015-08-27 14:05:31 +03:00
Andrey Pavlenko
016011fdf8 fixing start faulure on some devices; syncronization improvements 2015-08-27 14:05:31 +03:00
Alexander Alekhin
4b0f3bf188 Merge pull request #5260 from vipul-sharma20:vipul-sharma20-docs 2015-08-27 11:02:03 +00:00
Vipul Sharma
072b1469e7 fixed the URL under Additional Resources
The URL http://www.nptel.iitm.ac.in/courses/106108057/26 under Additional Resource section gives a 404. I've added the updated one i.e. http://www.nptel.ac.in/courses/106108057/26
2015-08-27 15:37:04 +05:30
Vadim Pisarevsky
bd43c62a75 Merge pull request #5232 from sturkmen72:patch-6 2015-08-27 07:07:53 +00:00
berak
a11ff876d4 enable VideoWriter class for java
fixing fourcc
2015-08-27 08:04:58 +02:00
Alexander Alekhin
94cf5430d0 Merge pull request #5250 from SpecLad:missing-conflicts 2015-08-26 16:39:13 +00:00
Alexander Alekhin
af9c558764 Merge pull request #5246 from mshabunin:ccache-fix 2015-08-26 15:14:14 +00:00
Maksim Shabunin
0be2d4188e Merge pull request #5249 from alalek:build_with_python3_only 2015-08-26 14:49:34 +00:00
Suleyman TURKMEN
f660461bb3 documentation patch 2015-08-26 17:40:38 +03:00
Andrey Pavlenko
b78eb49178 removing a garbage comment 2015-08-26 14:15:18 +03:00
Roman Donchenko
4ab2771957 Only conflict with packages corresponding to modules that are built 2015-08-26 13:42:21 +03:00
Andrey Pavlenko
4aefb9f2fc making the test deepper 2015-08-26 13:38:26 +03:00
Alexander Alekhin
bbff288447 fix build with python3 only 2015-08-26 13:08:06 +03:00
Anush Elangovan
7bb3feff45 Add Android ARMEABI_V7A_HARD for Hardfp support
Add Android HardFP support. Expose the "armeabi-v7a-hard with NEON"
ANDROID_ABI.

TEST= Add -DANDROID_NATIVE_API_LEVEL=21
-DANDROID_ABI="armeabi-v7a-hard with NEON"

to compile with hardfp. Checked the output of make verbose to
confirm -lm_hard is being linked. There are known test
failures but that can be fixed once this is in.
2015-08-25 15:57:55 -07:00
Vadim Pisarevsky
b33853c5be Merge pull request #4199 from AVshokurov:master 2015-08-25 18:09:50 +00:00
Vadim Pisarevsky
587b0cc7b4 Merge pull request #4200 from Astero92:#3800 2015-08-25 18:08:54 +00:00
Roman Donchenko
bef2b27155 Add missing packages to the Debian conflict list
And refactor the code to make sure that the dev and runtime package lists are
in sync.
2015-08-25 18:50:06 +03:00
Maksim Shabunin
69db797ebb Fixed ccache detection condition 2015-08-25 18:24:07 +03:00
Vadim Pisarevsky
96fa0ef752 Merge pull request #5115 from ManuelFreudenreich:hog_variable 2015-08-25 14:45:53 +00:00
Andrey Pavlenko
3656a1aa66 fixing 'map_unmap_counting' 2015-08-25 17:25:03 +03:00
Maksim Shabunin
84ecf4b1dd Disabling precompiled headers when ccache is detected 2015-08-25 16:53:32 +03:00
Vadim Pisarevsky
ef1d4eba84 Merge pull request #5241 from alalek:fix_sample_opencl 2015-08-25 07:51:33 +00:00
Vadim Pisarevsky
edcd2c0408 Merge pull request #4176 from alalek:issue_4461 2015-08-25 07:46:28 +00:00
Vadim Pisarevsky
e2b677ddcf Merge pull request #5109 from olumby:fix-cvvideocamera-defaultfps 2015-08-25 07:44:29 +00:00
Vadim Pisarevsky
b6869df556 Merge pull request #5127 from LorenaGdL:data.cpp-(ml-module) 2015-08-25 07:42:41 +00:00
Vadim Pisarevsky
622301c78a Merge pull request #5142 from StevenPuttemans:fix_4230 2015-08-25 07:39:02 +00:00
Andrey Pavlenko
f6b758699b Revert merging of pull request #5176 from vladimir-dudnik:master (reverted from commit 5ee00ec5c6b21debd461808f584accbe7c42c869) 2015-08-24 19:22:22 +03:00
Alexander Alekhin
784f77a4a5 Merge pull request #5210 from a-stacey:cmake_3.1.0_pdb_support 2015-08-24 16:00:56 +00:00
Vadim Pisarevsky
bd8bac27d5 Merge pull request #4212 from ludv1x:master 2015-08-24 14:20:54 +00:00
Alexander Alekhin
1b1246cbae samples: fix OpenCL detection / build warning 2015-08-24 15:52:14 +03:00
Vadim Pisarevsky
702afcd760 Merge pull request #5143 from alankarkotwal:2.4 2015-08-24 11:06:30 +00:00
Vadim Pisarevsky
ff8aa6662e Merge pull request #5201 from alalek:move_semantics 2015-08-24 11:05:43 +00:00
Alexander Alekhin
c385ac575d Merge pull request #5238 from LorenaGdL:master 2015-08-24 00:47:01 +00:00
Lorena García
9d01818e8a Small update of Colormap documentation
Small change in documentation: http://docs.opencv.org/master/d3/d50/group__imgproc__colormap.html#gga9a805d8262bcbe273f16be9ea2055a65a5d4a709cda1130bfa3cc4b4c5ae8f82a&gsc.tab=0

In the enum images, the "parula" colormap has wrongly assigned subtitle 'hot'
2015-08-23 19:09:15 +02:00
Alexander Alekhin
6c42112555 Merge pull request #5235 from philippefoubert:issue_5234 2015-08-23 06:42:52 +00:00
Philippe FOUBERT
b668d3f693 Modification of the related tests in core/tests/ocl 2015-08-22 13:39:34 +02:00
Philippe FOUBERT
0629add3f7 Fix issue #5234 (UMat::convertTo when noScale) 2015-08-22 13:16:59 +02:00
Vitaliy Lyudvichenko
85cc11e3b2 Changed behaviour of Mat/UMat::reshape() to accept n-dim shapes 2015-08-21 19:26:29 +03:00
Maksim Shabunin
680efe1a97 Merge pull request #5231 from alalek:fix_tls 2015-08-21 15:09:50 +00:00
Alexander Alekhin
b8956d0111 tls: fix access to array (out of bounds) 2015-08-21 16:43:15 +03:00
Alexander Alekhin
44f8670719 Merge pull request #5171 from avershov:opencl-vaapi-interop 2015-08-21 12:47:14 +00:00
Philipp Hasper
14c0bfce2f kmeans and one-dimensional vectors
Clustering one-dimensional data was only possible when storing it column-based. But a std::vector is interpreted as matrix with height=1
Additionally, made conditionals more readable
2015-08-21 14:20:00 +02:00
Alexey Ershov
a8656ea20f implemented core support & sample
fixed whitespaces
fixed issues
fixed issue
fixed module statement issues
fixed access mode
added initialization check
fixed warning
2015-08-21 02:44:03 +03:00
Maksim Shabunin
9734abdc1a Merge pull request #5114 from a-andre:missingHeader 2015-08-20 15:45:52 +00:00
Alexander Alekhin
1f7fc6875f Merge pull request #5222 from apavlenko:android_ocl_tutorial 2015-08-20 13:14:50 +00:00
Alexander Alekhin
3b97549bb1 Merge pull request #5226 from ilya-lavrenov:valgrind_memory_leak 2015-08-20 13:14:29 +00:00
Alexander Alekhin
c1778f1199 Merge pull request #5161 from alalek:fix_string 2015-08-20 12:49:54 +00:00
Alexander Alekhin
fc0b997064 Merge pull request #5223 from ilya-lavrenov:warpaffine_valgrind 2015-08-20 12:36:24 +00:00
Alexander Alekhin
3afe8832c5 Merge pull request #5195 from mshabunin:warn-missing-contrib 2015-08-20 12:36:00 +00:00
Andrey Pavlenko
58e5aca631 Android camera + OpenCL tutorial (for existing code at samples/android/tutorial-4-opencl) 2015-08-20 15:13:34 +03:00
Ilya Lavrenov
4722b2d0e5 fixed memory leak caused by illegal memory access 2015-08-20 13:28:10 +03:00
Ilya Lavrenov
f100cdb6d4 fixed "Conditional jump or move depends on uninitialised value" warning 2015-08-20 12:20:38 +03:00
Maksim Shabunin
973abf0d62 cmake: Added missing extra modules warning 2015-08-19 18:33:59 +03:00
Maksim Shabunin
4a067dca58 Merge pull request #5154 from brunomorishita:patch-1 2015-08-19 15:22:35 +00:00
Alexander Alekhin
887d8d091b Merge pull request #5177 from lupustr3:pvlasov/tls_fixes 2015-08-19 14:18:19 +00:00
Alexander Alekhin
76da19d543 Merge pull request #5148 from StevenPuttemans:fix_4237 2015-08-19 13:28:48 +00:00
Steven Puttemans
be89b0505a Fix 2015-08-19 13:46:17 +02:00
Pavel Vlasov
a33d98c13a TLS memory leaks were fixed;
TLS was redesigned in more straightforward way;
OPENCV_ABI_COMPATIBILITY define was added;
2015-08-19 13:31:44 +03:00
Alexander Alekhin
a00b37d209 Merge pull request #5094 from SpecLad:f2d-ts-rng 2015-08-19 00:45:04 +00:00
a-andre
b757359ff8 fix documentation builder warnings 2015-08-18 18:48:32 +02:00
Alexander Alekhin
ca5e07d342 Merge pull request #5199 from TheodoreT:tickmeter_update 2015-08-17 17:18:31 +00:00
Alexander Alekhin
3172e6d54b Merge pull request #5203 from ilya-lavrenov:valgrind_error 2015-08-17 17:18:07 +00:00
Alexander Alekhin
365603e1c2 Merge pull request #5212 from thebucc:master 2015-08-17 16:37:27 +00:00
thebucc
421e1b237c Fix for bug #5007: moved definition of Size_MatDepth_t and Size_MatDepth from ts_perf.hpp to perf_channels.cpp. This way they are closer to where they are needed and live in a different namespace (possibly the reason why the fix works). 2015-08-17 16:09:00 +01:00
theodore
9449af8ada 1e-3 -> 1e3 2015-08-17 15:52:16 +02:00
Alexander Alekhin
5ee00ec5c6 Merge pull request #5176 from vladimir-dudnik:master 2015-08-17 12:22:15 +00:00
Vladimir Dudnik
58934f1e16 add condition to skip unmapping for internally allocated host memory. this should fix map_unmap_counting UMat test. 2015-08-17 14:36:34 +03:00
Alexander Alekhin
8e5ce69ee8 Merge pull request #5208 from ilya-lavrenov:cmd 2015-08-17 10:19:53 +00:00
Alexander Alekhin
9b0f5e61d1 Merge pull request #5185 from mshabunin:fix-rgbe-header-parse 2015-08-17 10:19:15 +00:00
Ashley Stacey
d8d78b4a98 Fix pdb file generation on Windows for CMake versions after 3.1.0.
Pdb file support was changed in CMake 2.8.12, support was added in CMake 3.1.0 to work around the problems created by the change introduced in CMake 2.8.12.
2015-08-17 10:28:22 +10:00
Ilya Lavrenov
7da16d6f47 used proper method 2015-08-17 01:44:50 +03:00
Ilya Lavrenov
75fcedf0ed added some property setting and getting 2015-08-16 21:25:36 +03:00
Ilya Lavrenov
c19ed39a78 repaired GStreamer 0.10 version 2015-08-16 21:01:22 +03:00
Alexander Alekhin
0e4bd80b80 Merge pull request #5194 from mshabunin:add-contrib-tutorials-root 2015-08-16 15:08:40 +00:00
Ilya Lavrenov
793bdaada7 typo 2015-08-16 11:46:48 +03:00
Ilya Lavrenov
dbd7912b88 repaired gstreamer camera capture:
1. Enabled property retrieval: height, width, FPS
2. Fixed issue when isOpened returns always true even for non-existing devices
3. Ability to work with non-0 device. Camera capture index is taken into account
2015-08-16 11:16:25 +03:00
Alexander Alekhin
e65de8d1da fixes for MSVS compiler optimizer 2015-08-16 02:03:04 +03:00
Alexander Alekhin
ac37b77452 c++ move semantics for cv::UMat 2015-08-16 02:02:26 +03:00
Alexander Alekhin
306aa0e699 c++ move semantics for cv::Mat_ 2015-08-16 02:02:25 +03:00
Alexander Alekhin
1afc9eb730 c++ move semantics for cv::Mat 2015-08-16 02:02:24 +03:00
Alexander Alekhin
5a0af53683 c++ move semantics for cv::Ptr<> 2015-08-15 16:45:19 +03:00
Ilya Lavrenov
370d1ff21a fixed typo 2015-08-15 16:25:25 +03:00
theodore
6d68f72473 bug fix fro the TickMeter class 2015-08-15 14:12:40 +02:00
Ilya Lavrenov
47cee8715b fixed uninitialized values warning in bad arg test class 2015-08-15 14:30:27 +03:00
Alexander Alekhin
56cdd6f14f Merge pull request #5116 from lenlen:viz_improvement 2015-08-15 08:28:22 +00:00
Ilya Lavrenov
b70e27e076 fixed memory leaks in warpAffine tests 2015-08-15 10:11:52 +03:00
Ilya Lavrenov
d1b882ddcf fixed memory leaks in floodfill tests 2015-08-15 10:09:31 +03:00
Ilya Lavrenov
b2489d31d6 fixed memory leaks in cvtyuv tests 2015-08-15 10:06:09 +03:00
Ilya Lavrenov
7719da9552 fixed memory leak in core ds tests 2015-08-15 09:53:30 +03:00
Antonella Cascitelli
079ceea616 Added new functionalities to viz module
- load OBJ file
- set offscreen rendering
- set roll angle of the camera
- get Mat screenshot of the current scene
- remove all lights from the scene
- add a custom light in the scene
- modify the size of the WImage3D widget
- added ambient property for the widget

Changed Vec3d in cv::viz::Color

Renamed method getMatScreenshotin getScreenshot

Modified showWidget

Fixed on viz::Color and reverted fix on vtkProp3D

Removed cameraRoll method

Merged load mesh method (for ply and obj file)

Fixed doc

Fixed cv::viz::WImage3D::setSize for vtk5.8

Fixed enum for cv::viz::Mesh::load
2015-08-15 01:03:59 +02:00
Alexander Alekhin
8d264d9f64 Merge pull request #5193 from ilya-lavrenov:valgrind_error 2015-08-14 15:32:16 +00:00
Maksim Shabunin
612822367d Added auto-generated root page for all contrib tutorials 2015-08-14 18:11:27 +03:00
Ilya Lavrenov
855765986e fixed valgrind warning in polylines 2015-08-14 17:57:54 +03:00
Alexander Alekhin
e866680d96 Merge pull request #5156 from brunomorishita:fix_build 2015-08-14 13:56:45 +00:00
Alexander Alekhin
30e6725006 Merge pull request #5192 from D-Alex:master 2015-08-14 13:55:28 +00:00
Alexander Smorkalov
d0210f510e OpenCV version++. 2015-08-14 16:43:10 +03:00
Alexander Duda
fbcf5f0918 cvCreateCameraCapture: fix using preffered interface
The provided interface id must be removed from the index. Otherwise, the
underlying implementations are using a wrong camera id.

Example:
VideoCapture(800) fails because PvAPI tries to open a camera
on position 800
2015-08-14 13:40:24 +02:00
Bruno Goncalves
cf4025c224 fix documentation code formulas 2015-08-13 23:13:47 -03:00
Alexander Alekhin
68f8d1cef0 Merge pull request #5164 from vladimir-dudnik:test-umat-copyTo-issue 2015-08-13 14:59:07 +00:00
Maksim Shabunin
9e4c62967b Fixed RGBE images header parsing (fixes #4885) 2015-08-13 17:24:54 +03:00
Alexander Alekhin
53a92983a4 Merge pull request #5167 from ruslo:suppress.vs.error 2015-08-13 12:21:37 +00:00
Alexander Alekhin
9e065bc802 Merge pull request #5179 from alalek:update_android_samples 2015-08-13 12:02:30 +00:00
Alexander Alekhin
03bab0fc0d tutorial-4-opencl: enable build with OpenCV 2015-08-13 13:32:23 +03:00
Alexander Alekhin
11a829f9de Merge pull request #5180 from boatx:bugfix/proper-conversion-of-numpy-array-to-mat 2015-08-13 10:03:43 +00:00
Alexander Alekhin
6483919b17 Merge pull request #5170 from mshabunin:add-android-pack 2015-08-13 09:19:09 +00:00
boatx
d674965bf9 Fixing typo in variable name. 2015-08-12 20:50:05 +00:00
Maksim Shabunin
e0b327aafe Merge pull request #5140 from PhilLab:patch-3 2015-08-12 15:50:03 +00:00
Alexander Alekhin
e1ad86c1fa android samples: update way to attach native part of OpenCV
OPENCV_ANDROID_SDK - OpenCV Android SDK location (or OpenCV build dir)
Can be passed via ndk-build parameter or environment variable.
2015-08-12 18:37:29 +03:00
Maksim Shabunin
34aa4e4578 Merge pull request #5151 from mshabunin:fix-training-data-corruption 2015-08-12 14:40:51 +00:00
Alexander Alekhin
d789c810bf Merge pull request #4239 from apavlenko:android_ocl_sample2 2015-08-12 14:00:36 +00:00
Maksim Shabunin
cb324b4ec3 Merge pull request #5168 from alalek:fix_5067 2015-08-12 13:11:57 +00:00
Maksim Shabunin
2255472e31 Fixed whitespace issue 2015-08-12 14:57:49 +03:00
Maksim Shabunin
ef16650f5c Android SDK build Initial 2015-08-12 11:31:35 +03:00
ManuelFreudenreich
89889ae8ea changed hog to work with variable parameters and changed the hog sample to test it with more options
added comments and tests
2015-08-12 09:16:20 +02:00
Alexander Alekhin
c119e04947 fix opengl sample build on Linux (#5067) 2015-08-11 22:49:19 +03:00
Ruslan Baratov
e8a1bc2bd9 Suppress error message of execute_process
Command 'execute_process' from OpenCVFindMatlab module can omit error message
to the standard output. This can break build of the OpenCV package in
ExternalProject_Add (Windows/Visual Studio).
2015-08-11 20:39:24 +03:00
Vladimir Dudnik
6bb8afde96 fixed typo in OpenCLAllocator.upload method (wrong step used) 2015-08-11 16:01:05 +03:00
Vladimir Dudnik
131d7c394e enabled test UMat copyTo. Now it will detect FAIL on Intel platform for ROI (issue with clEnqueueCopyBufferRect) 2015-08-11 14:19:14 +03:00
Vladimir Dudnik
ef0d1c1c3f fixed download/upload for non contiguous umat 2015-08-11 01:33:46 +03:00
Alexander Alekhin
cda9ed449f fix some functions for valid processing of empty string content (cstr_==0, len_==0) 2015-08-10 18:08:58 +03:00
Alexander Alekhin
09b9b0fb9e Merge pull request #5135 from alalek:issue_4468 2015-08-10 14:46:31 +00:00
Alexander Alekhin
3316e58314 more test loops (and disable tests - tests pass but require a lot of time) 2015-08-10 14:44:28 +03:00
Maksim Shabunin
447b8bf58a Fixing possible corruption for big training data sizes 2015-08-10 12:36:27 +03:00
Alexander Alekhin
aed9f5d5e8 Merge pull request #5132 from hewj03:master 2015-08-09 11:27:43 +00:00
Bruno Goncalves
894c2468df fix build error when both OpenNI and OpenNI2 are supported (issue 4918) 2015-08-09 00:48:49 -03:00
Alexander Alekhin
9b2a7fe723 Merge pull request #5125 from StevenPuttemans:fix_annotation_tool 2015-08-08 16:52:25 +00:00
Alexander Alekhin
e9539061db Merge pull request #5124 from StevenPuttemans:fix_annotation_tool_2.4 2015-08-08 16:51:51 +00:00
Alexander Alekhin
11b3529b39 Merge pull request #5146 from avershov:fix-issue-5122 2015-08-07 10:55:08 +00:00
Alexander Alekhin
53effc529b Merge pull request #5149 from Nerei:minor_comment_fix 2015-08-07 10:13:56 +00:00
Anatoly Baksheev
0dab097a26 minor comment fix 2015-08-07 12:55:10 +03:00
StevenPuttemans
b09f591dda fix py_matcher tutorial 2015-08-07 09:36:49 +02:00
Alexey Ershov
c7f420ba75 applied changes proposed in 5122 2015-08-06 20:55:41 +03:00
Alankar Kotwal
98078c231e Merge pull request #1 from alankarkotwal/bugfix
Correct missing braces in operations_in_arrays.rst
2015-08-06 22:15:04 +05:30
Alankar Kotwal
1d92a73a55 Correct missing braces in operations_in_arrays.rst 2015-08-06 22:09:23 +05:30
StevenPuttemans
dd8589c352 change as suggested by original programmer and user of ecc software 2015-08-06 14:59:15 +02:00
Philipp Hasper
29db3c2f17 Update README.md 2015-08-06 14:00:24 +02:00
Alexander Alekhin
8293ed7f9b add tests from issue 4468 (#5062) 2015-08-06 13:50:13 +03:00
StevenPuttemans
d0344cd308 add checks for valid input data given to parameters
make the software system dependent
add LICENSE on top
2015-08-06 10:24:33 +02:00
StevenPuttemans
ba7bf1ef68 add checks on input parameters for valid path and folder
opening a folder is system specific - made system specific code
added license
2015-08-06 10:23:41 +02:00
Wenju He
67ca143a0b fix adaptiveThreshold mean 2015-08-06 10:23:31 +08:00
Vadim Pisarevsky
573858f134 Merge pull request #5117 from mshabunin:adding-google-search 2015-08-05 17:27:38 +00:00
Vadim Pisarevsky
b76d351419 Merge pull request #5128 from ageitgey:ag-prevent-demos-from-autorunning 2015-08-05 17:25:34 +00:00
Vadim Pisarevsky
4a2aad5bba Merge pull request #4149 from LaurentBerger:ThreshGaussianFloat 2015-08-05 17:25:01 +00:00
Vadim Pisarevsky
9ff69dbf4a Merge pull request #5130 from alalek:issue_4380 2015-08-05 17:19:55 +00:00
Alexander Alekhin
5a53f41622 Merge branch '2.4.10.x-prep' into 2.4 2015-08-05 16:20:12 +03:00
Alexander Alekhin
21467d817b tapi: add test from issue 4380 (#5010) 2015-08-05 16:08:48 +03:00
Adam Geitgey
e976c448b7 Prevent grabcut, houghcircles and houghlines python2 demos from running automatically while browsing demos in the demo list viewer 2015-08-04 14:01:51 -07:00
LaurentBerger
a64d096369 remove test 2015-08-04 22:58:22 +02:00
Lorena García
c545857ea6 Indent fix 2015-08-04 16:50:55 +02:00
Lorena García
4cd78bc7ad Whitespace error 2015-08-04 16:45:39 +02:00
Lorena García
fe62243805 Whitespace error 2015-08-04 16:37:41 +02:00
Lorena García
2cb47b4191 Update data.cpp
Update to allow loading data from a .csv file that only contains training samples values and not the associated responses. To allow this behavior, function must be called with parameters ResponsesStartIdx <= -2 and ResponsesEndIdx = 0
2015-08-04 15:58:24 +02:00
Alexander Alekhin
da0c159557 Merge pull request #5118 from alalek:fix_viz_build 2015-08-04 10:28:43 +00:00
Alexander Alekhin
63bae5da71 vtk: disable on cross-compilation 2015-08-03 19:09:07 +03:00
Alexander Alekhin
80844fd554 Merge pull request #5096 from terfendail:2.4 2015-08-03 12:46:45 +00:00
Alexander Alekhin
d83d2d4c2f viz: fix precompiled headers definitions 2015-08-03 14:39:24 +03:00
Maksim Shabunin
bd4c685553 Documentation: adding Google Custom search block to each header 2015-08-03 14:01:12 +03:00
Alexander Alekhin
da948c82b4 Merge pull request #5106 from vladimir-dudnik:opencl-opengl-upd 2015-08-03 09:57:06 +00:00
Alexander Alekhin
0f8c46f368 Merge pull request #5107 from vladimir-dudnik:d3d-interop-upd 2015-08-03 09:56:37 +00:00
Vadim Pisarevsky
3f65a86977 Merge pull request #4233 from alalek:fix_4006 2015-08-03 05:46:29 +00:00
Vadim Pisarevsky
c10230f81c Merge pull request #5087 from alexst07:cuda_contrib 2015-08-03 05:42:33 +00:00
Vadim Pisarevsky
02906bf23a Merge pull request #5102 from nzjrs:fix-python-digits 2015-08-03 05:40:24 +00:00
a-andre
5262371660 install new headers like "opencv2/core.hpp" 2015-08-02 13:13:58 +02:00
Oliver Lumby
2de3a24f46 fix CvVideoCamera defaultfps 2015-08-01 13:55:28 +02:00
Vladimir Dudnik
57bff43aec fixed not initialized nv12_cpu_copy surface, remove odd code 2015-08-01 02:10:05 +03:00
Vladimir Dudnik
5c4c8bcea3 update opencl-opengl interop sample (remove odd no processing branch) 2015-08-01 01:16:06 +03:00
Alexander Alekhin
157c94c03e Merge pull request #5097 from alalek:fix_build 2015-07-31 15:35:42 +00:00
Vitaly Tuzov
a96a6bf149 Resize area result verification moved to the separate function 2015-07-31 15:01:33 +03:00
John Stowers
e05b6bb6e7 remove picloud from digits_adjust
the service has been closed since 2013/2014
2015-07-31 09:17:16 +02:00
John Stowers
c4c3f1b25e fix digits.py to not ignore model parameters
otherwise model is only ever trained with default
parameters, and digits_adjust does nothing (for example)
2015-07-31 09:14:20 +02:00
Andrey Pavlenko
56bde913d4 adding mode switching via menu 2015-07-31 03:39:26 +03:00
Andrey Pavlenko
9ab291ea1c adding displaying FPS 2015-07-31 01:52:10 +03:00
Alexander Alekhin
fe0a17e78f fix build with Win7 SDK 2015-07-30 23:23:01 +03:00
Andrey Pavlenko
0185cb27eb excluding libOpenCL.so from the APK 2015-07-30 23:18:45 +03:00
Alexey Ershov
ea10290153 change displaying of fps to time (ms) 2015-07-30 19:57:11 +03:00
Alexander Alekhin
1704aea6a0 tapi: enable some disabled tests 2015-07-30 19:21:24 +03:00
Maksim Shabunin
429d280501 Merge pull request #5081 from sbokov:Adding_HAL_v_extract 2015-07-30 16:12:38 +00:00
Vitaly Tuzov
b7c9aaa471 Added more resize_area tests to ensure right rounding behavior for half and quarter downscaling 2015-07-30 18:48:06 +03:00
Roman Donchenko
1245cd1752 NearestNeighborTest: use ts->get_rng() instead of (implicit) theRNG()
This ensures that test data is not dependent on the order the tests are
executed in.
2015-07-30 18:03:48 +03:00
Maksim Shabunin
6922b94894 Merge pull request #5093 from sturkmen72:patch-5 2015-07-30 13:04:48 +00:00
Alexander Alekhin
2b2bc83b61 Merge pull request #4238 from vladimir-dudnik:d3d11-nv12-interop 2015-07-30 10:36:25 +00:00
Suleyman TURKMEN
9dd41a8187 Update how_to_scan_images.cpp 2015-07-30 13:17:17 +03:00
Alexander Smorkalov
1f5fd865aa Merge pull request #5092 from etalanin:update-branch-to-2-4-12 2015-07-29 18:57:02 +00:00
Evgeny Talanin
9a3dccab20 Increase Android Manager version 2015-07-29 21:16:21 +03:00
Evgeny Talanin
ac6ca660f4 Increase version to 2.4.12 2015-07-29 20:34:47 +03:00
Alex Torres
383b7e9dd1 Fixes namespace error on cudaoptflow 2015-07-29 14:22:45 -03:00
Vladimir Dudnik
6bd01a96d9 finished with NV12 support for D3D11-interop. Now, if texture is in NV12 format then it will be converted to/from BGR UMat. 2015-07-29 19:52:05 +03:00
Vladimir Dudnik
d4774ead43 d3d11-nv12 interop
fixed issues with ocl nv12 cvt kernel

finisged ocl nv12-to-rgba kernel, update dx-interop samples. (ocl rgba-to-nv12 kernel will be added later)

an attempt to fix build issue

fix for non opencl build issue

fix typo

fix compilation warnings

fix compile issue for Mac (OpenCL)

add convertion from rgba to nv12 (still need to debug kernel)

remove empty line at the EOF

fixed compilation warning
2015-07-29 19:52:03 +03:00
Alexander Alekhin
6f47c26acf Merge pull request #5091 from jet47:gpu-sanity-epsilon 2015-07-29 16:29:37 +00:00
Vladislav Vinogradov
945663bc9b increase epsilon for some GPU sanity tests 2015-07-29 18:57:14 +03:00
Alexander Alekhin
0263b49298 Merge pull request #5090 from SpecLad:autotune-crash 2015-07-29 15:47:20 +00:00
Roman Donchenko
c2f59a0f73 flann: fix AutotunedIndex crashing if a KDTree index is selected
Backport of mariusmuja/flann@f8ca6df3.
2015-07-29 18:03:48 +03:00
Alex Torres
2838ccc78e Fixes compilation errors when BUILD_CUDA_STUBS is ON 2015-07-29 08:59:38 -03:00
Alexey Ershov
0a4830b3d5 added command line processing 2015-07-29 13:51:03 +03:00
Alexey Ershov
b102bc6678 fixed memory leaks 2015-07-29 11:07:11 +03:00
Andrey Pavlenko
c8f863dfc5 minor fixes 2015-07-29 00:13:35 +03:00
Alexander Alekhin
4eef486afe tapi: datarace fixup for cvtColor 2015-07-28 11:49:46 +03:00
Alexander Alekhin
9bcccb028b fixes 2015-07-28 11:49:46 +03:00
Alexander Alekhin
cd5c70691a ocl: add map tests 2015-07-28 11:49:46 +03:00
Alexander Alekhin
b36f565d13 fix OpenCV code (bug 4006: #4862) 2015-07-28 11:49:41 +03:00
Vladimir Dudnik
ed7907e46c add test for bug 4006: #4862 2015-07-28 11:49:02 +03:00
sbokov
1ef8cf5a23 Replacing SSE with v_extract 2015-07-27 19:49:25 +03:00
sbokov
b2c592255a Merge pull request #1 from Itseez/master
Update
2015-07-27 18:39:58 +03:00
Alexander Alekhin
47e7a7a7ce Merge pull request #4213 from mshabunin:hal-vextq 2015-07-27 15:08:29 +00:00
Alexander Alekhin
c94945f892 Merge pull request #4210 from wangyan42164:ocl_umat_convert 2015-07-27 15:05:57 +00:00
Maksim Shabunin
6b8e13d017 Merge pull request #4232 from berak:patch-2 2015-07-27 08:15:11 +00:00
Andrey Pavlenko
0e4bb2b49f adding OpenCV with TAPI (UMats) 2015-07-27 04:04:56 +03:00
Andrey Pavlenko
274aba1a89 adding OpenCL processing (Image2D-to-Image2D only, others will be added later) 2015-07-27 02:57:01 +03:00
Andrey Pavlenko
2a6d4b6ee2 Camera and Camera2 preview is rendered via OpenGL textures and can be modified on CPU via C++ code. No OpenCL yet. 2015-07-27 01:07:56 +03:00
berak
d9148ea604 Update ml.hpp
misplaced CV_WRAP statement lead to not exposing EM::getCovs() to python/java/matlab wrappers

add a CV_OUT to return the covs properly
2015-07-25 08:22:39 +02:00
Maksim Shabunin
ecd3661119 Merge pull request #4179 from sbokov:improvingStereoSGBM 2015-07-24 21:12:56 +00:00
Maksim Shabunin
9eda260495 Merge pull request #4211 from alalek:fix_python_2_4 2015-07-24 13:33:51 +00:00
Maksim Shabunin
3ed54b9008 Merge pull request #4220 from alalek:fix_gcc_warnings_2_4 2015-07-24 13:09:44 +00:00
Maksim Shabunin
be70df1187 Merge pull request #4196 from alalek:fix_python 2015-07-24 11:43:00 +00:00
Maksim Shabunin
6a6ccf6032 v_extract universal intrinsic 2015-07-24 14:05:28 +03:00
sbokov
f40b580bb8 Fixing StereoSGBM ROI
Now StereoSGBM behaves similarly to StereoBM in terms of ROI handling.
2015-07-23 23:17:16 +03:00
sbokov
aea4157340 Adding new HAL-accelerated MODE_SGBM_3WAY
New mode is approximately 2-3 times faster than MODE_SGBM
with minimal degradation in quality and uses universal
HAL intrinsics. A performance test was added. The accuracy
test was updated to support the new mode.
2015-07-23 23:08:26 +03:00
Alexander Alekhin
11c3fa527a Merge pull request #4222 from mshabunin:fix-android-warnings 2015-07-23 12:38:14 +00:00
Yan Wang
132416ebe9 It is unnecessary to use fma() if no scaling.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2015-07-23 10:18:11 +08:00
Maksim Shabunin
46e457d340 Fixed loop check 2015-07-22 17:54:42 +03:00
Maksim Shabunin
14d7b38613 Fixing GCC 4.9 warnings 2015-07-22 16:12:31 +03:00
Alexander Alekhin
6b954cd24e Merge pull request #4219 from SpecLad:freak-missing-init 2015-07-22 12:52:36 +00:00
Alexander Alekhin
42ba5c7d16 fix GCC 4.9 warnings 2015-07-22 14:17:54 +03:00
Roman Donchenko
72ddeea479 FREAK: add missing field initialization 2015-07-22 14:06:39 +03:00
Vadim Pisarevsky
6d3bc7c82d Merge pull request #4183 from paroj:8point 2015-07-22 11:01:23 +00:00
Vadim Pisarevsky
9ad84896da Merge pull request #4217 from wangyan42164:ocl_pyrlk_mul 2015-07-22 11:00:00 +00:00
Vadim Pisarevsky
f53d3de73e Merge pull request #4215 from renatoGarcia:master 2015-07-22 10:55:23 +00:00
Vadim Pisarevsky
869dda4117 Merge pull request #4204 from gladilov-gleb:minMaxLocBugFix 2015-07-22 10:52:16 +00:00
Gleb Gladilov
07de67c32f Added test of minMaxLoc on filling with maximums of int 2015-07-22 11:43:35 +03:00
Yan Wang
a00eb1e9f5 Move coefficient (32.0f) to the end of every iteration.
It could reduce 7 multiplications every iteration.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2015-07-22 11:25:18 +08:00
Renato Florentino Garcia
ec0f901153 Remove an unneeded semicolon. 2015-07-21 14:54:06 -03:00
Alexander Alekhin
c0b544af70 Merge pull request #4209 from vladimir-dudnik:fix-opencl-opencv-interop-sample 2015-07-21 15:58:20 +00:00
Alexander Alekhin
c1c0f23fd1 Merge pull request #4004 from paroj:camera-api 2015-07-21 15:57:48 +00:00
Gleb Gladilov
c467d0d553 Fixed minMaxLoc and test functions 2015-07-21 17:17:23 +03:00
Alexander Alekhin
c0ee03fab2 Merge pull request #4192 from avershov:opencl-opengl-buffer 2015-07-21 14:10:00 +00:00
Vadim Pisarevsky
c976c1192d Merge pull request #4181 from themightyoarfish:findEssMatDocTypoFix 2015-07-21 12:06:45 +00:00
Vadim Pisarevsky
61c0ff007a Merge pull request #4197 from themightyoarfish:projectPointsDocBugfix 2015-07-21 11:56:46 +00:00
Vadim Pisarevsky
03824682ad Merge pull request #4189 from vladimir-dudnik:update_dx_samples 2015-07-21 11:55:21 +00:00
Vadim Pisarevsky
a7805301cb Merge pull request #4201 from sturkmen72:new_function_imread_reduced 2015-07-21 11:49:51 +00:00
Vadim Pisarevsky
e26b941e66 Merge pull request #4207 from alalek:fix_calib3d_test 2015-07-21 11:48:14 +00:00
Alexey Ershov
89392b2a6d added convertToGLBuffer() & convertFromGLBuffer() functions; added OpenGL interop sample comment
rewrite & change convertFromGLBuffer() & convertToGLBuffer() into acquireGLBuffer() & releaseGLBuffer(), respectively

opengl sample: added buffer support

tested and fixed buffer support on Windows

change glFlush() call to glFinish()

added UMat::release() call; fixed functions' names

adopted & implemented API suggestion(s) from Alexander

fixed unreachable code warning

added more info to the mapGLBuffer/unmapGLBuffer description
2015-07-21 13:42:17 +03:00
Alexander Alekhin
0906744788 fix python cross-compilation 2015-07-21 12:41:57 +03:00
Alexander Alekhin
b6d88f21af Merge pull request #4195 from wangyan42164:ocl_pyrlk 2015-07-21 09:25:11 +00:00
Vladimir Dudnik
ef05318c69 fix opencl-opencv-interop.cpp issues reported by Dmitry Budnikov 2015-07-21 01:27:27 +03:00
Vladimir Dudnik
6c452addfe changed output from fps to time (in msec). Notes for dx10 and dx11: the first measure is wrong (zero), the followiing are correct; measured time includes output text to surface. 2015-07-20 19:05:05 +03:00
Alexander Alekhin
dac071ed78 Merge pull request #4202 from PhilLab:patch-5 2015-07-20 15:13:43 +00:00
Alexander Alekhin
76296fb672 Merge pull request #4206 from sturkmen72:patch-2 2015-07-20 15:13:17 +00:00
Alexander Alekhin
bbe75fe1d2 calib3d: normalize Rodrigues vector in perf test 2015-07-20 17:05:25 +03:00
Suleyman TURKMEN
7522527827 Update window_w32.cpp 2015-07-20 16:35:00 +03:00
Philipp Hasper
2b7637df36 Fixed buffer overflow in string handling
pos should never exceed strlen, else the overflow check 'if (!len)' will wrongfully pass
2015-07-20 09:00:24 +02:00
Yan Wang
2c1650ad33 Optimize pyrlk.
1. Remove uncessary index calculation.
2. Use mad/mad24 as possible.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2015-07-20 13:46:01 +08:00
Suleyman TURKMEN
7b7d54df68 new function imread_reduced()
by this new function we can set libjpeg "scale_denom" parameter and load jpeg images scaled 1/2 - 1/4 - 1/8
other image formats resized after loading
2015-07-19 03:53:43 +03:00
Anton V. Shokurov
4691d98e19 Adds support for property CV_CAP_PROP_FOCUS in functions cvSetCaptureProperty and cvGetCaptureProperty.
In compliance with the Windows (DirectDraw) version autofocus is disabled when either of the abovementioned functions is called.
2015-07-18 15:24:16 +03:00
Dominik Kleiser
f363670934 Bug #3800 - Resize viewport when CV_WINDOW_KEEPRATIO was set (Qt) 2015-07-17 20:02:01 +02:00
themightyoarfish
b8f93e08e9 Fixed documentation bug for projectPoints: Distortion coefficients cannot actually be NULL 2015-07-17 17:34:33 +02:00
Alexander Alekhin
2c2645191a fix python cross-compilation 2015-07-17 14:43:01 +03:00
Alexander Smorkalov
67158b12cd Merge pull request #4191 from SpecLad:irc-workaround 2015-07-16 08:17:45 +00:00
Maksim Shabunin
0726c4d4ea Merge pull request #4190 from sbokov:fixingStereoBMissue 2015-07-15 14:43:09 +00:00
Alexander Alekhin
ae71f0c086 Merge pull request #4193 from jklontz:master 2015-07-15 10:12:07 +00:00
Josh Klontz
beed99dbc1 fixed conditional compilation of RGB2Gray<ushort> template specialization 2015-07-14 20:56:43 -04:00
sbokov
e0cea92f6e Fixing possible invalid memory access in validateDisparity 2015-07-14 18:23:24 +03:00
Maksim Shabunin
00b72df6c5 Merge pull request #4147 from alalek:fix_world_cyclic_deps 2015-07-14 14:54:38 +00:00
Alexander Alekhin
4c1cbffd2a Merge pull request #4184 from alalek:fix_cmake_status 2015-07-14 10:32:06 +00:00
Roman Donchenko
9e50cf5375 Refactor a section of icvRotatingCalipers to work around a GCC bug
https://bugs.launchpad.net/ubuntu/+source/gcc-4.9/+bug/1474304
2015-07-14 13:26:47 +03:00
Vladimir Dudnik
dee05f982b compute fps changed (now only interop counts). fixed d3d10 and d3d11 print info method (there were issues with texture mapping) 2015-07-13 23:40:45 +03:00
Alexander Alekhin
4bf82e50d0 Merge pull request #4187 from SpecLad:chessboard-png 2015-07-13 15:52:46 +00:00
Pavel Rojtberg
0688bb61ed simplify 8point algorithm using Matx classes 2015-07-13 16:58:35 +02:00
Alexander Alekhin
f77926675f Merge pull request #4186 from ultrafro:fix_setDepthGeneratorProperty_registration_flag_polarity 2015-07-13 11:39:51 +00:00
ultrafro
ed574171bb Fixed polarity of ImageRegistration mode in setDepthGeneratorProperty function of CvCapture_OpenNI2 class 2015-07-12 18:28:23 -04:00
Alexander Alekhin
aa871ca506 fix wrong usage of status(), remove useless message in videoio 2015-07-10 19:18:07 +03:00
Alexander Alekhin
6116a2fcf8 Merge pull request #4182 from vladimir-dudnik:update_dx_samples 2015-07-10 14:30:03 +00:00
themightyoarfish
fcc842f08b Fixed typo in doc for findEssentialMat 2015-07-10 12:45:45 +02:00
Vladimir Dudnik
38723b0339 simplified sample's interface (remove odd "no processing" branch, add print to screen for processing mode) 2015-07-09 22:41:05 +03:00
Roman Donchenko
2e86d46cf2 CV_ChessboardDetectorTimingTest: don't ignore missing test data 2015-07-09 17:32:08 +03:00
Alexander Alekhin
88e66697a7 t-api: try to fix allocator fallback code paths
issue: http://code.opencv.org/issues/4461
2015-07-09 13:26:59 +03:00
Alexander Alekhin
ff90f2736b Merge pull request #4169 from alalek:issue_4457 2015-07-08 14:30:41 +00:00
Alexander Alekhin
06617392e0 workaround issue with MatExpr 2015-07-08 16:22:59 +03:00
Alexander Alekhin
a6f46d7bb1 issue 4457 2015-07-08 16:22:58 +03:00
Vadim Pisarevsky
0b99f70773 Merge pull request #4154 from alalek:ffmpeg_update_via_binary_repo 2015-07-08 12:23:14 +00:00
Pavel Rojtberg
b1842a4b89 use simplified API selection logic in cvCreateCameraCapture as well 2015-07-08 13:46:57 +02:00
Pavel Rojtberg
2909e07cb2 deny any other interfaces if someone is specified as preference
it provides more expectable results to end-users.
based on feedback by Alexander Alekhin
2015-07-08 13:46:56 +02:00
Pavel Rojtberg
41d8c4d879 allow specifying apiPreference in VideoCapture when opening a file. Add
a separate function instead of an overload not to change the ABI.

rename VideoCapture paramter 'device' to 'index' in CPP to reflect that
it allows specifying the API.
update comments to explain how to specify the API.
2015-07-08 13:46:56 +02:00
Vadim Pisarevsky
cd8143be0a Merge pull request #4171 from jet47:install-cudev-test 2015-07-08 10:10:17 +00:00
Vadim Pisarevsky
4997f5dfe9 Merge pull request #4174 from yangj1e:fix_svm_trainauto 2015-07-08 10:04:40 +00:00
Vadim Pisarevsky
743160b6ac Merge pull request #4158 from alalek:fix-bigdata-copyto 2015-07-08 10:00:46 +00:00
Vadim Pisarevsky
92777281a7 Merge pull request #4173 from kalistratovag:mjpeg_encoder_coverity_warnings 2015-07-08 09:19:01 +00:00
Alexander Alekhin
40fcc9d149 Merge pull request #4159 from alalek:vector_processing 2015-07-06 13:22:57 +00:00
Vadim Pisarevsky
8bede85f60 Merge pull request #4172 from alalek:ocl_minmaxloc_unaligned 2015-07-06 12:57:01 +00:00
Alexander Alekhin
c0d61964d6 ocl: fix unaligned memory access
http://code.opencv.org/issues/4462
2015-07-06 13:58:17 +03:00
kalistratovag
e2fe0ca835 Removing deadcode blocks, redudant variable & initializing all vars in constructor
Adding &31 to bit shift in order to silince coverity BAD_SHIFT defect

add default_stripes_count const
2015-07-06 12:36:21 +03:00
Jie Yang
2ba0d31785 Fix SVM::trainAuto (Bug #4464)
Fix SVM::trainAuto (Bug #4464)
2015-07-06 01:20:26 +09:30
Alexander Alekhin
56ad207d37 update ffmpeg wrapper binaries
Scripts are updated for Linux-based (Ubuntu 14.04) mingw cross-compilation (full stack of scripts provided)
Part of these scripts may work under Windows installation of MinGW, but it is not supported.

FFMPEG update: 2.7.1
Added OpenH264 Cisco binaries support for H264 encoding: v1.4.0
2015-07-03 19:13:15 +03:00
Vladislav Vinogradov
2f0de3aa2c add opencv_test_cudev to installation package 2015-07-03 13:33:36 +03:00
Alexander Alekhin
ca692b9804 Merge pull request #4168 from Dikay900:export_threadcontrol 2015-07-02 11:31:16 +00:00
Alexander Alekhin
f4cb8c0dfb Merge pull request #4127 from avershov:opengl-opencl-sample 2015-07-02 11:24:10 +00:00
Alexander Alekhin
885114ed2c fix copyTo memory corruption, but the main problem is still here 2015-07-02 13:47:59 +03:00
Dikay900
3ebb5d0e3b export thread control to python aswell 2015-07-01 22:55:12 +02:00
Vadim Pisarevsky
172c00faa6 Merge pull request #4167 from berak:patch-2 2015-07-01 17:29:24 +00:00
Alexander Alekhin
30a5a9ed34 test vector processing 2015-07-01 20:10:22 +03:00
Vadim Pisarevsky
c81b064727 Merge pull request #4164 from kalistratovag:parallel_mjpeg 2015-07-01 14:15:52 +00:00
Alexander Alekhin
ca8312b0b3 remove legacy intermediate unused files 2015-07-01 16:46:54 +03:00
berak
b29e473c21 fix plausability check, #issue 4429 2015-07-01 15:32:37 +02:00
Vadim Pisarevsky
e379ea6ed6 Merge pull request #4117 from jaimefrio:relaxed_strides 2015-07-01 10:53:45 +00:00
Vadim Pisarevsky
80eec9d531 Merge pull request #4064 from MSOpenTech:test-contrib 2015-07-01 10:47:44 +00:00
Vadim Pisarevsky
0ed0f2953a Merge pull request #4166 from sbokov:fixingStereoBMissue 2015-07-01 10:27:21 +00:00
Vadim Pisarevsky
426b3f6198 Merge pull request #4139 from swook:spatial_gradient 2015-07-01 10:22:36 +00:00
Vadim Pisarevsky
d5afd070ce Merge pull request #4094 from kashefy:Mat_push_back_MatExpr_bug_4340 2015-07-01 09:09:51 +00:00
Seon-Wook Park
20bf88bad1 spatialGradient: Make kern args const& 2015-07-01 09:34:27 +09:00
Alexey Ershov
9dfa9a81e9 eliminated unused function __OpenCLinitializeGL(), simplified query device logic 2015-06-30 21:27:15 +03:00
Seon-Wook Park
90c398ea67 spatialGradient: Add CV_SSE2 check 2015-07-01 00:42:08 +09:00
sbokov
ff1687d378 Fixing uninitialized memory access problem 2015-06-30 18:16:56 +03:00
Evgeny Agafonchikov
6a6d58d389 Adding test support for WINRT 2015-06-30 15:35:20 +03:00
kalistratovag
65e0387aa5 Implementing parallel mjpeg encoder.
Fixed errors in parallel_for based on pthreads

Fixing compiler errore & removing whitespaces

Fixing prallel_for_pthreads error and warnings on win
2015-06-30 13:57:37 +03:00
LaurentBerger
12362f76b1 Test for adaptive thresh will give FAIL_BAD_ACCURACY for old
implementation of adaptivethreshold
2015-06-30 10:51:50 +02:00
Youssef Kashef
790ef21a60 add unit test around Mat::push_back()
add template specialization Mat::push_back() for MatExpr paramters

extend push_back MatExpr to mat in unit test

cast to object instead of reference

test with multi-row MatExpr input
2015-06-30 10:29:40 +02:00
Seon-Wook Park
ed38ca5179 spatialGradient: Remove 4 loads in inner loop 2015-06-30 16:08:15 +09:00
Vadim Pisarevsky
8869150649 Merge pull request #4153 from stefan-cornelius:master 2015-06-30 06:12:03 +00:00
Seon-Wook Park
5dddb47863 spatialGradient: Remove pointers caching 2015-06-30 10:51:10 +09:00
Alexander Alekhin
50b453e5c2 Merge pull request #4150 from alalek:opencv_org_issue_4428 2015-06-29 17:08:54 +00:00
Seon-Wook Park
cf0fdfa2bb spatialGradient: Change ordering of vector loads 2015-06-29 23:50:05 +09:00
Seon-Wook Park
658f96b447 spatialGradient: L/R border handling outside. Kernelize. 2015-06-29 23:12:33 +09:00
Vadim Pisarevsky
d0c43f16e0 Merge pull request #4155 from MSOpenTech:highgui_contrib 2015-06-29 12:44:16 +00:00
Vadim Pisarevsky
fb4698e7fd Merge pull request #4161 from alalek:restore_data_file 2015-06-29 12:32:36 +00:00
Alexey Ershov
8ed45609d0 fixed cleanup, fixed unused context 2015-06-29 11:46:31 +03:00
Seon-Wook Park
15ea401087 spatialGradient: Move vector decl into loop 2015-06-27 10:01:47 +02:00
Seon-Wook Park
db0cc56c52 spatialGradient: Re-introduce 2-rows at a time 2015-06-27 09:53:42 +02:00
Seon-Wook Park
f958f29c55 spatialGradient: Suppress uninitialised j warnings 2015-06-27 01:03:43 +02:00
Maxim Kostin
ccdd1126f6 Updated sample to showcase highgui WinRT usage
Signed-off-by: Maxim Kostin <v-maxkos@microsoft.com>
2015-06-26 23:41:39 +03:00
Maxim Kostin
face069874 Added support for highgui module on WinRT 8.1+
Signed-off-by: Maxim Kostin <v-maxkos@microsoft.com>
2015-06-26 23:41:25 +03:00
Alexander Alekhin
f56563d6fe merge to resolve conflict
Conflicts:
	samples/data/detect_blob.png
2015-06-26 19:13:40 +03:00
Alexander Alekhin
898b257261 replacement for #4160 2015-06-26 18:45:58 +03:00
Seon-Wook Park
62cad09c64 spatialGradient: Process 1 row at a time in SSE 2015-06-26 17:35:17 +02:00
Seon-Wook Park
8a21726ae5 spatialGradient: Remove an unnecessary branch in nosse code 2015-06-26 17:26:21 +02:00
Seon-Wook Park
febd0f14c6 spatialGradient: Don't dynamically alloc C array, use vector 2015-06-26 17:15:44 +02:00
Seon-Wook Park
f92e2ed57a spatialGradient: Make nosse version faster 2015-06-26 17:13:23 +02:00
Seon-Wook Park
7b01e32fe8 spatialGradient: HAL-accelerated
TODO: Make nosse ver faster than Sobel
      Make sse ver faster than Sobel for BORDER_REPLICATE
2015-06-26 16:41:00 +02:00
Seon-Wook Park
6803d1ed28 Support non continuous, BORDER_REPLICATE
TODO: HAL-accelerated code
2015-06-26 14:49:31 +02:00
Alexey Ershov
3f68787051 OpenGL OpenCL sample
057cd52 first versions: cv::ogl::convertFromGLTexture2D & cv::ogl::convertToGLTexture2D
5656e94 added autogenerated stuff for cl_gl.h
765f1fd resolved CL functions in opengl.cpp
9f9fee3 implemented function cv::ogl::ocl::initializeContextFromGLTexture2D()
a792adb cv::ogl::ocl::initializeContextFromGLTexture2D() - added linux support (glx.h)
51c2869 added missing error message in function cv::ogl::ocl::initializeContextFromGLTexture2D()
513b887 fixed extension call in function cv::ogl::ocl::initializeContextFromGLTexture2D()
475a3e9 added CL-GL interop Windows sample (gpu/opengl_interop.cpp)
07af28f added building of CL-GL interop sample - Windows only
befe3a2 fixed whitespace errors & doxygen warnings (precommit_docs)
551251a changed function name to cv::ogl::ocl::initializeContextFromGL(), removed unused argument
4d5f009 changed CL_DEVICES_FOR_GL_CONTEXT_KHR to CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR
9fc3055 changed CL_DEVICES_FOR_GL_CONTEXT_KHR to CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KH
6d31cee Revert "changed CL_DEVICES_FOR_GL_CONTEXT_KHR to CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KH"
cc6a025 added texture format check in cv::ogl::convertFromGLTexture2D()
063a2c1 CL-GL sample: added Linux implementation (Xlib/GLX)
c392ae9 fixed trailing whitespace
85a80d0 fixed include files
ae23628 excluded samples/opengl from build case 2
9870ea5 added android EGL support
530b64c added doxygen documentation comments to CL-GL interop functions
2015-06-26 14:15:12 +03:00
Alexander Alekhin
04b2edcc8c ocl: autogenerated files for cl_gl.h 2015-06-26 14:08:27 +03:00
Alexander Alekhin
ee68d26f99 ocl: update generator scripts 2015-06-26 14:08:20 +03:00
scorneli
e66a4a0e12 Fix processing of SunRaster images with negative maplength 2015-06-25 20:24:28 +02:00
Alexander Alekhin
24e2a008c3 copyTo: fix for big data (4Gb+) 2015-06-25 21:08:37 +03:00
Alexander Alekhin
eb4bd6b4fb Merge pull request #4156 from mshabunin:fix-neon-intrin 2015-06-25 17:52:14 +00:00
Alexander Alekhin
bb556b8f55 Merge pull request #4124 from ruslo:android.fix 2015-06-25 17:16:04 +00:00
Alexander Alekhin
bc544e2a70 Merge pull request #4105 from jayceelock:master 2015-06-25 17:13:03 +00:00
Maksim Shabunin
7b784fa2ea Fixed transpose intrinsic prefix for NEON 2015-06-25 18:19:23 +03:00
LaurentBerger
ca0114228c In adaptiveThreshold ADAPTIVE_THRES_GAUSSIAN_C gaussianBlur is computed using float
number
2015-06-25 07:51:06 +02:00
Stefan Cornelius
851f20e40c Fix processing of SunRaster images with negative maplength 2015-06-25 00:17:49 +02:00
Alexander Alekhin
8298644b85 Merge pull request #4151 from lupustr3:pvlasov/ipp_alignment 2015-06-24 16:45:13 +00:00
Vadim Pisarevsky
56e637d5f4 Merge pull request #4135 from lupustr3:ipp_code_refactoring 2015-06-24 16:18:55 +00:00
Maksim Shabunin
b6e5e66661 Merge pull request #4152 from mshabunin:fix-cuda-build 2015-06-24 15:31:59 +00:00
Maksim Shabunin
6eb8d0aa51 Fixed build with CUDA 2015-06-24 16:05:08 +03:00
Pavel Vlasov
e02195b3dc Accidentally removed tegra checks were returned; 2015-06-24 14:55:45 +03:00
Pavel Vlasov
e57609836c Warning fix; 2015-06-24 14:43:42 +03:00
Pavel Vlasov
101607a7d0 Imgproc_Hist_MinMaxVal.accuracy fix;
Some code style corrections;
2015-06-24 13:50:17 +03:00
Pavel Vlasov
8439b5942b Proper IPP alignment; 2015-06-24 09:21:35 +03:00
Alexander Alekhin
53fc5440d7 implement singleton lazy initialization 2015-06-23 14:38:45 +03:00
Vadim Pisarevsky
7761331a75 Merge pull request #4146 from LaurentBerger:MvDetectBlobPNG 2015-06-23 11:19:39 +00:00
LaurentBerger
56b2b450ce A new constant in adaptivethreshold is created to calculate
gaussianBlur with CV_32F. hence rouding error are avoided
2015-06-22 22:21:30 +02:00
Alexander Alekhin
c8167c0b99 fix cyclic deps error (world,shared) 2015-06-22 20:14:30 +03:00
LaurentBerger
2f8ef61618 move data/detect_blob.png in samples/data 2015-06-22 17:51:01 +02:00
Vadim Pisarevsky
945aa06f58 Merge pull request #4111 from mshabunin:fix-flann-access 2015-06-22 11:53:32 +00:00
Vadim Pisarevsky
707d10f115 Merge pull request #4137 from asmorkalov:as/ros_conflict 2015-06-22 11:52:05 +00:00
Vadim Pisarevsky
81e1c043cc Merge pull request #4142 from sturkmen72:patch-2 2015-06-22 11:51:39 +00:00
Vadim Pisarevsky
bd90425f71 Merge pull request #4136 from alalek:fix_matallocator_destruction 2015-06-22 11:49:36 +00:00
jayceelock
0f59bbbee6 Fixed gen_pattern.py file permission back to 755 2015-06-22 08:41:44 +02:00
Alexander Alekhin
a1cdbd4d84 Merge pull request #4140 from mshabunin:fix-java-package 2015-06-20 14:20:54 +00:00
Alexander Alekhin
73031f9ab0 Merge pull request #4143 from Dikay900:ffmpeg_dict 2015-06-20 14:19:51 +00:00
Suleyman TURKMEN
d64c8aad99 Update mat.hpp
spelling corrections
2015-06-20 11:18:47 +03:00
Dikay900
902e381264 fix one dict parameter in ffmpeg implementation (introduced while porting) 2015-06-20 10:17:34 +02:00
Seon-Wook Park
2ff614dfab spatialGradient: Per row in outer loop 2015-06-19 19:25:07 +02:00
Maksim Shabunin
83b2621de4 Android: renamed default library name for static and dynamic fallback load; fixed libz import for 64-bit platforms 2015-06-19 18:53:45 +03:00
Alexander Alekhin
83a4ad5f51 Merge branch '2.4.9.x-prep' into 2.4 2015-06-19 14:55:38 +03:00
Alexander Alekhin
e7b82a8561 Merge branch '2.4.8.x-prep' into 2.4 2015-06-19 14:54:18 +03:00
Alexander Alekhin
59ed7d06bf Merge pull request #4072 from vladimir-dudnik:opencl-opencv-interop 2015-06-19 13:36:40 +03:00
Vladimir Dudnik
217dd63e02 OpenCV-OpenCL interop (PR #4072):
Commits:
added new function, cv::ocl::attachContext(String& platformName, void* platformID, void* context, void* deviceID) which allow to attach externally created OpenCL context to OpenCV.
add definitions of clRetainDevice, clRetainContext funcs
removed definitions for clRetainContext, clRetainDevice
fixed build issue under Linux
fixed uninitialized vars, replace dbgassert in error handling
remove function which is not ready yet
add new function, cv::ocl::convertFromBuffer(int rows, int cols, int type, void* cl_mem_obj, UMat& dst, UMatUsageFlags usageFlags = cv::USAGE_DEFAULT) which attaches user allocated OpenCL clBuffer to UMat
uncommented clGetMemObjectInfo definition (otherwise prevent opencv build)
fixed build issue on linux and android
add step parameter to cv::ocl::convertFromBuffer func
suppress compile-time warning
added sample opencl-opencv interoperability (showcase for cv::ocl::convertFromBuffer func)
CMakeLists.txt modified to not create sample build script if OpenCL SDK not found in system
fixed build issue (apple opencl include dir and spaces in CMake file)
added call to clRetainContext for attachContext func and call to clRetainMemObject for convertFromBuffer func
uncommented clRetainMemObject definition
added comments and cleanup
add local path to cmake modules search dirs (instead of replacing)
remove REQUIRED for find_package call (sample build together with opencv). need to try standalone sample build
opencl-interop sample moved to standalone build
set minimum version requirement for sample's cmake to 3.1
put cmake_minimum_required under condition, so do not check if samples not builded
remove code dups for setSize, updateContinuityFlag, and finalizeHdr
commented out cmake_minimum_required(VERSION 3.1)
add safety check for cmake version
add convertFromImage func and update opencl-interop sample
uncommented clGetImageInfo defs
uncommented clEnqueueCopyImageToBuffer defs
fixed clEnqueueCopyImageToBuffer defs
add doxygen comments
remove doxygen @fn tag
try to restart buildbot
add doxygen comments to directx interop funcs
remove internal header, use fwd declarations in affected compile units instead
2015-06-19 13:33:22 +03:00
Seon-Wook Park
e633c991b0 spatialGradient: Doc, fix dangling newline error 2015-06-19 04:57:01 +02:00
Seon-Wook Park
815cd8970d spatialGradient: Remove unnecessary index calculation 2015-06-19 04:46:17 +02:00
Seon-Wook Park
b5c4355c13 spatialGradient: Add basic perf test 2015-06-19 04:29:28 +02:00
Seon-Wook Park
f9c4c96663 spatialGradient: Reduce temporary vectors 2015-06-19 04:29:07 +02:00
Seon-Wook Park
a2dbd2f10e spatialGradient: Less vector loads 2015-06-19 04:07:18 +02:00
Seon-Wook Park
88bc88125a spatialGradient: Vectorise inner area 2015-06-19 03:36:49 +02:00
Seon-Wook Park
770e742e04 spatialGradient: Add non-SSE version 2015-06-19 02:56:51 +02:00
Seon-Wook Park
11fb1f74cc spatialGradient: Add asserts 2015-06-19 01:23:01 +02:00
Alexander Alekhin
6ab9df5208 Merge pull request #4132 from mshabunin:fix-java-package 2015-06-18 16:13:23 +00:00
Seon-Wook Park
9f1c641199 spatialGradient: Add test class and Sobel proxy method 2015-06-18 17:42:32 +02:00
Maksim Shabunin
00fb8a3abf Merge pull request #4103 from mtamburrano:master 2015-06-18 11:41:13 +00:00
Alexander Alekhin
032b6322fc fix MatAllocator creation/destruction issues 2015-06-18 14:02:01 +03:00
Dmitry Budnikov
a5a21019b2 ipp_countNonZero build fix;
Removed IPP port for tiny arithm.cpp functions

Additional warnings fix on various platforms.

Build without OPENCL and GCC warnings fixed

Fixed warnings, trailing spaces and removed unused secure_cpy.

IPP code refactored.

IPP code path  implemented as separate static functions to simplify future work with IPP code and make it more readable.
2015-06-18 12:47:07 +03:00
manuele
a55a8c9aa5 Enable NEON optimization for cvRound on newer devices 2015-06-18 11:19:46 +02:00
Maksim Shabunin
b98a54fbe0 Merge pull request #4133 from ruslo:interface.sample 2015-06-18 08:40:56 +00:00
Maksim Shabunin
11ca4e61a7 Merge pull request #4134 from alalek:fix_get_target_property 2015-06-18 08:36:55 +00:00
Maksim Shabunin
2bc16e83d6 Merge pull request #4128 from alalek:fix_noipp_build 2015-06-18 08:32:31 +00:00
Alexander Alekhin
f11ed4b91d fix "non target" warning for "world" build 2015-06-17 20:07:56 +03:00
Alexander Alekhin
80bd67c36b Merge pull request #4125 from ruslo:interface.include.dirs 2015-06-17 16:04:46 +00:00
Ruslan Baratov
83b882039e Update samples/cpp/example_cmake: no need to use include_directories 2015-06-17 17:53:05 +02:00
Maksim Shabunin
a816a4b964 Updated android manager readme file 2015-06-17 18:10:29 +03:00
Maksim Shabunin
bfa77ff5a4 Increase android samples versions 2015-06-17 18:10:28 +03:00
Maksim Shabunin
c79ad45fce Added interface libraries for android opencv_java 2015-06-17 18:10:28 +03:00
Maksim Shabunin
48cc53bf2e Updated android toolchain 2015-06-17 18:10:28 +03:00
Maksim Shabunin
f63dde2f43 Separate OpenCV.mk files for different ABIs 2015-06-17 18:10:28 +03:00
Maksim Shabunin
7bfd070864 Merge pull request #4095 from alalek:hal_unresolved_symbols 2015-06-17 14:35:40 +00:00
Alexander Alekhin
1ce0ef9d41 fix build without IPP (and empty 3rdparty) 2015-06-17 17:24:35 +03:00
Ruslan Baratov
f30bf39bd4 Add OpenCV_INCLUDE_DIRS to INTERFACE_INCLUDE_DIRECTORIES target property
With this fix there is no need to add includes by using
`include_directories(${OpenCV_INCLUDE_DIRS})`. Directory will be added by
command `target_link_libraries(... ${OpenCV_LIBS})` automatically.
2015-06-17 16:03:21 +02:00
Vadim Pisarevsky
bf8434770f Merge pull request #4115 from themightyoarfish:MatToUIImage_transparency 2015-06-17 11:59:33 +00:00
Vadim Pisarevsky
e055128d0d Merge pull request #4099 from sash-kan:fix.2822 2015-06-17 11:58:40 +00:00
Vadim Pisarevsky
66216ea2be Merge pull request #4093 from mshabunin:python-bases 2015-06-17 11:55:07 +00:00
Vadim Pisarevsky
d882797fbd Merge pull request #4100 from alalek:fix_ffmpeg 2015-06-17 11:29:33 +00:00
Vadim Pisarevsky
220bb14d10 Merge pull request #4114 from alalek:ocl_generator_error_processing 2015-06-17 11:26:53 +00:00
Vadim Pisarevsky
0824ed595b Merge pull request #4090 from MSOpenTech:highgui_winrt 2015-06-17 11:22:41 +00:00
Vadim Pisarevsky
fd225469bc Merge pull request #4122 from alalek:fix_issue_3891 2015-06-17 11:13:27 +00:00
Alexander Alekhin
12e6efc6e4 Merge pull request #4123 from rajithr:patch-1 2015-06-17 10:11:50 +00:00
Ruslan Baratov
0fcc5face3 Fix `cmake -E touch classes.jar' step
`-E touch` command doesn't create intermediate directories. We have to do it
manually using `file(MAKE_DIRECTORY ...)` command.
2015-06-17 12:11:11 +02:00
themightyoarfish
125782c061 fixed copy-paste errors 2015-06-17 12:08:34 +02:00
Maksim Shabunin
fef7509eed NumpyAllocator: check reference count before actual release, revert flann changes 2015-06-17 12:07:57 +03:00
Alexander Smorkalov
546e68dc65 Merge pull request #4034 from jet47:opencv_run_all_tests_unix 2015-06-17 08:19:47 +00:00
rajithr
510dec4927 Fixing resource leaks 2015-06-17 11:07:49 +05:30
Alexander Alekhin
9394486147 fix issue 3891 2015-06-16 18:53:58 +03:00
Vadim Pisarevsky
01c3ed6157 Merge pull request #4108 from Reen:patch-1 2015-06-16 13:26:47 +00:00
Vadim Pisarevsky
b7c2a46830 Merge pull request #4107 from SpecLad:libav-compat 2015-06-16 13:22:40 +00:00
Vadim Pisarevsky
719099ad6d Merge pull request #4104 from SpecLad:arm64-packaging 2015-06-16 13:19:11 +00:00
Vadim Pisarevsky
a003d1d758 Merge pull request #4109 from alalek:fix_build_dbt_bindings 2015-06-16 13:06:36 +00:00
Vadim Pisarevsky
2e9004813e Merge pull request #4088 from howtobeahacker:2.4 2015-06-16 12:31:13 +00:00
Vadim Pisarevsky
f824db4803 Merge pull request #4119 from D-Alex:master 2015-06-16 12:29:44 +00:00
Vadim Pisarevsky
0c67c6c136 Merge pull request #4112 from sturkmen72:patch-1 2015-06-16 12:18:13 +00:00
Vadim Pisarevsky
f846bb2b49 Merge pull request #4121 from sbokov:addingAloeGT 2015-06-16 12:15:27 +00:00
Vadim Pisarevsky
e79c184b2d Merge pull request #4116 from alalek:fix-pthread-pf 2015-06-16 12:08:42 +00:00
Maxim Kostin
6724a0b8cd Added dummy highgui WinRT implementation 2015-06-15 15:59:16 +03:00
sbokov
5123c3e52e Added ground-truth disparity map for 'aloe' 2015-06-14 23:59:48 +03:00
Alexander Duda
def2256609 cv::stereoRectify: fix segfault in case of empty distCoeffs
cvStereoRectify assumes that NULL is provided in case of no distCoeffs
2015-06-12 13:50:43 +02:00
Jaime Fernandez
c613ee2da4 BUG: ndarray to Mat conversion with NPY_RELAXED_STRIDES set
Add logic to avoid nonsense strides when dimension size is 1 and
NumPy is built with NPY_RELAXED_STRIDES from tripping OpenCV.
2015-06-11 09:41:12 -07:00
Alexander Alekhin
a482dcce46 fix support for pthreads parallel_for 2015-06-11 16:53:07 +03:00
themightyoarfish
d647261de2 Fixed alpha preservation when converting 4-channel Mat to UIImage 2015-06-11 14:59:57 +02:00
Alexander Alekhin
b7cfd5a7da ocl: added errors processing in OpenCL code generator, resolve space issue 2015-06-11 15:36:29 +03:00
Suleyman TURKMEN
caa0058d5b Update imgproc.hpp 2015-06-11 11:46:42 +03:00
Suleyman TURKMEN
dac715ad1f Update imgproc.hpp 2015-06-11 11:03:14 +03:00
Suleyman TURKMEN
061131a5ee Update imgproc.hpp 2015-06-10 13:18:40 +03:00
Maksim Shabunin
26d9a7cd40 Trying to fix flann python wrapper issue 2015-06-10 13:00:36 +03:00
Alexander Alekhin
caaf60ba00 remove bindings generation for DetectionBasedTracker 2015-06-09 19:01:04 +03:00
René
3e2515d735 Fix bug in distanceATS_L1_8u and typos.
The inner loop of the backward scan got the wrong initial "a".
2015-06-09 17:23:22 +02:00
Alexander Alekhin
3f2666778a videoio: fix some issues in ffmpeg error processing 2015-06-09 16:30:57 +03:00
Alexander Alekhin
959d575292 videoio: update ffmpeg backend
- fix compilation for old libraries
- update codec/tag selection logic
- add documentation note about MP4 container tags
2015-06-09 16:30:57 +03:00
Vincent Rabaud
50842b9036 get code to compile on Ubuntu Saucy
A define was forgotten for the codecs and there was a typo for
another.

(cherry picked from commit f052b0bc4d2619daafe5c56d91fc4a6cb00b8b7c)

Conflicts:
	modules/videoio/src/ffmpeg_codecs.hpp
2015-06-09 15:53:08 +03:00
Vadim Pisarevsky
3d6413cfc6 fixed compile warnings; hopefully fixed test failures
(cherry picked from commit 30912b49f3514895efbc597da89e6421bf08e60b)

Conflicts:
	modules/videoio/src/cap_ffmpeg_impl.hpp
	modules/videoio/src/ffmpeg_codecs.hpp
2015-06-09 15:53:08 +03:00
Vadim Pisarevsky
799622affd make sure opencv builds fine with the recent versions of libav (e.g. from Ubuntu 14.10)
(cherry picked from commit 2b2e3ee93c6788b892b084cc04d0ead5ab75c197)

Conflicts:
	cmake/OpenCVFindLibsVideo.cmake
	modules/videoio/src/cap.cpp
	modules/videoio/src/cap_ffmpeg_impl.hpp
	modules/videoio/src/ffmpeg_codecs.hpp
	modules/videoio/test/test_ffmpeg.cpp
2015-06-09 15:53:08 +03:00
Alexander Smorkalov
57ab0d4d17 Debian packages header update to fix conflict with OpenCV from deb repo. 2015-06-09 14:59:12 +03:00
Maksim Shabunin
1f983ec39c Fixed compilation of pthread-based parallel_for with gcc 4.4.3 2015-06-09 13:59:48 +03:00
jayceelock
a345d16cc1 Changed to allow for ISO page size selection, checkerboard pattern now centres itself properly in middle of the page 2015-06-09 11:35:48 +02:00
Roman Donchenko
02f8b85dd9 Add ARM64 packaging support 2015-06-08 18:03:08 +03:00
Roman Donchenko
1fbdca0c9b Set CPACK_DEBIAN_PACKAGE_ARCHITECTURE instead of CPACK_DEBIAN_ARCHITECTURE
Because that's the variable actually used by CPack.
2015-06-08 18:03:07 +03:00
alexander barakin (aka sash-kan)
0d821f04fd fix icvCloseCAM_V4L wrong order of code blocks
this patch fixes bug http://code.opencv.org/issues/2822 .
based on disussion (in russian):
http://ru.stackoverflow.com/a/428398/178576

Signed-off-by: alexander barakin (aka sash-kan) <alex@barak.in>
2015-06-06 14:41:00 +03:00
Alexander Alekhin
8184e57dd6 fix tests build (win,shared,world) 2015-06-05 16:30:36 +03:00
Maksim Shabunin
78ddc567f9 Python generator: moved base class handling to the generate step 2015-06-05 12:41:23 +03:00
Maksim Shabunin
424c2bddb3 Merge tag '3.0.0'
OpenCV 3.0.0

* tag '3.0.0':
  Version for 3.0.0 release
2015-06-04 14:54:50 +03:00
Maksim Shabunin
c12243cf4f Version for 3.0.0 release 2015-06-03 20:21:34 +03:00
Maksim Shabunin
39fdcf4df3 Merge pull request #4083 from mshabunin:java-engine 2015-06-03 17:17:36 +00:00
Maksim Shabunin
fd1b30fc6f Merge pull request #4089 from alalek:video_mp4 2015-06-03 17:16:52 +00:00
Maksim Shabunin
7ee79b73f6 AndroidMgr: fixed package build 2015-06-03 19:01:48 +03:00
Alexander Alekhin
1f3043f618 videoio: VideoWriter H264/.mp4 support via ffmpeg/libav 2015-06-03 18:35:12 +03:00
Maksim Shabunin
1d7d22e117 AndroidMgr: fixed library version check 2015-06-03 12:47:42 +03:00
howtobeahacker
9eaac6105f correct covariation matrix formula in Harris corner detector 2015-06-03 17:33:40 +08:00
Maksim Shabunin
33ab9ea188 AndroidMgr: fixed typos and package name 2015-06-03 11:53:29 +03:00
Ignas Daukšas
af62624849 Add cameraMatrix parameter to findEssentialMat and recoverPose 2015-06-03 10:50:33 +03:00
Vadim Pisarevsky
8ad6ba82fc Merge pull request #4084 from berak:patch-2 2015-06-03 07:25:51 +00:00
Vadim Pisarevsky
83ace8d580 Merge pull request #4085 from berak:patch-3 2015-06-03 07:25:17 +00:00
berak
851ce27240 http://code.opencv.org/issues/4359 2.4 branch 2015-06-03 07:48:29 +02:00
berak
737a1e2f12 http://code.opencv.org/issues/4359, for master 2015-06-03 07:44:46 +02:00
Vadim Pisarevsky
850e3c1ca2 Merge pull request #4082 from diogorolo:patch-1 2015-06-02 19:11:54 +00:00
Maksim Shabunin
7541c590e5 AndroidMgr: Reversed file existence checking 2015-06-02 18:34:30 +03:00
Maksim Shabunin
caffbaafbe Updated Manager for Android 2015-06-02 17:33:04 +03:00
Diogo Rolo
f57fb2375e Update cuda.markdown
Small typo fix in the documentation.
It was written 'devie' instead of 'device' in: 'Switching active device can be done using cuda::setDevice() function'
2015-06-02 14:34:15 +01:00
Vadim Pisarevsky
a28c8d002d Merge pull request #4081 from vpisarev:30_small_fixes 2015-06-02 08:36:03 +00:00
Vadim Pisarevsky
a4073ed676 made improvements in ECC code (comments from https://github.com/Itseez/opencv/pull/3845), as well as minor tweak in pthread's based parallel for. 2015-06-02 01:30:00 +03:00
Vadim Pisarevsky
78e07d3210 Merge pull request #3845 from ellbur:findTransformECC-mask 2015-06-01 20:35:29 +00:00
Vadim Pisarevsky
41af58d1d5 Merge pull request #4076 from kalistratovag:parallel_pthreads 2015-06-01 16:53:50 +00:00
kalistratovag
bf5393ae58 parallel for on pthreads initial commit
removing trailing whitespaces

Compilation error on Mac fix & warning on android

Warnings fixed on iOs
2015-06-01 17:48:21 +03:00
Vadim Pisarevsky
b866e2672a Merge pull request #4079 from Dikay900:2_4_to_master 2015-06-01 11:42:18 +00:00
Alexander Smorkalov
1df0f1da97 Precise default CUDA version for Tegra X1 chips. 2015-05-30 23:30:56 +02:00
Vadim Pisarevsky
535dc1e874 Merge pull request #3998 from msandler:master 2015-05-29 21:38:09 +00:00
Vadim Pisarevsky
24dea1c616 Merge pull request #3984 from LaurentBerger:ExampleCppORB 2015-05-29 21:36:43 +00:00
Vadim Pisarevsky
70f8d807c8 Merge pull request #4003 from uwinsoftware:2.4 2015-05-29 18:55:55 +00:00
Vadim Pisarevsky
96c3f16a90 Merge pull request #4075 from MSOpenTech:backslash-upd 2015-05-29 13:23:23 +00:00
Evgeny Agafonchikov
fd860d7cd0 Adding backslash in macro-based paths
of WINRT samples

This removes requirement to add OPENCV_WINRT_INSTALL_DIR with backslash in the end

in case trailing slash is presented VS handles duplicated slashes w/o issues
2015-05-29 09:36:42 +03:00
Vadim Pisarevsky
b46719b093 Merge pull request #4074 from vpisarev:objdetect_fixes 2015-05-28 19:43:51 +00:00
Vadim Pisarevsky
8b8fc9e66b Merge pull request #4070 from techfort:fixpythonsample 2015-05-28 18:06:17 +00:00
Vadim Pisarevsky
882c0321f4 clip the found objects in HOG as well (http://code.opencv.org/issues/3825); added test to check CascadeClassifier on small images (http://code.opencv.org/issues/3710) 2015-05-28 21:02:27 +03:00
Vadim Pisarevsky
8c3c6b31fc make sure the returned rectangles are inside the image (http://code.opencv.org/issues/3136) 2015-05-28 20:15:22 +03:00
Vadim Pisarevsky
5a94a95fbf improvements in Haar CascadeClassifier: 1) use CV_32S instead of CV_32F for the integral of squares (which is more accurate and more efficient); 2) skip the window if its contrast is too low 2015-05-28 19:33:21 +03:00
Vadim Pisarevsky
036c438904 make facedetect.py work when the nested cascade is not specified 2015-05-28 19:01:56 +03:00
Vadim Pisarevsky
5e095c8fbd Merge pull request #4022 from LaurentBerger:ExampleBLOB_MSER 2015-05-28 15:00:36 +00:00
Vadim Pisarevsky
665a317f1c Merge pull request #4056 from apavlenko:java_memory_release 2015-05-28 15:00:07 +00:00
Vadim Pisarevsky
daa21a4385 Merge pull request #4057 from apavlenko:24_java_memory_release 2015-05-28 14:59:46 +00:00
Vadim Pisarevsky
f7ad192842 Merge pull request #4063 from Dikay900:2_4_to_master 2015-05-28 14:49:13 +00:00
Vadim Pisarevsky
58cf11bd44 Merge pull request #4069 from MSOpenTech:sample-face-contrib 2015-05-28 14:48:00 +00:00
Vadim Pisarevsky
549ef8f141 Merge pull request #4071 from sergarrido:fix_isContourConvex 2015-05-28 14:44:36 +00:00
Vadim Pisarevsky
176dd96698 Merge pull request #4073 from MSOpenTech:video-sample-face 2015-05-28 14:41:40 +00:00
Vadim Pisarevsky
5f8f56ea0e report an error when trying to load HOG cascade 2015-05-28 17:24:22 +03:00
Joe Minichino
47d8187bc3 fixed outdated params setting 2015-05-28 15:20:08 +01:00
Vadim Pisarevsky
481f786fe7 added simple HAL test; added RHO homography test 2015-05-28 17:05:43 +03:00
Maxim Kostin
3408114602 Added video face detection. Restructured code.
Signed-off-by: Maxim Kostin <v-maxkos@microsoft.com>
2015-05-28 13:42:59 +03:00
S. Garrido
bd2c2f3bd1 fix isContourConvex 2015-05-27 20:51:53 +02:00
Joe Minichino
a4a2659dff fixed digits.py sample to work with opencv 3 2015-05-27 15:43:52 +01:00
Maxim Kostin
aa932eab41 Adding WinRT face tracking sample. Works with asset images. Created by @ericmitt.
Signed-off-by: Maxim Kostin <v-maxkos@microsoft.com>
2015-05-27 14:55:47 +03:00
Vadim Pisarevsky
565d3dde40 Merge pull request #4055 from rajithr:patch-1 2015-05-27 11:50:58 +00:00
Vadim Pisarevsky
85c08dd170 Merge pull request #4065 from gongzg:master 2015-05-27 11:26:57 +00:00
Vadim Pisarevsky
8bc21fc2f0 Merge pull request #4067 from PhilLab:patch-3 2015-05-27 11:24:35 +00:00
Vadim Pisarevsky
57c3e917e2 Merge pull request #4068 from PhilLab:patch-4 2015-05-27 11:24:17 +00:00
rajithr
7658c2e2d5 Fix for a potential data race condition
code changes to handle the failed build
2015-05-27 15:12:04 +05:30
rajithr
993e0b0bf9 Fix for a potential data race condition 2015-05-27 15:00:21 +05:30
Philipp Hasper
9aaa27d46b Adding missing docs for VideoWriter::release 2015-05-27 07:55:41 +02:00
Philipp Hasper
6c55e7c039 Fixed doc typo 2015-05-27 07:34:27 +02:00
Vadim Pisarevsky
1df244b6f4 Merge pull request #4062 from ilya-lavrenov:android_master 2015-05-26 17:24:32 +00:00
Vadim Pisarevsky
13cef0cdfc Merge pull request #4061 from ilya-lavrenov:android 2015-05-26 17:24:05 +00:00
Alexander Alekhin
75558ae75c Merge pull request #4058 from mshabunin:latch-sample 2015-05-26 16:26:57 +00:00
Andrew Senin
eb40dde688 Fixing XIMEA parameters mapping (issue #4176)
Conflicts:
	modules/highgui/src/cap_ximea.cpp
2015-05-26 18:08:29 +02:00
Ilya Lavrenov
bb72206ec5 ability to enable OpenMP simultaneously with other parallel framework 2015-05-26 18:08:28 +02:00
Samyak Datta
e9c765ee2c C++ sample code to detect facial features 2015-05-26 18:08:26 +02:00
StevenPuttemans
83723c15be added extra BUFFERSIZE doc and getter
Conflicts:
	modules/highgui/doc/reading_and_writing_images_and_video.rst
	modules/highgui/src/cap_dc1394_v2.cpp
2015-05-26 18:08:25 +02:00
StevenPuttemans
8454a8f2d1 adding extra buffer parameter
Conflicts:
	modules/highgui/include/opencv2/highgui/highgui_c.h
	modules/highgui/src/cap_dc1394_v2.cpp

fix typo
2015-05-26 18:08:22 +02:00
StevenPuttemans
6aedd4f7b0 fixing SVM negative value rounding
Conflicts:
	modules/objdetect/src/hog.cpp

fix android build
2015-05-26 17:26:30 +02:00
Vicente Olivert Riera
e96b8ce781 superres: Fix return value VideoFrameSource_GPU
superres module fails to compile with the following error messages:

[100%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/super_resolution.cpp.o
/opencv-2.4.10/modules/superres/src/frame_source.cpp: In function 'cv::Ptr<cv::superres::FrameSource> cv::superres::createFrameSource_Video_GPU(const string&)':
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:16: error: expected type-specifier before 'VideoFrameSource'
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:16: error: could not convert '(int*)operator new(4ul)' from 'int*' to 'cv::Ptr<cv::superres::FrameSource>'
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:16: error: expected ';' before 'VideoFrameSource'
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:41: error: 'VideoFrameSource' was not declared in this scope
/opencv-2.4.10/modules/superres/src/frame_source.cpp:264:1: error: control reaches end of non-void function [-Werror=return-type]
cc1plus: some warnings being treated as errors
make[3]: *** [modules/superres/CMakeFiles/opencv_superres.dir/src/frame_source.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....

This is caused because the return value of the createFrameSource_Video_GPU function should be a VideoFrameSource_GPU object.
Conflicts:
	modules/superres/src/frame_source.cpp
2015-05-26 16:54:35 +02:00
Ilya Lavrenov
b0cbec922b port of MR #4061 to master 2015-05-26 17:47:03 +03:00
Ilya Lavrenov
083aced3b4 fixed OS names 2015-05-26 17:41:23 +03:00
Zhigang Gong
0f7de40e66 Fixed the race condition between inc and dec on the l_counter.
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
2015-05-26 22:06:18 +08:00
Maksim Shabunin
5ad4bed70a Added cvconfig.h copy during the build 2015-05-26 15:58:27 +03:00
Maksim Shabunin
330b3e87eb Fixed latch sample build without contrib 2015-05-26 15:57:07 +03:00
Vadim Pisarevsky
8fb37606f6 Merge pull request #4032 from mshabunin:fix-pkg-config 2015-05-26 12:47:14 +00:00
Vadim Pisarevsky
dc587992a0 Merge pull request #4053 from vpisarev:calib3d_fixes 2015-05-26 11:23:50 +00:00
Andrey Pavlenko
72ec9c159e releasing native memory of temp Mat objects in generated Java code 2015-05-26 13:58:54 +03:00
Andrey Pavlenko
5b00d9da49 releasing native memory in Java converters 2015-05-26 13:58:35 +03:00
Andrey Pavlenko
c1c03e16f4 releasing native memory of temp Mat objects in generated Java code 2015-05-26 13:50:56 +03:00
Andrey Pavlenko
6006790c18 releasing native memory in Java converters 2015-05-26 13:10:54 +03:00
Vadim Pisarevsky
bb2e40b999 for some reason Calib3d_Homography.fromImages on ARM gives much smaller number of inliers than on x86/x64. Need to investigate more carefully, but let's decrease the tolerance threshold for now 2015-05-26 12:43:18 +03:00
Vadim Pisarevsky
b1a8e4f760 Merge pull request #4054 from gongzg:master 2015-05-26 07:46:03 +00:00
Vadim Pisarevsky
ca1d8c1737 fixed another compile warning from MSVC 2015-05-26 10:29:13 +03:00
rajithr
ff6881efbf Fix for a potential data race condition 2015-05-26 11:31:31 +05:30
Zhigang Gong
3c85200989 Avoid negative index for a local buffer in Canny.cl.
int pix_per_thr = l_counter / LOCAL_TOTAL + ((lid < mod) ? 1 : 0);
The pix_per_thr * LOCAL_TOTAL may be larger than l_counter.
Thus the index of l_stack may be negative which may cause serious
problems. Let's skip the loop when we get negative index and we need
to add back the lcounter to keep its balance and avoid potential
negative counter.

Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
2015-05-26 08:48:05 +08:00
Vadim Pisarevsky
e944533f01 fixed compile warnings; reenabled solvePnPRansac.concurrency test 2015-05-26 00:19:58 +03:00
Vadim Pisarevsky
85149f8686 hack solvePoly to finds roots of polynoms with zero higher-order coefficients. The roots are populated in this case, which is not valid, strictly speaking, but good enough for function like correctMatches. This solves http://code.opencv.org/issues/4330 2015-05-25 23:43:39 +03:00
Vadim Pisarevsky
a12ec66a04 fixed useExtrinsicGuess=true case with single-precision input (http://code.opencv.org/issues/2734) 2015-05-25 22:40:10 +03:00
Vadim Pisarevsky
9d90b0549c fixed bug http://code.opencv.org/issues/3882 2015-05-25 22:03:25 +03:00
Vadim Pisarevsky
3bc5958c58 added tests for http://code.opencv.org/issues/4011 and http://code.opencv.org/issues/3057; fixed random subset generation in both methods to increase chance for a good subset 2015-05-25 21:46:05 +03:00
Vadim Pisarevsky
2952c10ced Merge pull request #4049 from mshabunin:transition-hint 2015-05-25 17:06:50 +00:00
Maksim Shabunin
55d1f0b7d6 Transition guide: removed one of the version check methods 2015-05-25 18:05:20 +03:00
Vadim Pisarevsky
60064b3de7 Merge pull request #4015 from GilLevi:AddingLATCH 2015-05-25 13:09:49 +00:00
Vadim Pisarevsky
02eb8e7c70 Merge pull request #4052 from ilya-lavrenov:typo 2015-05-25 13:07:34 +00:00
Vadim Pisarevsky
786d62e3e5 Merge pull request #4051 from Dikay900:2_4_to_master_2 2015-05-25 13:06:37 +00:00
Ilya Lavrenov
13cd052990 typo 2015-05-25 11:21:02 +03:00
GilLevi
a4e5b09ea4 fixed whitespace issue 2015-05-25 01:28:05 +03:00
Andreas Stührk
3ec0e0943c TIFF loader: Allocate large enough buffer when (bpp * ncn) > 8.
Conflicts:
	modules/highgui/src/grfmt_tiff.cpp

floodfill return value removed
2015-05-24 14:06:33 +02:00
Vladislav Vinogradov
653810e4df fix installation layout for debian packages:
Install symlinks to shared libraries as a part of development package,
not runtime package.

It is default behavior for debian packages.
2015-05-24 14:06:32 +02:00
Ilya Lavrenov
efa2baed83 TCP instead of UDP
Conflicts:
	modules/highgui/src/cap_ffmpeg_impl.hpp
2015-05-24 14:06:30 +02:00
Andreas Stührk
c9481b0fd7 Don't allocate lots of memory when reading TIFFs with infinite rows per strip.
Some TIFF images consist of only one strip. The magic value 2**32-1 for the
"rows per strip" tag reflects that fact, effectively meaning "infinite".

Conflicts:
	modules/highgui/src/grfmt_tiff.cpp
	modules/highgui/test/test_grfmt.cpp

fix whitespace

fix compile error
2015-05-24 14:06:20 +02:00
Niklas Frisk
8138e26163 Fixes #3910, flags in _prepareImgAndDrawKeypoints are now binary OR'ed instead of added.
Conflicts:
	modules/features2d/src/draw.cpp
2015-05-24 13:31:11 +02:00
Alexander Smorkalov
a04a0514b9 Turn off superres accuracy tests if video i/o is not supported. 2015-05-24 13:31:09 +02:00
Alexander Smorkalov
a9ae0c8e82 Test fisheye.rectify disabled for Tegra. 2015-05-24 13:31:08 +02:00
jormansa
3c2e12a744 bug fixed
Conflicts:
	modules/highgui/src/cap_ffmpeg_impl.hpp
2015-05-24 13:31:07 +02:00
StevenPuttemans
cb55d60f98 fixing GT and GE comparison symbol
Conflicts:
	modules/gpu/doc/per_element_operations.rst
2015-05-24 13:31:06 +02:00
Alexander Smorkalov
6e1a595342 GCC 4.8 warning array subscript is above array bounds fixed.
tiff test fixed
2015-05-24 13:31:01 +02:00
Alexander Smorkalov
5141141e2b Deb package build fix for CUDA 6.5 and newer.
(cherry picked from commit e650d87e470b2e6a8f87ad4dd81977748a136aee)
(cherry picked from commit ca9c52ac9778d01eba933a786b4303c79d0162be)

Conflicts:
	cmake/OpenCVPackaging.cmake
2015-05-24 11:55:47 +02:00
Martijn Liem
7e6947a940 Bugfix for bug #3767
Fixed a memory leak in cap_dshow.cpp in videoInput::setVideoSettingCamera(). The leak was caused by not releasing an IBaseFilter object created in a call to getDevice(). Tho object is now properly released.

Conflicts:
	modules/highgui/src/cap_dshow.cpp
2015-05-24 11:55:46 +02:00
Vadim Pisarevsky
bb989f2034 Merge pull request #4050 from Dikay900:2_4_to_master 2015-05-24 09:30:46 +00:00
Ruslan Baratov
9c8255feeb Doc: fix definition of macro CV_MAKETYPE
At least this is how it's defined in core/types_c.h

Conflicts:
	modules/core/doc/intro.rst
2015-05-23 19:09:34 +02:00
Leonid Beynenson
4f95e6c70b Fixed bug in cv::detail::waveCorrect
The function makes wave correction of a stitched panorama.
Earlier it gave wrong results for panorama made from 1 frame.
2015-05-23 19:09:33 +02:00
Camille
55a5e6be2c bug fix 3696 2015-05-23 19:09:31 +02:00
Mike Maraya
607d3b54ce Fixes resizeWindow() on OS X (Bug #3200) 2015-05-23 17:36:46 +02:00
Dikay900
7ca0557b40 typos in comments 2015-05-23 17:36:45 +02:00
Aleksandr Petrikov
25b4cface0 add NEON realization for StereoBM(findCorrespondence, prefilterXSobel)
Conflicts:
	modules/calib3d/src/stereobm.cpp

Add CV_Assert (ndisp % 8 == 0) to NEON version
2015-05-23 17:36:44 +02:00
Ehren Metcalfe
e9bc9c47c2 Fix resource leak with iOS camera due to failure to remove AVCaptureSession input/outputs on stop (Bug #3389)
Conflicts:
	modules/highgui/src/cap_ios_abstract_camera.mm
2015-05-23 17:36:42 +02:00
aletheios
6a50a51b4e Bugfix #3705: params.setRecordingHint(true) breaks camera preview on Samsung Galaxy S2 2015-05-23 17:36:41 +02:00
Jüri Aedla
22c0238bf1 Android camera qcom HAL doesn't like it when no consumer usage bits are set. Set a usage bit for preview BufferQueue. 2015-05-23 17:36:39 +02:00
Alexander Smorkalov
acbc7362db Bug #3611 Initializing static cv::Mat with cv::Mat::zeros causes segmentation fault fixed.
fix MatOpInitializer
2015-05-23 17:36:35 +02:00
Vadim Pisarevsky
2466ca02bf removed cameraMatrix modification in the currently disabled uPnP algorithm for SolvePnP problem (http://code.opencv.org/issues/3985) 2015-05-23 14:19:55 +03:00
Vadim Pisarevsky
7fd5b3a0c5 added another triangulation test case from http://code.opencv.org/issues/3461; fixed partial derivative on distortion coefficients, as http://code.opencv.org/issues/4101 suggests 2015-05-23 14:15:11 +03:00
Vadim Pisarevsky
74bb0beeb0 Merge pull request #4008 from cr333:triangulation_fix_2.4 2015-05-23 10:18:08 +00:00
Vadim Pisarevsky
a1a35ca5f7 Merge pull request #4010 from cr333:triangulation_fix_master 2015-05-23 10:17:39 +00:00
Vadim Pisarevsky
90a78585fb reproduced test case from http://code.opencv.org/issues/4334 2015-05-23 13:16:32 +03:00
Vadim Pisarevsky
f5be8f6c77 Merge pull request #4047 from MSOpenTech:videoio-refactor-contrib 2015-05-23 09:02:11 +00:00
Vadim Pisarevsky
526defab85 Merge pull request #4048 from vpisarev:hal_fixes 2015-05-22 21:19:03 +00:00
Maksim Shabunin
44d1738d47 Transition guide: how to check library version 2015-05-22 18:46:16 +03:00
Vadim Pisarevsky
f32f0486e2 trying to eliminate warnings in Android build 2015-05-22 16:53:34 +03:00
Vadim Pisarevsky
8e392251ba Merge pull request #4016 from vladimir-dudnik:directx-opencl-sample 2015-05-22 13:21:36 +00:00
Maksim Shabunin
3863dc5b2b Updated pkg-config generation, added sample makefile 2015-05-22 16:09:07 +03:00
Samuel Martin
671a630f47 cmake/OpenCVGenPkgconfig.cmake: rework opencv.pc generation
Using absolute path to locate the components in the "Libs:" field of the
*.pc can badly break cross-compilation, especially when building
statically linked objects.

Indeed, pkg-config automatically replaces the '-I...' and '-L...' paths
when the PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_LIBDIR environment
variables are set [1]. This feature is very helpful and common in
cross-compilation framework like Buildroot [2,3].

When there are absolute paths in the *.pc files, pkg-config won't be
able to do the path substitutions for these paths when the
aforementioned environment variables are set.
In such case, since the prefix is the target one, not the sysroot one,
these libraries' absolute paths will point to:
- in the best case: a non-existing file (i.e. these files do not exists
  on the host system;
- at worst: the host system's libraries. This will make the linking
  failed because these host system's libraries will most likely not be
  build for the target architecture [4].

So, this patch replace the components' absolute paths by the form:
  -L<libdir> -l<libname>

This way, the linker will be able to resolve each dependency path,
whatever the kind of objects/build (shared object or static build) it
is dealing with.

Note that for static link, the library order does matter [5]. The order
of the opencv components has been carefully chosen to comply with this
requirement.

Fixes #3931

This patch is a port of [6] on the master branch.

[1] http://linux.die.net/man/1/pkg-config
[2] http://buildroot.org/
[3] http://git.buildroot.net/buildroot/tree/package/pkgconf/pkg-config.in
[4] http://autobuild.buildroot.net/results/e8a/e8a859276db34aff87ef181b0cce98916b0afc90/build-end.log
[5] http://stackoverflow.com/questions/45135/linker-order-gcc
[6] eceada586b

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
2015-05-22 16:09:05 +03:00
Vadim Pisarevsky
d2aaa70e93 removed HAL calls from public OpenCV headers; put IPP calls back to hall:sqrt() and such (but they are disabled for now) 2015-05-22 16:04:10 +03:00
Maxim Kostin
4418ee6c77 Refactored internal helpers. Simplified structure. Updated comments. Updates #41
Signed-off-by: Maxim Kostin <v-maxkos@microsoft.com>
2015-05-22 15:41:50 +03:00
Vladimir Dudnik
c64a15294d short description moved to the beginning of file 2015-05-22 14:12:00 +03:00
Vadim Pisarevsky
ef8182e12a Merge pull request #4025 from vpisarev:features2d_fixes 2015-05-21 19:16:27 +00:00
laurentBerger
b204013483 back to #include "opencv2/cvconfig.h" 2015-05-21 20:22:57 +02:00
Vadim Pisarevsky
af47b6551f another attempt to make the MSER test pass. removed possible randomization in parameters from run to run 2015-05-21 17:10:35 +03:00
Vladimir Dudnik
892684ebe5 add short description 2015-05-21 17:08:13 +03:00
Vadim Pisarevsky
4c67ae1a0b fixed failure in Features2d_MSER.cases 2015-05-21 16:27:34 +03:00
Vadim Pisarevsky
021473e93e Merge pull request #4040 from dobrypd:libgphoto2-connection 2015-05-21 13:19:22 +00:00
Vadim Pisarevsky
08714c510f Merge pull request #4042 from ilya-lavrenov:android_mk 2015-05-21 13:17:46 +00:00
laurentBerger
b116d6c6e8 use ifndef HAVE_GTK 2015-05-21 14:57:49 +02:00
Vadim Pisarevsky
6b04c2b904 Merge pull request #4027 from zenev:master 2015-05-21 12:35:17 +00:00
Vadim Pisarevsky
acfbed8654 Merge pull request #4037 from Lectem:patch-1 2015-05-21 12:33:42 +00:00
Vadim Pisarevsky
7061bf0000 Merge pull request #4031 from apavlenko:revert_4014 2015-05-21 12:31:48 +00:00
Vadim Pisarevsky
6212084046 Merge pull request #4041 from ilya-lavrenov:warning_fix 2015-05-21 12:24:46 +00:00
Vadim Pisarevsky
dab78c26b1 added reasonable test for MSER (including coverage for http://code.opencv.org/issues/4273, http://code.opencv.org/issues/1723 and http://code.opencv.org/issues/756); also, added some "in-progress" info to the Features2d_Feature2d.no_crash test. 2015-05-21 15:03:17 +03:00
laurentBerger
a6a0fc5b21 replace "cvconfig.h" it with "opencv2/cvconfig.h". 2015-05-21 14:01:11 +02:00
Ilya Lavrenov
d89b6226a3 fixed Android mk generation for arm64-v8a 2015-05-21 15:00:46 +03:00
Ilya Lavrenov
11d1909e6b fixed warning 2015-05-21 11:49:06 +03:00
Vadim Pisarevsky
fede94e979 it's now true MSER algorithm that works well on binary images too 2015-05-21 05:44:14 +03:00
Piotr Dobrowolski
6d0407b65e VideoCapture with digital camera and gPhoto2 library 2015-05-21 00:41:39 +02:00
GilLevi
05a45ef6dc renamed LATCH 2015-05-21 00:04:24 +03:00
Lectem
3c6fe75149 fix mutex for uclibc
The uClibc doesn't have pthread_spin_* implemented on their 'old' linux threads.
Since it is on linux, we have to check if uclibc is using this implementation or not.
2015-05-20 12:18:28 +02:00
Vadim Pisarevsky
298c98ea32 Merge pull request #4026 from mshabunin:install-cvconfig 2015-05-20 09:58:48 +00:00
Alexander Smorkalov
00d9f690f6 Version++. 2015-05-20 11:21:28 +03:00
Vladislav Vinogradov
ae79fe10dc do not loose logs from nvidia tests
(cherry picked from commit d58d277707ac4750d0986c25de1ef6ca896254aa)
2015-05-20 08:16:44 +03:00
Vladislav Vinogradov
62fc342d35 use fixed seed for RNG in gpu SolvePnPRansac test
(cherry picked from commit 95eed59f2dcc0fc4a3b46892d60deb9e26d22872)
2015-05-20 08:16:22 +03:00
Vladislav Vinogradov
36924d6dbb use cv::theRNG() instead of ::rand() in gpu::solvePnPRansac
(cherry picked from commit 62bc647731cc41d216ad2d96e2572a416ccb6588)
2015-05-20 08:16:05 +03:00
Alexander Smorkalov
ede4943d7e Merge pull request #4030 from asmorkalov:as/accurate_cuda_arch_aarch64 2015-05-20 05:12:43 +00:00
Alexander Smorkalov
9d148c76ca Merge pull request #4033 from jet47:gpu-tests-fix 2015-05-20 05:12:24 +00:00
Andrey Pavlenko
ab8afc3bcc Revert of "Merge pull request #4006 from sgjava:opencv-steve" (reverted from commit 4743184078659d4bcf43c363efd2aa430e4786ff) 2015-05-19 18:55:57 +03:00
Vladislav Vinogradov
21d8b588a2 exclude dates from report names 2015-05-19 18:26:13 +03:00
Vladislav Vinogradov
5d66b1130b save tests console output to separate log files 2015-05-19 18:26:13 +03:00
Vladislav Vinogradov
0550b2c1fe check that current directory has write access 2015-05-19 18:26:04 +03:00
Vladislav Vinogradov
d58d277707 do not loose logs from nvidia tests 2015-05-19 17:28:43 +03:00
Vladislav Vinogradov
95eed59f2d use fixed seed for RNG in gpu SolvePnPRansac test 2015-05-19 17:27:50 +03:00
Vladislav Vinogradov
62bc647731 use cv::theRNG() instead of ::rand() in gpu::solvePnPRansac 2015-05-19 17:27:23 +03:00
Vladimir Dudnik
af806bc816 replaced macros with template func 2015-05-19 16:08:25 +03:00
Andrey Pavlenko
d67d32af48 Revert of "Merge pull request #4014 from sgjava:opencv-sgjava" (reverted from commit 52fa55a770cb07a6401aa6617b81f413d1165771) 2015-05-19 13:30:18 +03:00
Alexander Smorkalov
7f63776395 Precise default CUDA version for Tegra X1 chips. 2015-05-19 13:24:17 +03:00
zenev
6ac4a4ceb6 Merge branch 'master' of https://github.com/zenev/opencv 2015-05-18 13:29:54 -07:00
zenev
5cb70d34d7 fixed vector out of range exception in nextImg 2015-05-18 13:29:15 -07:00
Vadim Pisarevsky
b5a7122855 added test to do smoke testing of ORB, KAZE, AKAZE and BRISK on images of different size 2015-05-18 21:16:53 +03:00
Maksim Shabunin
e936670571 Install cvconfig.h file 2015-05-18 19:19:48 +03:00
Vadim Pisarevsky
fc06a2384b added test for batch detection/descriptor extraction (http://code.opencv.org/issues/3943) 2015-05-18 19:01:00 +03:00
Vadim Pisarevsky
432cf1152a added read/write functions for vector<DMatch> + the test (http://code.opencv.org/issues/4308) 2015-05-18 18:59:37 +03:00
Vadim Pisarevsky
b9792fdc14 Merge pull request #3829 from ippei-i:2.4-flann-lsh-addable-index 2015-05-18 15:38:21 +00:00
Vadim Pisarevsky
3136010e1a Merge pull request #4023 from Dikay900:cleanup_cascadedetect 2015-05-18 14:08:22 +00:00
Vadim Pisarevsky
2fc92448df Merge pull request #4024 from jet47:cuda-minmaxloc-one-row-input 2015-05-18 14:06:37 +00:00
Vladislav Vinogradov
e22979f334 fix #4343 : cv::cuda::findMinMaxLoc incorrect output for single row matrix 2015-05-18 14:16:55 +03:00
Alexander Smorkalov
0410fe6978 Merge pull request #3785 from jet47:tiny-gpu-module 2015-05-18 08:00:12 +00:00
Dikay900
a5242265d7 cleanup after last PR 2015-05-18 00:31:39 +02:00
Vadim Pisarevsky
8b791477df Merge pull request #3971 from Dikay900:2_4_to_master_3 2015-05-17 00:28:30 +00:00
laurentBerger
268283ff16 suppress android and mac warnings 2015-05-16 22:54:53 +02:00
GilLevi
6613519c2e added sample for LATCH 2015-05-16 22:37:38 +03:00
Vadim Pisarevsky
e0136e39f4 Merge pull request #4011 from cr333:parula 2015-05-16 19:11:32 +00:00
laurentBerger
546f70a6f0 some warnings and errors 2015-05-16 21:01:31 +02:00
GilLevi
f85eb23c3b sample for LATCH 2015-05-16 21:15:09 +03:00
Vadim Pisarevsky
78e89ba3ff Merge pull request #4001 from LaurentBerger:ExampleBLOB 2015-05-16 18:11:29 +00:00
Vadim Pisarevsky
eb41a574b7 Merge pull request #4005 from MSOpenTech:videoio-contrib 2015-05-16 18:08:28 +00:00
laurentBerger
187ab0ca61 include cvconfig.h to use constant HAVE_OPENGL 2015-05-16 19:59:59 +02:00
laurentBerger
7cf5de0ed0 trailing whitespace and some bracket 2015-05-16 19:29:12 +02:00
laurentBerger
68e9d19743 An example how to use features2d for MSER. Data results are visualized in 3D using openglwith mouse or keyboard 2015-05-16 18:59:22 +02:00
Vladimir Dudnik
f0197006e0 removed original samples and replace them with new ones. modified new samples (reduce code duplication, add cmd line params and short description) 2015-05-16 00:40:05 +03:00
Vadim Pisarevsky
a85bb091c8 Merge pull request #4018 from vpisarev:imgproc_video_fixes 2015-05-15 16:15:01 +00:00
Maxim Kostin
3d20157d4f Added sample Windows Universal application (UAP) using videoio logic for video preview and processing.
Signed-off-by: Maxim Kostin <v-maxkos@microsoft.com>
2015-05-15 18:03:06 +03:00
Maxim Kostin
55f78f8a83 Added configuration changes enabling videoio WinRT support.
Signed-off-by: Maxim Kostin <v-maxkos@microsoft.com>
2015-05-15 16:29:06 +03:00
Maxim Kostin
d08cb6b357 Added WinRT support for videoio.
Signed-off-by: Maxim Kostin <v-maxkos@microsoft.com>
2015-05-15 16:28:47 +03:00
Maxim Kostin
d40eefd5a4 Moved old WinRT related wrappers from highgui to videoio fixing long broken logic.
Signed-off-by: Maxim Kostin <v-maxkos@microsoft.com>
2015-05-15 16:28:25 +03:00
Vadim Pisarevsky
4a9b244577 hopefully, fixed crash in sparse mat test 2015-05-15 16:15:10 +03:00
Vadim Pisarevsky
cc086b9452 Merge pull request #3979 from ruslo:fix.cxx11 2015-05-15 12:32:46 +00:00
Vadim Pisarevsky
35884a7e3f Merge pull request #3982 from patrikhuber:vs2015-support-master 2015-05-15 12:32:27 +00:00
Vadim Pisarevsky
3109c77013 Merge pull request #3983 from ruslo:unify.ios 2015-05-15 12:32:05 +00:00
Vadim Pisarevsky
a26ab3ab16 Merge pull request #3917 from yanlend:patch-1 2015-05-14 21:16:24 +00:00
Vadim Pisarevsky
66eb270cf7 significantly reduced sparse matrix footprint:
http://code.opencv.org/issues/2206,
http://code.opencv.org/issues/2924
2015-05-14 23:29:09 +03:00
Vadim Pisarevsky
354ed5c4d6 Merge pull request #4009 from mshabunin:fix-ann-moment 2015-05-14 18:25:16 +00:00
Vadim Pisarevsky
c52092e6f8 Merge pull request #3992 from nomarek:master 2015-05-14 18:24:09 +00:00
Vadim Pisarevsky
52fa55a770 Merge pull request #4014 from sgjava:opencv-sgjava 2015-05-14 18:23:28 +00:00
Vadim Pisarevsky
a87e1c2f90 Merge pull request #4012 from mshabunin:doc-fixes 2015-05-14 18:22:26 +00:00
Vadim Pisarevsky
cc92cd07e8 Merge pull request #4017 from headupinclouds:master 2015-05-14 18:16:23 +00:00
Vadim Pisarevsky
7dd67f4997 use _mm_sad_epu8 instead of _mm_movemask_epi8 in countNonZero. Therefore, we do not need any popcount table and this solves http://code.opencv.org/issues/4333 2015-05-14 20:33:53 +03:00
Vadim Pisarevsky
3c769edea0 added extra check in CalibrateDebevec to make sure the points are within the image:
http://code.opencv.org/issues/4124
2015-05-14 19:54:48 +03:00
Vadim Pisarevsky
3c7f7de477 avoid possible problems with zero values in tone mapping algorithms (http://code.opencv.org/issues/4020) 2015-05-14 19:32:25 +03:00
Vadim Pisarevsky
ffabbfa778 added test to prove that remap does not leak memory (http://code.opencv.org/issues/2502). disabled the test for now to save execution time. 2015-05-14 18:21:26 +03:00
Vadim Pisarevsky
ca90667723 fixed compile warnings on Linux and Windows 2015-05-14 16:42:51 +03:00
Vadim Pisarevsky
05d888316a added test for http://code.opencv.org/issues/2957 2015-05-14 16:25:18 +03:00
Vadim Pisarevsky
b37aaa8303 significantly improved parallel non-local means by using granularity parameter in parallel_for_ loop. Because the algorithm deals with sliding sums, it's essential that each thread has enough work to do, otherwise the algorithm gets higher theoretical complexity and thus there is no speedup comparing to 1-thread code (at best). 2015-05-14 15:39:42 +03:00
Vladimir Dudnik
3cb4954d70 fixed new blank line at EOF 2015-05-14 12:08:14 +03:00
Vadim Pisarevsky
feb5b6aa93 increased singularity epsilon in LU decomposition. This solved singular case from http://code.opencv.org/issues/3305. Added the respective test. 2015-05-14 10:42:55 +03:00
Vadim Pisarevsky
2e7e754032 added support for n-channel (n>4) images in warpAffine/warpPerspective/remap: http://code.opencv.org/issues/4190 2015-05-14 08:06:46 +03:00
David Hirvonen
cab0ecdf19 Avoid clearing HaarEvaluator::tofs variable (introduced fb8478eb7b6c76f15c106c29a8843d8c3722bb62) in HaarEvaluator::setImage(...) since it won't be recomputed by HaarEvaluator::computeOptFeatures() for cases where the input image dimensions and requested search scales are the same as the previous. If none of the above change then it should be correct, and if they do change it will be computed correctly inside HaarEvaluator::computeOptFeatures() (in commit 952f9dbe629e8e9f310c70c78ed46d484439c1c9)
I'm guessing there is a unit test for this that needs to be called 2x with the same image and search parameters (or another image with the same size) to illustrate the problem.
2015-05-13 17:34:16 -04:00
Vadim Pisarevsky
d3b0cb878a added test for http://code.opencv.org/issues/2736 2015-05-13 22:16:35 +03:00
Vadim Pisarevsky
71002e0e79 some fixes from http://code.opencv.org/issues/3733 2015-05-13 22:00:02 +03:00
GilLevi
a41ac8fd40 added sample code for LATCH 2015-05-13 21:20:28 +03:00
sgjava
8b3b2a52f0 Removed finalize() and added n_delete to release() 2015-05-13 13:45:19 -04:00
sgjava
fe0ce9282a Changed delete() modifier to public from protected 2015-05-13 13:44:53 -04:00
Marek Nogacki
25bcca2edb fixed http://code.opencv.org/issues/4276 - set drawing thickness limit to 32767 2015-05-13 18:54:25 +02:00
laurentBerger
31ef944176 remove example_blob.bmp 2015-05-13 18:06:26 +02:00
laurentBerger
06b0fa6fc2 BLOB_MSER avec opengl 2015-05-13 18:03:58 +02:00
Maksim Shabunin
6d1cbc6458 Reorganized user guide 2015-05-13 18:46:21 +03:00
Maksim Shabunin
3f91b0d340 Fixed external link in python colorspace tutorial 2015-05-13 18:46:21 +03:00
Maksim Shabunin
a7160d9b12 Docs: fixed _dest type in cv::compare 2015-05-13 18:46:21 +03:00
Maksim Shabunin
e22c09c601 Documentation for CommandLineParser 2015-05-13 18:46:21 +03:00
Maksim Shabunin
61293a09ff Fixed RGB-to-HLS conversion formula in documentation 2015-05-13 18:46:21 +03:00
Maksim Shabunin
c8cb03fd8f Replaced 'corrected' to 'distorted' in camera calibration tutorials 2015-05-13 18:46:21 +03:00
Christian Richardt
6425ac3b13 Added color map similar to Matlab's new default color map 'parula'. 2015-05-13 17:34:14 +02:00
Christian Richardt
cbaf0ecaf6 Fixed triangulation bug http://code.opencv.org/issues/4334. 2015-05-13 16:28:14 +02:00
Maksim Shabunin
b95769333c Fixed ANN_MLP dw initialization when moment is not 0 2015-05-13 16:56:34 +03:00
Christian Richardt
242e64c08d Fixed triangulation bug http://code.opencv.org/issues/4334. 2015-05-13 15:47:00 +02:00
Vadim Pisarevsky
4743184078 Merge pull request #4006 from sgjava:opencv-steve 2015-05-13 11:36:15 +00:00
Vadim Pisarevsky
3f180b0ad9 Merge pull request #4007 from martin-ueding:master 2015-05-13 11:35:09 +00:00
Martin Ueding
1e00a93f97 Fix spelling 2015-05-13 08:16:39 +02:00
Vladimir Dudnik
450a276f87 directx opencl interop samples (with copy from opencl image2d to buffer) 2015-05-13 01:51:54 +03:00
sgjava
0f53526598 Added VideoWriter and changed finalize to delete 2015-05-12 14:18:39 -04:00
laurentBerger
780f4ae7c5 try to implement remark included in message 2015-05-12 19:01:05 +02:00
Vadim Pisarevsky
4af2eb22ab Merge pull request #3974 from StevenPuttemans:fix_RGB_naming_master 2015-05-12 15:12:27 +00:00
Vadim Pisarevsky
cc94b393c5 Merge pull request #3975 from StevenPuttemans:RGB_doc_fixing_2.4 2015-05-12 15:12:04 +00:00
Vadim Pisarevsky
5de9d8e6e1 Merge pull request #3994 from mshabunin:fix-gtk-crash 2015-05-12 15:11:07 +00:00
Vadim Pisarevsky
d3ef3cff94 Merge pull request #3996 from Ashod:opengl_context_clip 2015-05-12 15:06:31 +00:00
Vadim Pisarevsky
568303ac7f Merge pull request #3993 from vrabaud:master 2015-05-12 15:04:41 +00:00
Vadim Pisarevsky
09c26d6805 Merge pull request #3999 from berak:features2d_tutorial_fix 2015-05-12 15:01:54 +00:00
Vadim Pisarevsky
939c1d2474 Merge pull request #4000 from sdika:HOGSignedGradient 2015-05-12 14:47:36 +00:00
Vadim Pisarevsky
b8d40b4ad5 Merge pull request #4002 from marvins:gdal-fix 2015-05-12 14:33:07 +00:00
Marvin Smith
ae933db526 Fixing the gdal include error that Macports seems to only mess up. 2015-05-11 20:27:50 -07:00
laurentBerger
dfc508bb15 problem float constant and position of > in vector 2015-05-11 13:45:08 +02:00
laurentBerger
05bc7621e6 trailing whitespace 2015-05-11 13:20:52 +02:00
laurentBerger
a94fdbe0f0 Example about BLOB with a new image in data folder 2015-05-11 13:13:20 +02:00
laurentBerger
e7fcffeead Exxemple MSER et BLOB séparés 2015-05-11 12:48:18 +02:00
msandler
8e82bed459 updated cap_libv4l.cpp to support CV_CAP_PROP_POS_MSEC, CV_CAP_PROP_POS_FRAMES and CV_CAP_PROP_FPS 2015-05-11 03:25:48 -07:00
berak
3fe69f4e67 small fixes for features2d tutorials 2015-05-10 13:44:49 +02:00
Michaël Sdika
ab40c2acf7 added the signedGradient varaible to the HOGDescriptor class.
when true, use signed gradient for the angular histogram computation.
default to false for backward compatibility.
2015-05-10 09:23:30 +02:00
Ashod Nakashian
7cd198623e Prevent the parent from drawing over OpenGL context. 2015-05-09 12:23:09 -04:00
laurentBerger
16e20e5c73 An another improvement? 2015-05-09 10:29:53 +02:00
laurentBerger
9e97d7b4db Etude de MSER 2015-05-09 08:44:18 +02:00
Nguyen Nguyen
58dd70e8dc Revert support for audio 2015-05-08 12:06:03 -04:00
Nguyen Nguyen
53ff537f1c temporary fixes 2015-05-08 11:33:11 -04:00
laurentBerger
26d7da68fc warning C4101: 'e' line 146 2015-05-08 09:57:05 +02:00
laurentBerger
f6f5b6035b trailing whitespace 2015-05-07 22:55:38 +02:00
laurentBerger
966d50762d Try to include comment from @eduardo and @berak
Akaze descriptor with DESCRIPTOR_KAZE_UPRIGHT added
2015-05-07 22:48:13 +02:00
Maksim Shabunin
01c3d491e7 Fixed python crash when both cv2.imshow and gtk module are used 2015-05-07 16:44:45 +03:00
Vincent Rabaud
f052b0bc4d get code to compile on Ubuntu Saucy
A define was forgotten for the codecs and there was a typo for
another.
2015-05-07 11:38:59 +00:00
Vadim Pisarevsky
a31b29308f Merge pull request #3919 from cbalint13:brisk 2015-05-07 10:38:31 +00:00
laurentBerger
3a53e726dd example BLOB_MSER and fixed bug in blobdetector 2015-05-07 11:52:06 +02:00
Marek Nogacki
d59a6b29d5 fixed http://code.opencv.org/issues/4276 - removed drawing thickness upper limit 2015-05-07 11:19:22 +02:00
Nguyen Nguyen
a5814871d9 Adding audio to opencv 2015-05-06 17:01:38 -04:00
laurentBerger
cfcef3ec98 File was not saved due to wrong file name.
Add a comment about bug 4308
2015-05-06 19:55:16 +02:00
Vadim Pisarevsky
f49544f310 Merge pull request #3987 from vpisarev:core_fixes_part_1 2015-05-06 15:49:18 +00:00
Vadim Pisarevsky
1aa03cecf1 Merge pull request #3981 from patrikhuber:vs2015-support 2015-05-06 15:35:36 +00:00
laurentBerger
171b58e2ca Example BLOB_MSER 2015-05-06 16:50:22 +02:00
Vadim Pisarevsky
7a3c0cb70e Merge pull request #3991 from mshabunin:python-underscore 2015-05-06 14:48:34 +00:00
Vladislav Vinogradov
f10537cdd6 fix tests compilation issue on Windows 2015-05-06 17:15:25 +03:00
Vladislav Vinogradov
9d294cbcf5 fix performance tests in tiny mode 2015-05-06 17:15:25 +03:00
Vladislav Vinogradov
f1bec940b1 fix accuracy tests in tiny mode 2015-05-06 17:15:25 +03:00
Vladislav Vinogradov
dd93d48be4 turn on stereob instantiates that required for tests 2015-05-06 17:15:25 +03:00
Vladislav Vinogradov
ad3123adfd turn on some instantiates that required for other primitives 2015-05-06 17:15:25 +03:00
Vladislav Vinogradov
f939d80f4c fixed seg faults 2015-05-06 17:15:25 +03:00
Vladislav Vinogradov
ee316758ca reduce color instantiates for tiny build 2015-05-06 17:15:24 +03:00
Vladislav Vinogradov
6d7a61cbdc reduce copy_make_border instantiates for tiny build 2015-05-06 17:15:24 +03:00
Vladislav Vinogradov
b44b1ab47b reduce matrix_reductions instantiates for tiny build 2015-05-06 17:15:24 +03:00
Vladislav Vinogradov
2e47a1a61b reduce pyramids instantiates for tiny build 2015-05-06 17:15:24 +03:00
Vladislav Vinogradov
72685cf01c reduce resize instantiates for tiny build 2015-05-06 17:15:24 +03:00
Vladislav Vinogradov
612888c066 reduce remap instantiates for tiny build 2015-05-06 17:15:24 +03:00
Vladislav Vinogradov
e7b55f4982 reduce warp instantiates for tiny build 2015-05-06 17:15:24 +03:00
Vladislav Vinogradov
3004f5fa30 reduce stereobm instantiates for tiny build 2015-05-06 17:15:24 +03:00
Vladislav Vinogradov
9682d2afff reduce element_operations instantiates for tiny build 2015-05-06 17:15:24 +03:00
Vladislav Vinogradov
87d655325c reduce add_weighted instantiates for tiny build 2015-05-06 17:13:59 +03:00
Vladislav Vinogradov
db25e44a17 reduce brute_force_matcher instantiates for tiny build 2015-05-06 17:13:59 +03:00
Vladislav Vinogradov
b7a9e672c5 reduce bilateral filter instantiates for tiny build 2015-05-06 17:13:59 +03:00
Vladislav Vinogradov
8e49ab1d3b reduce filter2d instantiates for tiny build 2015-05-06 17:13:59 +03:00
Vladislav Vinogradov
00c36e88ef reduce separable filter instantiates for tiny build 2015-05-06 17:13:59 +03:00
Vladislav Vinogradov
cde697dd14 introduce BUILD_TINY_GPU_MODULE CMake option
it adds OPENCV_TINY_GPU_MODULE definition, that will allow
to build tiny version of gpu module (with limited image format support)
2015-05-06 17:13:59 +03:00
Vadim Pisarevsky
1756590117 Merge pull request #3985 from StevenPuttemans:fix_imread_parameters 2015-05-06 14:02:33 +00:00
Alexander Smorkalov
e49e75da06 OpenCV patch verison++. 2015-05-06 16:29:51 +03:00
Vladislav Vinogradov
1d40946959 Bug #4315 : fix CUDA bitwise operations with mask
(cherry picked from commit d87c30dc8470e39048cc01f75f26eb7bd3d6ce9f)
2015-05-06 16:27:12 +03:00
Alexander Smorkalov
2598392295 Added explicit deb package dependency from libtbb-dev if TBB is enabled.
(cherry picked from commit 63d6cc5ca66c0627652021650b3f5c5cc608d7f5)
2015-05-06 16:26:50 +03:00
lujia
17cc5e2c40 bugfix_for_hog_detectMultiScale_with_weights
(cherry picked from commit 7ce116695d616f73e285e55e0a38fa5fa6e5b097)
2015-05-06 16:24:39 +03:00
Vladislav Vinogradov
4b14400976 disable several heavy performance tests
(cherry picked from commit cbdddb473c10429ce8511fddc8afce8cea0a171c)
2015-05-06 16:24:07 +03:00
Vladislav Vinogradov
4704a254f7 disable Video_PyrLKOpticalFlowDense performance test
sanity fails on Maxwell and CUDA 7.0 due to unknow reason
(cherry picked from commit b4c2891ef3e24d0e90e1706c24dc459f7ec62ed1)
2015-05-06 16:23:41 +03:00
Vladislav Vinogradov
7708e9882e use border extrapolation for central pixel in pyrDown
in case if image has odd dimension

(cherry picked from commit 13252133035e3a5972c83d3f123b12033dcc3886)
2015-05-06 16:23:28 +03:00
Vladislav Vinogradov
fe1bd0cc2f fix racecheck warning in scanRows kernel
(cherry picked from commit fb15bdfb21da2c38beea6e87c7b08a19610821d6)
2015-05-06 16:23:09 +03:00
Vladislav Vinogradov
a752f25944 increase epsilon for solvePnPRansac function
(cherry picked from commit 9d2d173485f15043abbfa41b030f16c11ec56dc4)
2015-05-06 16:22:57 +03:00
Alexander Smorkalov
bb44316028 Merge pull request #3990 from jet47:cuda-bitwise-mask 2015-05-06 12:50:08 +00:00
Alexander Smorkalov
0b2cfcfda2 Merge pull request #3976 from SpecLad:rm-insertIframe 2015-05-06 12:47:59 +00:00
Alexander Smorkalov
9c02caf392 Merge pull request #3989 from asmorkalov:as/tbb_dep 2015-05-06 12:47:41 +00:00
Maksim Shabunin
c137ba53a0 Wrap ANN_MLP class into Python 2015-05-06 15:21:23 +03:00
Vladislav Vinogradov
d87c30dc84 Bug #4315 : fix CUDA bitwise operations with mask 2015-05-06 13:28:08 +03:00
Alexander Smorkalov
63d6cc5ca6 Added explicit deb package dependency from libtbb-dev if TBB is enabled. 2015-05-06 13:10:39 +03:00
cbalint13
6b1d5e48b6 Merge branch 'brisk' of https://github.com/cbalint13/opencv into brisk 2015-05-06 11:23:50 +03:00
cbalint13
fb56d5c482 Squash all BRISK commits into one. 2015-05-06 11:21:25 +03:00
Vadim Pisarevsky
d280205245 fixed compile errors on ARM, as well as failures in OCL_Dft* regression tests 2015-05-06 10:00:10 +03:00
Vadim Pisarevsky
0ee8634b2f fixed random failures in Core_DFT.complex_output2 test (the case of input_mat.cols == 1) 2015-05-05 20:31:30 +03:00
Nguyen Nguyen
9682430a69 Adding code to deal with audio output 2015-05-05 13:14:26 -04:00
Vadim Pisarevsky
73f760fdf0 some more compile warnings fixed 2015-05-05 18:03:40 +03:00
Vadim Pisarevsky
931a519969 fixed warning in mathfuncs 2015-05-05 17:49:36 +03:00
StevenPuttemans
0baaf0a60f fixing old variables in documentation and transfering to the new interface 2015-05-05 15:05:39 +02:00
Vadim Pisarevsky
63a63e3eaa extended MinProblemSolver::Function to 1) report the space dimensionality, 2) compute gradient if needed 2015-05-05 15:56:06 +03:00
laurentBerger
6b9e273f92 Essai examleBlob et MSER 2015-05-05 12:06:16 +02:00
cbalint13
2c6114f58d Force newer build over buildbot. 2015-05-05 12:19:35 +03:00
Nguyen Nguyen
b69ffe6376 Fixed memory leak when recording video in iOS 2015-05-04 16:21:25 -04:00
cbalint13
8ba1ec22e4 Force buildbot to rebuild. 2015-05-04 19:54:08 +03:00
Nguyen Nguyen
1f72815637 Exporting videoFileString to outside world 2015-05-04 12:38:55 -04:00
Maksim Shabunin
90c3d7d361 Merge pull request #3969 from Dikay900:master_to_2_4 2015-05-04 10:13:45 +00:00
Maksim Shabunin
4bf6bd3d37 Merge pull request #3972 from PhilLab:docLineno 2015-05-04 09:48:07 +00:00
laurentBerger
09930938e8 Trailing white space first step 2015-05-04 10:59:43 +02:00
laurentBerger
09e9e8ad9f I have modified source file and add a chart to have distance between keypoint for decriptor function og matching algorithm
My english is not good so you can change some words in my comment
2015-05-04 10:36:24 +02:00
StevenPuttemans
f4eebc46b2 Fixing all wrong uses of RGB channels instead of the OpenCV BGR standard 2015-05-04 09:23:15 +02:00
StevenPuttemans
34dacdea32 fixing all RGB instances to BGR where needed 2015-05-04 09:02:46 +02:00
laurentBerger
9ddb8bdb8b Problem with warning: comparison between signed and unsigned integer expressions 2015-05-03 14:08:24 +02:00
laurentBerger
56856a1810 Conversion size-t in int 2015-05-03 13:28:23 +02:00
laurentBerger
341de5d53f trailing whitespace 2015-05-03 12:04:19 +02:00
laurentBerger
b28056e3dd Trailing whitespace 2015-05-03 11:58:32 +02:00
laurentBerger
3e25c085ba A sample program : how to use ORB AKAZE BRISK descriptors for matching.
see http://answers.opencv.org/question/61062/features2d-example/
2015-05-03 11:42:27 +02:00
Vadim Pisarevsky
5b9182ba43 reenabled conjugate gradient solver test 2015-05-03 11:36:24 +03:00
Vadim Pisarevsky
5a31f6b4e1 ok, so probably the failure in downhill simplex has been finally solved 2015-05-03 11:31:49 +03:00
Vadim Pisarevsky
2ec92ba440 added test for http://code.opencv.org/issues/1918 2015-05-03 02:46:33 +03:00
Vadim Pisarevsky
01e351de37 refactored downhill simplex implementation a bit; hopefully, fixed the bug with random failures in the tests 2015-05-03 02:29:15 +03:00
Ruslan Baratov
441f93d58d Unify iOS platform check
There is only one place that use condition `CMAKE_SYSTEM_NAME STREQUAL iOS`.
All other `if` command use just IOS.
2015-05-02 23:44:19 +02:00
Vadim Pisarevsky
a33d7928a4 Fixed getContinuousSize() to handle huge matrices properly. This should solve http://code.opencv.org/issues/3232 2015-05-02 22:12:12 +03:00
Vadim Pisarevsky
9c0b740b84 improved randShuffle as suggested by John Stark in http://code.opencv.org/issues/3730 2015-05-02 21:31:47 +03:00
Vadim Pisarevsky
96b5ec14d4 fixed bug with simplex initialization in Downhill solver (thanks to Toby Rule for the patch): http://code.opencv.org/issues/3990.
re-enabled Downhill solver test, let's see how it goes
2015-05-02 20:59:57 +03:00
Vadim Pisarevsky
79ac0d05ce added test checking http://code.opencv.org/issues/4050 2015-05-02 20:38:30 +03:00
Patrik Huber
40b765b7c2 Add VS2015 compatibility to CMake scripts 2015-05-02 15:24:14 +01:00
Patrik Huber
2b1103c1d3 Add support for VS2015
Without the fix, OpenCV will compile and silently copy the compiled libs/executables to a location not prefixed with arch/vc14, and OpenCV won't be picked up by find_package and OpenCVConfig.cmake.
2015-05-02 13:31:43 +01:00
cbalint13
f426778160 Force buildbot rebuild. 2015-05-02 11:25:22 +03:00
Ruslan Baratov
f148eaace9 Fix errors while compiling with c++11 flag
Fix errors in file cap_avfoundation.mm.
Compiled with Xcode 6.2, iOS SDK 8.2

Example:

cap_avfoundation.mm:543:54: error: cannot initialize a parameter of
type 'AVCaptureFocusMode' with an rvalue of type 'int'
    if ([mCaptureDevice isFocusModeSupported:(int)value]){
                                             ^~~~~~~~~~
2015-05-01 21:29:20 +02:00
cbalint13
9b87c22e01 Fix bugs in non-max suppression routine. 2015-05-01 22:07:08 +03:00
Vadim Pisarevsky
9fbd1d68ad refactored div & pow funcs; added tests for special cases in pow() function.
fixed http://code.opencv.org/issues/3935
possibly fixed http://code.opencv.org/issues/3594
2015-05-01 21:49:11 +03:00
Roman Donchenko
e01b485ac6 Merge pull request #3973 from xsorifc28:patch-1 2015-04-30 12:48:51 +00:00
Roman Donchenko
007a3ef8b6 Remove insertIframe.js
It hasn't been used since f82c04f. Also, the line adding the script had
an unneeded pathto call, so the script was being loaded from the wrong path
anyway.
2015-04-30 15:42:15 +03:00
Belev
83eb1d3608 Fix typo
Fixed difference in the given arguments to the ellipse function and the description after that

Fixed two more typos

Replaced unnecessary the with to

Conflicts:
	doc/tutorials/core/adding_images/adding_images.markdown
	doc/tutorials/core/basic_geometric_drawing/basic_geometric_drawing.markdown
	doc/tutorials/core/random_generator_and_text/random_generator_and_text.markdown
	modules/imgproc/include/opencv2/imgproc.hpp
2015-04-30 09:14:36 +02:00
cbalint13
bbdf21679f Leave AGAST at thresold=10, cosmetic for perf tests. 2015-04-30 02:23:58 +03:00
cbalint13
e2f74309f7 Default AGAST threshold is 40 (as authors recomandation) 2015-04-29 23:54:16 +03:00
cbalint13
0ec5561b4e Adjust AGAST perftest to be at parity (better) with FAST ones. 2015-04-29 23:42:57 +03:00
Vadim Pisarevsky
74e2b8cbcb fixed invalid output of cv::dft when using DFT_ROWS + DFT_COMPLEX_OUTPUT (http://code.opencv.org/issues/3428) 2015-04-29 23:08:22 +03:00
Vadim Pisarevsky
7918267d02 fixed U non-orthogonality in SVD (http://code.opencv.org/issues/3801) 2015-04-29 16:09:58 +03:00
Vadim Pisarevsky
135fa85e8f added vector<bool> support (http://code.opencv.org/issues/3826) 2015-04-29 15:36:45 +03:00
Vadim Pisarevsky
d8f360316d fixed http://code.opencv.org/issues/3828, added test. thanks to berak for the patch 2015-04-29 13:12:53 +03:00
lujia
b73894b271 bugfix_for_hog_detectMultiScale_with_weights 2015-04-29 11:46:26 +02:00
Vadim Pisarevsky
0746ec7035 fixed http://code.opencv.org/issues/4278 2015-04-29 11:58:49 +03:00
Vadim Pisarevsky
a8226814c5 fixed http://code.opencv.org/issues/4189 2015-04-29 11:47:12 +03:00
Vadim Pisarevsky
30a3ff0de6 fixed compile errors on OSX and other systems where ffmpeg is detected manually, not via pkg-config 2015-04-29 11:43:53 +03:00
Philipp Hasper
dadf53f17c Doxygen: replaced @includelineno by @include to enable copy-pasting 2015-04-29 09:31:53 +02:00
Andrey Pavlenko
5c12c92243 Merge pull request #3961 from apavlenko:2.4_fix_polylines_empty 2015-04-28 16:22:31 +00:00
AfterEight
f39d351d04 Modified resetCvImage() in cap_ximea.cpp, so that the IplImage* frame is also updated after the resolution has changed via set(CV_CAP_PROP_FRAME_WIDTH, value)/set(CV_CAP_PROP_XI_DOWNSAMPLING, value)
Conflicts:
	modules/highgui/src/cap_ximea.cpp
2015-04-28 18:07:39 +02:00
cbalint13
0039690f11 Merge branch 'master' of https://github.com/Itseez/opencv into brisk 2015-04-28 18:51:13 +03:00
Martin Ueding
9e29762838 Add example data types for calibrateCamera call
It took me a while to figure out what was meant with

    OpenCV Error: Assertion failed (i < 0) in getMat

While searching for this error message I found [a list of error
messages](https://adventuresandwhathaveyou.wordpress.com/2014/03/14/opencv-error-messages-suck/)
which also explained what the problem was: The data type for `rvecs` was
not a simple `cv::Mat` but a `std::vector<cv::Mat>`.

After I fixed that, I got the next error message:

    OpenCV Error: Assertion failed (ni > 0 && ni == ni1) in
    collectCalibrationData, file
    /build/buildd/opencv-2.4.9+dfsg/modules/calib3d/src/calibration.cpp,
    line 3193

The problem here was that my data type for the `objectPoints` was just
`vector<Vec3f>` and not `vector<vector<Vec3f>>`.

In order to save other people the time looking for this, I added
explicit examples of the needed data types into the documentation of the
function. I had to re-read the current version a couple of times until I
can read the needed levels of `vector<>`. Having this example would have
really helped me there.

Conflicts:
	modules/calib3d/include/opencv2/calib3d.hpp
2015-04-28 17:24:37 +02:00
Vadim Pisarevsky
07e07655d4 Merge pull request #3967 from Belev:fix-typo 2015-04-28 14:47:05 +00:00
Vadim Pisarevsky
e60dcc9b3b Merge pull request #3966 from Dikay900:master_diff_to_2_4_2 2015-04-28 11:00:57 +00:00
Vadim Pisarevsky
7245803405 Merge pull request #3954 from martin-ueding:master 2015-04-28 10:55:05 +00:00
Vadim Pisarevsky
da229cce9a Merge pull request #3946 from zjulujia:bugfix_for_hog_detectMultiScale_with_weights 2015-04-28 10:54:45 +00:00
Vadim Pisarevsky
36af97d00c Merge pull request #3959 from jet47:gpu-fixes 2015-04-28 10:49:06 +00:00
Vadim Pisarevsky
d705c651f2 Merge pull request #3960 from ilya-lavrenov:aarch64_test_fixes 2015-04-28 10:48:33 +00:00
Vadim Pisarevsky
ce7812fcb0 Merge pull request #3962 from apavlenko:fix_polylines_empty 2015-04-28 10:47:36 +00:00
Vadim Pisarevsky
08848c56b7 Merge pull request #3965 from Dikay900:2_4_diff_to_master_2 2015-04-28 10:47:05 +00:00
Vadim Pisarevsky
ebe979090e Merge pull request #3963 from Dikay900:2_4_diff_to_master 2015-04-28 10:41:42 +00:00
Maksim Shabunin
bcf02ae439 Merge pull request #3678 from mshabunin:explicit-sse-disable 2015-04-28 10:41:14 +00:00
Vadim Pisarevsky
8919c3162d Merge pull request #3964 from Dikay900:master_diff_to_2_4 2015-04-28 10:38:54 +00:00
Belev
2200e0fb7e Fix typo
Fixed difference in the given arguments to the ellipse function and the description after that

Fixed two more typos

Replaced unnecessary the with to
2015-04-28 13:10:08 +03:00
cbalint13
0ded2984b8 Merge remote-tracking branch 'upstream/master' into brisk 2015-04-28 06:48:52 +03:00
Samed Ozdemir
5e44aa37ff Fixed a typo, "requited" -> "required" 2015-04-27 23:00:39 -04:00
Maksim Shabunin
9efc57f24b Increased perf_imgproc.moments max error 2015-04-27 17:05:55 +03:00
kalistratovag
20156d1eeb Adding 1 to moments to avoid tests fails 2015-04-27 15:36:40 +03:00
Maksim Shabunin
1138a38dbe Use explicit no-sse flags when SSE is off
Also:
- Silence clang warnings about unsupported command line arguments
- Add diagnostic print to calib3d test
- Fixed perf test relative error check
- Fix iOS build problem
2015-04-27 15:36:10 +03:00
Thomas Gabrowski
63dbeeaac5 Fix iOS warnings about implicit conversion precision by changing double literals to float ones
Conflicts:
	modules/contrib/include/opencv2/contrib/retina.hpp
2015-04-26 12:22:41 +02:00
Mansour Moufid
655b28ee0c Use the CMake find_library command to find the FFmpeg libraries.
Conflicts:
	cmake/OpenCVFindLibsVideo.cmake
2015-04-25 19:00:33 +02:00
Roman Donchenko
5455e38e15 cap_msmf.hpp: fix a warning about nNull being unused
The two functions featuring nNull are not particularly needed, so
I simply removed them.

Conflicts:
	modules/highgui/src/cap_msmf.hpp
2015-04-25 18:54:54 +02:00
Mansour Moufid
b99f7a29df Cast some image coordinates and sizes to double.
Conflicts:
	modules/gpu/perf/perf_imgproc.cpp

Cast a long integer to double explicitly.

Conflicts:
	modules/python/src2/cv2.cpp

Cast some matrix sizes to type int.

Change some vector mask types to unsigned.

Conflicts:
	modules/core/src/arithm.cpp
2015-04-25 18:54:53 +02:00
Luis Díaz Más
b599774e30 Fix a bug that impede to set the trackbar pos using the Qt control panel
Conflicts:
	modules/highgui/src/window_QT.cpp
2015-04-25 18:54:53 +02:00
Luis Díaz Más
e6f7e96ff4 Fixing the bug #4244 that I just reported in code.opencv.org 2015-04-25 18:54:52 +02:00
Craig Reynolds
b4c7c011b7 In cvAddText, construct QString from "text" using fromUtf8. 2015-04-25 18:54:51 +02:00
Boris Daskalov
3b5530fb67 Fix a bad free space check in icvGrowSeq.
A difference of two pointers was casted to unsigned which can lead to
overflow on 64-bit systems.
2015-04-25 18:54:51 +02:00
Vladimir Kolesnikov
2c73e49dac Not block PDB file in multithreaded build on Windows.
If used cl compiler, but generator is not Visual Studio e.g. Ninja,
enable FS option to prevent blocking PDB file in multithreaded build.
2015-04-25 18:54:50 +02:00
Pierre Moulon
901d4995e3 Fix a typo error
Fix a typo error
Conflicts:
	modules/features2d/include/opencv2/features2d.hpp
2015-04-25 15:07:17 +02:00
Adi Shavit
aad95c7d8c Added call to clone() to avoid unexpected change to external data.
- Fix both stitching_detailed.cpp sample and cv::Stitcher.
2015-04-25 14:54:35 +02:00
Dikay900
d9b7b300b4 fix qt example on 2.4 with vs2010 and higher 2015-04-25 14:46:17 +02:00
Brian Park
044de4105e add input paramter checking that verifies the existance of the input files to stero_match example
remove the unnecessary header file

check input paramter by checking the image size
2015-04-25 14:46:17 +02:00
Chris Mayo
7a5aa06b9e Act on INSTALL_PYTHON_EXAMPLES
Conflicts:
	samples/CMakeLists.txt
2015-04-25 14:46:16 +02:00
Ben Hagen
a21fb63c28 store user-provided data in PlaneTracker class 2015-04-25 11:22:18 +02:00
Yang Fan
eaa9b78121 ENH: explicitly declared outputFilename to surpress error C2668
Conflicts:
	samples/gpu/video_writer.cpp
2015-04-25 10:58:01 +02:00
Abhijit Kundu
fd4df0f67d Added suuport for finding Intel TBB for Visual Studio 2013 2015-04-25 10:23:34 +02:00
Alexander Nitsch
d6c95621e8 Implement CMAKE_CURRENT_LIST_DIR for older CMake
The use of built-in CMAKE_CURRENT_LIST_DIR requires at least
CMake 2.8.3. This fix properly defines the variable to allow its
use in versions < 2.8.3 as well.

Fixes issue #4205.

Exclude >= 2.8.3 from reimplementation of CMAKE_CURRENT_LIST_DIR

This avoids violation of possible future CMake policy checks
regarding reserved/read-only variables.
2015-04-24 23:10:50 +02:00
Simon Heinen
6decc2596d squashed #3729
Update android+AsyncServiceHelper.java

Update android+AsyncServiceHelper.java

changed tabs in last commit to spaces

Update android+AsyncServiceHelper.java

small formatting fixes
2015-04-24 23:02:10 +02:00
Eric Sommerlade
41b920344d added support for uncompressed parameters to tiff image format as described here: expertland.net/question/b6o3n6p9a72341db823b48nl98m91dx8n1/detail.html
Conflicts:
	modules/imgcodecs/src/grfmt_tiff.cpp
2015-04-24 22:59:08 +02:00
Milania1
b94c513cee fixed error in hough lines tutorial (the point (9,4) is not on the lines, but the point (4,9) is)
Conflicts:
	doc/tutorials/imgproc/imgtrans/hough_lines/hough_lines.rst
2015-04-24 22:48:44 +02:00
Ying Xiong
82668e06d4 Silence cmake 3.0+ warnings about MACOSX_RPATH 2015-04-24 22:39:49 +02:00
Ilya Lavrenov
614edafe73 typo 2015-04-24 22:38:51 +02:00
ttagu99
a81374c1d7 findcontour_example check image empty 2015-04-24 21:58:31 +02:00
侯骥
66fc6126d2 Update MatchTemplate_Demo.cpp 2015-04-24 21:58:31 +02:00
Jay Bosamiya
8b58b59df4 Fix typo 2015-04-24 21:58:30 +02:00
RafaRuiz
f0595b8254 Update lkdemo.cpp because of memory leak
In MacOSx x64 it was getting a memory leak even without initializing points:
http://code.opencv.org/issues/4250
2015-04-24 21:58:29 +02:00
Pastafarianist
1e01441767 Fixed typo 2015-04-24 21:58:29 +02:00
Dikay900
c797746b6e use constant instead of value backported from #785 2015-04-24 21:58:28 +02:00
Dikay900
1bf4427a5c filename correction from #3217 2015-04-24 21:58:28 +02:00
Kevin Hughes
ac3ec0d96d squashed #823
removed separate example for reading image sequences and modified starter_video.cpp to better explain the functionality of VideoCapture. I also added a bit more explanation in the documentation of the VideoCapture interface

Conflicts:
	modules/highgui/doc/reading_and_writing_images_and_video.rst
	samples/cpp/starter_video.cpp

starter_video.cpp changed CV WINDOW KEEPRATIO to just WINDOW KEEPTATIO to fix build error

starter_video.cpp hid local functions
2015-04-24 21:58:14 +02:00
Maximilien Cuony
5c6c537044 Fix typo in error for extrinsic parameters 2015-04-24 18:39:34 +02:00
Dikay900
f8c82fc214 update openni sample comments referring #81 2015-04-24 18:25:23 +02:00
Dikay900
9f7548ab89 update openni sample comments referring #81 2015-04-24 18:19:03 +02:00
Andrey Pavlenko
d2409d12c6 porting polylines with empty vector<Point> from 2.4 to master 2015-04-24 17:11:51 +03:00
Andrey Pavlenko
40b762bceb adding test for polylines() call with empty Point-s vector and fix for crash in this case 2015-04-24 16:40:14 +03:00
Alexander Alekhin
6a5f413f27 Merge tag '3.0.0-rc1' 2015-04-24 14:56:47 +03:00
Ilya Lavrenov
89e3c508d8 fixed tests for aarch64 2015-04-24 13:56:20 +03:00
Vadim Pisarevsky
755527a90a Merge pull request #3958 from ilya-lavrenov:cuda_aarch64 2015-04-23 17:16:52 +00:00
Vadim Pisarevsky
1e90b2f51d Merge pull request #3957 from dhood:fm-8pt-bug 2015-04-23 17:16:25 +00:00
Vladislav Vinogradov
cbdddb473c disable several heavy performance tests 2015-04-23 19:09:03 +03:00
Vladislav Vinogradov
b4c2891ef3 disable Video_PyrLKOpticalFlowDense performance test
sanity fails on Maxwell and CUDA 7.0 due to unknow reason
2015-04-23 19:08:40 +03:00
Ilya Lavrenov
f57063efa2 port of aarch64 cuda changes from 2.4 2015-04-23 17:57:29 +03:00
Alexander Alekhin
b057a62c8b Set status to rc 2015-04-23 17:29:40 +03:00
Vladislav Vinogradov
1325213303 use border extrapolation for central pixel in pyrDown
in case if image has odd dimension
2015-04-23 17:21:42 +03:00
Vladislav Vinogradov
fb15bdfb21 fix racecheck warning in scanRows kernel 2015-04-23 17:21:42 +03:00
Vladislav Vinogradov
9d2d173485 increase epsilon for solvePnPRansac function 2015-04-23 17:21:42 +03:00
Vadim Pisarevsky
12a3156aff Merge pull request #3955 from vpisarev:fixed_mjpeg_encoder 2015-04-23 14:21:32 +00:00
Deanna Hood
eee210f3b5 Fix Bug #3441, #4072, #4173: 8-point fundamental matrix calculation error 2015-04-23 10:09:48 -04:00
Deanna Hood
34bc3b8595 Don't relax error level for particular fundamental matrix calculation methods 2015-04-23 10:08:42 -04:00
Vadim Pisarevsky
26e3bcb9de Merge pull request #3956 from ilya-lavrenov:cuda_aarch64 2015-04-23 13:49:33 +00:00
Vadim Pisarevsky
960dee8ab8 Merge pull request #3953 from ilya-lavrenov:cuda_unused 2015-04-23 12:26:07 +00:00
Ilya Lavrenov
847976de4e fixed find cuda for aarch64 2015-04-23 14:49:12 +03:00
Vadim Pisarevsky
d825b7ee9a fixed mjpeg encoder so that libjpeg-based decoder does not complain on extra bytes in the end of stream 2015-04-23 14:40:44 +03:00
Martin Ueding
5ffb53f229 Add example data types for calibrateCamera call
It took me a while to figure out what was meant with

    OpenCV Error: Assertion failed (i < 0) in getMat

While searching for this error message I found [a list of error
messages](https://adventuresandwhathaveyou.wordpress.com/2014/03/14/opencv-error-messages-suck/)
which also explained what the problem was: The data type for `rvecs` was
not a simple `cv::Mat` but a `std::vector<cv::Mat>`.

After I fixed that, I got the next error message:

    OpenCV Error: Assertion failed (ni > 0 && ni == ni1) in
    collectCalibrationData, file
    /build/buildd/opencv-2.4.9+dfsg/modules/calib3d/src/calibration.cpp,
    line 3193

The problem here was that my data type for the `objectPoints` was just
`vector<Vec3f>` and not `vector<vector<Vec3f>>`.

In order to save other people the time looking for this, I added
explicit examples of the needed data types into the documentation of the
function. I had to re-read the current version a couple of times until I
can read the needed levels of `vector<>`. Having this example would have
really helped me there.
2015-04-23 13:30:14 +02:00
Ilya Lavrenov
ceec0eb33a rmeoved unused functions 2015-04-23 12:48:50 +03:00
Vadim Pisarevsky
dcf177e372 Merge pull request #3952 from vpisarev:fix_libav_case 2015-04-23 06:25:25 +00:00
Vadim Pisarevsky
30912b49f3 fixed compile warnings; hopefully fixed test failures 2015-04-23 00:39:44 +03:00
Vadim Pisarevsky
882dc0a7f6 Merge pull request #3950 from paroj:fix-gftt_ocl 2015-04-22 19:08:15 +00:00
Vadim Pisarevsky
4840c4ae6f Merge pull request #3949 from ilya-lavrenov:clobbered_warning 2015-04-22 19:07:46 +00:00
Vadim Pisarevsky
d8f62673d7 Merge pull request #3951 from kalistratovag:mjpeg_dec_uninitialized 2015-04-22 19:03:20 +00:00
Vadim Pisarevsky
2b2e3ee93c make sure opencv builds fine with the recent versions of libav (e.g. from Ubuntu 14.10) 2015-04-22 21:57:29 +03:00
kalistratovag
08925330e0 mjpec_decoder initialize m_movi_start variable 2015-04-22 19:49:11 +03:00
Pavel Rojtberg
1ea41e7246 fix gftt opencv kernel when using mask 2015-04-22 16:13:50 +02:00
Ilya Lavrenov
02e29fc99c suppress -Wclobbered warning 2015-04-22 16:42:03 +03:00
Vadim Pisarevsky
7dd19f6d97 Merge pull request #3939 from paroj:fmtfix 2015-04-22 12:15:17 +00:00
Vadim Pisarevsky
415a212d09 Merge pull request #3936 from dhood:fitEllipse-bug 2015-04-22 11:22:35 +00:00
Vadim Pisarevsky
bac4999ae4 Merge pull request #3948 from PhilLab:markdownPatch 2015-04-22 11:02:50 +00:00
Philipp Hasper
0b20ce696a Fixed markdown: **Note** -> @note 2015-04-22 08:08:10 +02:00
Vadim Pisarevsky
a69b435c92 Merge pull request #3909 from Nuzhny007:master 2015-04-21 14:02:59 +00:00
Vadim Pisarevsky
063e4004ba Merge pull request #3935 from vpisarev:extending_hal_part1 2015-04-21 14:02:02 +00:00
Vadim Pisarevsky
dce0405c4d Merge pull request #3947 from tcavallari:patch-1 2015-04-21 14:01:22 +00:00
Vadim Pisarevsky
8e493ef370 Merge pull request #3925 from ttagu99:findcontour_example2 2015-04-21 12:21:36 +00:00
Vadim Pisarevsky
887fe932cc Merge pull request #3926 from stoneyang:stone 2015-04-21 12:20:42 +00:00
Vadim Pisarevsky
0f13208d81 Merge pull request #3929 from daeyun:findEssentialMat_doc 2015-04-21 12:20:02 +00:00
Vadim Pisarevsky
737d866197 Merge pull request #3930 from berak:python_docs_stereobm 2015-04-21 12:19:37 +00:00
Vadim Pisarevsky
4c875dc393 Merge pull request #3932 from nisargthakkar:Bug4243 2015-04-21 12:18:37 +00:00
Vadim Pisarevsky
60a51b82d7 Merge pull request #3921 from sergarrido:master 2015-04-21 12:11:57 +00:00
Vadim Pisarevsky
99d0fcf49d Merge pull request #3938 from paroj:triangulatecpp 2015-04-21 12:02:26 +00:00
Vadim Pisarevsky
faf84e7100 Merge pull request #3937 from mshabunin:android-engine3 2015-04-21 11:47:26 +00:00
Vadim Pisarevsky
d01ee09fd6 Merge pull request #3945 from nisargthakkar:DocBugFix4282 2015-04-21 11:46:30 +00:00
Vadim Pisarevsky
926754a66e another attempt to resolve ABI checker complains 2015-04-21 12:42:46 +03:00
Pavel Rojtberg
78eac67a01 clean up cvTriangulatePoints by using C++ primitives directly.
- fixes the Calib3d_StereoCalibrate_C testcase.
update comment regarding cv::SVD::MODIFY_A
2015-04-21 11:29:26 +02:00
Vadim Pisarevsky
fa41653420 trying to avoid ABI checker failures 2015-04-21 11:30:41 +03:00
tcavallari
cca78e0601 Null Pointer check in vizimpl.cpp
Should fix #4191 (http://code.opencv.org/issues/4191)
2015-04-21 10:08:17 +02:00
lujia
7ce116695d bugfix_for_hog_detectMultiScale_with_weights 2015-04-21 02:32:27 -04:00
Nisarg Thakkar
0fd1203b3b Fixed Doc Errors Bug#4282 2015-04-21 10:37:50 +05:30
Vadim Pisarevsky
b27467d9f9 Merge pull request #3931 from mshabunin:fix-svm-train 2015-04-20 20:00:36 +00:00
Vadim Pisarevsky
b4aa37aa30 Merge pull request #3933 from BKNio:putText_3_0 2015-04-20 20:00:11 +00:00
Vadim Pisarevsky
c879b1ab09 Merge pull request #3940 from sergarrido:fix-gen_pattern.py-2.4 2015-04-20 19:47:55 +00:00
Vadim Pisarevsky
6916a1438f fixed some newly introduced compile errors and warnings 2015-04-20 21:34:37 +03:00
Vadim Pisarevsky
ca9a2887fc extended universal intrinsics: added 64-bit integers, improved shift operators, renamed "pack" operations; changed semantics of extended integer multiplication, added v_dotprod.
also, split intrinsics into separate files. C implementation is compiled only when none of SSE2 or NEON is available.
2015-04-20 20:27:03 +03:00
Vladislav Vinogradov
a984da911b increase epsilons for some sanity tests
(cherry picked from commit 6a6619ec1eb20e1c78705167c76fad4f0f6b578a)
2015-04-19 14:06:47 +03:00
Vladislav Vinogradov
df55be3c3d fix BruteForceMatcher resource distribution
added launch bounds attributes for all CUDA kernels
(cherry picked from commit d22516872cab0fa7c9b661f85e1eb1d36b2ff7cb)
2015-04-19 14:06:36 +03:00
Vladislav Vinogradov
55339de684 make NVIDIA tests verbose by default
(cherry picked from commit 17608f7ade9f31f2363bcf1d15153b75868b8f15)
2015-04-19 14:06:25 +03:00
Vladislav Vinogradov
f08dd510fa fixed a bug in scanRows CUDA kernel (part of nppStIntegral)
uninitialized value
(cherry picked from commit 81ebe28c24df70fe06bbebe650eea0585bada0cd)
2015-04-19 14:06:11 +03:00
Alexander Smorkalov
de8d8720a2 Merge pull request #3924 from jet47:gpu-fixes 2015-04-19 11:04:55 +00:00
Vladislav Vinogradov
d308ed3712 fix GPU WARP border mode in CUDA 7.0 and Maxwell architecture
(cherry picked from commit 27302c367cdd8636a0cd0dd290cc0fbfe0555f6b)
2015-04-19 14:02:54 +03:00
Vladislav Vinogradov
6d0f8aa893 fix tests for gpu HOG
initialize HOG after CUDA device switch
(cherry picked from commit c849492dfa07c6a35dfbd3c44a42c1c6a4fc0d60)
2015-04-19 14:01:16 +03:00
Vladimir Kolesnikov
bea98bd22a Not block PDB file in multithreaded build on Windows.
If used cl compiler, but generator is not Visual Studio e.g. Ninja,
enable FS option to prevent blocking PDB file in multithreaded build.

(cherry picked from commit 58c9135626ed85b3436c44b54030f5d9ab485e43)
2015-04-19 14:00:24 +03:00
Vladislav Vinogradov
4539607ab1 fix gpu HOG implementation:
move hog::set_up_constants from constructor to compute method

if user changed CUDA device between constructor and computation,
some variables were uninitialized
(cherry picked from commit 21bbed7bafd25114ff15d8012f3f8619d258d0c1)
2015-04-19 13:57:37 +03:00
Vladislav Vinogradov
b320138dba fix GpuMat::setTo implementation
previous implementation was not thread/stream safe, since it used constant
memory

new implementation doesn't use any global objects, so it is thread/stream safe
(cherry picked from commit 4f5d30a865bd45f144cc70aed1057ac500a72e0c)
2015-04-19 13:57:23 +03:00
Vladislav Vinogradov
95ea12588e set epsilon for gpu OpticalFlowBM to 1e-6, since it uses floating point arithmetic
(cherry picked from commit c147ab1e8574bf5adc6847a9700d9d6718dc8a2f)
2015-04-19 13:57:03 +03:00
Roman Donchenko
bcd08b5d18 Mark the libs component required
Everything else depends on it, after all.

(cherry picked from commit cf54e3b97ea13c0aeef5e94b5330a4b26a601d81)
2015-04-19 13:55:35 +03:00
Roman Donchenko
19298ae3cb Add component display names
(cherry picked from commit 6d52ea898442d2458a40f8b06b75320c9ab4a5cc)
2015-04-19 13:55:22 +03:00
Roman Donchenko
5e06da3050 Update the CPack variables to match the changes in asmorkalov/CMake#1
Which also happens to align the non-Debian specific variables
with the ones used by upstream CMake.

(cherry picked from commit b8c60234c3fa94c31a3e2a72275fefa811c75d5c)

Conflicts:
	cmake/OpenCVPackaging.cmake
2015-04-19 13:54:32 +03:00
Roman Donchenko
17ac18a7b9 Remove useless CPACK_*_COMPONENT_INSTALL variables
They don't actually do anything. And even if they did, all components are
enabled by default, anyway.

(cherry picked from commit 49fe496914cca93f19dd61aa7b1c120037d65282)
2015-04-19 13:42:14 +03:00
Roman Donchenko
c259590b26 Fix a memory leak in CvCapture_FFMPEG::close
FFmpeg now requires that frames allocated with avcodec_alloc_frame are
freed with avcodec_free_frame.

(cherry picked from commit 77578d415f4d2b22a4ee1989ef0afda73c9d649b)
2015-04-19 13:41:22 +03:00
Roman Donchenko
3f3ca85103 Don't use ${CMAKE_INSTALL_PREFIX} as an install destination
Absolute destinations are not necessary, and prevent CPack from working.

(cherry picked from commit 0387f8ad56ba863a3d0d6656579e839ccaa66f10)
2015-04-19 13:39:55 +03:00
Alexander Smorkalov
05ddc16eaa Added Debian changelog to -tests package.
(cherry picked from commit a87ccb9ac068ef1cb9a5c99cd98615fade6676bf)
2015-04-19 13:39:01 +03:00
Alexander Smorkalov
2ba77614aa Debian package names replaced by lower case version to satisfy lintian.
(cherry picked from commit e6ac64008bf8186f5ea30de25573ce667ab28d29)
2015-04-19 13:38:46 +03:00
Vladislav Vinogradov
ef347aa6a4 disable gpu::matchTemplate tests
(cherry picked from commit 7bb8c50080045dd350441e8ce744b1aa5f29cee8)
2015-04-19 13:38:20 +03:00
Alexander Smorkalov
b1cdb91139 Fixed samples install permissions for Debian packaging.
(cherry picked from commit cf852972d1c40ce16a56b8e7d5fbf060716560eb)
2015-04-19 13:37:50 +03:00
Alexander Smorkalov
a09ad35d98 opencv_testing.sh script installation is removed as run tests script does the same thing.
(cherry picked from commit 9206ec30a25ce8653c3acc1603501e4f545bed25)
2015-04-19 13:37:29 +03:00
Alexander Smorkalov
1b5835cd35 Added dependency from numpy to debian package with python bindings.
(cherry picked from commit be6b8476750e1aefe21c9775b0b732b497e2d4bd)
2015-04-19 13:37:04 +03:00
Alexander Smorkalov
9932bbad3a Added Debian changelog installation step for Debian package generation.
(cherry picked from commit ddc1b965b62a699239851c509e89efe23442a36e)
2015-04-19 13:36:47 +03:00
Vijay Pradeep
39ac84ff04 Fixing race condition by expanding resultsMutex lock section
(cherry picked from commit 042ff210d57bba264639bcfe8974d0b3304d18a7)
2015-04-19 13:36:17 +03:00
Vladislav Vinogradov
fcbefaff86 fix tests for gpu::matchTemplate:
use ASSERT_FLOAT_EQ to compare float values, it is more robust for
large values
(cherry picked from commit d00f36ec7585d98c7cab26430c55e9c82b97ed49)
2015-04-19 13:32:24 +03:00
Roman Donchenko
bf2256fb89 cvOpenFileStorage: reduce the scope of xml_buf and make sure it's freed...
... before any exceptions occur.

(cherry picked from commit 08da247a871ed40b868119a999af538da6526c6d)
2015-04-19 13:31:52 +03:00
Vladislav Vinogradov
b0b2fc9e3f get rid of cuda.h usage
(cherry picked from commit eeb997261d1d22e8c69af777c86e21cce2d04f87)
2015-04-19 13:29:45 +03:00
Roman Donchenko
1ccd64e102 Fix uninitialized memory reads and memory leaks in StereoGC
(cherry picked from commit 7d8e5f623a9f1f971c45aa4912dc4679f5165f43)
2015-04-19 13:27:55 +03:00
Vicente Olivert Riera
23bf3e337a superres: Fix return value VideoFrameSource_GPU
superres module fails to compile with the following error messages:

[100%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/super_resolution.cpp.o
/opencv-2.4.10/modules/superres/src/frame_source.cpp: In function 'cv::Ptr<cv::superres::FrameSource> cv::superres::createFrameSource_Video_GPU(const string&)':
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:16: error: expected type-specifier before 'VideoFrameSource'
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:16: error: could not convert '(int*)operator new(4ul)' from 'int*' to 'cv::Ptr<cv::superres::FrameSource>'
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:16: error: expected ';' before 'VideoFrameSource'
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:41: error: 'VideoFrameSource' was not declared in this scope
/opencv-2.4.10/modules/superres/src/frame_source.cpp:264:1: error: control reaches end of non-void function [-Werror=return-type]
cc1plus: some warnings being treated as errors
make[3]: *** [modules/superres/CMakeFiles/opencv_superres.dir/src/frame_source.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....

This is caused because the return value of the createFrameSource_Video_GPU function should be a VideoFrameSource_GPU object.
(cherry picked from commit 2e393ab83362743ba1825ad4b31d4a2925c606b4)
2015-04-19 13:25:16 +03:00
Vladislav Vinogradov
3cf265992f fix installation layout for debian packages:
Install symlinks to shared libraries as a part of development package,
not runtime package.

It is default behavior for debian packages.
(cherry picked from commit f55c1cc0fb390f88c91557cb443e932f459c5849)
2015-04-19 13:23:47 +03:00
S. Garrido
a855d230ec completing and fixing gen_pattern.py for 2.4 branch 2015-04-18 22:13:22 +02:00
Deanna Hood
37f77e7397 Change condition on parallel ellipse case so can only calculate t if necessary 2015-04-18 13:51:32 -04:00
Deanna Hood
5a552b6d8d Regression test for Bug #3989: check fitEllipse with rotation angles of n*pi/2 2015-04-18 13:51:26 -04:00
Pavel Rojtberg
b02fc039cd fix python and numpy output formatters 2015-04-17 17:42:24 +02:00
Maksim Shabunin
a362aca783 Rename manager package to OpenCV3 Manager 2015-04-17 16:59:52 +03:00
Vadim Pisarevsky
46a6f70d88 Merge pull request #3934 from mshabunin:add-cpp-sample-project 2015-04-17 13:40:34 +00:00
Maksim Shabunin
316d76bdb6 Rename OpenCV Engine to org.opencv.engine3 for release candidate 2015-04-17 16:00:33 +03:00
Vadim Pisarevsky
92f2ad0a11 trying to fix test failures (take 2) 2015-04-17 11:32:20 +03:00
Vadim Pisarevsky
17675b4cb8 trying to fix test failures 2015-04-17 10:51:49 +03:00
Vadim Pisarevsky
ce7590bd24 continuing fixing universal intrinsics 2015-04-17 08:32:06 +03:00
Vadim Pisarevsky
bfbf864a73 fixed some more compile warnings (2) 2015-04-17 00:13:08 +03:00
Vadim Pisarevsky
1fcc83b84b fixed some more compile warnings 2015-04-16 23:52:23 +03:00
Vadim Pisarevsky
c7121e8772 fixed compile warnings 2015-04-16 23:42:00 +03:00
Vadim Pisarevsky
ee11a2d266 fully implemented SSE and NEON cases of intrin.hpp; extended the HAL with some basic math functions 2015-04-16 23:00:26 +03:00
Deanna Hood
103336c76e Fix Bug #3989: correctly identify ellipse with its axes parallel to x-y axes during semi-major axis calculation 2015-04-16 11:59:05 -04:00
Maksim Shabunin
b80142be69 Fix an issue in cmake tutorial 2015-04-16 17:52:00 +03:00
Maksim Shabunin
bb0631a365 Add sample cmake project 2015-04-16 17:33:38 +03:00
Ahmatnurov Dinar
2358c79db2 move 3265 to 3.0; 2015-04-16 14:36:46 +03:00
Nisarg Thakkar
00094a8792 Fix for Bug4243. Made changes relating to non OpenCL devices 2015-04-16 00:22:08 +05:30
Nisarg Thakkar
a0bc0ab7cb Fix for Bug4243 2015-04-15 23:49:01 +05:30
Maksim Shabunin
cb00c7036f Fix cache error during SVM train 2015-04-15 15:46:07 +03:00
Vadim Pisarevsky
a2bba1b9e6 HAL extensions: added initial version of universal intrinsics (C implementation and SSE2, NEON - TBD). added empty files where some functionality from core and imgproc will be moved to 2015-04-15 00:36:27 +03:00
Alexander Alekhin
81c5d58035 Merge pull request #3928 from ilya-lavrenov:android_4.6 2015-04-14 18:12:24 +00:00
berak
723c317108 changed create function in tutorial 2015-04-14 19:01:48 +02:00
Ilya Lavrenov
17bedd72f0 workaround for stange internal compiler error when cross-compiling with 4.6 2015-04-14 16:55:11 +03:00
Daeyun Shin
4686b935c1 Fix typo in documentation. F = K^-T * E * K^-1 2015-04-14 07:44:32 -05:00
Vladislav Vinogradov
6a6619ec1e increase epsilons for some sanity tests 2015-04-14 10:12:56 +03:00
Yang Fan
3b177eaaa3 ENH: explicitly declared outputFilename to surpress error C2668 2015-04-14 13:39:14 +08:00
ttagu99
3c797b0ca5 findcontour_example check image empty 2015-04-14 10:01:53 +09:00
Alexander Alekhin
8c2bde2af4 Merge pull request #3923 from ilya-lavrenov:typo 2015-04-13 16:57:13 +00:00
Vladislav Vinogradov
d22516872c fix BruteForceMatcher resource distribution
added launch bounds attributes for all CUDA kernels
2015-04-13 17:12:04 +03:00
Vladislav Vinogradov
17608f7ade make NVIDIA tests verbose by default 2015-04-13 17:11:19 +03:00
Vladislav Vinogradov
81ebe28c24 fixed a bug in scanRows CUDA kernel (part of nppStIntegral)
uninitialized value
2015-04-13 17:09:59 +03:00
S. Garrido
2f95acf273 completing and fixing gen_pattern.py 2015-04-11 19:03:17 +02:00
cbalint13
dee3a4b528 Add missing opencv_contrib PR #202 patch. 2015-04-11 17:43:28 +03:00
cbalint13
26997f32c6 Fix BRISK detector&descriptor using proper AGAST. 2015-04-11 12:09:13 +03:00
Vadim Pisarevsky
b639353193 Merge pull request #3912 from kalistratovag:mjpeg_dec 2015-04-10 16:18:37 +00:00
yanlend
443b3157e0 Fix win32 search for same bitness executable
find_package(PythonInterp) calls find_program(PYTHON_EXECUTABLE), i.e. without version number. For the Win32-search before to be effective, the same variable has to be used.
2015-04-10 14:57:31 +02:00
Vadim Pisarevsky
c094c58b51 Merge pull request #3916 from mshabunin:fix-winpack-test 2015-04-10 12:48:31 +00:00
kalistratovag
740ae3581c Initial commit of avi mjpeg decoder
std::streams removed

debug code removed

whitespaces removed

stdint.h added and trailing whitespaces removed

trailing whitespaces removed

warnings on windows fix

warnings on windows fix pt 2

Refactoring performed: AviMjpegStream class introduced. CAP_PROP_FRAME_WIDTH and CAP_PROP_FRAME_HEIGHT properties support added.

Windows warnings & uninitialized variable fix

Windows warning fix

Win32 warning fix
2015-04-10 14:16:43 +03:00
Maksim Shabunin
97c78838a4 Fixed windows build and one warning 2015-04-10 11:37:16 +03:00
Vadim Pisarevsky
369a3d1426 Merge pull request #3907 from yxiong:python-dependencies 2015-04-10 05:34:14 +00:00
Maksim Shabunin
728bd0ba84 Merge pull request #3905 from mshabunin:fix-android-mk 2015-04-09 12:08:05 +00:00
Alexander Alekhin
c436cac797 Merge pull request #3913 from mshabunin:fix-world-build 2015-04-09 09:24:21 +00:00
Maksim Shabunin
e7c02f376f Fixed world build with HAL 2015-04-08 19:56:17 +03:00
Maksim Shabunin
f803c2a7bb Generators: updated the library gathering loop 2015-04-08 14:15:20 +03:00
Сергей Нужный
e630375fd6 Merge branch 'master' of https://github.com/Nuzhny007/opencv 2015-04-08 12:53:04 +03:00
Сергей Нужный
4a65f3cee2 Squashed commit of the following:
commit 5c379aa1b83ddd66f67b1a9c2ccd00e5bac8576e
Merge: e800800 3646967
Author: Сергей Нужный <snuzhny@stc-spb.ru>
Date:   Wed Apr 8 12:44:46 2015 +0300

    Merge branch 'master' of https://github.com/Nuzhny007/opencv

commit e800800bec8596127274f359e744723a7371b5b7
Author: Сергей Нужный <snuzhny@stc-spb.ru>
Date:   Wed Apr 8 12:43:38 2015 +0300

    Squashed commit of the following:

    commit 3646967deb9b48f45c44203e5c96836a8a180218
    Author: Сергей Нужный <snuzhny@stc-spb.ru>
    Date:   Tue Apr 7 15:48:30 2015 +0300

        Fix bug in SVM::trainAuto

    commit 0c24ccf53897c60dff19193623a97fc4713ce14e
    Author: Сергей Нужный <snuzhny@stc-spb.ru>
    Date:   Tue Apr 7 15:43:59 2015 +0300

        Revert "Fix bug in SVM::trainAuto"

        This reverts commit 225da0226e4e9d54e97aee488ac2b5ed4e813443.

    commit 225da0226e4e9d54e97aee488ac2b5ed4e813443
    Author: Сергей Нужный <snuzhny@stc-spb.ru>
    Date:   Tue Apr 7 15:09:47 2015 +0300

        Fix bug in SVM::trainAuto

commit 3646967deb9b48f45c44203e5c96836a8a180218
Author: Сергей Нужный <snuzhny@stc-spb.ru>
Date:   Tue Apr 7 15:48:30 2015 +0300

    Fix bug in SVM::trainAuto

commit 0c24ccf53897c60dff19193623a97fc4713ce14e
Author: Сергей Нужный <snuzhny@stc-spb.ru>
Date:   Tue Apr 7 15:43:59 2015 +0300

    Revert "Fix bug in SVM::trainAuto"

    This reverts commit 225da0226e4e9d54e97aee488ac2b5ed4e813443.

commit 225da0226e4e9d54e97aee488ac2b5ed4e813443
Author: Сергей Нужный <snuzhny@stc-spb.ru>
Date:   Tue Apr 7 15:09:47 2015 +0300

    Fix bug in SVM::trainAuto
2015-04-08 12:51:57 +03:00
Сергей Нужный
5c379aa1b8 Merge branch 'master' of https://github.com/Nuzhny007/opencv 2015-04-08 12:44:46 +03:00
Сергей Нужный
e800800bec Squashed commit of the following:
commit 3646967deb9b48f45c44203e5c96836a8a180218
Author: Сергей Нужный <snuzhny@stc-spb.ru>
Date:   Tue Apr 7 15:48:30 2015 +0300

    Fix bug in SVM::trainAuto

commit 0c24ccf53897c60dff19193623a97fc4713ce14e
Author: Сергей Нужный <snuzhny@stc-spb.ru>
Date:   Tue Apr 7 15:43:59 2015 +0300

    Revert "Fix bug in SVM::trainAuto"

    This reverts commit 225da0226e4e9d54e97aee488ac2b5ed4e813443.

commit 225da0226e4e9d54e97aee488ac2b5ed4e813443
Author: Сергей Нужный <snuzhny@stc-spb.ru>
Date:   Tue Apr 7 15:09:47 2015 +0300

    Fix bug in SVM::trainAuto
2015-04-08 12:43:38 +03:00
Vadim Pisarevsky
5b3f89df0a Merge pull request #3911 from vpisarev:core_tweaks 2015-04-07 19:03:48 +00:00
Vadim Pisarevsky
edb4a7ad03 Merge pull request #3879 from mshabunin:add-hal 2015-04-07 17:06:58 +00:00
Vadim Pisarevsky
259e41da73 reverted "typedef _InputArray InputArray", fixed warning from doxygen 2015-04-07 19:34:51 +03:00
Maksim Shabunin
35b2139929 Basic HAL module 2015-04-07 18:16:22 +03:00
Vadim Pisarevsky
052593c760 1. Input/OutputArray optimizations;
2. Algorithm::load/save added (moved from StatModel)
3. copyrights updated; added copyright/licensing info for ffmpeg
4. some warnings from Xcode 6.x are fixed
2015-04-07 16:44:26 +03:00
Сергей Нужный
3646967deb Fix bug in SVM::trainAuto 2015-04-07 15:48:30 +03:00
Сергей Нужный
0c24ccf538 Revert "Fix bug in SVM::trainAuto"
This reverts commit 225da0226e4e9d54e97aee488ac2b5ed4e813443.
2015-04-07 15:43:59 +03:00
Сергей Нужный
225da0226e Fix bug in SVM::trainAuto 2015-04-07 15:09:47 +03:00
Vadim Pisarevsky
f7792f0be2 Merge pull request #3908 from jet47:gpu-wrap-border-mode 2015-04-07 11:44:51 +00:00
Vladislav Vinogradov
27302c367c fix GPU WARP border mode in CUDA 7.0 and Maxwell architecture 2015-04-07 13:04:31 +03:00
Vadim Pisarevsky
44f112a9de Merge pull request #3906 from yxiong:policy-0042 2015-04-07 09:35:07 +00:00
Vadim Pisarevsky
bd2be9c79c Merge pull request #3890 from greensea:patch-1 2015-04-07 09:33:36 +00:00
Vadim Pisarevsky
a153948a19 Merge pull request #3898 from greensea:2.4 2015-04-07 09:31:36 +00:00
Ilya Lavrenov
4273534c92 typo 2015-04-07 11:08:21 +03:00
greensea
7274e2ff1a Fix a segment fault issue in cascade classfier 2015-04-07 10:38:58 +08:00
greensea
52c727f09a Fix a segment fault issue in cascade classfier
work_var_count and sample_count are both 32bit integer, if the product of work_var_count and sample_count is bigger than 2^31, the compiler will treat (work_var_count*sample_count) as a negative number. Force work_var_count as an unsigned 64bit integer to avoid this issue.
2015-04-07 10:31:12 +08:00
Ying Xiong
2d8b4fea9f Add #ifdef's such that python wrapper builds independent of other components 2015-04-06 19:57:10 -04:00
Ying Xiong
9cccd87e79 Silence cmake 3.0+ warnings about MACOSX_RPATH 2015-04-06 16:37:06 -04:00
Nuzhny007
581923fa57 Merge pull request #1 from Itseez/master
merge with itseez/opencv/master
2015-04-06 16:24:53 +03:00
Maksim Shabunin
979721c979 Fix generating of android.mk 2015-04-06 16:12:00 +03:00
Vadim Pisarevsky
ac22c524fc Merge pull request #3903 from SeninAndrew:master 2015-04-05 18:01:18 +00:00
Vadim Pisarevsky
0e8bfff386 Merge pull request #3904 from SeninAndrew:2.4 2015-04-05 18:00:30 +00:00
Vadim Pisarevsky
08c84e0c34 Merge pull request #3729 from bitstars:AsyncServiceHelper.java-Android-5-hotfix 2015-04-05 17:57:53 +00:00
Vadim Pisarevsky
caa03f72b7 Merge pull request #3694 from Ashod:jp2 2015-04-05 17:57:11 +00:00
Ashod Nakashian
f75f2ffd48 Jpeg2k color to greyscale conversion on non-Windows is done post decoding because system libjasper segfaults when decoding color images as greyscale. 2015-04-03 21:01:45 -04:00
Ashod Nakashian
54ab3137d5 Simplified temp filename generation. 2015-04-03 21:01:44 -04:00
Ashod Nakashian
6fd2fdc2e6 Jasper unit-tests and removed a superfluous assertion. 2015-04-03 21:01:43 -04:00
Ashod Nakashian
03ea24f298 Fix for decoding large Jp2 images on Windows.
On Windows, the tmpnam function returns a temp filename in the current directory, which has a prepended backslash '\\'.
This subsequently fails the open function.

This patch creates a proper temp filename in the temp folder and makes unlike work by opening the file as short-lived.
2015-04-03 21:01:42 -04:00
Andrew Senin
8c55d7be5e Ximea camera fix (see issue #4235) 2015-04-03 22:50:05 +03:00
Andrew Senin
58f20a3b7f Ximea camera fix (see issue #4235) 2015-04-03 22:49:50 +03:00
Vadim Pisarevsky
085b4ca741 Merge pull request #3902 from apavlenko:doc_fix_imwrite_master 2015-04-03 13:26:22 +00:00
Vadim Pisarevsky
f6de017171 Merge pull request #3900 from apavlenko:doc_fix_imwrite 2015-04-03 13:26:00 +00:00
Vadim Pisarevsky
be9c6bdd67 Merge pull request #3901 from StevenPuttemans:add_breakrule_cascade_accuracy 2015-04-03 13:24:47 +00:00
Vadim Pisarevsky
cc63452f65 Merge pull request #3899 from StevenPuttemans:add_breakrule_traincascade_2.4 2015-04-03 11:44:55 +00:00
Andrey Pavlenko
ed9f933d41 fixing confusing variable naming in a sample code 2015-04-03 14:03:09 +03:00
Andrey Pavlenko
eeae81e903 fixing confusing variable naming in a sample code 2015-04-03 13:54:49 +03:00
StevenPuttemans
796c15d3e6 fixing wrong equation in accuracy break rule 2015-04-03 12:54:05 +02:00
StevenPuttemans
e30139edc3 add the possibility to add traincascade accuracy 2015-04-03 12:47:09 +02:00
Vadim Pisarevsky
f01b2413c3 Merge pull request #3770 from jet47:gpu-hog-tests 2015-04-03 10:32:59 +00:00
Vadim Pisarevsky
240b52151d Merge pull request #3798 from StevenPuttemans:add_breakrule_cascade_accuracy 2015-04-03 10:19:03 +00:00
Vadim Pisarevsky
559dfa297d Merge pull request #3813 from hahne:iss1915 2015-04-03 10:16:30 +00:00
StevenPuttemans
7e35f76d06 allowing people to manually define how sharp a cascade classifier model should be trained 2015-04-03 10:02:13 +02:00
Alexander Smorkalov
772fcf4088 Merge pull request #3893 from SpecLad:cuda-imported-targets 2015-04-02 13:56:31 +00:00
Vadim Pisarevsky
a035d39158 Merge pull request #3892 from MSOpenTech:imgcodecs-contrib 2015-04-02 11:53:55 +00:00
Vadim Pisarevsky
246b7abe7e Merge pull request #3869 from Dikay900:remove_unused_variable 2015-04-02 11:48:43 +00:00
Vadim Pisarevsky
da0e2c5bf3 Merge pull request #3889 from nitsch:fix-mingw-cmake 2015-04-02 11:45:20 +00:00
Vadim Pisarevsky
38ce0fe954 Merge pull request #3897 from sanchom:bugfix_4030 2015-04-02 11:44:32 +00:00
ippei ito
b8c00854fe instead of "using namespace cv" put all the tests into cv:: namespace. 2015-04-02 19:58:19 +09:00
Simon Heinen
d2dc7f4c27 Update android+AsyncServiceHelper.java
small formatting fixes
2015-04-02 09:05:56 +02:00
Simon Heinen
0df9dc8fb9 Update android+AsyncServiceHelper.java
changed tabs in last commit to spaces
2015-04-02 08:42:19 +02:00
Sancho McCann
6593422c05 Bugfix: #4030 SVM auto-training. 2015-04-01 20:44:51 +00:00
Dikay900
952f9dbe62 initialize tiltedOffset variable at correct location
do not use this variable if it is not an tilted feature
2015-04-01 20:32:30 +02:00
Vadim Pisarevsky
ba0a8dc723 Merge pull request #3783 from StevenPuttemans:fix_traincascade_getNegatives 2015-04-01 13:56:29 +00:00
Vadim Pisarevsky
100c2dd91c Merge pull request #3852 from renko:multithread_cl_not_studio_generator 2015-04-01 13:25:39 +00:00
Vadim Pisarevsky
5ab26e3202 Merge pull request #3874 from paroj:calib_sample 2015-04-01 11:13:05 +00:00
Vadim Pisarevsky
6aaa6a50e3 Merge pull request #3887 from MSOpenTech:update_py_script 2015-04-01 11:05:56 +00:00
Vladimir Kolesnikov
58c9135626 Not block PDB file in multithreaded build on Windows.
If used cl compiler, but generator is not Visual Studio e.g. Ninja,
enable FS option to prevent blocking PDB file in multithreaded build.
2015-04-01 13:52:07 +03:00
Vadim Pisarevsky
80c79d4021 Merge pull request #3891 from mshabunin:fix-v4l2-link 2015-04-01 10:49:52 +00:00
Evgeny Agafonchikov
ae090fe10d Functionality for relocation of tests
This allows to start run.py with --move_tests parameter to place tests

to another location and keep them runnable from there
2015-04-01 11:50:05 +03:00
Evgeny Agafonchikov
1f04f9d63b Fixing help messages
--help message and starting run.py w/o parameters generate different messages

E. g. w/ and w/o build_path in the end

build_path is required, removing square brackets
2015-03-31 17:58:25 +03:00
Maxim Kostin
75850a1351 Added sample imgcodecs logic to winrt sample app
- Made use imread() in OcvImageProcessing sample.
 - Added test/sample logic to verify file creation via imgcodecs.

Signed-off-by: Maxim Kostin <v-maxkos@microsoft.com>
2015-03-31 17:09:09 +03: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
Maxim Kostin
412a2aa4ab Added support for 'imgcodecs' module:
- Resolved GET_ENV and input type incompatibility
 - Made libjpeg compile for WINRT. So does imgcodecs module.
 - Updated .gitignore (log, tlog)
2015-03-31 16:31:37 +03:00
Roman Donchenko
6e121b2e29 Use imported targets for linking to CUDA
This retains the desirable quality of not including paths to CUDA libraries
from the build system into the config files, and has two major advantages:

* It removes the need to use link_directories, which doesn't guarantee that
  the libraries from the supplied directory will be used (there may be
  libraries with the same names earlier in the search path).

* It removes the need to put -L entries into OPENCV_LINKER_LIBS. This variable
  is used with target_link_libraries, where such entries are treated as linker
  flags, so doing this is unportable. I remove the support for -L entries
  from OpenCVGenPkgconfig.cmake, as well, to discourage adding them in the
  future.
2015-03-31 13:46:28 +03:00
Roman Donchenko
149c1c16ba cap_libv4l.cpp depends on both libv4l 1 and 2, so search for both
How this worked before, I do not know.
2015-03-31 12:41:50 +03:00
Alexander Nitsch
afd9de6f1b Fix static/shared lib detection
The check for BUILD_SHARED_LIBS had its logic backwards. If this
variable is not defined we must assume a build of static libs.
2015-03-31 00:05:49 +02:00
Alexander Nitsch
66e653d24d Remove local variables from CMAKE namespace 2015-03-31 00:05:48 +02:00
Alexander Nitsch
3fff0e5b3c Fix MinGW detection on x86
Make detection of x64 using the gcc's target triplet identical
to the one used in cmake/OpenCVDetectCXXCompiler.cmake.
Otherwise, MinGW-w64 setups will always be treated as x64 since
they contain "w64" as vendor key.
2015-03-31 00:05:48 +02:00
Alexander Nitsch
8f84a73b82 Fix MinGW architecture detection
Fix typo that would always lead to detection of x86 for MinGW
builds in the OpenCVConfig.cmake file.
2015-03-31 00:05:47 +02:00
Alexander Nitsch
2e86cedef2 Fix MinGW detection on x86
MinGW-w64 always uses "w64" as vendor key which the previously
used check for "64" anywhere in the target triplet matched. This
would lead to MinGW-w64 setups always being treated as x64.

Turns out we do not even need this additional check since the
architecture has been correctly determined earlier in this file.
No need to do it again.
2015-03-31 00:02:03 +02:00
Vadim Pisarevsky
864b4e3b26 Merge pull request #3873 from Dmitry-Me:reduceVariableScope10 2015-03-30 17:20:39 +00:00
Alexander Alekhin
13a9d4a61f Merge pull request #3888 from alalek:fix_build 2015-03-30 15:52:05 +00:00
Alexander Alekhin
d326c77007 fix build (related to PR #3814) 2015-03-30 16:32:00 +03:00
Roman Donchenko
e6619cf580 Move the CUDA searching code in OpenCVConfig.cmake.in out of the foreach loop
There's no reason to do it twice.
2015-03-30 15:04:27 +03:00
Roman Donchenko
122b9f8e17 Turn ocv_convert_to_lib_name into a function 2015-03-30 14:58:37 +03:00
Vadim Pisarevsky
4b0543c887 Merge pull request #3883 from kmsquire:python_cmake_fix 2015-03-30 09:38:18 +00:00
Vadim Pisarevsky
fa9c9e791b Merge pull request #3876 from vpisarev:mjpeg_codec 2015-03-30 09:27:10 +00:00
Vadim Pisarevsky
ff682a30b3 Merge pull request #3872 from mshabunin:add-rst-link 2015-03-30 09:13:26 +00:00
Vadim Pisarevsky
d948b2a235 Merge pull request #3886 from beahacker:2.4 2015-03-30 09:09:31 +00:00
howtobeahacker
ebd7d08408 fix bug 4269 2015-03-30 00:01:20 +08:00
Alexander Alekhin
d279f127c1 Merge pull request #3884 from mshabunin:fix-vc10-build 2015-03-27 18:03:37 +00:00
Vadim Pisarevsky
602d2c33c0 added video writer quality, which user may change dynamically in the case of motion jpeg; enabled NEON intrinsics in the encoder 2015-03-27 15:15:59 +03:00
ippei ito
140051b18c Merge remote-tracking branch 'origin/2.4-flann-lsh-addable-index' into 2.4-flann-lsh-addable-index 2015-03-27 20:55:59 +09:00
ippei ito
b7276359e9 Test accuracy for PR#3829 2015-03-27 20:54:05 +09:00
Maksim Shabunin
56b02331f7 Commented unused constants in the RHO algorithm 2015-03-27 14:36:27 +03:00
Maksim Shabunin
fab2a947ca Fix build for VC10 2015-03-27 12:15:26 +03:00
Kevin Squire
5e354fa844 Allow PYTHON_LIBRARY and PYTHON_INCLUDE_DIR to actually be overridden 2015-03-26 17:48:03 -07:00
Vadim Pisarevsky
77cbddf715 Merge pull request #3847 from mshabunin:android-build 2015-03-26 16:56:49 +00:00
Vadim Pisarevsky
83d6d70a56 Merge pull request #3855 from polarfuchs99:2.4 2015-03-26 16:55:30 +00:00
Vadim Pisarevsky
1381564a84 Merge pull request #3880 from vpisarev:fix_emd 2015-03-26 16:40:17 +00:00
Vadim Pisarevsky
10e0540e61 Merge pull request #3871 from potpath:patch-1 2015-03-26 13:35:35 +00:00
Vadim Pisarevsky
b123870871 Merge pull request #3868 from Dikay900:fix_cudalegacy_without_cudaimgproc 2015-03-26 13:35:12 +00:00
Vadim Pisarevsky
b91313a84e initialize the output flow in EMD (thanks to Daniel DeMenthon for the bug report) 2015-03-26 16:26:41 +03:00
Vadim Pisarevsky
eff302a231 Merge pull request #3875 from alalek:fix_build 2015-03-26 13:09:01 +00:00
Vadim Pisarevsky
8d1232cc7a fixed warnings; transpose qtab to make it compatible with neon branch 2015-03-26 15:59:49 +03:00
Vadim Pisarevsky
109b696599 Merge pull request #3878 from mshabunin:fix-python 2015-03-26 10:22:11 +00:00
Maksim Shabunin
e94dfcee0d Add python test for inheritance structure generation 2015-03-26 11:43:49 +03:00
Maksim Shabunin
82adf7955f Fix python submodules inheritance detection 2015-03-26 11:22:56 +03:00
Vadim Pisarevsky
3df6b6fdcf added self-contained motion jpeg encoder (filename should end with .avi; fourcc should be "MJPG" 2015-03-26 00:39:29 +03:00
Alexander Alekhin
32da602bf7 fix build (related to PR #3814) 2015-03-25 19:12:36 +03:00
Prof. Dr. Rudolf Haussmann
a9d4e05346 Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

	modified:   highgui/include/opencv2/highgui/highgui_c.h
	modified:   highgui/src/cap_dshow.cpp
	modified:   java/generator/gen_java.py

The correction of the orthographic error in the enumeration constant
CAP_PROP_MONOCROME has been undone.
2015-03-25 15:45:20 +01:00
Dmitry-Me
75a65542ba Reduce variables scope 2015-03-25 17:17:06 +03:00
Vadim Pisarevsky
97bdc92d1b Merge pull request #3870 from Dmitry-Me:reduceVariableScope9 2015-03-25 13:32:33 +00:00
Maksim Shabunin
313e799df5 Add link to old documentation format 2015-03-25 16:27:35 +03:00
Dikay900
3465cef689 disable cuda::OpticalFlowNeedleMap if configured without cudaimgproc
disable cuda::FastOpticalFlowBM if configured without cudaarithm
2015-03-25 13:47:53 +01:00
Prof. Dr. Rudolf Haussmann
e5e6367223 Merge remote-tracking branch 'upstream/2.4' into 2.4 2015-03-25 13:38:49 +01:00
potpath
86c7d601b0 Fix a typo in template_matching.markdown
Fix a typo in first equation under method=CV_TM_CCOEFF.
2015-03-25 18:07:01 +07:00
Vadim Pisarevsky
0545aeb11b Merge pull request #3670 from obilaniu:master 2015-03-25 10:10:05 +00:00
Vadim Pisarevsky
5678ba1227 Merge pull request #3805 from nitsch:fix-mingw-cmake-config 2015-03-25 09:53:35 +00:00
Vadim Pisarevsky
b01f067614 Merge pull request #3865 from tdsmith:2.4-python-linkage 2015-03-25 09:52:52 +00:00
Vadim Pisarevsky
bd7c78ffd5 Merge pull request #3866 from tdsmith:python-linkage 2015-03-25 09:51:20 +00:00
ippei ito
65b0ecfec5 Test accuracy for PR#3829.Fix WOrder warning on gcc 2015-03-25 18:24:52 +09:00
Dmitry-Me
6318409a5d Reduce variable scope 2015-03-25 10:35:11 +03:00
ippei ito
d1902a1276 Test accuracy for PR#3829.Fix warning on gcc, comment out INIT_RANDOM_SEED for same result each ran. 2015-03-25 05:28:29 +09:00
ippei ito
56cae1b293 Test accuracy for PR#3829.Fix Some Error, Modify SLA. 2015-03-25 03:11:44 +09:00
ippei ito
7c740b6a31 Test accuracy for Pull Request # 3829 2015-03-25 02:38:01 +09:00
Vadim Pisarevsky
f6c561a01b Merge pull request #3634 from mshabunin:transition-guide 2015-03-24 16:10:19 +00:00
Maksim Shabunin
dddba2637f Changed Android Manager version to 3.0 2015-03-24 18:57:29 +03:00
Vadim Pisarevsky
5501cfd809 Merge pull request #3814 from erikrk:denoising-16bit-master 2015-03-24 15:23:58 +00:00
Vadim Pisarevsky
7ea0239776 Merge pull request #3835 from StevenPuttemans:upgrade_traincascade_memory_master 2015-03-24 15:19:56 +00:00
Vadim Pisarevsky
3c51fdffac Merge pull request #3849 from Dikay900:fix_tilted_features_crash 2015-03-24 15:19:13 +00:00
Vadim Pisarevsky
f7f10a7d2c Merge pull request #3854 from Dmitry-Me:reduceVariableScope8 2015-03-24 15:13:34 +00:00
Vadim Pisarevsky
d7cb99254e Merge pull request #3858 from MSOpenTech:fix-ml-test 2015-03-24 15:09:53 +00:00
Vadim Pisarevsky
70ff448067 Merge pull request #3859 from NewProggie:fix-doc-typo 2015-03-24 15:08:03 +00:00
Vadim Pisarevsky
54deb5ed5a Merge pull request #3860 from theodr:document_hconcat_vconcat 2015-03-24 15:07:34 +00:00
Vadim Pisarevsky
72b3dcd8b5 Merge pull request #3861 from wangyan42164:cascade_optimizing 2015-03-24 15:07:12 +00:00
Vadim Pisarevsky
174593643c Merge pull request #3863 from MSOpenTech:fix_winrt_linker 2015-03-24 15:05:43 +00:00
Vadim Pisarevsky
dec722b2ee Merge pull request #3864 from MSOpenTech:removed-unused-winrttest 2015-03-24 15:05:15 +00:00
Vadim Pisarevsky
f18eba44f8 Merge pull request #3867 from RafaRuiz:patch-1 2015-03-24 15:04:45 +00:00
Alexander Nitsch
d430664791 Remove local variables from CMAKE namespace 2015-03-24 14:42:55 +01:00
theodore
02c3d8d792 documentation for the hconcat and vconcat functions 2015-03-24 13:59:09 +01:00
RafaRuiz
660a53e0e0 Update lkdemo.cpp because of memory leak
In MacOSx x64 it was getting a memory leak even without initializing points:
http://code.opencv.org/issues/4250
2015-03-24 09:06:55 +00:00
Tim D. Smith
b9b743bbe3 Don't explicitly link Python on OS X
Explicitly linking to a Python framework on OS X prevents modules from
being built against one Python (i.e. system python) and imported from
another (i.e. Homebrew python); the interpreter segfaults if there's a
linkage to a foreign Python. Building the module with `-undefined
dynamic_lookup` instead of an explicit link allows the symbols to be
resolved at load time from a compatible python.
2015-03-23 23:36:46 -07:00
Tim D. Smith
d057828ee3 Don't explicitly link Python on OS X
Explicitly linking to a Python framework on OS X prevents modules from
being built against one python (i.e. system python) and imported from
another (i.e. Homebrew python); the interpreter segfaults if there's a
linkage to a foreign python. Building the module with `-undefined
dynamic_lookup` instead of an explicit link allows the symbols to be
resolved at load time from a compatible python.
2015-03-23 23:13:48 -07:00
Erik Karlsson
01d3df0d00 Added normType parameter to fastNlMeansDenoisingMulti 2015-03-24 02:01:31 +01:00
Erik Karlsson
70a64ebe72 Added test cases 2015-03-24 01:16:17 +01:00
Erik Karlsson
5f8d688664 Added parameter normType to fastNlMeansDenoising 2015-03-24 00:47:11 +01:00
Erik Karlsson
9fff7896c5 Removed fastNlMeansDenoisingColored[Multi]Abs 2015-03-23 23:23:35 +01:00
Evgeny Agafonchikov
c196df6db0 Do not link vfw32 library for WinRT
HAVE_VFW flag is defined by CMake try_compile check.

Check fails for WINRT as vfw.h begins with

and contains empty set of functions for Store apps.

So we can safely remove vfw32.lib for WINRT in general

(independently of availability for specific configuration)
2015-03-23 20:45:58 +03:00
Evgeny Agafonchikov
17d36b7835 Removing unused winrttest.cpp file 2015-03-23 16:56:50 +03:00
Maksim Shabunin
e64188021a Merge pull request #3862 from mshabunin:abi-contrib-disable 2015-03-23 13:26:46 +00:00
Maksim Shabunin
796bf01797 Do not compare extra modules in ABI check 2015-03-23 13:10:40 +03:00
Yan Wang
433c3da7cf Optimize the performance of cascade OpenCL kernel.
1. Use built-in mad() instead of += and *.
2. For stump stages, if weight.z == 0, avoid unnecessary calculation
because some features only have 2 rectangles..

It could improve
OCL_Cascade_Image_MinSize_CascadeClassifier.CascadeClassifier/*
about 10% mean values.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2015-03-23 17:47:40 +08:00
Vadim Pisarevsky
5a0c7a1330 Merge pull request #3853 from alalek:ocl_fix_bufferpool_cleanup 2015-03-23 08:10:22 +00:00
Vadim Pisarevsky
7ab7322915 Merge pull request #3848 from yxiong:fix-4125 2015-03-23 08:04:41 +00:00
Vadim Pisarevsky
c9bb18b9f7 Merge pull request #3850 from piponazo:2.4 2015-03-23 08:03:49 +00:00
Vadim Pisarevsky
daa99514fa Merge pull request #3846 from mshabunin:fix-headers 2015-03-23 08:01:25 +00:00
Kai Wolf
f815bbab24 Fix typo in types_c.h 2015-03-22 10:55:54 +01:00
Evgeny Agafonchikov
91bd7df8c1 Fixing invalid opencv_test_ml calls 2015-03-20 17:49:03 +03:00
Dikay900
fb8478eb7b add resetting the offset variable after setting a new image 2015-03-20 13:26:13 +01:00
Vadim Pisarevsky
d2da7dc3e5 Merge pull request #3841 from MSOpenTech:samples-contrib 2015-03-20 10:48:51 +00:00
Dmitry-Me
ce167e233b Reduce variable scope 2015-03-20 13:27:08 +03:00
Alexander Alekhin
b5529aef9c ocl/bufferpool: fix cleanup 2015-03-20 13:21:10 +03:00
Vadim Pisarevsky
297e2b6f1a Merge pull request #3834 from asmorkalov:retina_docs_fix 2015-03-20 10:14:29 +00:00
Vadim Pisarevsky
3853a18e0e Merge pull request #3792 from laomaiweng:cuda-pkg-config-Ldir 2015-03-20 10:13:46 +00:00
Vadim Pisarevsky
8616cd875b Merge pull request #3836 from Dmitry-Me:uninitializedMember 2015-03-20 10:03:11 +00:00
Vadim Pisarevsky
226b4e3ed5 Merge pull request #3839 from hyperscience:fix-free-space-check-in-grow-seq 2015-03-20 09:37:49 +00:00
Vadim Pisarevsky
072a4b5497 Merge pull request #3851 from ellbur:findTransformECC-initialize-bug 2015-03-20 09:34:04 +00:00
Owen Healy
86fb9f8409 Modify findTransformECC to support a mask of pixels to consider
Tests of the mask are also included.

This is useful for registering a non-square image against a non-square
template.

This also needs to relax a sanity check as per
https://github.com/Itseez/opencv/pull/3851
2015-03-19 22:16:32 -04:00
Owen Healy
ff48387a8a Fix bug of uninitialized matrix in findTransformECC
The matrix templateZM needs to be initialized because otherwise
uninitialized values leak into the correlation in:

    const double correlation = templateZM.dot(imageWarped)

In the worst case this will lead the correlation to be NaN ruining the
whole routine. The subtraction does not initialize templateZM due to the
mask.

Unfortunately, the uninitialized values (by altering the correlation)
have the side effect of dragging out the computation a little longer
giving a slightly better error bound. This means that fixing this bug
breaks perf_ecc where

    SANITY_CHECK(warpMat, 1e-3);

is just a little too tight and happens to work due to the uninitialized
values. Since this is a performance not a accuracy test I think it is OK
to just relax the error bound a little bit (the tight error bound being
after all the result of a bug).
2015-03-19 20:50:49 -04:00
Prof. Dr. Rudolf Haussmann
756c1a22d9 Merge remote-tracking branch 'upstream/2.4' into 2.4 2015-03-20 01:44:29 +01:00
Prof. Dr. Rudolf Haussmann
a7bf1d53d8 Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

	modified:   modules/highgui/include/opencv2/highgui/highgui_c.h
	modified:   modules/highgui/src/cap_dshow.cpp
	modified:   modules/highgui/src/cap_pvapi.cpp
	modified:   modules/java/generator/gen_java.py

Änderungen in der PvAPI hinzugefügt.
2015-03-20 01:42:16 +01:00
Luis Díaz Más
7711cd284b Fix a bug that impede to set the trackbar pos using the Qt control panel 2015-03-19 21:25:10 +01:00
Dikay900
80069f384a resolve crash of haarclassifier when using a tilted feature 2015-03-19 20:47:33 +01:00
Ying Xiong
decbdd1abb Fix compiler error on std::swap (CUDA7.0/clang/OSX) 2015-03-19 14:23:44 -04:00
Boris Daskalov
8755ffbf31 Fix a bad free space check in icvGrowSeq.
A difference of two pointers was casted to unsigned which can lead to
overflow on 64-bit systems.
2015-03-19 17:32:32 +02:00
Vadim Pisarevsky
9683f93a76 Merge pull request #3840 from MSOpenTech:concurrency-contrib 2015-03-19 15:11:01 +00:00
Maksim Shabunin
ee4bea72bf Reverted unneeded change 2015-03-19 15:51:12 +03:00
Vadim Pisarevsky
9997e6d337 Merge pull request #3823 from lupustr3:pvlasov/implementation_detector_update 2015-03-19 12:47:22 +00:00
Maksim Shabunin
9f08310307 Disabled TrainData::getNormCatValues wrapping due to pointer in parameters 2015-03-19 15:45:34 +03:00
Vadim Pisarevsky
e92645c588 Merge pull request #3838 from PhilLab:patch-3 2015-03-19 12:33:56 +00:00
Vadim Pisarevsky
e157d70d43 Merge pull request #3837 from mshabunin:abi-compliance 2015-03-19 12:30:32 +00:00
Maksim Shabunin
231685133e OpenCV Manager: support 3.0.0 library 2015-03-19 15:27:14 +03:00
Maksim Shabunin
9b9ebe0999 Ported from 2.4 2015-03-19 15:25:44 +03:00
Vadim Pisarevsky
69344f175b Merge pull request #3843 from piponazo:BugFix4244 2015-03-19 12:15:41 +00:00
Maksim Shabunin
5709ec85d7 Disabled missing python method for static ml function 2015-03-19 15:11:49 +03:00
Maksim Shabunin
fab51ac0af Removed blank line at EOF 2015-03-19 13:34:19 +03:00
Maksim Shabunin
5247eacc3c Add python and java support for ml module 2015-03-19 13:22:30 +03:00
Maksim Shabunin
4d7d354498 Added to TOC 2015-03-19 13:18:10 +03:00
Maksim Shabunin
8779d029b2 Added transition (from 2.4) guide 2015-03-19 13:15:08 +03:00
Luis Díaz Más
d14a1de947 Fixing the bug #4244 that I just reported in code.opencv.org 2015-03-18 20:07:08 +01:00
Maxim Kostin
349e3b546a Fixed 'doc' builder warnings. 2015-03-18 17:44:49 +03:00
Maksim Shabunin
d5b954c2d4 Moved property implementation macros to private header 2015-03-18 17:33:12 +03:00
Maksim Shabunin
7335a40a61 Replaced CV_PURE_PROPERTY macros with corresponding code 2015-03-18 17:23:42 +03:00
Maxim Kostin
5ec908c5f0 Added WinRT 8.1 Modern Desktop JavaScript sample 2015-03-18 16:31:27 +03:00
Maxim Kostin
d1a8171011 Added WinRT concurrency support. 2015-03-18 15:13:08 +03:00
Olexa Bilaniuk
8a1d8c8470 Merge remote-tracking branch 'refs/remotes/upstream/master' 2015-03-18 02:21:36 -04:00
Olexa Bilaniuk
6d27d488bf Bugfix in n* optimization.
Similar to the problem in LevMarq, arg.inl was being used instead of
best.inl. This opened us up to a potential segfault.
2015-03-18 02:21:16 -04:00
Alexander Smorkalov
514b3b520c Documentation update after iOS warnings fix in contrib/retina header. 2015-03-17 19:25:05 +03:00
Philipp Hasper
e0efda7145 Fixed persistent.hpp documentation
Small error - object fs does not exist in this code example
2015-03-17 15:28:37 +01:00
Maksim Shabunin
9fbc92aace Added cmake option for abi descriptor generating (GENERATE_ABI_DESCRIPTOR) 2015-03-17 16:04:04 +03:00
Dmitry-Me
0c5faa6d24 Fix uninitialized members, fix log output typo 2015-03-17 14:47:00 +03:00
Vadim Pisarevsky
e12a04ac7e Merge pull request #3811 from StevenPuttemans:fix_traincascade_getNegatives_master 2015-03-17 11:22:10 +00:00
Vadim Pisarevsky
4a6b1805e0 Merge pull request #3824 from Milania1:tutorial_hough_lines_fix 2015-03-17 11:14:13 +00:00
Vadim Pisarevsky
903f10c237 Merge pull request #3804 from polarfuchs99:master 2015-03-17 11:12:49 +00:00
Vadim Pisarevsky
0f4d57d59e Merge pull request #3833 from sgrayb:houghline_bugfix 2015-03-17 10:37:10 +00:00
Vadim Pisarevsky
b708969326 Merge pull request #3832 from Dmitry-Me:fixNullPointerDereference3 2015-03-17 10:36:52 +00:00
Vadim Pisarevsky
8cf45ce0af Merge pull request #3828 from vpisarev:fix_win32_perf_calib3d_solvepnp_failure 2015-03-17 10:34:53 +00:00
StevenPuttemans
d0ad599a24 update traincascade assigned memory buffers 2015-03-17 09:00:41 +01:00
Dmitry-Me
52a8d37f11 Fix potential null pointer dereference 2015-03-16 18:36:12 +03:00
Vadim Pisarevsky
ca19ae8b5a in solvePnPRansac call the solvePnP in the end with all the inliers to get more precise estimate 2015-03-16 16:56:26 +03:00
Vadim Pisarevsky
4ab525c880 Merge pull request #3810 from StevenPuttemans:upgrade_traincascade_default_memory 2015-03-16 10:02:07 +00:00
Vadim Pisarevsky
5c352c9146 temporarily use EPNP in SolvePnP instead of UPNP or DLS algorithms, since the latter two are not quite stable 2015-03-16 12:46:24 +03:00
Vadim Pisarevsky
3c54c50c5a Merge pull request #3802 from sanuj:master 2015-03-16 09:25:41 +00:00
Vadim Pisarevsky
f80e7530f3 Merge pull request #3827 from MSOpenTech:license-26 2015-03-16 09:11:24 +00:00
Vadim Pisarevsky
c6e9280373 Merge pull request #3816 from ilya-lavrenov:il/cvround 2015-03-16 09:09:55 +00:00
Vadim Pisarevsky
f9b2444735 Merge pull request #3826 from mshabunin:fix-install-paths 2015-03-16 09:08:54 +00:00
Vadim Pisarevsky
259a54a6dd Merge pull request #3830 from NaerChang:issue.3710 2015-03-16 09:05:42 +00:00
Vadim Pisarevsky
a1f86d01e2 Merge pull request #3831 from Dmitry-Me:reduceVariableScope7 2015-03-16 09:05:18 +00:00
Naer Chang
cdc9bc397d Revert "issue 3710"
Trying to fix whitespace issue.
This reverts commit dcc2512f581f56fb887ae955ebe828071dee7b92.
2015-03-14 18:32:46 -04:00
Olexa Bilaniuk
ac1099deb8 Merge remote-tracking branch 'refs/remotes/upstream/master' 2015-03-14 12:41:56 -04:00
Olexa Bilaniuk
7e3cc44738 More docs on variable accesses.
Listed accesses for more functions.
2015-03-14 12:41:25 -04:00
Dmitry-Me
8ed4bae4dd Reduce variable scope, make formatting consistent with surrounding code 2015-03-14 12:50:42 +03:00
Naer Chang
dcc2512f58 issue 3710
added a check to prevent illegal access to operator[] when vector is empty
2015-03-14 02:56:29 -04:00
ippei ito
7d665a4754 Fix warn conversion from 'size_t' to 'int'. add comment for doxygen 2015-03-14 09:35:53 +09:00
Scott Graybill
3d2c0ed97f Removed check on limits. A common use of HoughLines would be to restrict theta to be between a small negative number and a small positive number, e.g. -pi/16 to pi/16. This wasn't possible with the previous checks. 2015-03-13 17:04:13 -07:00
ippei ito
f7d52c774e Fix compile error on linux change cv::InputArray& to cv::InputArray 2015-03-14 06:58:34 +09:00
ippei ito
8efdfd9dfc Fix unused-parameter Warning 2015-03-14 06:07:55 +09:00
ippei ito
cd42e38013 FlannBasedMatcher(LshIndex) in the feature2d optimization for continuance additional train()
Current implementation of miniflann is releasing the trained index, and
rebuilding the index from the beginning.
But, some indexing algorithms like the LSH are able to add the indexing
data after that.
This branch is implementation of that optimization for LshIndex
FlannBasedMatcher in the feature2d.
2015-03-14 04:38:07 +09:00
Vadim Pisarevsky
1760078f67 trying to make solvePnPSmallPoints pass 2015-03-13 20:11:33 +03:00
Maxim Kostin
79f512337d Changed encoding from ANSI to UTF8. 2015-03-13 19:28:36 +03:00
Vadim Pisarevsky
7e07220440 made the solvepnp a bit more modest; test 5-point configuration instead of 4-point in some cases; reduce the noise in 4-point configurations in other cases 2015-03-13 18:04:23 +03:00
Vadim Pisarevsky
930808c22b Merge pull request #3820 from LorenaGdL:patch-1 2015-03-13 13:20:09 +00:00
Vadim Pisarevsky
04f16965d5 Merge pull request #3780 from StevenPuttemans:fix_locale_master 2015-03-13 13:16:09 +00:00
Vadim Pisarevsky
133bd56436 Merge pull request #3769 from adamgreig:fix-py3-submodules 2015-03-13 13:15:51 +00:00
Vadim Pisarevsky
18904036dc Merge pull request #3825 from alalek:fix_msvs2010_build 2015-03-13 13:02:43 +00:00
Maxim Kostin
6cef4eba29 Replacing license headers per PR-3700 feedback. Updates #26 2015-03-13 14:33:09 +03:00
Maksim Shabunin
632afe6ae3 Fixed mangled install layout on unix machines 2015-03-13 14:18:37 +03:00
Alexander Alekhin
50b99e5aef fix compilation on MSVS2010 2015-03-12 19:07:53 +03:00
Milania1
339e6aa782 fixed error in hough lines tutorial (the point (9,4) is not on the lines, but the point (4,9) is) 2015-03-12 16:46:25 +01:00
Pavel Vlasov
085409340e Implementation collector update;
Moved out of TLS to properly collect data from different threads;
Concurrent access guards were added to collection functions;
2015-03-12 17:58:03 +03:00
Vadim Pisarevsky
309eb3c122 Merge pull request #3815 from StevenPuttemans:add_camera_IP_regulations 2015-03-12 14:39:48 +00:00
Vadim Pisarevsky
2594e5e384 Merge pull request #3800 from StevenPuttemans:add_parameter_info_annotation 2015-03-12 14:29:04 +00:00
Vadim Pisarevsky
74e88cc0f1 Merge pull request #3801 from StevenPuttemans:add_parameter_info_annotation_master 2015-03-12 14:28:19 +00:00
Vadim Pisarevsky
79a77cb91f Merge pull request #3819 from MSOpenTech:readme-24 2015-03-12 13:11:59 +00:00
Vadim Pisarevsky
06703c9d56 Merge pull request #3817 from SpecLad:forward-ports 2015-03-12 12:15:24 +00:00
Vadim Pisarevsky
362c1a23ea Merge pull request #3821 from i-ito:master-flann-lsh-addable-index 2015-03-12 12:14:23 +00:00
ippei ito
518fd59a10 fixed whitespace error 2015-03-12 01:09:15 +09:00
ippei ito
49b38fe793 Fixed compile error build with VisualStudio2013 on windows.
REG_NONE defined in ml.hpp conflicts with defined in Winnt.h
2015-03-12 00:32:17 +09:00
LorenaGdL
b21b24fd8a Update train_HOG.cpp
Incorrect number of input arguments in main function
2015-03-11 14:18:07 +01:00
Ilya Lavrenov
6f8b3fc633 cvRound 2015-03-11 16:14:39 +03:00
Maxim Kostin
b194812f5a Fixed trailing whitespace. 2015-03-11 13:22:22 +03:00
Adam Greig
211a131351 Fix Python3 binding's submodules
Previously the Python3 cv2 package ends up with no submodules (bgsegm, face,
etc) in it, which makes a lot of functionality unusable. By not writing over
our root reference we ensure the new submodules are added to the correct cv2
module.
2015-03-10 22:07:53 +00:00
Maxim Kostin
052c010d3f Reformatted since this is not a markdown file 2015-03-10 17:02:31 +03:00
Max Kostin
deb2cb752b Updates README for setup_script
Updates README to reflect setup_script build capabilities and requirements to setup binaries and includes for sample applications. Fixes #24
2015-03-10 16:58:06 +03:00
Roman Donchenko
c71e94f054 Mark the libs component required
Everything else depends on it, after all.

(cherry picked from commit cf54e3b97ea13c0aeef5e94b5330a4b26a601d81)

Conflicts:
	cmake/OpenCVPackaging.cmake
2015-03-10 16:24:23 +03:00
Roman Donchenko
8a732e306f Add component display names
(cherry picked from commit 6d52ea898442d2458a40f8b06b75320c9ab4a5cc)
2015-03-10 16:24:23 +03:00
Roman Donchenko
87eb3f6e68 Update the CPack variables to match the changes in asmorkalov/CMake#1
Which also happens to align the non-Debian specific variables
with the ones used by upstream CMake.

(cherry picked from commit b8c60234c3fa94c31a3e2a72275fefa811c75d5c)

Conflicts:
	cmake/OpenCVPackaging.cmake
2015-03-10 16:24:23 +03:00
Roman Donchenko
35760bb6bf Add a script to run all tests on Windows
It's pretty much a simplified copy of the Linux script, lacking fancy colors.
Also, I had to drop Python testing, because it's not easy to pass the Python
module location to the script, and I have no pressing need to run the Python
tests at the moment.

(cherry picked from commit c1e3ca170e6acd983fc010bffd6bc10f12a738c5)

Conflicts:
	CMakeLists.txt
2015-03-10 16:24:23 +03:00
Roman Donchenko
592122bf4f Install data on Windows
Because why not?

(cherry picked from commit e8a73940099b9823879e156a896e42a1854ca1bb)

Conflicts:
	data/CMakeLists.txt
2015-03-10 12:55:17 +03:00
Roman Donchenko
1a3273a7e3 Remove useless CPACK_*_COMPONENT_INSTALL variables
They don't actually do anything. And even if they did, all components are
enabled by default, anyway.

(cherry picked from commit 49fe496914cca93f19dd61aa7b1c120037d65282)

Conflicts:
	cmake/OpenCVPackaging.cmake
2015-03-10 12:53:28 +03:00
Roman Donchenko
34ad2e0fa4 Fix a memory leak in CvCapture_FFMPEG::close
FFmpeg now requires that frames allocated with avcodec_alloc_frame are
freed with avcodec_free_frame.

(cherry picked from commit 77578d415f4d2b22a4ee1989ef0afda73c9d649b)

Conflicts:
	modules/highgui/src/cap_ffmpeg_impl.hpp
2015-03-10 12:48:46 +03:00
Roman Donchenko
1858b5cfba Don't install documentation if it isn't built
The HAVE_DOC_GENERATOR variable was always true.

(cherry picked from commit 3d46c1f9602bea7e6c6a49db8b6f2421166ef65d)

Conflicts:
	doc/CMakeLists.txt
2015-03-10 12:46:00 +03:00
Roman Donchenko
6274e1fc5f cvOpenFileStorage: reduce the scope of xml_buf and make sure it's freed...
... before any exceptions occur.

(cherry picked from commit 08da247a871ed40b868119a999af538da6526c6d)
2015-03-10 12:38:45 +03:00
Roman Donchenko
6b8ebf3e94 Fix memory leaks appearing when cvOpenFileStorage throws
(cherry picked from commit 16ce114e0cad6c85efead4a0ebb07724d691407a)
2015-03-10 12:38:45 +03:00
StevenPuttemans
3a7ea37090 extra camera specific information for IP settings 2015-03-10 10:16:13 +01:00
Erik Karlsson
82c54104d6 Fix warnings on Win x64 2015-03-10 01:39:43 +01:00
Erik Karlsson
812edb5fdc Fixed bug, maxDist() should reurn int, not double 2015-03-10 01:34:02 +01:00
Erik Karlsson
8aa0783995 Changed parameter type of fastNlMeansDenoising[Multi][Abs] from std::vector<float> to const std::vector<float>& 2015-03-09 23:47:49 +01:00
Vadim Pisarevsky
baf191fab2 Merge pull request #3771 from mshabunin:arm-round 2015-03-09 21:49:15 +00:00
Vadim Pisarevsky
3ee03a860d Merge pull request #3803 from Dmitry-Me:doubleUsedAsBoolean 2015-03-09 21:47:09 +00:00
Vadim Pisarevsky
368213290f Merge pull request #3806 from enpe:master 2015-03-09 21:44:33 +00:00
Vadim Pisarevsky
192e630cb8 Merge pull request #3807 from guopei:patch-1 2015-03-09 21:41:41 +00:00
Vadim Pisarevsky
a9ce2333c3 Merge pull request #3808 from guopei:patch-2 2015-03-09 21:41:02 +00:00
Vadim Pisarevsky
64bd77cf4d Merge pull request #3794 from vpisarev:ubuntu_x86_fixes 2015-03-09 21:34:17 +00:00
Erik Karlsson
5a7118a88b Merging in master 2015-03-09 22:00:58 +01:00
Erik Karlsson
b471f9ee26 Fixed call to tegra::fastNlMeansDenoising 2015-03-09 18:52:25 +01:00
hahne
1af4521239 fix for issue 1915 2015-03-09 16:19:47 +01:00
Erik Karlsson
4b5753daea Corrected documentation 2015-03-09 16:11:18 +01:00
Erik Karlsson
a594a0677a Cleanup 2015-03-09 16:00:24 +01:00
Erik Karlsson
c44488629a Changed parameters of fastNlMeansDenoising[Multi][Abs] from float * to std::vector<float> 2015-03-09 15:52:16 +01:00
StevenPuttemans
bf16f74618 fixing universal location execution 2015-03-09 13:11:29 +01:00
StevenPuttemans
9f0cd9ee10 upgrade traincascade default memory 2015-03-09 10:43:14 +01:00
guopei
f94b22fa5e grammar fix: then -> than 2015-03-08 18:59:28 +08:00
guopei
0e5c7720a4 grammar fix: a -> the 2015-03-08 18:51:48 +08:00
Nils Plath
ee55e4595c - Fixed compile error that appeared with Clang 5.1 on Mac 10.8.5:
modules/videoio/src/cap_gstreamer.cpp:577:31: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
            filename = "v4lsrc ! "COLOR_ELEM" ! appsink";
                              ^
    modules/videoio/src/cap_gstreamer.cpp:585:32: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
            filename = "v4l2src ! "COLOR_ELEM" ! appsink";
2015-03-08 00:23:38 +01:00
Alexander Nitsch
13694c8ae8 Fix MinGW detection on x86
Make detection of x64 using the gcc's target triplet identical
to the one used in cmake/OpenCVDetectCXXCompiler.cmake.
Otherwise, MinGW-w64 setups will always be treated as x64 since
they contain "w64" as vendor key.
2015-03-07 15:49:48 +01:00
Alexander Nitsch
dde7c22fad Fix MinGW architecture detection
Fix typo that would always lead to detection of x86 for MinGW
builds in the OpenCVConfig.cmake file.
2015-03-07 15:37:21 +01:00
Prof. Dr. Rudolf Haussmann
5e3d986ad8 Merge remote-tracking branch 'upstream/master' 2015-03-07 13:10:41 +01:00
Prof. Dr. Rudolf Haussmann
9f1eb70dbc Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

	modified:   modules/java/generator/gen_java.py
	modified:   modules/videoio/include/opencv2/videoio.hpp
	modified:   modules/videoio/include/opencv2/videoio/videoio_c.h
	modified:   modules/videoio/src/cap_dshow.cpp
	modified:   modules/videoio/src/cap_pvapi.cpp

Following changes have been made:
1. Some minor bugs have been removed.
2. In the PvAPI module the option CAP_PROP_MONOCROME has been removed because
   this option does not make sense and causes an error if a color camera is used.
3. Instead the new option CAP_PROP_PVAPI_PIXELFORMAT has been added which allows
   to activate the different pixel formats (color modes) of an AVT camera.
4. Since there were two identical defines
   CAP_PROP_MONOCROME = 19
   CAP_PROP_MONOCHROME = 19
   which were also used in the other module DSHOW, the first one with an orthographic
   error has been removed in favor of the second one.
2015-03-07 12:53:32 +01:00
Erik Karlsson
21160137d4 Addition of test cases 2015-03-06 20:44:31 +01:00
Erik Karlsson
cc8d94c6fc Addition of per-channel h-values for fastNlMeansDenoising[Multi][Abs] 2015-03-06 20:43:55 +01:00
Erik Karlsson
324fa26848 Refactoring of OpenCL implementation 2015-03-06 19:07:13 +01:00
Olexa Bilaniuk
9c432f4f75 Silence Windows warnings. 2015-03-06 12:16:38 -05:00
Alexander Alekhin
29e7eb7719 Merge pull request #3789 from StevenPuttemans:fix_cmakelist_annotation 2015-03-06 14:53:43 +00:00
Olexa Bilaniuk
d6534912d8 Merge remote-tracking branch 'refs/remotes/upstream/master' 2015-03-06 09:25:01 -05:00
Olexa Bilaniuk
2113636d29 Made seed a constant. 2015-03-06 09:24:45 -05:00
Olexa Bilaniuk
fcdbacdbb0 Corrected initialization of smart pointer. 2015-03-06 09:15:00 -05:00
Erik Karlsson
41ffcc27dd Added support for h = 0.0 2015-03-06 15:06:11 +01:00
Dmitry-Me
135701feac Double used as boolean for no reason 2015-03-06 17:04:54 +03:00
Vadim Pisarevsky
643bbb2d93 looks like Maksim was right; the new fix does not do the second attempt to detect python libs, it finds it correctly with the first attempt 2015-03-06 16:57:38 +03:00
sanuj
441cd22343 Add documentation for solvePnP in calib3d 2015-03-06 19:18:22 +05:30
Erik Karlsson
1e82a67cc4 Additional refactoring 2015-03-06 14:28:43 +01:00
Maksim Shabunin
ee2d7a1f39 Fixed warnings for iOS 2015-03-06 16:16:57 +03:00
Maksim Shabunin
451972f3cf Added ARM implementation in cvRound function
- note: uses VFPv3 instructions
- also added overloaded cvRound variants with float and int parameters
- thanks to Marina Kolpakova from Itseez for idea
- thanks to developers from #llvm IRC channel for help with inline asm
2015-03-06 16:14:37 +03:00
StevenPuttemans
3419c704a9 adding usage information 2015-03-06 13:52:52 +01:00
StevenPuttemans
a58bfbf3c7 info on how to use the tool 2015-03-06 13:52:02 +01:00
Vadim Pisarevsky
4aa6d10a60 added Maksim's fix as well; they both handle correctly more cases than each of them individually 2015-03-06 15:48:36 +03:00
StevenPuttemans
cef2cf2852 fixing locale settings - making it universal 2015-03-06 13:13:53 +01:00
Vadim Pisarevsky
5d8a1bf813 explained reason why IPP is disabled on 32-bit Linux. disable IPP's minMaxLoc_32f on 32-bit OSes only 2015-03-06 15:02:22 +03:00
StevenPuttemans
cdbb661eab update cmakelists of annotation tool 2015-03-06 12:51:28 +01:00
Vadim Pisarevsky
361eb633f6 Merge pull request #3795 from samyak-268:sqr-filter-doc 2015-03-06 10:22:56 +00:00
Vadim Pisarevsky
fd7a76fe5d Merge pull request #3796 from enpe:master 2015-03-06 10:21:57 +00:00
Vadim Pisarevsky
092f599aac Merge pull request #3797 from Dmitry-Me:reduceVariableScope6 2015-03-06 10:20:45 +00:00
Vadim Pisarevsky
a65dbc5dcd Merge pull request #3793 from sanuj:master 2015-03-06 10:20:16 +00:00
Vadim Pisarevsky
8c69266cbf Merge pull request #3786 from jviney:fix_background_subtractor_knn_width_step 2015-03-06 10:17:43 +00:00
Dmitry-Me
2fb4178f7c Reduce variable scope 2015-03-06 10:17:37 +03:00
Nils Plath
32d56c6b43 Fixed: wrong conversion of float-based Mat input inside the AKAZE. 2015-03-05 23:55:07 +01:00
Samyak Datta
20efcff166 Added doxygen comments for sqrBoxFilter() method 2015-03-06 03:50:51 +05:30
Erik Karlsson
c41efe4e30 Refactoring in preparation for per-channel h-values 2015-03-05 17:50:52 +01:00
Alexander Alekhin
4e87deae28 Merge pull request #3790 from StevenPuttemans:fix_cmakelist_annotation_master 2015-03-05 16:01:39 +00:00
Vadim Pisarevsky
7a52c3d9f1 1) make sure Python 2.7 is detected on Ubuntu (including libs) when it's there.
2) disable IPP on 32-bit Linux when OpenCV is built as shared libs. Otherwise we get linker errors
3) disable IPP's minMaxIdx 32-bit floating-point flavor in a hope that it fixes some test failures
2015-03-05 18:58:54 +03:00
sanuj
1f53b65511 Fix documentation in python binding tutorial 2015-03-05 20:00:19 +05:30
StevenPuttemans
217f628915 update cmakelists for annotation tool 2015-03-05 14:46:52 +01:00
quentin
afdf319f36 Add -L for CUDA libs path to pkg-config
Add all dirs from CUDA_LIBS_PATH as -L linker options to
OPENCV_LINKER_LIBS. These will end up in opencv.pc.
2015-03-05 14:37:21 +01:00
Erik Karlsson
18be52c05b Changed LUTs from IT to int 2015-03-05 13:55:06 +01:00
Erik Karlsson
305cff36e2 Changed from IT to int for distance calculation 2015-03-05 13:36:42 +01:00
Vadim Pisarevsky
2baf1a3c9f Merge pull request #3788 from berak:fix_features2d_tut 2015-03-05 12:22:50 +00:00
Vadim Pisarevsky
aa113c5a85 Merge pull request #3787 from Dmitry-Me:fixNullPointerDereference2 2015-03-05 12:19:02 +00:00
berak
b7f2a4da69 fix features2d tutorials 2015-03-05 10:26:45 +01:00
Dmitry-Me
d164d51380 Fix potential null pointer dereference 2015-03-05 10:31:51 +03:00
Vadim Pisarevsky
f9b8ce1d25 Merge pull request #3784 from ilya-lavrenov:nvidia_android 2015-03-05 06:43:03 +00:00
Jonathan Viney
4f24dc0959 Fix KNN background subtraction not honoring width step. 2015-03-05 12:46:07 +13:00
Vadim Pisarevsky
0b99f6bcd6 Merge pull request #3777 from ilya-lavrenov:nvidia_cvtcolor_eps 2015-03-04 13:53:41 +00:00
Ilya Lavrenov
cf4c79ebdd disabled some kernels for Android && NVidia 2015-03-04 14:46:49 +03:00
StevenPuttemans
488babf3b3 fixing undesired behaviour 2015-03-04 12:03:33 +01:00
Vadim Pisarevsky
e4bc592c46 Merge pull request #3583 from oresths:tbb_canny 2015-03-04 10:49:27 +00:00
Vadim Pisarevsky
ebac739a35 Merge pull request #3781 from Dmitry-Me:dangerousStringManipulation 2015-03-04 10:45:25 +00:00
Olexa Bilaniuk
52e67c1a29 Whitespace & Doc fixes on lower half of rho.cpp.
Spaced methods & functions more consistently, and started documenting
which members does each method access directly or through its callers
within RHO_HEST_REFC.
2015-03-04 05:04:52 -05:00
Dmitry-Me
f8c454733b Remove dangerous string manipulation, merge declaration with assignment 2015-03-04 10:35:06 +03:00
Olexa Bilaniuk
27fd810b6f Silenced build warnings on Windows. 2015-03-04 02:09:59 -05:00
Olexa Bilaniuk
736b42b372 Refactorings and renamings.
- Deleted "RefC" from names of external-interface functions.
- Renamed rhorefc.[cpp|hpp] to rho.[cpp|hpp]
- Introduced RHO_HEST base class, from which RHO_HEST_REFC inherits.
- rhoInit() currently only returns a Ptr<RHO_HEST_REFC>, but in the
future it will be allowed to return pointers to other derived classes,
depending on the values returned by cv::checkHardwareSupport().
2015-03-04 01:43:13 -05:00
Olexa Bilaniuk
3a4d9a77b2 Merge remote-tracking branch 'refs/remotes/upstream/master' 2015-03-03 23:15:05 -05:00
Olexa Bilaniuk
408f93340a External interface converted to use OpenCV Ptr<> smart pointer. 2015-03-03 23:12:33 -05:00
Olexa Bilaniuk
f592321771 Internal buffers converted to use OpenCV dynamic memory allocation. 2015-03-03 22:57:40 -05:00
Vadim Pisarevsky
4bb496409c Merge pull request #3779 from Dmitry-Me:uniformComputationOfVariableSize 2015-03-03 18:51:56 +00:00
Vadim Pisarevsky
c9ea878d10 Merge pull request #3722 from berak:py_houghlines_sample 2015-03-03 18:16:25 +00:00
Vadim Pisarevsky
4701b22e14 Merge pull request #3607 from soyersoyer:yuyv_pixfmt 2015-03-03 18:15:50 +00:00
Olexa Bilaniuk
bb01231990 Substituted the NaN check with OpenCV's implementation. 2015-03-03 13:06:36 -05:00
Olexa Bilaniuk
e7d5e57264 Merge remote-tracking branch 'refs/remotes/upstream/master' 2015-03-03 11:56:03 -05:00
Olexa Bilaniuk
16f36a5fda Replaced division by reciprocal + multiply in a few places. 2015-03-03 11:55:36 -05:00
Olexa Bilaniuk
e1abc416cf Changed seeding in initialization.
The call to rand()/random() is now a call to (unsigned)cv::theRNG().
2015-03-03 11:48:41 -05:00
Olexa Bilaniuk
0f6ea38eac Added OPENCV_ prefix to #include guard. 2015-03-03 11:42:04 -05:00
Olexa Bilaniuk
a2affe70d9 Deleted last remnants of restrict keyword. 2015-03-03 11:40:44 -05:00
Vadim Pisarevsky
dcff28b778 Merge pull request #3717 from Dmitry-Me:removeUnneededIndirections 2015-03-03 16:15:25 +00:00
Dmitry-Me
c587bae997 Uniform computation of variable size 2015-03-03 16:11:07 +03:00
Olexa Bilaniuk
b229d6b7ac Moved constants to cv:: namespace. 2015-03-03 08:05:52 -05:00
Vadim Pisarevsky
62b8895814 Merge pull request #3654 from StevenPuttemans:add_annotation_master 2015-03-03 12:53:07 +00:00
Vadim Pisarevsky
6820292256 Merge pull request #3700 from MSOpenTech:winrt-cmake-contrib 2015-03-03 12:52:03 +00:00
Vadim Pisarevsky
d3b74cdcb2 Merge pull request #3773 from ilya-lavrenov:warning 2015-03-03 12:33:17 +00:00
Vadim Pisarevsky
2c57717ca2 Merge pull request #3774 from JoeHowse:2.4 2015-03-03 12:31:29 +00:00
Vadim Pisarevsky
f38339c089 Merge pull request #3775 from Dmitry-Me:reduceVariableScope5 2015-03-03 12:29:18 +00:00
Ilya Lavrenov
26eebb3ee3 increased EPS for cvtColor for NVIDIA 2015-03-03 15:26:51 +03:00
Dmitry-Me
1b7066fc95 Reduce variable scope, only compute values that are used later 2015-03-03 11:04:22 +03:00
Erik Karlsson
69eae13ff3 Changed pointers from sample_t * to uchar *. Rescaling psz accordingly. 2015-03-03 03:02:44 +01:00
Erik Karlsson
d56d04e41b Updated documentation 2015-03-03 01:34:29 +01:00
Erik Karlsson
ac6771f975 Added test cases 2015-03-03 01:20:33 +01:00
Erik Karlsson
ae08884854 Added support for 4-component input for fastNlMeansDenoising[Multi][Abs] 2015-03-03 01:19:34 +01:00
Olexa Bilaniuk
ed2a23768e Merge remote-tracking branch 'refs/remotes/upstream/master' 2015-03-02 17:55:34 -05:00
Erik Karlsson
87760d13fb Cleanup and addition of 4-component support for ocl_fastNlMeansDenoising 2015-03-02 22:33:14 +01:00
Vadim Pisarevsky
7c7a63bebc Merge pull request #3772 from Dmitry-Me:reduceVariableScope4 2015-03-02 19:52:18 +00:00
Vadim Pisarevsky
aa506c6521 Merge pull request #3759 from mshabunin:wrap-all 2015-03-02 19:51:42 +00:00
Maxim Kostin
ad1149ff12 Enabled property sheets for WinRT related samples 2015-03-02 22:26:46 +03:00
Maxim Kostin
530c8dc0c0 Fixing 'doc' buildbot job: removing trailing whitespaces and tab indents
Signed-off-by: Maxim Kostin <v-maxkos@microsoft.com>
2015-03-02 22:26:45 +03:00
Maxim Kostin
22a30af353 Fixing buildbot job:
- explicitly turning OCL off since WinRT does not support it
 - fixing macro definitions in core/ocl.cpp

Signed-off-by: Maxim Kostin <v-maxkos@microsoft.com>
2015-03-02 22:26:45 +03:00
Maxim Kostin
213a6bc5c4 Adding Widows Phone 8 sample apps
Signed-off-by: Maxim Kostin <v-maxkos@microsoft.com>
2015-03-02 22:26:45 +03:00
Maxim Kostin
59d6a281cd Added WinRT Universal Apps samples
Signed-off-by: Maxim Kostin <v-maxkos@microsoft.com>
2015-03-02 22:26:44 +03:00
Maxim Kostin
5810845777 Added and updated WinRT samples
Signed-off-by: Maxim Kostin <v-maxkos@microsoft.com>
2015-03-02 22:26:44 +03:00
Maxim Kostin
86ebf4a2d8 Added build script to automate generating, building and installing OCV for WinRT, WindowsPhone 8, WindowsPhone 8.1. Added readme and .bat script wrapper. Added standalone script to build and install pre-generated projects.
Signed-off-by: Maxim Kostin <v-maxkos@microsoft.com>
2015-03-02 22:26:44 +03:00
Maxim Kostin
cdd23440c9 Adding support for WinRT(WinPhone 8/8.1 and Win Store) via CMake 3.1
- Substituted HAVE_WINRT with WINRT
- Fixed compilation issues in ocl.cpp and parallel.cpp
- Fixed compiler issue for WP8: "C2678: binary '+' : no operator found which takes a left-hand - Fixed gitignore
- Added #ifdef HAVE_OPENCL to remove compiler warnings in ocl.cpp
- Used NO_GETENV similar to '3rdparty\libjpeg\jmemmgr.c;
- Added ole32.lib for core module (for WindowsStore 8.0 builds)
- Made OpenCV_ARCH aware of ARM

Signed-off-by: Maxim Kostin <v-maxkos@microsoft.com>
2015-03-02 22:26:43 +03:00
Joe Howse
e9b4813bb2 Cat face detection cascades 2015-03-02 11:58:08 -04:00
Maksim Shabunin
37c74e38f4 Python support 2015-03-02 18:13:00 +03:00
Maksim Shabunin
457123027e Modified java wrapping mechanism 2015-03-02 18:12:30 +03:00
Erik Karlsson
50bb14a0a8 Avoiding unnecessary copy by creating borders in place after RGB -> RGBA conversion 2015-03-02 15:48:00 +01:00
Ilya Lavrenov
ffc453ebfd fixed [-Wsign-compare] warning 2015-03-02 16:41:06 +03:00
Dmitry-Me
4e582b131b Reduce veriables scope, move declaration to first use 2015-03-02 16:27:48 +03:00
Vadim Pisarevsky
9185b62a1d Merge pull request #3761 from StevenPuttemans:fix_smile_model 2015-03-02 11:49:41 +00:00
Vadim Pisarevsky
5850a9b8c3 Merge pull request #3744 from es0m:remotes/upstream/2.4.10.x-prep 2015-03-02 11:38:25 +00:00
Vadim Pisarevsky
22ad72d08e Merge pull request #3690 from theodr:moprh_lines_detection_tut 2015-03-02 11:36:15 +00:00
Vadim Pisarevsky
ac8045b9c6 Merge pull request #3754 from eliteraspberries:unsigned-mask 2015-03-02 11:34:43 +00:00
Vadim Pisarevsky
417f1e51a4 Merge pull request #3755 from eliteraspberries:mat-size-sign 2015-03-02 11:34:09 +00:00
Vadim Pisarevsky
e28a5803d9 Merge pull request #3742 from StevenPuttemans:fix_4151 2015-03-02 11:30:16 +00:00
Vadim Pisarevsky
e9d30a9383 Merge pull request #3746 from theodr:pca_tutorial 2015-03-02 11:29:33 +00:00
Vadim Pisarevsky
e43a14ccd2 Merge pull request #3750 from Dmitry-Me:reduceVariableScope3 2015-03-02 10:55:37 +00:00
Vadim Pisarevsky
de0997ab32 Merge pull request #3749 from alalek:fix_android_camera_master 2015-03-02 10:55:16 +00:00
Vadim Pisarevsky
b595812bd0 Merge pull request #3745 from nitsch:fix-mingw-detection 2015-03-02 10:55:00 +00:00
Vadim Pisarevsky
0172bd6beb Merge pull request #3756 from eliteraspberries:cast-double 2015-03-02 10:52:28 +00:00
Vadim Pisarevsky
8e37a693e5 Merge pull request #3758 from ilya-lavrenov:aarch64 2015-03-02 10:50:31 +00:00
Vadim Pisarevsky
845d3edb67 Merge pull request #3757 from ilya-lavrenov:popcnp 2015-03-02 10:50:08 +00:00
Vadim Pisarevsky
e02d6e2c8f Merge pull request #3766 from StevenPuttemans:add_GPU_old_models 2015-03-02 10:49:38 +00:00
Vadim Pisarevsky
0a5df01626 Merge pull request #3763 from laomaiweng:patch-1 2015-03-02 10:35:40 +00:00
Vadim Pisarevsky
f3f2f8ba97 Merge pull request #3764 from jet47:runtime-disable-optimizations 2015-03-02 10:35:18 +00:00
Vadim Pisarevsky
7458dfc082 Merge pull request #3765 from jet47:gpu-hog-fix 2015-03-02 10:34:51 +00:00
Vadim Pisarevsky
7b0abf52b3 Merge pull request #3767 from StevenPuttemans:fix_GPU_cascadeclassifiers 2015-03-02 10:34:12 +00:00
Vadim Pisarevsky
bed8cb42be Merge pull request #3768 from jet47:gpumat-set-to 2015-03-02 10:33:45 +00:00
Vladislav Vinogradov
c849492dfa fix tests for gpu HOG
initialize HOG after CUDA device switch
2015-03-02 11:02:47 +03:00
Erik Karlsson
73663dcdd1 Added support for 16-bit input 2015-03-02 03:29:17 +01:00
Erik Karlsson
3bde9e9365 Added test cases 2015-03-01 22:22:09 +01:00
Erik Karlsson
a9ff335a89 Added OpenCL support for FastNlMeansDenoisingAbs 2015-03-01 22:21:36 +01:00
Erik Karlsson
9f7cac8c59 Addtion of test cases for CV_8UC3 2015-03-01 21:01:57 +01:00
Erik Karlsson
0fdb95e195 Refactoring and addition of CV_8UC3 to ocl_fastNlMeansDenoising 2015-03-01 20:59:34 +01:00
Olexa Bilaniuk
094f143735 Merge remote-tracking branch 'refs/remotes/upstream/master' 2015-02-28 16:29:54 -05:00
Alexander Alekhin
7d4d286050 Merge pull request #3752 from mshabunin:fix-legacy-cmake-issue 2015-02-27 14:49:25 +00:00
Vladislav Vinogradov
4f5d30a865 fix GpuMat::setTo implementation
previous implementation was not thread/stream safe, since it used constant
memory

new implementation doesn't use any global objects, so it is thread/stream safe
2015-02-27 16:28:06 +03:00
StevenPuttemans
aea328e326 fixing CUDA cascade classifiers function and needed models 2015-02-27 14:20:27 +01:00
StevenPuttemans
2c0ef660bf Add GPU models in seperate folder, only old models are supported and they were replaced to make the CPU interface work.
This solves the undesired consequence of breaking the GPU interface.
2015-02-27 14:15:30 +01:00
Vladislav Vinogradov
21bbed7baf fix gpu HOG implementation:
move hog::set_up_constants from constructor to compute method

if user changed CUDA device between constructor and computation,
some variables were uninitialized
2015-02-27 14:28:12 +03:00
Vladislav Vinogradov
4254e35f6a merge new setUseOptimizations function with existed setUseOptimized 2015-02-27 14:24:51 +03:00
Vladislav Vinogradov
4800a34be3 do not dump OpenCL info if it is disabled 2015-02-27 12:52:44 +03:00
Vladislav Vinogradov
c10f1851cb rename setOptimizations -> setUseOptimizations 2015-02-27 12:52:28 +03:00
Vladislav Vinogradov
cda6fed41f move tegra namespace out of cv to prevent conflicts 2015-02-27 12:52:11 +03:00
Olexa Bilaniuk
5748cea80d Removed unnecessary precision in damped Cholesky decomposition.
Cholesky decomposition is stable; It is not necessary to carry it out
internally at double precision if the result will be truncated to single
precision when stored.
2015-02-26 21:47:29 -05:00
Olexa Bilaniuk
43a4124bdd Merge remote-tracking branch 'refs/remotes/upstream/master' 2015-02-26 20:47:16 -05:00
Quentin Minster
98d7e52b0a Update OpenCVDetectCUDA.cmake
Add check for CUDA version >= 7.0 (currently in RC1), which drops support for arches 1.x.
2015-02-27 00:41:31 +01:00
Vladislav Vinogradov
d696fac8b8 move cuda tests from core to cudaarithm 2015-02-26 19:49:12 +03:00
Ilya Lavrenov
c5a80193a8 aarch64 support 2015-02-26 19:43:32 +03:00
Vladislav Vinogradov
57b8640a76 disable all optimizations for CUDA tests 2015-02-26 19:36:13 +03:00
Vladislav Vinogradov
12180bd7b1 add generic method to disable/enable all optimizations (IPP, OpenCL, Tegra) 2015-02-26 19:36:04 +03:00
Vladislav Vinogradov
44e41baffe use new functions before all tegra:: calls 2015-02-26 19:34:58 +03:00
Vladislav Vinogradov
f8484e3266 add fucntion to control tegra optimizations in run-time 2015-02-26 19:34:20 +03:00
Maksim Shabunin
f73c6e6147 Merge pull request #3753 from biicode:biicode_docs 2015-02-26 14:55:43 +00:00
theodore
79bc85fb09 Introduction to PCA tutorial 2015-02-26 15:53:03 +01:00
StevenPuttemans
1e95c964f3 fixing model size, typo in previous PR 2015-02-26 15:53:00 +01:00
Olexa Bilaniuk
59d6279d4b Merge remote-tracking branch 'refs/remotes/upstream/master' 2015-02-25 20:26:42 -05:00
Ilya Lavrenov
b963d84b41 fixed bug #4215 2015-02-25 21:57:17 +03:00
mariadeanton
191336de97 Added biicode docs to introduction tutorials
biicode docs added with fixes
fixed biicode docs

added biicode docs
added biicode docs

fixed #include typos

fixed whitespaces and tabs in indent

fixed whitespaces

small fixes

fixed trailing whitespace

trial fix #includes

fixed #includes

fixed link and branch name
2015-02-25 16:43:23 +01:00
Vadim Pisarevsky
2c9547e314 Merge pull request #3747 from StevenPuttemans:fix_annotationtool_extras 2015-02-25 12:10:31 +00:00
Maksim Shabunin
eb30799aed Disable object libraries building for cmake 2.8.7 and earlier 2015-02-25 15:00:44 +03:00
Alexander Smorkalov
f73a97b53b Merge pull request #3751 from jet47:gpu-bmoptflow-test-epsilon 2015-02-25 11:54:44 +00:00
StevenPuttemans
0833352660 add annotation tool master branch 2015-02-25 11:31:50 +01:00
StevenPuttemans
387a0f26fb fix annotation tool, add auto make of tool 2015-02-25 11:27:59 +01:00
Vladislav Vinogradov
c147ab1e85 set epsilon for gpu OpticalFlowBM to 1e-6, since it uses floating point arithmetic 2015-02-25 13:16:36 +03:00
Dmitry-Me
2311504c44 Reduce variables scope 2015-02-25 10:38:44 +03:00
Alexander Nitsch
a5b293b412 Fix setting of architecture for MinGW builds
The architecture has been correctly determined earlier in this
file. No need to do it again.
2015-02-24 23:13:27 +01:00
Mansour Moufid
7d4cbbd7aa Cast a long integer to double explicitly. 2015-02-24 17:04:28 -05:00
Mansour Moufid
b7be49426d Cast some image coordinates and sizes to double. 2015-02-24 12:21:34 -05:00
Alexander Alekhin
52effe9e72 Android: fix JavaCameraView implementation
1) Fixed deadlock if camera is started and stopped immediately
2) Invalid pattern usage of Object.wait(). Refer to "spurious wakeup": http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait
3) Fixed buffer usage:
  a) fix eliminates processing of zero NV12 (green in RGB) first frame
  b) latest ready frame is delivered for processing (not previous)
2015-02-24 18:52:54 +03:00
Vadim Pisarevsky
bdb088dcca Merge pull request #3712 from jet47:fix-cuda-build-on-windows 2015-02-24 15:39:01 +00:00
Vadim Pisarevsky
457758b537 Merge pull request #3733 from StevenPuttemans:fix_4004_master 2015-02-24 15:38:40 +00:00
Vadim Pisarevsky
b64b82a1ef Merge pull request #3734 from Dmitry-Me:reduceVariableScope2 2015-02-24 15:38:19 +00:00
Vadim Pisarevsky
0016f6d73d Merge pull request #3736 from nisargthakkar:Bug3634_master 2015-02-24 15:38:02 +00:00
Vadim Pisarevsky
5dc569866e Merge pull request #3743 from StevenPuttemans:fix_3887_master 2015-02-24 15:37:13 +00:00
Alexander Smorkalov
96d7bcc2a9 Merge pull request #3677 from ilya-lavrenov:cuda_backport 2015-02-24 15:06:15 +00:00
Vadim Pisarevsky
2d2ecbf3ee Merge pull request #3653 from StevenPuttemans:add_annotationtool 2015-02-24 13:50:39 +00:00
theodore
96c824f375 Morphology Lines Extraction Tutorial 2015-02-24 14:33:15 +01:00
Ilya Lavrenov
e03136e951 backport from master 2015-02-24 16:05:21 +03:00
Vadim Pisarevsky
90fb43cd11 Merge pull request #3709 from StevenPuttemans:fix_traincascade_load_message_master 2015-02-24 12:50:38 +00:00
Alexander Smorkalov
1c6e9fdfae Merge pull request #3735 from SpecLad:align-cpack-variables 2015-02-24 11:42:40 +00:00
Alexander Smorkalov
1a795ac2ea Merge pull request #3738 from ilya-lavrenov:cc_master 2015-02-24 10:47:20 +00:00
Maksim Shabunin
1fe1ebf20c Merge pull request #3728 from StevenPuttemans:fix_3714_master 2015-02-24 10:09:22 +00:00
Maksim Shabunin
d56dd0e091 Merge pull request #3727 from StevenPuttemans:fix_3714_2.4 2015-02-24 10:08:43 +00:00
Maksim Shabunin
baabd95f30 Merge pull request #3740 from StevenPuttemans:fix_3028_2.4 2015-02-24 10:06:20 +00:00
Maksim Shabunin
02488215e6 Merge pull request #3741 from StevenPuttemans:fix_3028_master 2015-02-24 10:05:16 +00:00
Alexander Smorkalov
877058aaed Merge pull request #3739 from ilya-lavrenov:2_4_cc 2015-02-24 09:35:32 +00:00
Mansour Moufid
42b1c6440c Cast some matrix sizes to type int. 2015-02-23 23:19:33 -05:00
Mansour Moufid
35a89b1541 Change some vector mask types to unsigned. 2015-02-23 23:10:57 -05:00
Eric Sommerlade
998a909705 fixed whitespace issues 2015-02-23 08:15:34 -07:00
StevenPuttemans
6902fa6b1c fix formula getGaussianKernel in docs 2015-02-23 15:23:02 +01:00
StevenPuttemans
370389c7af add extra output argument to tutorial 2015-02-23 15:13:33 +01:00
StevenPuttemans
7401b02022 fix ellipse fitting notice 2015-02-23 15:05:55 +01:00
Alexander Nitsch
8ae6402799 Fix MinGW detection on x86
MinGW-w64 always uses "w64" as vendor key which the previously
used check for "64" anywhere in the target triplet matched. This
would lead to MinGW-w64 setups always being treated as x64.

Since we are actually interested in finding the "64" in the
triplet's operating system key, this fix makes sure to look for
"mingw64" and thus avoids the false match.

Fixes issue #3835. Credits to Lode Leroy for the original patch.
2015-02-23 15:03:28 +01:00
StevenPuttemans
720fd144ef add fit ellipse technique notice 2015-02-23 14:59:40 +01:00
Eric Sommerlade
a07d7a70a0 added support for uncompressed parameters to tiff image format as described here: expertland.net/question/b6o3n6p9a72341db823b48nl98m91dx8n1/detail.html 2015-02-23 06:12:42 -07:00
Ilya Lavrenov
58b3869730 fixed cross-compilation 2015-02-22 13:20:37 +03:00
Ilya Lavrenov
0832b47d21 fixed cross-compilation for Android with CUDA 2015-02-22 13:18:57 +03:00
Olexa Bilaniuk
eb7a7884f6 Merge remote-tracking branch 'refs/remotes/upstream/master' 2015-02-21 12:32:25 -05:00
Olexa Bilaniuk
f454929d9c PRNG changes: xorshift128+ algorithm, and seeding API.
- Switched to the extremely fast, while simple and high-quality,
xorshift128+ PRNG algorithm by Sebastiano Vigna in "Further scramblings
of Marsaglia's xorshift generators. CoRR, abs/1402.6246, 2014" (2^128-1
period, passes BigCrush tests). Performance improved by 10% over
random().
- Added an API to allow seeding with a specified seed, rather than using
rand() or random(). This allows deterministic, reproducible results in
tests using our algorithm (although findHomography() does not yet
support passing an entropy source on its own end).
2015-02-21 12:31:55 -05:00
Alexander Smorkalov
dcc569ee5c Merge pull request #3721 from nitsch:fix-cmake-current-list-dir 2015-02-21 16:49:36 +00:00
Alexander Smorkalov
0cbe2f2eab Merge pull request #3708 from StevenPuttemans:fix_traincascade_load_message 2015-02-21 16:47:58 +00:00
Alexander Smorkalov
3df13ff564 Merge pull request #3732 from StevenPuttemans:fix_4004_2.4 2015-02-21 16:46:41 +00:00
Alexander Alekhin
08dd1e085b Merge pull request #3730 from ilya-lavrenov:fix_bug 2015-02-21 08:10:25 +00:00
Nisarg Thakkar
b8f65d0252 Same as Bug #3309. Pushing to master 2015-02-21 09:20:00 +05:30
Alexander Nitsch
c2944dbc0c Exclude >= 2.8.3 from reimplementation of CMAKE_CURRENT_LIST_DIR
This avoids violation of possible future CMake policy checks
regarding reserved/read-only variables.
2015-02-20 19:55:46 +01:00
Eric Sommerlade
6447c7b2f4 Merge pull request #1 from Itseez/master
Update from original
2015-02-20 17:21:38 +00:00
Andrey Pavlenko
c059f7ddcd Merge pull request #3726 from asmorkalov:ocv_version_inc4 2015-02-20 16:11:58 +00:00
Roman Donchenko
cf54e3b97e Mark the libs component required
Everything else depends on it, after all.
2015-02-20 18:37:21 +03:00
Roman Donchenko
6d52ea8984 Add component display names 2015-02-20 18:22:01 +03:00
Roman Donchenko
b8c60234c3 Update the CPack variables to match the changes in asmorkalov/CMake#1
Which also happens to align the non-Debian specific variables
with the ones used by upstream CMake.
2015-02-20 18:21:47 +03:00
Dmitry-Me
53566f2ec0 Reduce variable scope, fix indenting 2015-02-20 17:46:48 +03:00
StevenPuttemans
2136c3f3c8 add remarks for iOS tutorial 2015-02-20 15:14:36 +01:00
StevenPuttemans
ea54c01125 add remarks for iOS tutorial 2015-02-20 14:30:11 +01:00
Olexa Bilaniuk
0ea009f611 Merge remote-tracking branch 'refs/remotes/upstream/master' 2015-02-20 08:26:04 -05:00
Vadim Pisarevsky
a46166d30f Merge pull request #3710 from asmorkalov:aarc64_manager_android_5 2015-02-20 13:02:07 +00:00
Ilya Lavrenov
5f7a994ad1 fixed internal compiler error 2015-02-20 15:46:22 +03:00
Vadim Pisarevsky
85fd599939 Merge pull request #3588 from vpradeep07:feature/deterministic_pnpransac 2015-02-20 12:32:35 +00:00
StevenPuttemans
350dccf84a fix error 3714 2015-02-20 13:30:40 +01:00
Vadim Pisarevsky
f3210b58a1 Merge pull request #3723 from SpecLad:run-all-tests-windows 2015-02-20 12:28:15 +00:00
Vadim Pisarevsky
d34a52042e Merge pull request #3704 from SpecLad:win-install-data 2015-02-20 12:27:35 +00:00
Vadim Pisarevsky
99ae48f0b4 Merge pull request #3707 from alalek:fix_android_camera 2015-02-20 12:27:13 +00:00
Alexander Smorkalov
96e5300fdd OpenCV and OpenCV Manager version++ 2015-02-20 15:17:11 +03:00
Simon Heinen
5d97dd0ea5 Update android+AsyncServiceHelper.java 2015-02-20 12:54:54 +01:00
StevenPuttemans
4f621de849 fix bug 3714 2.4 branch 2015-02-20 12:39:31 +01:00
Alexander Smorkalov
3649a1a179 Build fix for case without TegraDetector. 2015-02-20 13:29:58 +03:00
Alexander Smorkalov
352485fc54 Android 5 support and aarch64-related fixes for Android Manager. 2015-02-20 13:16:33 +03:00
berak
c83044d45a fix houghlines.py sample and tutorial
fix whitespace
2015-02-20 10:51:52 +01:00
Roman Donchenko
c1e3ca170e Add a script to run all tests on Windows
It's pretty much a simplified copy of the Linux script, lacking fancy colors.
Also, I had to drop Python testing, because it's not easy to pass the Python
module location to the script, and I have no pressing need to run the Python
tests at the moment.
2015-02-20 12:38:25 +03:00
Alexander Nitsch
9665e08bac Implement CMAKE_CURRENT_LIST_DIR for older CMake
The use of built-in CMAKE_CURRENT_LIST_DIR requires at least
CMake 2.8.3. This fix properly defines the variable to allow its
use in versions < 2.8.3 as well.

Fixes issue #4205.
2015-02-20 00:55:26 +01:00
Vadim Pisarevsky
7b270f4c69 Merge pull request #3679 from mshabunin:remove-algorithm-factory 2015-02-19 18:43:58 +00:00
Vadim Pisarevsky
65e4df751c Merge pull request #3705 from SpecLad:unused-nNull 2015-02-19 18:40:22 +00:00
Vadim Pisarevsky
0a1da4461b Merge pull request #3718 from mshabunin:image-max-width 2015-02-19 18:36:27 +00:00
Vadim Pisarevsky
aec8fd3243 Merge pull request #3719 from theodr:document_findnonzero_function 2015-02-19 18:36:09 +00:00
theodore
cfccdc9b0c documenting findnonzero() function 2015-02-19 17:57:52 +01:00
theodore
453f384bd7 adding documentation for the findnonzero() function 2015-02-19 17:38:44 +01:00
theodore
4a1adab9b4 Merge branch 'master' of https://github.com/theodr/opencv 2015-02-19 13:28:03 +01:00
Dmitry-Me
98a8045aaf Reduce variable scope 2015-02-19 13:10:02 +01:00
Nisarg Thakkar
e6876fecd3 Fixed doc error in optical flow 2015-02-19 13:10:02 +01:00
Olexa Bilaniuk
f148f23382 Merge remote-tracking branch 'refs/remotes/upstream/master' 2015-02-18 21:04:39 -05:00
Alexander Alekhin
4e8aac5308 Merge pull request #3683 from SeninAndrew:2.4 2015-02-18 17:15:10 +00:00
Dmitry-Me
c4c3e4fe83 Remove unneeded indirections 2015-02-18 18:25:17 +03:00
Maksim Shabunin
e57359a3a0 Documentation: set max-width property for inserted images 2015-02-18 18:19:36 +03:00
Erik Karlsson
8e7aff4486 Changed fastNlMeansDenoising and fastNlMeansDenoisingMulti back to sum of sq distances. Moved sq sum of abs distances to fastNlMeansDenoisingAbs and fastNlMeansDenoisingMultiAbs 2015-02-18 14:59:52 +01:00
Vadim Pisarevsky
6ff2f395e6 Merge pull request #3702 from Dmitry-Me:reduceVariableScope 2015-02-18 13:55:58 +00:00
Vadim Pisarevsky
a649aea82a Merge pull request #3699 from SpecLad:rm-component-install 2015-02-18 13:55:07 +00:00
Vadim Pisarevsky
009ab70272 Merge pull request #3711 from nisargthakkar:optical_flow_doc_fix 2015-02-18 13:52:09 +00:00
Vadim Pisarevsky
b64e106bb1 Merge pull request #3703 from BKNio:fixing_bad_alloc 2015-02-18 13:50:14 +00:00
Vadim Pisarevsky
1d356b6a48 Merge pull request #3714 from uqtimes:fixUIImageToMat 2015-02-18 13:49:14 +00:00
Vadim Pisarevsky
6b371865af Merge pull request #3716 from mshabunin:fix-vs-solution-build 2015-02-18 13:48:18 +00:00
Vadim Pisarevsky
4fcfcfd002 Merge pull request #3663 from eliteraspberries:ffmpeg-dylib 2015-02-18 12:50:10 +00:00
Vadim Pisarevsky
87f86b31fa Merge pull request #3715 from mshabunin:enable-stl 2015-02-18 12:12:14 +00:00
Vadim Pisarevsky
4f8bf98e6f Merge pull request #3706 from exeltior:patch-1 2015-02-18 11:30:05 +00:00
Maksim Shabunin
2085251df2 Exclude object libraries from visual studio solution build 2015-02-18 14:16:54 +03:00
Maksim Shabunin
c41db69f98 Fixed cmake issues 2015-02-18 12:44:48 +03:00
Maksim Shabunin
553020c448 Enabled STL usage within the library 2015-02-18 12:36:50 +03:00
UQ Times
1944443d10 iOS: fix crash from overrelease in UIImageToMat
- previous pull request: https://github.com/Itseez/opencv/pull/3340
2015-02-18 13:30:08 +09:00
Erik Karlsson
e647b7c7e8 Calculating almost_dist2weight at full size to avoid bounds checking 2015-02-17 23:08:36 +01:00
Erik Karlsson
baf266c29e Changed from sum of squared differences to sum of abs differences 2015-02-17 21:30:52 +01:00
Vladislav Vinogradov
671b59aa9d fix windows build with CUDA
rename cv::cuda::internal namespace
to cv::cuda::device to prevent conflicts
with cv::internal
2015-02-17 21:50:39 +03:00
Vijay Pradeep
4ce31c7c1a Merge remote-tracking branch 'itseez/2.4' into feature/deterministic_pnpransac 2015-02-17 10:16:44 -08:00
Vijay Pradeep
49bc100e51 Removing rng_seed arg in order to maintain ABI compatibility. Hardcoding seed 2015-02-17 09:19:36 -08:00
Nisarg Thakkar
437ef99ba5 Fixed doc error in optical flow 2015-02-17 22:14:57 +05:30
StevenPuttemans
2738939126 add same functionality as 2.4 2015-02-17 10:25:18 +01:00
StevenPuttemans
f5a14e5594 fix message of preloaded parameters 2015-02-17 10:21:31 +01:00
Maksim Shabunin
79e8f0680c Updated ml module interfaces and documentation 2015-02-17 11:46:14 +03:00
Alexander Alekhin
dc21a0a6b5 Android: fix JavaCameraView implementation
1) Fixed deadlock if camera is started and stopped immediately
2) Invalid pattern usage of Object.wait(). Refer to "spurious wakeup": http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait
3) Fixed buffer usage:
  a) fix eliminates processing of zero NV12 (green in RGB) first frame
  b) latest ready frame is delivered for processing (not previous)
2015-02-17 01:28:43 +03:00
exeltior
b51805e245 Update mser.cpp
Need to initialize boolean variable pass2Only, otherwise the result is not predictable
2015-02-16 18:17:41 +01:00
Roman Donchenko
d218f28070 cap_msmf.hpp: fix a warning about nNull being unused
The two functions featuring nNull are not particularly needed, so
I simply removed them.
2015-02-16 19:31:51 +03:00
Roman Donchenko
e8a7394009 Install data and test data on Windows
Because why not?
2015-02-16 19:24:07 +03:00
Vadim Pisarevsky
d1a15097fe Merge pull request #3664 from wangyan42164:ocl_cascasde_barrier 2015-02-16 15:42:26 +00:00
Ahmatnurov Dinar
21ee113af3 fixig std::bad_alloc
if points0 is empty checkVector(2) return -1, it causes the exception
2015-02-16 17:15:54 +03:00
Dmitry-Me
103687871d Reduce variable scope 2015-02-16 15:39:52 +03:00
Maksim Shabunin
da383e65e2 Remove deprecated methods from cv::Algorithm 2015-02-16 15:28:54 +03:00
Vadim Pisarevsky
fdf31ec14f Merge pull request #3650 from StevenPuttemans:fix_tutorials_master 2015-02-16 11:45:37 +00:00
Vadim Pisarevsky
d509ecd19a Merge pull request #3666 from mshabunin:meta-module 2015-02-16 11:43:30 +00:00
Vadim Pisarevsky
6a3a6416d7 Merge pull request #3698 from SpecLad:avcodec-free-frame 2015-02-16 11:33:00 +00:00
Vadim Pisarevsky
23633c1945 Merge pull request #3685 from alalek:ocl_android_default_off 2015-02-16 11:31:02 +00:00
Vadim Pisarevsky
edab3916aa Merge pull request #3696 from Dmitry-Me:shouldPassByReference 2015-02-16 11:29:22 +00:00
Vadim Pisarevsky
9e3a826263 Merge pull request #3697 from tomi44g:2.4 2015-02-16 11:28:02 +00:00
Vadim Pisarevsky
7164f22347 Merge pull request #3701 from jet47:internal-namespace 2015-02-16 11:27:05 +00:00
Vladislav Vinogradov
a932d8aba1 use full qualified name for all internal namespaces to prevent ambiguous symbol errors 2015-02-16 11:31:21 +03:00
Roman Donchenko
8714219dab Merge pull request #3695 from SpecLad:fix-hdc-tautology 2015-02-13 14:09:07 +00:00
Roman Donchenko
6c4b3c1efe Merge pull request #3693 from SpecLad:no-absolute-destinations 2015-02-13 14:06:54 +00:00
Olexa Bilaniuk
86b6cab7fa Merge branch 'master' of https://github.com/obilaniu/opencv
Conflicts:
	modules/calib3d/src/fundam.cpp
	modules/calib3d/src/rhorefc.cpp
2015-02-13 08:20:09 -05:00
Olexa Bilaniuk
5d79b1092f Merge remote-tracking branch 'refs/remotes/upstream/master' into rho 2015-02-13 08:12:11 -05:00
Olexa Bilaniuk
e5696bc5e6 Whitespace change reverts to minimize delta w.r.t master. 2015-02-13 08:07:15 -05:00
Erik Karlsson
c339720af9 Preparation for 16-bit colored denoising. Currently not working due to cvtColor not supportint 16-bit Lab conversion. 2015-02-13 13:38:37 +01:00
Roman Donchenko
49fe496914 Remove useless CPACK_*_COMPONENT_INSTALL variables
They don't actually do anything. And even if they did, all components are
enabled by default, anyway.
2015-02-13 15:31:19 +03:00
Roman Donchenko
77578d415f Fix a memory leak in CvCapture_FFMPEG::close
FFmpeg now requires that frames allocated with avcodec_alloc_frame are
freed with avcodec_free_frame.
2015-02-13 15:12:52 +03:00
Hamid Bazargani
5070f2a334 Fix sacCalcJacobianErrors arguments. (curr.inl replaced with best.inl)
Fix the issue given NULL inlMask
2015-02-13 00:44:19 -05:00
Hamid Bazargani
44f906eb35 Fix sacCalcJacobianErrors arguments. (curr.inl replaced with best.inl)
Fix the issue given NULL inlMask
2015-02-13 00:38:19 -05:00
Hamid Bazargani
e22678018b Fix sacCalcJacobianErrors arguments. (curr.inl replaced with best.inl)
Fix the issue given NULL inlMask
2015-02-13 00:30:18 -05:00
Hamid Bazargani
42176f8eb1 Fix sacCalcJacobianErrors arguments. (curr.inl replaced with best.inl)
Fix the issue given NULL inlMask
2015-02-13 00:09:37 -05:00
ASUS
9a555063e8 Fix sacCalcJacobianErrors arguments. (curr.inl replaced with best.inl)
Fix the issue given NULL inlMask
2015-02-12 23:34:48 -05:00
Erik Karlsson
584372bbf2 Fixed bounds checking 2015-02-13 04:33:29 +01:00
ASUS
6b04351ce1 Merge branch 'accuracy' of https://github.com/obilaniu/opencv into accuracy
Conflicts:
	modules/calib3d/src/rhorefc.cpp
2015-02-12 21:27:08 -05:00
ASUS
6dbf13d7b5 saveBestModel() is modified. accuracy test is passed. 2015-02-12 21:22:52 -05:00
Thomas Gabrowski
ff4c42d182 Fix iOS warnings about implicit conversion precision by changing double literals to float ones 2015-02-13 00:51:03 +00:00
Erik Karlsson
d588c717da Using WEIGHT_THRESHOLD to limit table size. Still problematic with 16-bit and big h-values. 2015-02-13 00:11:30 +01:00
Erik Karlsson
42db9e7153 Basic 16-bit implmentation of fastNlMeansDenoising. Table-based exponetiation leads to high memory footprint and loss of precision in 16-bit mode. 2015-02-12 22:14:01 +01:00
Erik Karlsson
49e93747b1 Added saturate_cast from int64 and uint64 2015-02-12 22:05:05 +01:00
Olexa Bilaniuk
ff2509af56 Fixed printouts in testcase to blame the correct method for a failure.
Previously, certain test failures by the method RHO would result in an
error blaming RANSAC instead. The fix involves a parameter change to
several functions in test_homography.cpp.
2015-02-12 14:42:37 -05:00
Erik Karlsson
8368fb9ea8 Additional refactoring preparing for 16-bit implementation 2015-02-12 18:45:09 +01:00
Dmitry-Me
c3f8fc41b7 Parameters should have been passed by reference 2015-02-12 17:32:43 +03:00
Erik Karlsson
e178294b49 Refactoring in preparation for 16-bit implementation of fastNlMeansDenoising 2015-02-12 15:23:28 +01:00
Roman Donchenko
3d46c1f960 Don't install documentation if it isn't built
The HAVE_DOC_GENERATOR variable was always true.
2015-02-12 16:51:26 +03:00
Roman Donchenko
0387f8ad56 Don't use ${CMAKE_INSTALL_PREFIX} as an install destination
Absolute destinations are not necessary, and prevent CPack from working.
2015-02-10 19:43:29 +03:00
Maksim Shabunin
a5a510da4b Support for compound modules, support for contrib_world 2015-02-10 18:30:05 +03:00
Vadim Pisarevsky
5466e321b8 Merge pull request #3687 from Dmitry-Me:fixPossibleNullPtrDeref 2015-02-10 12:17:11 +00:00
Vadim Pisarevsky
f6b82d99ad Merge pull request #3684 from SeninAndrew:master 2015-02-10 12:03:52 +00:00
Vadim Pisarevsky
dd1878c64f Merge pull request #3688 from jet47:test-script-optional-color-3.0 2015-02-10 12:02:36 +00:00
Vadim Pisarevsky
9a62173a5b Merge pull request #3689 from jet47:test-script-optional-color-2.4 2015-02-10 12:00:44 +00:00
Vladislav Vinogradov
6a3f33090d make color output in run_test script optional 2015-02-09 15:24:46 +03:00
Vladislav Vinogradov
682fdcfc9b make color output in run_test script optional 2015-02-09 15:23:34 +03:00
Andrew Senin
b9a6edfe3d Fixing XIMEA parameters mapping (issue #4176) 2015-02-09 15:15:23 +03:00
Dmitry-Me
ea48fcfc9f Fix possible null pointer dereference 2015-02-09 12:38:02 +03:00
Vadim Pisarevsky
05e404c2ff Merge pull request #3681 from jet47:fix-run-tests-script-3.0 2015-02-08 17:07:28 +00:00
Vadim Pisarevsky
606a646435 Merge pull request #3680 from jet47:fix-run-tests-script-2.4 2015-02-08 17:07:11 +00:00
Alexander Alekhin
79416cdf10 ocl: disable OpenCL by default for Android builds 2015-02-08 13:08:14 +03:00
Olexa Bilaniuk
ccd33a721e Fixed build failures related to designSPRTTest(). 2015-02-07 01:19:40 -05:00
Olexa Bilaniuk
7e273396c1 Merge remote-tracking branch 'refs/remotes/upstream/master' into rho 2015-02-07 01:08:10 -05:00
Olexa Bilaniuk
adac8c04bb Converted to C++ style, + bugfixes.
The code has been refactored in response to feedback on Pull Request

Also, outputZeroH() now also zeroes the inlier set, much like
outputModel().
2015-02-07 00:56:58 -05:00
Andrew Senin
8c7b3b91fa Fixing XIMEA parameters mapping (issue #4176) 2015-02-07 00:50:23 +03:00
Vadim Pisarevsky
6c8681a472 Merge pull request #3656 from SeninAndrew:master 2015-02-06 11:49:27 +00:00
Vladislav Vinogradov
098389d8eb fix opencv_run_all_tests_unix.sh script:
use `bash` shell instead of `sh`, since on Ubuntu `sh` by default is `dash`,
and `dash` doesn't support `PIPESTATUS` feature used in this sctipt
2015-02-06 12:36:18 +03:00
Vladislav Vinogradov
94d14c637f fix opencv_run_all_tests_unix.sh script:
use `bash` shell instead of `sh`, since on Ubuntu `sh` by default is `dash`,
and `dash` doesn't support `PIPESTATUS` feature used in this sctipt
2015-02-06 12:34:50 +03:00
Vadim Pisarevsky
1e47c6cc56 Merge pull request #3612 from guoyejun:fix_face_detect 2015-02-05 07:50:13 +00:00
Vadim Pisarevsky
cd1ca7b08b Merge pull request #3667 from AfterEight:cap_ximea_setResolution_bugfix 2015-02-05 07:48:43 +00:00
Vadim Pisarevsky
bbec7f8e89 Merge pull request #3669 from vbystricky:fix_tr_cascade_boost 2015-02-05 07:47:39 +00:00
Vadim Pisarevsky
5524e8d2c0 Merge pull request #3673 from jet47:colorize-run-test-script-3.0 2015-02-05 07:36:14 +00:00
Vadim Pisarevsky
98f9a013d1 Merge pull request #3674 from jet47:colorize-run-test-script-2.4 2015-02-05 07:35:01 +00:00
Vadim Pisarevsky
3f86e7b75a Merge pull request #3668 from mshabunin:fix-ann-memory-access 2015-02-05 07:33:49 +00:00
Vadim Pisarevsky
7854ef3840 Merge pull request #3675 from alalek:fix_coreTlsData 2015-02-05 07:32:58 +00:00
Olexa Bilaniuk
87c2b8197a Bug fixes in mask output.
Previously, the output mask of inliers could remain completely
uninitialized. This fix is the first part of a solution.
2015-02-05 02:18:41 -05:00
Olexa Bilaniuk
b90800f0c7 Corrected typo in comment.
The inverted JtJ does not multiply itself, but rather Jte. Correct this
in the comment.
2015-02-04 12:12:14 -05:00
Mansour Moufid
c60fa84027 Add back the version variables removed in ab40630f. 2015-02-04 10:55:38 -05:00
Vadim Pisarevsky
50eb661df8 Merge pull request #3676 from asmorkalov:changelog_for_tests 2015-02-04 15:13:44 +00:00
Alexander Smorkalov
a87ccb9ac0 Added Debian changelog to -tests package. 2015-02-04 16:52:39 +03:00
Vadim Pisarevsky
8e1b1a845b Merge pull request #3672 from asmorkalov:debian_lower_case 2015-02-04 13:17:51 +00:00
Vadim Pisarevsky
5253265342 Merge pull request #3671 from jet47:disable-gpu-match-template-tests 2015-02-04 13:17:26 +00:00
Alexander Alekhin
2054123890 coreTlsData -> getCoreTlsData() 2015-02-04 13:03:27 +03:00
Vladislav Vinogradov
a9325102a2 colorize opencv_run_all_tests_unix.sh script output 2015-02-04 12:39:51 +03:00
Vladislav Vinogradov
2b303f38a8 colorize opencv_run_all_tests_unix.sh script output 2015-02-04 12:38:51 +03:00
Alexander Smorkalov
e6ac64008b Debian package names replaced by lower case version to satisfy lintian. 2015-02-04 11:56:29 +03:00
Vladislav Vinogradov
7bb8c50080 disable gpu::matchTemplate tests 2015-02-04 11:21:17 +03:00
Olexa Bilaniuk
2609e77af7 Silence spurious loss-of-data warnings from Windows.
Added explicit casts to silence warnings in fundam.cpp and rhorefc.cpp.
2015-02-04 02:26:01 -05:00
Olexa Bilaniuk
ce0570b777 Splitting vectorized code into separate branch.
Deleted SSE code from master branch.
Slight cleanups in fundam.cpp were made as a consequence.
2015-02-03 23:33:52 -05:00
Mansour Moufid
8c68f1f626 Fix indentation of 98a157f5. 2015-02-03 23:17:43 -05:00
Mansour Moufid
98a157f589 Remove Apple-specific logic in finding the FFmpeg libraries.
Thanks to SpecLad.
2015-02-03 23:14:11 -05:00
Olexa Bilaniuk
69b146412a Edited Doxygen documentation in the module calib3d.
Added a mention within calib3d.hpp that the flag RHO is available as an
option on calls to findHomography().
2015-02-03 22:55:40 -05:00
Olexa Bilaniuk
8907e6feac Merge remote-tracking branch 'refs/remotes/upstream/master' into rho 2015-02-03 22:50:45 -05:00
VBystricky
f5987c258f Fix small error in traincascade application 2015-02-03 21:32:47 +04:00
Maksim Shabunin
c85197da55 Fixed allocated vector size in ML ANN algorithm
- updated return value of points_classifier sample
2015-02-03 18:16:20 +03:00
Mansour Moufid
a1cc9380e5 Correct the new find_library commands.
Thanks to SpecLad.
2015-02-02 11:54:09 -05:00
AfterEight
e938563de5 Modified resetCvImage() in cap_ximea.cpp, so that the IplImage* frame is also updated after the resolution has changed via set(CV_CAP_PROP_FRAME_WIDTH, value)/set(CV_CAP_PROP_XI_DOWNSAMPLING, value) 2015-02-02 15:04:29 +01:00
Vadim Pisarevsky
4c52dfc956 Merge pull request #3657 from BelBES:sb/tegra_optimization_fix 2015-02-02 10:18:59 +00:00
Vadim Pisarevsky
0ab4bbf771 Merge pull request #3662 from StevenPuttemans:fix_models 2015-02-02 10:17:43 +00:00
Vadim Pisarevsky
94431c23f6 Merge pull request #3661 from StevenPuttemans:fix_models_2.4 2015-02-02 10:15:40 +00:00
Vadim Pisarevsky
e64fb44f67 Merge pull request #3632 from theodr:dist_transf_tutorial 2015-02-02 10:10:39 +00:00
Vadim Pisarevsky
71a333dd78 Merge pull request #3644 from mshabunin:ml-docs 2015-02-02 10:08:40 +00:00
Vadim Pisarevsky
72194b2115 Merge pull request #3651 from mshabunin:shape-test 2015-02-02 10:07:01 +00:00
Vadim Pisarevsky
bbf3607fa8 Merge pull request #3652 from alalek:ocl_message 2015-02-02 10:04:39 +00:00
Yan Wang
99aaf4030a Remove unnecessary barrier in runHaarClassifier().
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2015-02-02 16:55:11 +08:00
Mansour Moufid
ab40630ff4 Use the CMake find_library command to find the FFmpeg libraries. 2015-02-01 15:51:33 -05:00
StevenPuttemans
8548a8430e fixing wrong model sizes 2015-02-01 15:13:57 +01:00
StevenPuttemans
9944f46b47 fixing wrong model sizes 2015-02-01 15:08:43 +01:00
Vadim Pisarevsky
06b97b7b67 Merge pull request #3660 from asmorkalov:samples_install_permissions 2015-02-01 09:14:28 +00:00
Alexander Smorkalov
cf852972d1 Fixed samples install permissions for Debian packaging. 2015-02-01 00:34:23 +03:00
Vadim Pisarevsky
1f47c22371 Merge pull request #3655 from asmorkalov:remove_opencv_testing_sh 2015-01-31 14:46:40 +00:00
Vadim Pisarevsky
602b034a03 Merge pull request #3658 from asmorkalov:numpy_dependency 2015-01-31 14:45:11 +00:00
Vadim Pisarevsky
8764b17ffc Merge pull request #3659 from asmorkalov:debian_changelog_stub 2015-01-31 14:44:41 +00:00
Alexander Smorkalov
ddc1b965b6 Added Debian changelog installation step for Debian package generation. 2015-01-30 13:21:52 +03:00
Alexander Smorkalov
be6b847675 Added dependency from numpy to debian package with python bindings. 2015-01-30 12:27:33 +03:00
sergei
0d72420480 HAVE_TEGRA_OPTIMIZATION was fixed 2015-01-30 11:57:35 +03:00
Andrew Senin
52535b356c Fix for assert in compute when subimage is used (see issue #4149) 2015-01-29 21:39:07 +04:00
Alexander Smorkalov
9206ec30a2 opencv_testing.sh script installation is removed as run tests script does the same thing. 2015-01-29 19:20:18 +03:00
Vadim Pisarevsky
a7e9760316 Merge pull request #3649 from StevenPuttemans:fix_tutorials 2015-01-29 12:14:09 +00:00
Vadim Pisarevsky
7e1068919b Merge pull request #3587 from vpradeep07:fix/pnpransac_race_cond 2015-01-29 12:12:18 +00:00
StevenPuttemans
30d46313ec adding a universal OpenCV based annotation tool for cascade classifier training 2015-01-29 13:03:28 +01:00
Alexander Alekhin
f282fd0ebf ocl: print missing error message only if OPENCV_OPENCL_RUNTIME is used 2015-01-29 13:16:31 +03:00
Vadim Pisarevsky
97aa8d3341 Merge pull request #3603 from alalek:ocl_svm 2015-01-29 05:35:46 +00:00
Vadim Pisarevsky
bdebf4cea7 Merge pull request #3637 from wangyan42164:LBP_mad24_opt 2015-01-28 18:51:52 +00:00
Vadim Pisarevsky
f3311f9e2a Merge pull request #3638 from jet47:remove-cuda-module 2015-01-28 18:51:32 +00:00
Vadim Pisarevsky
7d7d323f53 Merge pull request #3639 from cbenhagen:patch-1 2015-01-28 18:50:58 +00:00
Vadim Pisarevsky
5cbdce97aa Merge pull request #3645 from SeninAndrew:mp-msvs-fix 2015-01-28 18:50:39 +00:00
Vadim Pisarevsky
c1252a1089 Merge pull request #3648 from SpecLad:get_policy-ts 2015-01-28 18:49:59 +00:00
Maksim Shabunin
cf0a29ce4d Fixed win64 compile warning 2015-01-28 18:11:53 +03:00
Maksim Shabunin
10639c9526 Shape module tests refactored
- common operations moved to separate class
- debug console messages removed
- test results are stored in memory instead of file
2015-01-28 17:01:37 +03:00
StevenPuttemans
be1728fba1 fixing tutorial errors master branch 2015-01-28 13:56:29 +01:00
StevenPuttemans
a86dc747b3 fixing tutorial errors 2015-01-28 13:52:50 +01:00
Alexander Karsakov
c481e06e87 Fixed getPolicy() method to make it thread-safe.
(cherry picked from commit 8910508b838363ce4f721e5b463cd04cfd225a1a)
2015-01-27 19:20:35 +03:00
tt
4ea2eceb70 Image Segmentation .cpp tutorial
Distance Transform tutorial fixes

Distance Transform fixes v.2

Distance Transform fixes v.3

Distance Transform fixes v.4
2015-01-27 16:44:52 +01:00
Andrew Senin
d08589d435 Fix for Visual Studio multiprocess builds for CMake versions > 2.8 2015-01-26 18:54:27 +04:00
Vadim Pisarevsky
3bfe4f711d Merge pull request #3641 from cbenhagen:patch-2 2015-01-26 09:45:59 +00:00
Vadim Pisarevsky
6e565ab4a4 Merge pull request #3642 from ilya-lavrenov:linux_x86 2015-01-26 09:44:59 +00:00
Vadim Pisarevsky
f1fb474459 Merge pull request #3643 from jet47:find-cuda-fix 2015-01-26 09:44:31 +00:00
Vladislav Vinogradov
482feb7266 FindCUDA fix : do not unset CACHE variables on first call
This will allow to override CUDA CMake variables from first CMake call,
like cmake -DCUDA_TOOLKIT_ROOT_DIR=... -DCUDA_CUDA_LIBRARY=...
2015-01-26 10:24:53 +03:00
Maksim Shabunin
53c9460454 Reorganized ML module documentation
- fixed one BiB record
- moved algorithms overview to separate page
- added docs for some enumerations
- fixed some small documentation errors
2015-01-23 23:43:06 +03:00
Alexander Alekhin
0a07d780e0 ocl: OpenCL SVM support 2015-01-23 20:37:45 +03:00
Vladislav Vinogradov
fa23a01775 fix FindCUDA CMake module:
do not unset variables if CUDA_TOOLKIT_TARGET_DIR is not defined
2015-01-23 19:17:00 +03:00
Alexander Alekhin
58ad952b1a UMat: added USAGE_ALLOCATE_SHARED_MEMORY 2015-01-23 18:44:12 +03:00
Ilya Lavrenov
dcb0c68ed3 fix for -m32 2015-01-23 17:26:48 +03:00
Ben Hagen
5245c7454c Do not blacklist GStreamer on Apple 2015-01-23 12:59:09 +01:00
Vladislav Vinogradov
c9e07bbc95 exclude compactPoints and calcWobbleSuppressionMaps from compilation
if they are not needed
2015-01-22 16:36:16 +03:00
Ben Hagen
8914fa51ff Do not blacklist GStreamer on Apple 2015-01-22 14:17:43 +01:00
Vladislav Vinogradov
6ebc95470b fix videostab compilation without CUDA 2015-01-22 15:02:22 +03:00
Vladislav Vinogradov
2660eee961 restore CUDA module introduction
put it into core documentation
2015-01-22 15:02:21 +03:00
Vladislav Vinogradov
a0691289f9 fix cudalegacy sanity test 2015-01-22 15:02:21 +03:00
Vladislav Vinogradov
124ac15f1e remove cuda module 2015-01-22 15:02:21 +03:00
Vladislav Vinogradov
ce0e595a4f move the rest cuda functions to cuda legacy 2015-01-22 15:02:21 +03:00
Vladislav Vinogradov
f1e1785386 move vstab related CUDA routines to vstab module 2015-01-22 15:02:20 +03:00
Vladislav Vinogradov
b416e8715d move labeling routines from cuda to cudalegacy 2015-01-22 15:02:20 +03:00
Vadim Pisarevsky
3f1fb281be Merge pull request #3635 from jet47:cuda-optflow-refactoring 2015-01-22 09:45:19 +00:00
Vadim Pisarevsky
9c81338cb9 Merge pull request #3505 from karelknoest:lsd_subpixel 2015-01-22 09:44:29 +00:00
Vadim Pisarevsky
f93be25cc8 Merge pull request #3629 from nstiurca:matx-fix 2015-01-22 09:43:33 +00:00
Yan Wang
df697f6520 Optimize runLBPClassifierStumpSimple by built-in mad24.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2015-01-22 16:36:16 +08:00
Vadim Pisarevsky
4949f70860 Merge pull request #3633 from mshabunin:fix-gdal-warning 2015-01-21 13:07:53 +00:00
Vladislav Vinogradov
710617034b remove unused function from pyrlk_optical_flow sample 2015-01-21 15:50:22 +03:00
Vladislav Vinogradov
63ff39f9f3 remove obsolete gpu optical flow samples 2015-01-21 15:50:22 +03:00
Vladislav Vinogradov
b3a743f09a fix gpu samples compilation 2015-01-21 15:50:22 +03:00
Vladislav Vinogradov
62f8240b00 fix videostab module compilation 2015-01-21 15:50:21 +03:00
Vladislav Vinogradov
03ae1e5aae fix superres module compilation 2015-01-21 15:50:21 +03:00
Vladislav Vinogradov
2dc3b0f7f9 fix cudaoptflow tests build 2015-01-21 15:50:21 +03:00
Vladislav Vinogradov
381216aa54 refactor cudaoptflow public API:
* use opaque algorithm interfaces
* add stream support
2015-01-21 15:50:21 +03:00
Vladislav Vinogradov
19c6bbe7d9 move obsolete algorithms from cudaoptflow to cudalegacy 2015-01-21 15:50:21 +03:00
Vladislav Vinogradov
c4b2058d23 simplify TVL1 accuracy test to reduce run time 2015-01-21 15:50:21 +03:00
Vladislav Vinogradov
71c391cd8d remove unused memory transfer from TVL1 CUDA implementation
it caused runtime failures
2015-01-21 15:50:21 +03:00
Maksim Shabunin
036b13ee05 Fixed GDAL loader check 2015-01-21 14:01:21 +03:00
Vadim Pisarevsky
cc1090cf3b Merge pull request #3521 from ana-GT:registration_openni2 2015-01-21 10:48:23 +00:00
Vadim Pisarevsky
bd4580a242 Merge pull request #3589 from JBosch:master 2015-01-21 10:46:53 +00:00
Vadim Pisarevsky
03fc3d1ceb Merge pull request #3591 from ilya-lavrenov:sse_avx 2015-01-21 10:46:23 +00:00
Vadim Pisarevsky
adbe84425f Merge pull request #3622 from nagua:fix_find_gstreamer 2015-01-21 10:44:11 +00:00
Vadim Pisarevsky
b49fa7d384 Merge pull request #3625 from wangyan42164:ocl_cascade_deadlock 2015-01-21 10:43:50 +00:00
Vadim Pisarevsky
479cac2a14 Merge pull request #3626 from jet47:cuda-bgsegm-refactoring 2015-01-21 10:40:47 +00:00
Vadim Pisarevsky
2fabe56bbe Merge pull request #3631 from StevenPuttemans:fix_samples 2015-01-21 10:40:19 +00:00
Maksim Shabunin
1a15596f21 Fixed build warning in GDAL support module 2015-01-21 12:53:50 +03:00
Nicu Știurcă
8722faa167 fix whitespace 2015-01-20 23:58:05 -05:00
Nicu Știurcă
7a3ca99894 fix _OutputArray::assign() for _OutputArrays of type MATX when data types differ 2015-01-20 23:49:04 -05:00
Olexa Bilaniuk
045f8294bb Merge remote-tracking branch 'refs/remotes/upstream/master' into rho 2015-01-20 13:11:09 -05:00
Ilya Lavrenov
e9a6c5db21 sqsum 2015-01-20 21:10:06 +03:00
karelknoest
b5bd2fd880 Improved documentation and method comment to clarify that LineSegmentDetector::detect method accepts both Vec4i and Vec4f as return vector. 2015-01-20 17:05:57 +01:00
karelknoest
1ded2de2dd Let LineSegmentDetector output line segment coordinates in float precision, as supported by the LSD algorithm. 2015-01-20 17:05:38 +01:00
Vadim Pisarevsky
2ca39c910d Merge pull request #3468 from StevenPuttemans:fix_models 2015-01-20 15:25:51 +00:00
StevenPuttemans
cf5a7b9679 remove an unused #endif 2015-01-20 15:41:39 +01:00
Vadim Pisarevsky
95ecdc3af9 Merge pull request #3600 from jet47:cuda-objdetect-module 2015-01-20 13:29:32 +00:00
Vadim Pisarevsky
579ce93885 Merge pull request #3598 from caraffi:bug4108_testCasesLinkError 2015-01-20 12:59:34 +00:00
Vadim Pisarevsky
21a9a17478 Merge pull request #3568 from ilya-lavrenov:neon_runtime 2015-01-20 12:47:51 +00:00
Vadim Pisarevsky
e501c61c04 Merge pull request #3611 from jet47:fix-gpumat-setto 2015-01-20 12:37:45 +00:00
Vadim Pisarevsky
9a6a046caf Merge pull request #3613 from asmorkalov:aarch64_tiff 2015-01-20 12:36:38 +00:00
Vadim Pisarevsky
aacb9b7cf5 Merge pull request #3610 from jet47:fix-ocv_add_module-3.0 2015-01-20 12:35:36 +00:00
Vadim Pisarevsky
c29c52a216 Merge pull request #3609 from jet47:fix-ocv_add_module-2.4 2015-01-20 12:34:50 +00:00
Vadim Pisarevsky
f647054c8c Merge pull request #3616 from marvins:gdal-fixes 2015-01-20 12:31:14 +00:00
Vadim Pisarevsky
52d3afd798 Merge pull request #3624 from jet47:fix-arm-linux-toolchain 2015-01-20 12:30:42 +00:00
Vadim Pisarevsky
696a6561d3 Merge pull request #3627 from cbenhagen:patch-1 2015-01-20 12:27:19 +00:00
Vadim Pisarevsky
ea38f7fa66 Merge pull request #3628 from cbenhagen:patch-2 2015-01-20 12:18:04 +00:00
Yan Wang
f5b21e8141 Avoid deadlock becasue some work item couldn't reach barrier in loop
and unsynchronized.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2015-01-20 13:45:33 +08:00
Nicu Știurcă
e97d18ba81 implement _OutputArray::assign() for _OutputArrays of type MATX 2015-01-19 16:20:10 -05:00
Ben Hagen
5422cbcecb make PlaneTracker class more thread-safe 2015-01-19 21:57:23 +01:00
Ben Hagen
3f8cefea0e store user-provided data in PlaneTracker class 2015-01-19 21:51:19 +01:00
Vadim Pisarevsky
5e92a777ef Merge pull request #3569 from ilya-lavrenov:sse_mul 2015-01-19 13:42:36 +00:00
Vadim Pisarevsky
07c9a88d9c Merge pull request #3621 from asmorkalov:ts_master_comapat_header 2015-01-19 12:33:58 +00:00
Vladislav Vinogradov
dae188d14f move obsolete algorithms from cudabgsegm to cudalegacy:
* GMG
* FGD
2015-01-19 14:17:00 +03:00
Vadim Pisarevsky
17b1152fa3 Merge pull request #3544 from jet47:cuda-warping-refactoring 2015-01-19 11:10:48 +00:00
Vadim Pisarevsky
381917b762 Merge pull request #3563 from cjmayo:pyexamples 2015-01-19 11:09:58 +00:00
Vadim Pisarevsky
5cc4aa0e93 Merge pull request #3554 from wangyan42164:match_template_mask 2015-01-19 11:03:44 +00:00
Vadim Pisarevsky
dc27a13426 Merge pull request #3570 from a-wi:Win32_UI_commctrl_defs_v3 2015-01-19 10:54:26 +00:00
Vadim Pisarevsky
225c3e78cb Merge pull request #3582 from ptzafrir:fix_samples 2015-01-19 10:53:42 +00:00
Vadim Pisarevsky
f3439de480 Merge pull request #3623 from Trundle:fix_android_link 2015-01-19 10:51:12 +00:00
Vadim Pisarevsky
219d315c8d Merge pull request #3615 from jaybosamiya:grabcuttypo 2015-01-19 10:50:52 +00:00
Vadim Pisarevsky
28dd3aae79 Merge pull request #3614 from cwreynolds:Unicode-fix-for-addText-2 2015-01-19 10:50:14 +00:00
Vadim Pisarevsky
fe2a7d23a5 Merge pull request #3606 from jet47:warnings-fix 2015-01-19 10:49:53 +00:00
Vadim Pisarevsky
49f2bd6f17 Merge pull request #3608 from jet47:cmake-CMP0054-fix 2015-01-19 10:49:08 +00:00
Vadim Pisarevsky
bcfcc779f6 Merge pull request #3605 from jet47:cuda-photo-refactoring 2015-01-19 10:48:44 +00:00
Vadim Pisarevsky
3a84444488 Merge pull request #3596 from jet47:cuda-features2d-refactoring 2015-01-19 10:48:18 +00:00
Vadim Pisarevsky
b6023eab9c Merge pull request #3594 from asmorkalov:opencv4tegra_support 2015-01-19 10:47:49 +00:00
Vladislav Vinogradov
5978ef1df5 Fix arm linux toolchain file
Use find_program() to set CMAKE_C_COMPILER and CMAKE_CXX_COMPILER.

Originally the variables was set to compiler name, without absolute path.
CMake 3.0 tries to find them in CMAKE_FIND_ROOT_PATH (since 
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM was set to ONLY) and fails.
2015-01-19 10:43:49 +03:00
Andreas Stührk
0a5b200da2 Update link to information about Android platform.
The current link does no longer seem to work.
2015-01-19 00:01:12 +01:00
Nicolas Riebesel
052fe626b3 Corrected the WITH_GSTREAMER and WITH_GSTREAMER_0_10 semantic 2015-01-18 20:27:09 +01:00
Alexander Smorkalov
9e9327e2f8 Added OpenCV 3.0 compat header for TS module. 2015-01-18 21:32:19 +03:00
Vadim Pisarevsky
9fb0f5ac51 Merge pull request #3620 from asmorkalov:native_samples_install 2015-01-18 18:22:27 +00:00
Alexander Smorkalov
cc97c57fd4 Accuracy fix for blenaders in stitching module. 2015-01-18 20:45:57 +03:00
Alexander Smorkalov
911be68a41 Prevent native c/c++/ocl/gpu CMakeLists.txt install if samples are turned off. 2015-01-18 20:33:05 +03:00
Marvin Smith
9a0e038a48 Fixed compile warning from redefined macro. 2015-01-17 20:37:51 -08:00
Marvin Smith
91fbe00caa Updated gdal tutorial to include comments. 2015-01-17 19:28:58 -08:00
Marvin Smith
9a1a9d9aff Updating CMake to get GDAL working again on OS X. 2015-01-17 16:59:56 -08:00
Jay Bosamiya
10cc7c78dd Fix typo 2015-01-17 22:53:30 +05:30
Craig Reynolds
72d90ba8d2 In cvAddText, construct QString from "text" using fromUtf8. 2015-01-16 14:57:11 -08:00
Alexander Smorkalov
d277a1ba75 TIFF support hack for aarch64 reverted. 2015-01-17 01:25:58 +03:00
Vadim Pisarevsky
396f7e1a17 Merge pull request #3604 from asmorkalov:ocv_samples_package 2015-01-16 10:23:32 +00:00
Vladislav Vinogradov
698c367d8d fix ocv_add_module CMake macro:
it tries to remove 'opencv_' prefix from 'name' variable, but
it creates new variable with the same name as module
2015-01-16 11:00:56 +03:00
Vladislav Vinogradov
12a3eb776d fix ocv_add_module CMake macro:
it tries to remove 'opencv_' prefix from 'name' variable, but
it creates new variable with the same name as module
2015-01-16 10:59:52 +03:00
Yan Wang
46ed461e22 Add template match with mask.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2015-01-16 11:09:26 +08:00
Guo Yejun
595ec6b852 correct the size of buf which holds integral sum/sumsq
layer_dy is not initialized correctly, it results in a small height
of the buffer, and so memory write is out of range in cv::integral.
2015-01-16 10:51:39 +08:00
Vladislav Vinogradov
f676bfb3d7 fix GpuMat::setTo method in case if mask is empty:
it might be called from _OutputArray::setTo
2015-01-15 19:33:27 +03:00
Vladislav Vinogradov
0376a8643e fix CMake CMP0054 warning:
ported from c105b72945013b1cecb00617879598c43b82f298
2015-01-15 18:40:33 +03:00
Vladislav Vinogradov
a524a677e4 disable warnings caused by CUDA headers 2015-01-15 17:20:35 +03:00
Vladislav Vinogradov
c120001178 fix -Wsign-compare warnings 2015-01-15 17:17:35 +03:00
Vladislav Vinogradov
14e15fb4f7 fix documentation warnings 2015-01-15 17:15:59 +03:00
soyer
d84d3a519b Allow YUYV capture via libv4l 2015-01-15 15:10:15 +01:00
Vladislav Vinogradov
f48befc6f0 refactor CUDA part of photo module 2015-01-15 16:46:48 +03:00
Vadim Pisarevsky
df57d038b8 Merge pull request #3572 from berak:python_samples_30 2015-01-15 13:17:26 +00:00
Vadim Pisarevsky
713aa5c5b9 Merge pull request #3557 from ilya-lavrenov:sse_add_weighted 2015-01-15 13:14:06 +00:00
Vadim Pisarevsky
61f111143a Merge pull request #3599 from a-wi:DShow_COM_interfaces_v3 2015-01-15 13:12:51 +00:00
Alexander Smorkalov
6628714fc6 Fixed -samples debian package dependencies. 2015-01-15 15:36:45 +03:00
Tzafrir
997dded1ac add default file to load in case sample was run without command line arguments 2015-01-15 14:10:31 +02:00
Alexander Smorkalov
187befd665 Fixed installation of CMakeLists.txt and enabled GPU samples build in stand alone version. 2015-01-15 14:48:24 +03:00
Vadim Pisarevsky
16b56e71d9 Merge pull request #3561 from jet47:cuda-arithm-refactoring 2015-01-15 11:44:35 +00:00
Vadim Pisarevsky
c58373dbea Merge pull request #3574 from mikeizbicki:patch-1 2015-01-15 11:36:51 +00:00
Vadim Pisarevsky
1c9668b371 Merge pull request #3584 from nisargthakkar:UMatDimsZeroAfterRelease 2015-01-15 11:27:11 +00:00
Vadim Pisarevsky
bd6ad79759 Merge pull request #3595 from timsat:error_messages 2015-01-15 11:24:53 +00:00
Vadim Pisarevsky
ce5e2697cb Merge pull request #3597 from wangyan42164:cascade_cl_opt 2015-01-15 11:24:25 +00:00
Vadim Pisarevsky
bcc9dac087 Merge pull request #3602 from vbystricky:cap_images_frames_cnt 2015-01-15 11:21:23 +00:00
berak
fd60e98c5b fixes for latest changes in opencv3.0 api
fixes for latest changes in opencv3.0 api

waitKey() normalization

fixed mser bindings
2015-01-15 12:01:47 +01:00
Olexa Bilaniuk
02124f19e6 Further LevMarq improvements.
Implemented a damping-parameter choice strategy similar to that
described in http://www2.imm.dtu.dk/documents/ftp/tr99/tr05_99.pdf.
Removed a few debug statements.
Chosen a new starting lambda value, 0.01.
We now actually output the mask of inliers.
2015-01-15 04:21:16 -05:00
Vladislav Vinogradov
dccdadc38a fix documentation warnings 2015-01-15 10:34:43 +03:00
VBystricky
d5092a6f7c Add CV_CAP_PROP_POS_FRAMES property to cap_images.cpp 2015-01-15 01:55:17 +04:00
Alexander Smorkalov
54f52c3f45 Build fix for non-TEGRA case. 2015-01-14 22:17:37 +03:00
Vladislav Vinogradov
734212a402 refactor CUDA CascadeClassifier 2015-01-14 19:50:05 +03:00
Vladislav Vinogradov
8257dc3c1e refactor CUDA HOG algorithm:
use abstract interface with hidden implementation
2015-01-14 19:50:05 +03:00
Vladislav Vinogradov
0af7597d36 fix CUDA HOG for multi GPU systems:
move GPU constants initialization from constructor to compute method
2015-01-14 19:50:05 +03:00
Vladislav Vinogradov
f126f371b2 move CUDA object detection algorithms to separate module 2015-01-14 19:50:05 +03:00
Artur Wieczorek
1264be8785 Check if _WIN32_IE is defined with proper value in window_w32.cpp
TBBUTTONINFO struct and BTNS_xxx symbols used in the code need _WIN32_IE to be defined with at least 0x0500 value (_WIN32_IE_IE50) in order to be included from commctrl.h.
2015-01-14 14:52:32 +01:00
Artur Wieczorek
01717c83d7 Don't define destructors for COM-based interfaces. 2015-01-14 14:06:42 +01:00
Yan Wang
07ab0c1c53 Avoid compile unnecessary OpenCL kernel.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2015-01-14 19:52:41 +08:00
Claudio Caraffi
efc7dbaae2 Prevent linking failure, bug 4108 2015-01-14 11:55:41 +01:00
Olexa Bilaniuk
ff91af825d LevMarq made semi-functional.
Replaced the complex rules OpenCV uses to select lambda with a naive but
fast heuristic. It's imperfect but produces good results. It is still
subject to the same problem as OpenCV - namely, on occasion LevMarq will
make a poor result even worse.
2015-01-14 04:22:48 -05:00
Olexa Bilaniuk
8a5182662e Merge remote-tracking branch 'refs/remotes/upstream/master' into rho 2015-01-14 04:11:24 -05:00
Vijay Pradeep
1292fdf71a Now using default arg instead of overloads 2015-01-13 11:25:01 -08:00
Vladislav Vinogradov
5f1282afdb fix documentation warnings 2015-01-13 18:23:59 +03:00
Vladislav Vinogradov
8a178da1a4 refactor CUDA BFMatcher algorithm:
use new abstract interface and hidden implementation
2015-01-13 18:03:57 +03:00
Vladislav Vinogradov
764d55b81d add extended documentation for Features2DAsync 2015-01-13 18:03:57 +03:00
Vladislav Vinogradov
f960a5707d refactor CUDA ORB feature detector/extractor algorithm:
use new abstract interface and hidden implementation
2015-01-13 18:03:57 +03:00
Vladislav Vinogradov
554ddd2ec4 fix compilation without CUDA 2015-01-13 18:03:57 +03:00
Vladislav Vinogradov
9f77ffb03f extend Feature2DAsync interface 2015-01-13 18:03:57 +03:00
Vladislav Vinogradov
14ef62ed66 refactor CUDA FAST feature detector algorithm:
use new FastFeatureDetector abstract interface and hidden implementation
2015-01-13 18:03:56 +03:00
Vladislav Vinogradov
6f91b7f6a4 remove firstLevel=2 test case, because CPU implementation fails 2015-01-13 18:03:56 +03:00
Vladislav Vinogradov
1421e306fb fix compilation without CUDA 2015-01-13 18:00:27 +03:00
Vladislav Vinogradov
ecee388236 move buildWarp*Maps to stitching 2015-01-13 18:00:26 +03:00
Vladislav Vinogradov
4cc7b0a74f move ImagePyramid to cudalegacy 2015-01-13 18:00:26 +03:00
Vadim Pisarevsky
b2a5e66fc5 Merge pull request #3593 from kilobyte:master 2015-01-13 12:25:21 +00:00
Alexander Smorkalov
3425c90b66 GPU samples with NVIDIA specific API excluded from build if CUDA disabled. 2015-01-13 14:58:51 +03:00
Alexander Smorkalov
b0c5f49170 Build fixes for GPU samples. 2015-01-13 14:39:18 +03:00
Vadim Pisarevsky
9cadc1e530 Merge pull request #3310 from tSed:opencv-2.4/fix-gstreamer-detection 2015-01-13 11:25:32 +00:00
Vadim Pisarevsky
f566f6baa9 Merge pull request #3535 from wangyan42164:use_hypot 2015-01-13 11:22:21 +00:00
Vadim Pisarevsky
2ecca8f59c Merge pull request #3566 from jet47:cuda-imgproc-refactoring 2015-01-13 11:21:51 +00:00
Vadim Pisarevsky
60cedd7a68 Merge pull request #3592 from jet47:cuda-7.0-android 2015-01-13 11:18:20 +00:00
Vadim Pisarevsky
bc23f29b27 Merge pull request #3537 from mshabunin:ml-old-xml 2015-01-13 11:17:36 +00:00
Alexander Smorkalov
c0d76ef984 driver_api_stereo_multi sample reworked to use parallel_for_ instead of parallel_do 2015-01-13 13:00:06 +03:00
Alexander Smorkalov
72063bf136 parallel_do replaced with parallel_for_ in driver_gpu_multi sample. 2015-01-13 12:53:13 +03:00
Adam Borowski
7b0d1c932e Get rid of sysctl includes on Linux.
The 'sysctl' syscall has been strongly deprecated on Linux for ages.
Currently, on old architectures it will spam syslog whenever used, and on
newer ones it's missing from the headers altogether.  Opencv has migrated
away on Linux already, but #includes were left lingering.  This commit
removes them on non-__APPLE__, unbreaking x32 (and probably others).
2015-01-13 01:52:56 +01:00
Ilya Lavrenov
81f786393a NEON detection in runtime 2015-01-13 01:35:53 +03:00
Alexander Smorkalov
1fa37fe733 OpenCV for Tegra compilation fix for
- Gaussian blur;
- CascadeClassifier;
- Blenders in stitching module;
- Laplacial pyromids in stitching module.
2015-01-12 23:43:26 +03:00
Olexa Bilaniuk
f73b48b8b6 Merge remote-tracking branch 'refs/remotes/upstream/master' into rho 2015-01-12 11:59:38 -05:00
Olexa Bilaniuk
4401095b38 Optimizations to Jacobian and error calculations.
Deleted multiplications by zero and consequent additions of zero terms.
2015-01-12 11:33:05 -05:00
Vadim Pisarevsky
390f17d1e0 Merge pull request #3575 from Ashod:multipage_imread 2015-01-12 11:31:04 +00:00
Vadim Pisarevsky
36c1dce264 Merge pull request #3578 from asmorkalov:ocv_avx 2015-01-12 11:29:21 +00:00
Vadim Pisarevsky
9eba746eb8 Merge pull request #3586 from wangyan42164:bfm 2015-01-12 10:55:34 +00:00
Olexa Bilaniuk
7fca146b21 More LevMarq bugfixes.
LevMarq now doesn't outright fail, but doesn't seem to improve things
much if at all.
2015-01-12 05:37:40 -05:00
Olexa Bilaniuk
33a3fba2d1 Work on LevMarq code.
Refactoring of Cholesky decomposition.
Fix for memory corruption bug.
LevMarq as a whole still non-functional.
2015-01-12 04:58:07 -05:00
Ilya Lavrenov
8c94568cc3 cv::sum 2015-01-12 10:59:31 +03:00
Ilya Lavrenov
33176db5dc compareHist 2015-01-12 10:59:31 +03:00
Ilya Lavrenov
6bce6ee34a checks 2015-01-12 10:59:31 +03:00
Ilya Lavrenov
1d3c860411 SinCos_32f 2015-01-12 10:59:31 +03:00
Ilya Lavrenov
3b23e57925 convertMaps 2015-01-12 10:59:31 +03:00
Ilya Lavrenov
0fd8f50522 warpAffine INTER_NEAREST 2015-01-12 10:59:31 +03:00
Ilya Lavrenov
d92f67ee2c warpPerspective 2015-01-12 10:59:31 +03:00
Ilya Lavrenov
ef29b15c9a reciprocal 2015-01-12 10:59:30 +03:00
Ilya Lavrenov
44d89638fd divide 2015-01-12 10:59:30 +03:00
Ilya Lavrenov
7b060d9122 cvtColor 4 cn 2015-01-12 10:59:30 +03:00
Ilya Lavrenov
f2cd65cf1e fixes 2015-01-12 10:59:30 +03:00
Ilya Lavrenov
25e99c453f avx2 in arithm 2015-01-12 10:59:30 +03:00
Ilya Lavrenov
70933ea999 convert from f64 2015-01-12 10:59:30 +03:00
Ilya Lavrenov
612b8ce2cb fixed compilation issues 2015-01-12 10:59:30 +03:00
Ilya Lavrenov
b2f851af06 cornerMinEigenVal 2015-01-12 10:59:30 +03:00
Ilya Lavrenov
d87457a025 split/merge 2015-01-12 10:59:30 +03:00
Ilya Lavrenov
fc0869735d used popcnt 2015-01-12 10:59:30 +03:00
Ilya Lavrenov
31827d8dfe fixed typo 2015-01-12 10:59:30 +03:00
Ilya Lavrenov
bc394e7516 detection of other CPU features 2015-01-12 10:59:30 +03:00
Ilya Lavrenov
3a426660ea sse_utils.hpp 2015-01-12 10:59:30 +03:00
Ilya Lavrenov
a340ea872e cvtColor Luv 2 RGB u8 2015-01-12 10:59:30 +03:00
Ilya Lavrenov
e20613a776 cvtColor RGB 2 Luv u8 2015-01-12 10:59:30 +03:00
Ilya Lavrenov
584eed633e cvtColor Lab 2 RGB u8 2015-01-12 10:59:30 +03:00
Ilya Lavrenov
05e21015e9 cvtColor HLS 2 RGB u8 2015-01-12 10:59:30 +03:00
Ilya Lavrenov
51684c109e cvtColor RGB 2 HLS u8 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
51e7fb76b6 cvtColor HSV 2 RGB u8 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
c4c86a8990 cvtColor XYZ 2 RGB f32 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
93f8800844 cvtColor RGB 2 XYZ f32 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
e1773749ae cvtColor RGB 2 gray 16s 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
1c9e886a6a cvtColor YCrCb 2 RGB 32f 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
97fad1cb53 cvtColor RGB 2 YCrCb 32f 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
b99396ab12 cvtColor RGB 2 YCrCb 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
940f1e7914 interliving / deinterliving 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
fe371bf624 cvtColor Gray 2 BGR5x5 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
9cacd3261d cvtColor BGR5x5 2 Gray 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
edee922b59 cvtColor YCrCb 2 RGB 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
5f2135695e cvtColor rgb 2 YCrCb 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
bfb45b27e6 column sum 32s 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
1ca35b7424 resize are fast 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
56f3c92737 pyrUp and pyrDown 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
63fc6ef316 convertTo from 64f 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
8870ef4159 convertTo from 16u, 16s, 32s, 32f 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
116fb275a8 convertTo from 8s 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
19e77e4787 convertTo from 8u 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
b758dbd384 convertTo AVX2 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
3a78a22733 convertScaleAbs for s8, f64 2015-01-12 10:59:29 +03:00
Ilya Lavrenov
5578088983 countNonZero 2015-01-12 10:59:28 +03:00
Ilya Lavrenov
972ff1d0c4 polarToCart 2015-01-12 10:59:28 +03:00
Ilya Lavrenov
0a5c9cf145 magnitude 64f 2015-01-12 10:59:28 +03:00
Ilya Lavrenov
6ab928fb39 phase 64f 2015-01-12 10:59:28 +03:00
Ilya Lavrenov
a2a8ba17fc compare 2015-01-12 10:59:28 +03:00
Ilya Lavrenov
8d48632ebe avx2 2015-01-12 10:59:28 +03:00
Vladislav Vinogradov
d8272b9395 remove "-target-os-variant" NVCC option for CUDA 7.0
it is marked as obsolete
2015-01-12 10:58:43 +03:00
Olexa Bilaniuk
c175a86cbb Merge remote-tracking branch 'upstream/master' into rho 2015-01-12 02:11:14 -05:00
Timur Sattarov
4762728fd5 More sensible error messages 2015-01-11 03:56:07 +04:00
Vijay Pradeep
964d5a20e9 Whitespace fix 2015-01-09 10:44:19 -08:00
Vijay Pradeep
177478a8ad overload instead of default arg for ABI backwards compatibility. rng_seed is now 'int' to support python port 2015-01-09 10:18:08 -08:00
Josep Bosch
75c99d65a5 Fisheye calibration methods available now in python 2015-01-09 10:05:36 +01:00
Yan Wang
75277bb770 Remove unnecessary global/local dim for radius match.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2015-01-09 13:37:00 +08:00
Vijay Pradeep
a1c5740044 solvePnPRansac now accepts a seed and is deterministic 2015-01-08 18:24:55 -08:00
Vijay Pradeep
042ff210d5 Fixing race condition by expanding resultsMutex lock section 2015-01-08 15:26:15 -08:00
Nisarg Thakkar
a11c02497f Fixed Bug similar to Bug#3757. UMat all dims zero after release. 2015-01-08 13:48:48 +05:30
orestis
c7b2e48efe Canny TBB Optimization 2015-01-07 19:54:20 +02:00
Alexander Alekhin
28833421ae Merge pull request #3580 from JoeHowse:master 2015-01-05 19:40:37 +00:00
Alexander Alekhin
e607a4ec02 Merge pull request #3579 from basheersubei:patch-1 2015-01-05 19:39:39 +00:00
Joe Howse
379de5708f Fix shadowed variable warning 2015-01-05 10:56:46 -04:00
Basheer Subei
fd1cae0dcc typo fix in instructions of fitline.py sample 2015-01-05 00:09:00 +03:00
Alexander Smorkalov
091c7a3821 OpenGL interop sample reworked not ot use cvconfig.h 2015-01-04 23:52:00 +03:00
Alexander Smorkalov
c778011f14 More accurate AVX and AVX2 control.
- Previous version just checked option support, but not enable it.
- Also OpenCV tests reports invalid AVX and AVX2 support status.
2015-01-04 23:41:14 +03:00
Ashod Nakashian
473964806c Added imread and imreadmulti regression tests. 2015-01-03 12:48:29 -05:00
Ashod Nakashian
61ca38103c Added imreadmulti API to read multi-paged images into a vector of Mat. 2015-01-03 00:09:35 -05:00
Ashod Nakashian
ecf359b8c9 Support for multipage decoding in BaseImageDecoder and implemented in TiffDecoder. 2015-01-03 00:09:34 -05:00
Mike Izbicki
ac47c0c624 fix to work with python 2.6
I had to make this modification locally to get opencv to build with python 2.6.  Python 2.6 requires indices in the format string (the `0` I added).  This requirement was relaxed in 2.7, so what used to be there would be working for people who could upgrade. I don't think the change has any negative consequences for future python versions, but I'm no expert.
2015-01-02 14:41:44 -08:00
Ilya Lavrenov
68962adc54 SSE mul 2014-12-31 17:58:54 +03:00
Ilya Lavrenov
60f2f7898a SSE4.1 addWeighted fo 16u 2014-12-31 17:55:30 +03:00
Vadim Pisarevsky
6cb93445e1 Merge pull request #3548 from alalek:fix_sample_python 2014-12-31 09:31:33 +00:00
Vadim Pisarevsky
2f6db4dfac Merge pull request #3547 from ilya-lavrenov:ocl_setto 2014-12-31 09:30:40 +00:00
Vadim Pisarevsky
33a6e5ac04 Merge pull request #3493 from vbystricky:createsamples 2014-12-31 09:29:57 +00:00
Vadim Pisarevsky
4e9cb475da Merge pull request #3565 from mshabunin:ml-leak-24 2014-12-31 09:17:25 +00:00
Maksim Shabunin
38d37d2b00 Fixed uninitialized memory usage in ANN_MLP 2014-12-31 12:16:26 +03:00
Maksim Shabunin
d004ee58c5 Support loading old models in ML module
- added test for loading legacy files
- added version to new written models
- fixed loading of several fields in some models
- added generation of new fields from old data
2014-12-31 12:16:25 +03:00
Vadim Pisarevsky
1c8493fb0d Merge pull request #3549 from mshabunin:sphinx-doc-remove 2014-12-31 09:14:22 +00:00
Vadim Pisarevsky
c937e15763 Merge pull request #3555 from ilya-lavrenov:sse_integral 2014-12-31 09:13:18 +00:00
Vadim Pisarevsky
f792fdc3e0 Merge pull request #3559 from ilya-lavrenov:sse_dot_s8 2014-12-31 08:06:06 +00:00
Vadim Pisarevsky
2bddbd2cb5 Merge pull request #3558 from ilya-lavrenov:sse_resize 2014-12-31 08:04:00 +00:00
Vadim Pisarevsky
ba8a971742 Merge pull request #3551 from serval2412:master 2014-12-31 06:09:29 +00:00
Vadim Pisarevsky
2b30759af0 Merge pull request #3556 from rokm:semicolon-warnings 2014-12-31 06:08:12 +00:00
Vadim Pisarevsky
622cf566b9 Merge pull request #3560 from ilya-lavrenov:sse_remap 2014-12-31 06:07:02 +00:00
Vadim Pisarevsky
9c872f5316 Merge pull request #3567 from vbystricky:intelperc_fix 2014-12-31 06:06:18 +00:00
Alexander Smorkalov
e02418e904 parallel_do replaced by parallel_for_ in gpu/multi.cpp sample to get rid of cvconfig.h 2014-12-30 16:44:33 +03:00
Alexander Smorkalov
840088e021 Get rid of cvconfig.h in Latent SVM samples. Use common OpenCV parallel framework instead of direct TBB calls. 2014-12-30 15:52:23 +03:00
vbystricky
083d8645a5 Fix error of compilation of cap_intelperc.cpp 2014-12-30 15:38:03 +03:00
Vladislav Vinogradov
f50a061225 added stream parameter to all cudaimgproc routines 2014-12-30 15:37:45 +03:00
Vladislav Vinogradov
220d937d9a removed buffered versions of histogram functions
used BufferPool mechanism instead
2014-12-30 15:37:45 +03:00
Maksim Shabunin
e23ba9215d Fixed memory leak in ML module
"int * CvMLData::sample_idx" was not freed
2014-12-30 15:20:24 +03:00
Vadim Pisarevsky
2fd01ee24e Merge pull request #3550 from JoeHowse:master 2014-12-30 11:10:02 +00:00
Vadim Pisarevsky
ad71efb2cb Merge pull request #3562 from asmorkalov:ocv_aarch64 2014-12-30 11:06:00 +00:00
Chris Mayo
34f0da6010 Act on INSTALL_PYTHON_EXAMPLES 2014-12-30 10:13:10 +00:00
Maksim Shabunin
f8d09945ac Added dummy build targets for compatibility 2014-12-30 12:11:37 +03:00
Vladislav Vinogradov
b4e7ee46c6 fix compilation without CUDA 2014-12-30 11:06:33 +03:00
Vladislav Vinogradov
cd0e95de16 refactor cudaarithm reductions:
* remove overloads with explicit buffer, now BufferPool is used
* added async versions for all reduce functions
2014-12-30 11:06:33 +03:00
Vladislav Vinogradov
a4e598f474 use new BufferPool class for some cudaarithm routines 2014-12-30 11:06:33 +03:00
Vladislav Vinogradov
7454189c2a use new getInputMat/getOutputMat/syncOutput methods in cudaarithm routines 2014-12-30 11:06:33 +03:00
Vladislav Vinogradov
3d0410c147 remove reciprocal version of cuda::divide
it might cause errors, due to implicit type conversion and another cuda::divide
overload
2014-12-30 11:06:32 +03:00
Vladislav Vinogradov
00e7816c1b add auxiliary functions to work with Input/Output arrays:
they allow to perform asynchronous upload/download into temporary buffer
to get valid GpuMat object
2014-12-30 11:06:32 +03:00
Maksim Shabunin
d04fc15e06 Replaced tabs with spaces in stylesheet 2014-12-30 10:52:08 +03:00
Ilya Lavrenov
02b2fdeda9 SSE resize Lanczos 2014-12-30 10:41:23 +03:00
Yan Wang
9699fde8d2 Use hypot to do vector calculation.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2014-12-30 14:12:28 +08:00
Olexa Bilaniuk
46631c4b18 Merge remote-tracking branch 'upstream/master' into rho 2014-12-29 20:55:24 -05:00
Ilya Lavrenov
042895977e SSE2 conversio in remap 2014-12-30 01:00:22 +03:00
Ilya Lavrenov
f57136fd79 SSE2 cv::Mat::dot 2014-12-30 00:34:09 +03:00
Ilya Lavrenov
f6b3bc01e5 addWeighted 2014-12-29 22:01:53 +03:00
Rok Mandeljc
e3b32cce80 modules/core: removed extra semi-colon from mat.inl.hpp and utility.hpp
This silences the pedantic warning messages from gcc 4.8.3
2014-12-29 16:23:43 +01:00
Ilya Lavrenov
9436103ed6 SSE2 optimization of cv::integral 2014-12-29 15:51:55 +03:00
Ilya Lavrenov
1af7d397d4 optimization of UMat::setTo 2014-12-29 13:34:21 +03:00
Alexander Smorkalov
8acd4c3ff4 More accurate fix for libtiff and aarch64. 2014-12-28 12:44:24 +03:00
Alexander Smorkalov
0f263e125b Full AARCH64 support with NEON and new CUDA toolkit. 2014-12-28 11:51:33 +03:00
Alexander Smorkalov
82bd82e2f8 TBB updated to 4.3u2. Fix for aarch64 support. 2014-12-28 11:49:25 +03:00
Alexander Smorkalov
c0a8d4e1ef Fix of HaarCascade GPU test for aarch64. 2014-12-28 11:49:25 +03:00
Julien Nabet
2d5e3b57ea Fix cppcheck reports warnings:
(performance) Possible inefficient checking for 'lmap' emptiness
(warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
(style) Array index '<xxx>' is used before limits check
2014-12-27 10:54:34 +01:00
Joe Howse
2d16026df6 more const correctness in OpenNI2 getProperty 2014-12-27 00:11:14 -04:00
Joe Howse
b7a3204c57 const correctness in OpenNI and OpenNI2 getProperty 2014-12-26 23:54:03 -04:00
Joe Howse
a963ade012 Removing whitespace to appease doc builder 2014-12-26 21:15:45 -04:00
Joe Howse
450ba8b43f Frontal cat face detectors 2014-12-26 20:13:13 -04:00
Maksim Shabunin
11591b3e9d Added Qt help generation support 2014-12-26 19:17:18 +03:00
Maksim Shabunin
3ffae9f7b7 Some documentation customization 2014-12-26 19:17:18 +03:00
Maksim Shabunin
b4050c775e Updated sample files documentation inclusions 2014-12-26 19:17:18 +03:00
Maksim Shabunin
ec9a17e71a Restored PlantUML support for doxygen 2014-12-26 19:17:18 +03:00
Maksim Shabunin
ad6a80f68c Moved tutorial table-of-contents files to corresponding root level 2014-12-26 19:17:14 +03:00
Maksim Shabunin
bebf6c47c6 Removed Sphinx generation commands from cmake scripts 2014-12-26 19:17:08 +03:00
Maksim Shabunin
d01bedbc61 Removed Sphinx documentation files 2014-12-26 19:12:19 +03:00
Vadim Pisarevsky
61991a3330 Merge pull request #3444 from Sync-my-L2P:patch-1 2014-12-26 14:40:29 +00:00
Vadim Pisarevsky
27b224ac74 Merge pull request #3485 from mapycz:fix-calibrate-crash 2014-12-26 14:38:54 +00:00
Vadim Pisarevsky
61886a61de Merge pull request #3504 from a-wi:VideoCapture_get_const_v3 2014-12-26 14:37:47 +00:00
Vadim Pisarevsky
9c2ef369ed Merge pull request #3530 from jet47:win-install-testdata 2014-12-26 14:34:39 +00:00
Vadim Pisarevsky
a5969aec96 Merge pull request #3534 from taka-no-me:build_fixes 2014-12-26 14:34:13 +00:00
Vadim Pisarevsky
0ff67253f7 Merge pull request #3531 from jet47:cuda-core-refactoring 2014-12-26 12:12:42 +00:00
Vadim Pisarevsky
f85838087a Merge pull request #3539 from mshabunin:openni-linux-paths 2014-12-26 12:12:01 +00:00
Vadim Pisarevsky
b01cdf28ca Merge pull request #3543 from MatMoore:2.4 2014-12-26 12:11:42 +00:00
Vadim Pisarevsky
ba84eb58f2 Merge pull request #3545 from jet47:gpu-match-template-tests 2014-12-26 12:08:54 +00:00
Vadim Pisarevsky
18025c2908 Merge pull request #3546 from jet47:cuda-imgproc-fixes 2014-12-26 12:07:12 +00:00
Alexander Alekhin
63fc313d02 samples: fix python contants 2014-12-26 14:47:36 +03:00
Vladislav Vinogradov
fe3f236aa5 disable GeneralizedHoughGuil performance test 2014-12-26 12:04:07 +03:00
Vladislav Vinogradov
f36546dbd2 improve error reporting in _InputArray methods 2014-12-26 12:03:25 +03:00
Vladislav Vinogradov
7c901e39e1 disable sanity test for GeneralizedHoughGuil
the algorithm is not stable yet
2014-12-25 19:23:16 +03:00
Vladislav Vinogradov
18d1be4530 fix tests for match template 2014-12-25 19:23:16 +03:00
Vladislav Vinogradov
26afa49d71 fix cuda match template:
use correct types for integral/sum outputs
2014-12-25 19:23:16 +03:00
Vladislav Vinogradov
9b8c3fd675 rewrite cuda::cvtColor with new device layer and fix test failures 2014-12-25 19:23:15 +03:00
Vladislav Vinogradov
d00f36ec75 fix tests for gpu::matchTemplate:
use ASSERT_FLOAT_EQ to compare float values, it is more robust for
large values
2014-12-25 17:43:13 +03:00
Andrey Kamaev
7ec6d8a336 Fix Android build with the most resent android.toolchain.cmake 2014-12-25 12:41:17 +03:00
Andrey Kamaev
c105b72945 Assorted fixes:
* cmake CMP0054 and CMP0045
* aarch64 build
* portable code options in PCH cmake
* some of gcc 4.9 warnings
2014-12-25 12:41:16 +03:00
Maksim Shabunin
128e509527 Added enviroment search paths for OpenNI2 for linux and fixed specific warning 2014-12-24 15:07:05 +03:00
Vadim Pisarevsky
1bdd86edeb Merge pull request #3523 from jet47:fix-cuda-buffer-pool 2014-12-24 11:20:27 +00:00
Vadim Pisarevsky
cddee22cf2 Merge pull request #3527 from jet47:cuda-deprivate-old-device-layer 2014-12-24 11:20:06 +00:00
Vadim Pisarevsky
214f633dd4 Merge pull request #3541 from jet47:find-cuda-update 2014-12-24 11:14:54 +00:00
Vadim Pisarevsky
5d15676b7b Merge pull request #3532 from oresths:filter_neon 2014-12-24 09:02:24 +00:00
Roman Donchenko
1ed22204c8 Merge pull request #3506 from doltac:typofix 2014-12-24 09:01:40 +00:00
Vadim Pisarevsky
8d4d36f805 Merge pull request #3538 from alalek:icv_fix_package 2014-12-24 09:00:32 +00:00
Roman Donchenko
034ff3ce13 Merge pull request #3497 from SpecLad:fs-open-fail-leak 2014-12-24 08:59:53 +00:00
Mat Moore
1386489f41 Minor grammar improvements to documentation 2014-12-23 19:17:27 +00:00
Vladislav Vinogradov
e4d0652899 [FindCUDA] improvements for cross-platform build
* improve `CUDA_TARGET_CPU_ARCH` cache initialization,
    allow to override initial value from calling script;
* add `CUDA_TARGET_OS_VARIANT` option to select OS variant;
* add `CUDA_TARGET_TRIPLET` option to select target triplet from
    `${CUDA_TOOLKIT_ROOT_DIR}/targets` folder;
* remove `CUDA_TOOLKIT_TARGET_DIR` option, now it is calculated from
    `CUDA_TARGET_TRIPLET`, the old approach still can be used for compatibility;
* for CUDA 6.5 and newer try to locate static libraries too, because
   in 6.5 toolkit for ARM cross compilation only static libraries are included.
2014-12-23 17:48:18 +03:00
Vladislav Vinogradov
c4246bc59c update FindCUDA CMake module to the latest version from upstream 2014-12-23 17:47:04 +03:00
Vladislav Vinogradov
e7e0da0153 fix GpuMat::swap method:
add swap instruction for allocator field
2014-12-23 17:43:28 +03:00
Vladislav Vinogradov
b33f3bb2cc refactor CV_CUDA_TEST_MAIN, use CV_TEST_MAIN for it
use CV_CUDA_TEST_MAIN for opencv_test_core to initialize CUDA
device information
2014-12-23 17:43:14 +03:00
Vladislav Vinogradov
8237418be6 add Allocator parameter to cudev::GpuMat_ contructors 2014-12-23 17:42:49 +03:00
Vladislav Vinogradov
f054d6316a add cuda::HostMem::getAllocator method
it allows to use cudaHostAlloc methods for cv::Mat objects
2014-12-23 17:42:49 +03:00
Vladislav Vinogradov
2f8e1798ca add more FeatureSet constants 2014-12-23 17:42:49 +03:00
Vladislav Vinogradov
1be1a28920 move CUDA core tests to core module 2014-12-23 17:42:49 +03:00
Vladislav Vinogradov
53862687d5 rename CudaMem -> HostMem to better reflect its purpose 2014-12-23 17:42:49 +03:00
Vladislav Vinogradov
9210d8e542 move allocMatFromBuf function to farneback.cpp:
* it is the only place, where it is used
* no need to make this function public
2014-12-23 17:42:49 +03:00
Vladislav Vinogradov
1d82aecf45 minor reorganization for CUDA doxygen groups:
move main CUDA group to modules/core/cuda.hpp
2014-12-23 17:42:20 +03:00
Vladislav Vinogradov
b5ab82fdbd mark old CUDA device layer as deprecated and remove it from doxygen documentation
add a note to use new cudev module as a replacement
2014-12-23 17:42:14 +03:00
Vladislav Vinogradov
68e08bbecd fix null stream initialization for multi-gpu systems 2014-12-23 17:41:24 +03:00
Vladislav Vinogradov
05d40946f3 move StackAllocator to cpp file
it is internal class, no need to export it
2014-12-23 17:41:24 +03:00
Vladislav Vinogradov
7ed38b97c3 fix cuda::BufferPool deinitialization
The deinitialization of BufferPool internal objects is controled by global
object, but it depends on other global objects, which leads to errors
caused by undefined deinitialization order of global objects.

I merge global objects initialization into single class, which performs
initialization and deinitialization in correct order.
2014-12-23 17:41:24 +03:00
Vladislav Vinogradov
b75b0c822d install test data on Windows platform too 2014-12-23 17:40:41 +03:00
Alexander Alekhin
864ec5ef45 IPPICV: don't use full paths in dependencies 2014-12-23 17:23:35 +03:00
Vadim Pisarevsky
fd6ef87c32 Merge pull request #3529 from jet47:fix-linux-install 2014-12-23 13:38:23 +00:00
Vadim Pisarevsky
95ec92994d Merge pull request #3536 from mshabunin:doxygen-intro 2014-12-23 13:36:40 +00:00
Jiri Drbalek
d71e001736 fix crash when sample point out of image boundaries 2014-12-22 21:01:17 +00:00
Roman Donchenko
08da247a87 cvOpenFileStorage: reduce the scope of xml_buf and make sure it's freed...
... before any exceptions occur.
2014-12-22 18:54:39 +03:00
Maksim Shabunin
06c2a70c49 Fixed some mistakes 2014-12-22 17:21:37 +03:00
Maksim Shabunin
637b615e08 Tutorial: documenting OpenCV 2014-12-22 15:51:37 +03:00
Vadim Pisarevsky
d9f159a554 Merge pull request #3513 from mshabunin:compat-30 2014-12-22 11:58:01 +00:00
Vadim Pisarevsky
c0005fd293 Merge pull request #3520 from JoeHowse:master 2014-12-22 11:14:29 +00:00
Vadim Pisarevsky
f12bd999bf Merge pull request #3524 from jet47:fix-cuda-warnings 2014-12-22 10:58:07 +00:00
Vadim Pisarevsky
a1df295079 Merge pull request #3525 from jet47:fix-cudev-tests 2014-12-22 10:57:07 +00:00
Vadim Pisarevsky
63bc4d4b7f Merge pull request #3471 from HelenWong:FixBug3714 2014-12-22 10:55:23 +00:00
Vadim Pisarevsky
cc024d3ef2 Merge pull request #3484 from euphrat:gmg_update_fix 2014-12-22 10:54:57 +00:00
Vadim Pisarevsky
7b20ce4952 Merge pull request #3490 from oresths:symmcolumnsmall_fix 2014-12-22 10:44:47 +00:00
Vadim Pisarevsky
20d957d212 Merge pull request #3511 from mattip:2.4 2014-12-22 10:41:21 +00:00
Vadim Pisarevsky
432546e4c4 Merge pull request #3512 from vins31:OpenNi2_AsusXtion 2014-12-22 10:39:42 +00:00
Vadim Pisarevsky
03df7831ab Merge pull request #3514 from mshabunin:compat-24 2014-12-22 10:38:56 +00:00
Vadim Pisarevsky
700a388173 Merge pull request #3499 from StevenPuttemans:fix_2432 2014-12-22 10:29:31 +00:00
Vadim Pisarevsky
2425dac9a1 Merge pull request #3500 from StevenPuttemans:fix_2432_2.4 2014-12-22 10:28:33 +00:00
Vadim Pisarevsky
5fea331d42 Merge pull request #3510 from boaz001:feature-4057 2014-12-22 10:27:33 +00:00
Vadim Pisarevsky
9071598a65 Merge pull request #3515 from StevenPuttemans:fix_FeatureDetector_docs 2014-12-22 10:27:01 +00:00
Vadim Pisarevsky
1ab551487d Merge pull request #3516 from ana-GT:openni2_defaultMode 2014-12-22 10:26:30 +00:00
Vadim Pisarevsky
060d67517a Merge pull request #3518 from wangyan42164:ocl_cascade_detect 2014-12-22 10:25:47 +00:00
Vadim Pisarevsky
199f1aec2e Merge pull request #3519 from fvgoto:patch-1 2014-12-22 10:25:00 +00:00
Vadim Pisarevsky
35d730bf2b Merge pull request #3528 from ilya-lavrenov:update_android_cmake 2014-12-22 10:22:20 +00:00
Roman Donchenko
16ce114e0c Fix memory leaks appearing when cvOpenFileStorage throws 2014-12-22 12:59:08 +03:00
Vladislav Vinogradov
ec33c4ae36 increase epsilons for tests due to different optimizations (IPP vs CUDA, float vs double) 2014-12-22 11:48:45 +03:00
Vladislav Vinogradov
25f33a7e30 update cudev color conversions according to the latest changes in CPU code 2014-12-22 11:48:45 +03:00
Vladislav Vinogradov
48c9c24da6 disable -Wshadow warning for CUDA modules:
it is generated by CUDA headers and we can't fix it
2014-12-22 11:48:19 +03:00
orestis
fffe2464cd Change DescriptorExtractor_ORB regression test
to compensate for neon ieee754 non-compliancy.
Also changed the comparison between max valid and calculated distance to
make the error message more accurate (in case curMaxDist == maxDist)
2014-12-21 21:27:03 +02:00
orestis
9811a739b0 Change gaussianBlur5x5 perf test epsilon
Set it 1 instead of 0.001, as is already done in gaussianBlur3x3. That
will allow integer destination matrices that are not exactly the same,
but very close to the expected result, to pass the test.
2014-12-20 17:14:21 +02:00
orestis
9c6da03504 SymmRowSmallVec_32f 1x5 asymm
NEON speedup: 2.31x
Auto-vect speedup: 2.26x

Test kernel: [-0.9432, -1.1528, 0, 1.1528, 0.9432]
2014-12-19 22:51:42 +02:00
orestis
13c0855114 SymmRowSmallVec_32f 1x5
NEON speedup: 2.36x
Auto-vect speedup: 2.36x

Test kernel: [0.1, 0.2408, 0.3184, 0.2408, 0.1]
2014-12-19 22:47:06 +02:00
orestis
ed0ce48179 SymmColumnVec_32f16s asymm
NEON speedup: 9.46x
Auto-vect speedup: 1x

Test kernel: [-0.9432, -1.1528, 0, 1.1528, 0.9432]
2014-12-19 22:44:39 +02:00
orestis
a2a131799f SymmColumnVec_32f16s
NEON speedup: 8.64x
Auto-vect speedup: 1x

Test kernel: [0.1, 0.2408, 0.3184, 0.2408, 0.1]
2014-12-19 22:42:31 +02:00
orestis
37e018454d SymmColumnSmallVec_32s16s 3x1 asymm
NEON speedup: 2.12x
Auto-vect speedup: 1.01x

Test kernel: [-2, 0, 2]
2014-12-19 22:40:55 +02:00
orestis
4443d6b0a1 SymmColumnSmallVec_32s16s [-1, 0, 1]
NEON speedup: 3.27x
Auto-vect speedup: 1.01x
2014-12-19 22:37:52 +02:00
orestis
99e782e62c SymmColumnSmallVec_32s16s 3x1
NEON speedup: 1.75x
Auto-vect speedup: 1x
2014-12-19 22:36:46 +02:00
orestis
33dfeb85be SymmColumnSmallVec_32s16s [3, 10, 3] Scharr
NEON speedup: 2.04x
Auto-vect speedup: 1x
2014-12-19 22:35:52 +02:00
orestis
61a7f48bf4 SymmColumnSmallVec_32s16s [1, -2, 1]
NEON speedup: 2.75x
Auto-vect speedup: 1.01x
2014-12-19 22:34:11 +02:00
orestis
4f906372e2 SymmColumnSmallVec_32s16s [1, 2, 1]
NEON speedup: 2.66x
Auto-vect speedup: 1x
2014-12-19 22:33:11 +02:00
orestis
80a0364465 SymmColumnVec_32s8u asymm
NEON speedup: 2.95x
Auto-vect speedup: 1x

Test kernel: [-0.9432, -1.1528, 0, 1.1528, 0.9432]
2014-12-19 22:29:54 +02:00
orestis
4f5916f12d SymmColumnVec_32s8u
NEON speedup: 1.96x
Auto-vect speedup: 1x

Test kernel: [0.0708, 0.2445, 0.3694, 0.2445, 0.0708]
2014-12-19 22:26:41 +02:00
orestis
1fb966dc61 SymmRowSmallVec_8u32s 1x5 asymm
NEON speedup: 3.14x
Auto-vect speedup: 1.6x

Test kernel: [-5, -2, 0, 2, 5]
2014-12-19 22:23:09 +02:00
orestis
2e7b9a2c0f SymmRowSmallVec_8u32s 1x3 asymmetric
NEON speedup: 1.95x
Auto-vect speedup: 1.17x

Test kernel: [-2, 0, 2]
2014-12-19 22:15:37 +02:00
orestis
969a218057 SymmRowSmallVec_8u32s [-1, 0, 1]
NEON speedup: 1.84x
Auto-vect speedup: 1.2x
2014-12-19 22:11:52 +02:00
orestis
c0019a42e4 SymmRowSmallVec_8u32s 1x5 general
NEON speedup: 3.86x
Auto-vect speedup: 1.67x

Test kernel: [0.0708, 0.2445, 0.3694, 0.2445, 0.0708]
2014-12-19 22:10:58 +02:00
orestis
cb48d7798d SymmRowSmallVec_8u32s 1x3 general
NEON speedup: 2.56x
Auto-vect speedup: 1.26x

Test kernel: [1, 3, 1]
2014-12-19 22:08:23 +02:00
orestis
0ba3b06efd SymmRowSmallVec_8u32s [1, 2, 1]
NEON speedup: 4.1
Auto-vect speedup: 2.25
2014-12-19 22:02:57 +02:00
Maksim Shabunin
c485aee464 Included c-headers for better 2.4 compatibility 2014-12-19 17:05:26 +03:00
Vladislav Vinogradov
b15cf355af remove opencv_testing.sh installation to /etc/profile.d/
opencv_run_all_tests_unix.sh already exports OPENCV_TEST_DATA_PATH
2014-12-19 11:55:38 +03:00
Ilya Lavrenov
96adeb71ca update android.toolchain.cmake 2014-12-18 19:31:10 +03:00
Vadim Pisarevsky
79f770455b Merge pull request #3517 from wangyan42164:ocl_denoising_2 2014-12-18 14:50:13 +00:00
Vadim Pisarevsky
183454a723 Merge pull request #3522 from ilya-lavrenov:update_android_toolchain_cmake 2014-12-18 14:49:35 +00:00
Ilya Lavrenov
ba612fc9bd update android.toolchain.cmake 2014-12-17 20:08:55 +03:00
Joe Howse
13c04120dd For Java compatibility, avoiding explicit pseudonym in enum 2014-12-16 21:37:14 -04:00
Ana Huaman Quispe
1ad1b737c2 Fixed registration bug: It was ALWAYS OFF - even after changing the property 2014-12-16 19:45:50 -05:00
Joe Howse
620a969285 Allow BGR, RGB, or gray capture via libv4l 2014-12-16 20:07:37 -04:00
Artur Wieczorek
854a722c70 Implement VideoCapture::get, CvCapture::getProperty, IVideoCapture::getProperty as constant methods. 2014-12-16 16:08:22 +01:00
Florian Verdet
f87f0cc481 fix obvious copy+paste typo in computeDistance()
(with this else-branch, argument contour2 would not be used at all)
2014-12-16 12:46:07 +01:00
Maksim Shabunin
91e21847e2 Some changes to make migration to 3.0 easier 2014-12-16 13:00:31 +03:00
Yan Wang
efa84d8225 Use preprocessor for constant values in OpenCL kernel instead of
the parameter variable.

It could improve the performance of
OCL_Cascade_Image_MinSize_CascadeClassifier.CascadeClassifier/*.
Especially,
OCL_Cascade_Image_MinSize_CascadeClassifier.CascadeClassifier/15
OCL_Cascade_Image_MinSize_CascadeClassifier.CascadeClassifier/16
could be improved about 2% in Intel platform.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2014-12-16 16:21:05 +08:00
Yan Wang
fd2d800c06 Remove unnecessary local variable "size".
It should also be better for optimizing when compiling kernel.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2014-12-16 14:25:24 +08:00
Ana Huaman Quispe
0b429fee7b Changed CV_DbgAssert to CV_Assert when setting video modes for OpenNI2. Otherwise, in release mode the default modes never get set 2014-12-15 18:16:25 -05:00
Vadim Pisarevsky
241991c677 Merge pull request #3498 from ilya-lavrenov:omp 2014-12-15 18:08:31 +00:00
Vadim Pisarevsky
009aec5164 Merge pull request #3491 from mshabunin:ios-extra-world 2014-12-15 18:07:09 +00:00
Vadim Pisarevsky
3c74c23bad Merge pull request #3473 from TobyWanKenobi:master 2014-12-15 18:04:01 +00:00
Vadim Pisarevsky
d54b069ae1 Merge pull request #3448 from Ashod:highgui_trackbar_improvements 2014-12-15 18:03:01 +00:00
Vadim Pisarevsky
4ef03ccbe1 Merge pull request #3449 from Ashod:2.4_highgui_trackbar_improvements 2014-12-15 18:02:29 +00:00
Olexa Bilaniuk
bcc630a8dc Merge remote-tracking branch 'upstream/master' into rho 2014-12-15 12:31:22 -05:00
StevenPuttemans
73d1ea9a52 fix bug 2432 for 2.4 branch 2014-12-15 11:56:42 +01:00
StevenPuttemans
edb608d206 fix documentation bug 2432 2014-12-15 11:53:55 +01:00
StevenPuttemans
db9a0cfbc0 add extra to FeatureDetector docs 2014-12-15 11:31:18 +01:00
vincentweb
4d12beb723 Added better OpenNI2 support to the Asus Xtion and Occipital Structure
sensors which do not have image generators.
2014-12-14 20:52:24 +01:00
mattip
ff7ea605ef export thread control to generated wrappers 2014-12-14 11:55:02 +02:00
Boaz Stolk
bb873b1de5 add option to link to dynamic IPP libraries 2014-12-12 14:21:47 +01:00
Sync-my-L2P
5a43c7a28e Update segmentation.cpp
removed trailing whitespaces
2014-12-11 17:36:36 +01:00
doltac
6cc5959356 Fixed typos in latentSVM detector demo. 2014-12-11 19:22:40 +09:00
Ilya Lavrenov
ce81433aff ability to enable OpenMP simultaneously with other parallel framework 2014-12-10 13:34:39 +03:00
vbystricky
c48f30d4ec Move createsamples application from 2.4 version 2014-12-10 12:17:58 +04:00
Vadim Pisarevsky
fed1b3fd59 Merge pull request #3495 from taka-no-me:fix_android_arm64 2014-12-09 14:12:22 +00:00
Vadim Pisarevsky
25378587e2 Merge pull request #3479 from mshabunin:doxygen-tutorials 2014-12-09 14:06:23 +00:00
Vadim Pisarevsky
10dc5a3759 Merge pull request #3492 from Dmitry-Me:reduceVariablesScope1 2014-12-09 14:05:35 +00:00
Andrey Kamaev
9582c33eab Fix build for Android arm64-v8a 2014-12-09 12:06:56 +03:00
Alexander Alekhin
0f7721e915 Merge pull request #3486 from Chuanbo-Weng:repeat-perf 2014-12-08 15:49:21 +00:00
Dmitry-Me
f269828160 Reduce variables scope, move declaration to first use point 2014-12-08 18:21:17 +03:00
TobyWanKenobi
b35f5d115f Removed "FORMAT_XML" to generalize format
Removed the "FileStorage::FORMAT_XML" to generalize format of the String
model.
2014-12-08 09:21:55 +01:00
orestis
c762da9893 Fix SymmColumnSmallVec_32s16s SSE code
Specifically, in general antisymmetric case src[-1] (S0) should be
subtracted from from src[1] (S2), and not the opposite.
2014-12-06 19:53:07 +02:00
Ashod Nakashian
63c49be487 highgui: Support to change trackbar count in setTrackbarPos and replaced deprecated CreateToolbarEx in Windows. 2014-12-06 11:56:01 -05:00
Ashod Nakashian
006384edaf highgui: Support to change trackbar count in setTrackbarPos and replaced deprecated CreateToolbarEx in Windows. 2014-12-06 11:55:17 -05:00
Vadim Pisarevsky
0a4c616d43 Merge pull request #3487 from taka-no-me:ctrl_s_gtk 2014-12-06 10:04:22 +00:00
Vadim Pisarevsky
ef347f4b62 Merge pull request #3472 from Dmitry-Me:preventDivByZero 2014-12-06 08:09:01 +00:00
Vadim Pisarevsky
e0ab007b2b Merge pull request #3475 from fhsm:master 2014-12-06 08:08:44 +00:00
Vadim Pisarevsky
ef534537b4 Merge pull request #3478 from akarsakov:rect_fix_typo 2014-12-06 08:08:27 +00:00
Vadim Pisarevsky
4f82b3588a Merge pull request #3480 from mshabunin:python-test-24 2014-12-06 08:07:56 +00:00
Vadim Pisarevsky
bada364eb3 Merge pull request #3481 from mshabunin:python-test 2014-12-06 08:07:39 +00:00
Vadim Pisarevsky
3481c1caec Merge pull request #3488 from jeremyhu:PR-4048 2014-12-06 08:03:56 +00:00
Olexa Bilaniuk
51963f95dd Merge remote-tracking branch 'upstream/master' into rho 2014-12-05 15:56:33 -05:00
Jeremy Huddleston Sequoia
35f96d6da7 Fix tautologies in calibfilter.cpp which cause a build failure when using -Werror=address with clang-3.5
http://code.opencv.org/issues/4048

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-12-05 10:22:11 -08:00
Maksim Shabunin
c28fea32c7 Build separate world-like iOS framework for contrib 2014-12-05 17:48:28 +03:00
Alexander Alekhin
893deb4040 Merge pull request #3483 from wangyan42164:ocl_orb_improve 2014-12-05 12:55:54 +00:00
Alexander Alekhin
1252e870f9 Merge pull request #3482 from wangyan42164:ocl_brute_match_improve 2014-12-05 12:55:29 +00:00
Maksim Shabunin
ecfd056111 Fixed whitespace warnings in new tutorials 2014-12-05 15:33:53 +03:00
Andrey Kamaev
05bc48e8f4 Make Ctrl+S open save dialog on Gtk backend 2014-12-05 14:53:19 +03:00
Andrey Kamaev
fac99de7ec It turns opengl gheck is not needed for win ctrl+s 2014-12-05 14:52:44 +03:00
Firat Kalaycilar
2bda7aaf61 minor fix to make "updateBackgroundModel=false" option meaningful. 2014-12-04 22:36:42 +02:00
Yan Wang
2df606f098 Use sincos instead of sin and cos.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2014-12-04 15:48:23 +08:00
Yan Wang
1c9f956b88 Remove unnecesary operations and calculations in loop body.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2014-12-04 15:25:18 +08:00
Chuanbo Weng
2d8c89c40b Remove unnecessary kercn limitation of 4.
When accessing global memory by DWORD4, memory bandwidth
can be fully utilized on Intel platform. This patch will
make more image format(e.g. 8UC4) be processed in DWORD4
by work-item. After applying this patch, 3 subcase of
./opencv_perf_core --gtest_filter=OCL_RepeatFixture_Repeat.Repeat/*
can be speedup on HD4000 graphics card with Beignet:
OCL_RepeatFixture_Repeat.Repeat/2, 64% improvement.
OCL_RepeatFixture_Repeat.Repeat/6, 50% improvement.
OCL_RepeatFixture_Repeat.Repeat/8, 56% improvement.

Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com>
2014-12-04 11:15:13 +08:00
TobyWanKenobi
f54b80d2c8 Re-edition of documentation
Re-edited the documentation again.
2014-12-03 17:13:11 +01:00
Maksim Shabunin
3212dd5465 Python test: new options provide local test data paths 2014-12-03 18:15:54 +03:00
Maksim Shabunin
84379140ba Python test: added options to provide local data path 2014-12-03 18:12:01 +03:00
TobyWanKenobi
b3bba3476d Re-editing Documentation
Attempting to re-editing the documentation, to satisfy buildbot error
status.
2014-12-03 15:54:25 +01:00
TobyWanKenobi
270af2ca79 Changing tabs to spaces.
Edited previous code to change tabs into spaces.
2014-12-03 15:40:12 +01:00
Alexander Karsakov
bcca34bc96 Fixed typo in description of Rect operations 2014-12-03 16:01:03 +03:00
StevenPuttemans
7efc917ee0 pulling most recent models 2014-12-03 12:57:37 +01:00
fhsm
146d66267f White space and spelling in meanshift tutorial
Removed a leading whitespace from a parenthetical comment and corrected the spelling of "maybe"
2014-12-02 12:46:05 -05:00
HelenWong
ec57a938c0 Fix#3714:Improve Display Image Tutorial
For Bug #3714, user use the imshow() function without calling
namedWindow() properly, because user did not know the implicit rule for
imshow(). (i.e. without calling namedWindow implied calling namedWindow(
,CV__WINDOW_AUTOSIZE).

Improve the Display Image Tutorial to educate the user for such implied
rule.

Put a note on documentation for Bug#3714

Revise the documentation regarding to imshow() function to better
educate the user the implicit rule. (i.e. without creating the window
before the imshow() function is the same as creating AUTOSIZE window)
2014-12-02 09:43:52 -08:00
TobyWanKenobi
a1e04c98aa Add method in StatModel class, to load from String
Added a method "loadFromString" which is based on the "load" one. It
allow to directly pass the XML string which can be usefull and faster
when you have a huge file in a variable.
2014-12-02 15:15:06 +01:00
Maksim Shabunin
6d282ddf72 Documentation: removed mention of Mat(IplImage*) constructor 2014-12-02 15:15:10 +03:00
Dmitry-Me
cb049657e5 Prevent division by zero 2014-12-02 14:44:09 +03:00
Vadim Pisarevsky
be5c910358 Merge pull request #3443 from HelenWong:bug3363Fix 2014-12-02 09:14:36 +00:00
Vadim Pisarevsky
f61db41d25 Merge pull request #3453 from mshabunin:doxygen-others 2014-12-02 09:05:32 +00:00
Vadim Pisarevsky
46858c4328 Merge pull request #3463 from Dikay900:fix_sample_video_writer 2014-12-02 09:04:27 +00:00
Vadim Pisarevsky
726ed2632d Merge pull request #3469 from a-wi:Fill_ellipse_arc_v3 2014-12-02 09:03:52 +00:00
Vadim Pisarevsky
bf5ff7fcd0 Merge pull request #3470 from Dmitry-Me:simplifyOverengineeredCode 2014-12-02 09:00:59 +00:00
Maksim Shabunin
d3beb755df Doxygen tutorials: support contrib, some minor changes 2014-12-01 19:22:04 +03:00
Dmitry-Me
c669b7e4cd Simplify overengineered code 2014-12-01 17:58:06 +03:00
Maksim Shabunin
4ccbd44559 User guide converted to doxygen 2014-12-01 16:40:06 +03:00
Artur Wieczorek
41afe54696 Fix determining bounding box of the edge collection in FillEdgeCollection().
There is necessary to account also x-coordinate of the end of the edge when determining bounding box of the edge collection.
2014-12-01 14:30:05 +01:00
Maksim Shabunin
812ce48c36 Doxygen tutorials: python final edits 2014-12-01 16:05:38 +03:00
Maksim Shabunin
875f922332 Doxygen tutorials: python basic 2014-12-01 16:05:38 +03:00
Maksim Shabunin
36a04ef8de Doxygen tutorials: cpp done 2014-12-01 16:05:38 +03:00
Maksim Shabunin
c5536534d8 Doxygen tutorials: warnings cleared 2014-12-01 16:05:38 +03:00
Maksim Shabunin
8375182e34 Doxygen tutorials: basic structure 2014-12-01 16:05:37 +03:00
Maksim Shabunin
220f671655 Doxygen tutorials: some fixes in RST-docs 2014-12-01 16:05:37 +03:00
Maksim Shabunin
03e213ccae Doxygen documentation: BiB references and fixes 2014-12-01 15:50:55 +03:00
Maksim Shabunin
1523fdcc1c Doxygen documentation: more fixes and cleanups 2014-12-01 15:50:36 +03:00
Maksim Shabunin
f9a83c28e5 Doxygen documentation: mathbbm support 2014-12-01 15:47:13 +03:00
Maksim Shabunin
6dcafe0c2d Doxygen documentation: cuda submodules reorganized 2014-12-01 15:47:13 +03:00
Maksim Shabunin
397bf7f2b7 Doxygen documentation: viz 2014-12-01 15:47:13 +03:00
Maksim Shabunin
9d89f8d3dc Doxygen documentation: shape, superres, videostab 2014-12-01 15:47:13 +03:00
Maksim Shabunin
ceb6e8bd94 Doxygen documentation: cuda 2014-12-01 15:47:13 +03:00
Maksim Shabunin
472c210687 Doxygen documentation: flann, photo and stitching modules 2014-12-01 15:47:13 +03:00
Maksim Shabunin
8e9ea0e3d1 Doxygen doucmentation: ml module 2014-12-01 15:47:13 +03:00
Maksim Shabunin
c5a698fb54 Doxygen documentation: calib3d and features2d modules 2014-12-01 15:47:13 +03:00
Maksim Shabunin
dcae7698ad Doxygen documentation for: highgui, video, imgcodecs and videoio 2014-12-01 15:47:13 +03:00
Vadim Pisarevsky
1f43999f2a Merge pull request #3428 from 23pointsNorth:patch-6 2014-12-01 10:45:31 +00:00
Vadim Pisarevsky
aadab03b7b Merge pull request #3452 from Dmitry-Me:fixIncorrectSizeComputation 2014-12-01 10:43:44 +00:00
Vadim Pisarevsky
02f4f2f96d Merge pull request #3426 from mshabunin:doxygen-imgproc 2014-12-01 10:43:13 +00:00
Vadim Pisarevsky
d368a7ceb4 Merge pull request #3446 from pokeefe:fix-compilation-without-videoio 2014-12-01 10:41:35 +00:00
Vadim Pisarevsky
c5b6c0456d Merge pull request #3445 from jet47:get-rid-of-cuda-h 2014-12-01 10:40:57 +00:00
Vadim Pisarevsky
1b73530b75 Merge pull request #3447 from a-wi:Fill_ellipse_arc 2014-12-01 10:40:12 +00:00
Vadim Pisarevsky
2f4c11b5e5 Merge pull request #3467 from Dikay900:fix_gpu_surf_perf_test_cpu_part 2014-12-01 10:37:40 +00:00
Vadim Pisarevsky
7106d3e8c2 Merge pull request #3458 from thorikawa:kmeans-index-parallel 2014-12-01 10:37:23 +00:00
Vadim Pisarevsky
6b0952b9bd Merge pull request #3464 from asuwend1:master 2014-12-01 10:30:49 +00:00
Vadim Pisarevsky
2dd438c230 Merge pull request #3457 from burun:patch-1 2014-12-01 10:29:51 +00:00
Vadim Pisarevsky
88f67ce6b1 Merge pull request #3466 from taka-no-me:ctrl_s_win 2014-12-01 10:26:27 +00:00
Dikay900
44f629f99c fix gpu sample performance test cpu part 2014-11-30 15:19:16 +01:00
Andrey Kamaev
3fa02787ac Make Ctrl+S open save dialog on Windows 2014-11-30 00:43:21 +03:00
Ari Suwendi
b14f7c99d2 bug fix for a crash when input image is small 2014-11-29 01:57:15 -08:00
Dikay900
8c919ed248 samples: gpu: fix include of TickMeter 2014-11-28 19:19:20 +01:00
Takahiro Poly Horikawa
553bb7956e Fix "assignment operator could not be generated" warnings 2014-11-28 19:33:52 +09:00
Takahiro Poly Horikawa
180e54d09d - Use cv::Mutex to safely update converged flag
- Use cv::AutoBuffer rather than new allocation
- Fix "assignment operator could not be generated" warning
2014-11-28 18:39:49 +09:00
Alexander Alekhin
50c9367d7a Merge pull request #3451 from wangyan42164:ocl_pyrup_unrolled 2014-11-27 09:53:36 +00:00
Takahiro Poly Horikawa
123ca7e1c5 Parallize building kmeans index in flann 2014-11-27 16:29:05 +09:00
burun
c52a3f7634 Update py_colorspaces.rst
mask = cv2.inRange(hsv, lower_green, upper_green)
to
mask = cv2.inRange(hsv, lower_blue, upper_blue)
2014-11-27 09:00:40 +02:00
HelenWong
e88bf2bc30 Updated Documentation (HoughCircles)
Rewrite the note on HoughCircles documentation to make it more clear

Add note to clarify that the output vector of found circles is sorted by
descending order of centres accumulator values.

Also delete reductant lines on the HoughCircles documentation.

Added comments to hough circles function.

Added comments to icvhoughgradient

Misalignment in line 1183 corrected
2014-11-26 11:37:33 -08:00
Dmitry-Me
4ff8a3ad92 Fix incorrect size computation 2014-11-26 12:24:53 +03:00
Yan Wang
6e7050555e Optimize pyrUp_unrolled() by mad function.
It could improve performance when image size is large.
E.g. OCL_PyrUpFixture_PyrUp.PyrUp/18
2014-11-26 16:55:08 +08:00
Pat O'Keefe
6d78cfc0d9 Fix compilation when building without the Video I/O module. 2014-11-25 13:52:07 -05:00
Artur Wieczorek
7512b5fdde Fix determining bounding box of the edge collection in FillEdgeCollection().
There is necessary to account also x-ccordinate of the end of the edge when determining bounding box of the edge collection.
2014-11-25 18:54:47 +01:00
Vladislav Vinogradov
eeb997261d get rid of cuda.h usage 2014-11-25 18:29:56 +03:00
Sync-my-L2P
f14b8b4341 Update segmentation.cpp
Added detailed comments to watershed()
2014-11-25 16:25:56 +01:00
Vadim Pisarevsky
3dd1afe4ec Merge pull request #3433 from StevenPuttemans:fix_whitebalance_naming 2014-11-24 09:40:21 +00:00
Vadim Pisarevsky
73ba435610 Merge pull request #3435 from oresths:filter_anchor_fix 2014-11-24 09:38:42 +00:00
Vadim Pisarevsky
15952d7188 Merge pull request #3436 from oresths:compiler_option 2014-11-24 09:37:27 +00:00
Olexa Bilaniuk
38e3f2c7f5 Merge https://github.com/Itseez/opencv into rho 2014-11-22 12:28:19 -05:00
orestis
aad98e545f Remove redundant -mfpu=neon flag.
This flag is already added in line 131.
2014-11-19 23:26:36 +02:00
orestis
a7757b0eb6 Fix anchor for small symmetrical column filters.
In the unoptimized version of small symmetrical column filters, when we
try to detect if the kernel, ky, is equal to [1;2;1] or [1;-2;1] we
should take into consideration that the anchor points in the middle
element.
2014-11-19 23:12:58 +02:00
Vadim Pisarevsky
ba9bc2d72f Merge pull request #3409 from fish2000:patch-1 2014-11-19 16:25:36 +00:00
Vadim Pisarevsky
b009e8d0fb Merge pull request #3411 from eltermann:master 2014-11-19 16:25:12 +00:00
Vadim Pisarevsky
7ed5284ae6 Merge pull request #3432 from taka-no-me:wintitle 2014-11-19 16:23:52 +00:00
StevenPuttemans
f151b1d277 fix wrong property name and corresponding documentation 2014-11-19 14:00:40 +01:00
Andrey Kamaev
f4ba8b13c7 Add cv::setWindowTitle to highgui 2014-11-18 16:54:03 +03:00
Andrey Kamaev
1744098438 silence cmake 3.0+ warnings on LOCATION attribute 2014-11-18 16:18:22 +03:00
Maksim Shabunin
555fdf893a Documenting imgproc module
- disabled doxygen tree
- enabled doxygen enum listing
- added imgproc reference to main page
- enabled BiB support
- chenged doxygen root page format
2014-11-18 14:00:56 +03:00
Olexa Bilaniuk
68e59d6154 [RHO] Initial commit of RHO algorithm for rapid homography estimation.
Implements the RHO algorithm as presented in

Paper: Bilaniuk, Olexa, Hamid Bazargani, and Robert Laganiere. "Fast
Target Recognition on Mobile Devices: Revisiting Gaussian Elimination
for the Estimation of Planar Homographies." In Computer Vision and
Pattern Recognition Workshops (CVPRW), 2014 IEEE Conference on, pp.
119-125. IEEE, 2014.

- Complete, heavily documented reference C implementation, as well as
temporarily disabled dirty SSE2 port.
- Enabled tests for RHO in test_homography; Currently these fail
presumably due to too-stringent accuracy requirements.
- Refinement and final refinement are not yet functional; Do not pass
their corresponding flags to RHO.
2014-11-17 15:06:08 -05:00
Vadim Pisarevsky
32348604e3 Merge pull request #3431 from PhilLab:patch-3 2014-11-17 13:39:46 +00:00
Philipp Hasper
799646e5d0 Typos in CMake 2014-11-17 12:30:12 +01:00
Vadim Pisarevsky
047b1ca457 Merge pull request #3419 from samyak-268:2.4 2014-11-16 18:17:54 +00:00
Vadim Pisarevsky
d48e0a04ae Merge pull request #3424 from dsjolie:daniel 2014-11-16 18:10:01 +00:00
Vadim Pisarevsky
986878a881 Merge pull request #3422 from avdmitry:install_doc_update 2014-11-16 18:08:35 +00:00
Vadim Pisarevsky
8ebd474c0e Merge pull request #3425 from StevenPuttemans:fix_firewire_buffersize 2014-11-16 18:06:20 +00:00
Vadim Pisarevsky
9086d6a230 Merge pull request #3427 from tstellarAMD:2.4-farneback-crash-fix 2014-11-16 18:05:17 +00:00
Daniel Angelov
303868b3c4 Fixed variable name consistency
The function parameters were different from the ones described below.

P.S. Why is ``flow`` InputOutputArray, shouldn't it be just OutputArray? If so, shouldn't the reason be specified - e.g. so others can benefit as well (e.g. not allocating memory on every frame?)
2014-11-14 22:49:22 +00:00
StevenPuttemans
d9164bdd4c added extra BUFFERSIZE doc and getter 2014-11-14 14:09:43 +01:00
Daniel Sjölie
a9a45e1546 Merge remote-tracking branch 'upstream/master' into daniel 2014-11-14 13:44:06 +01:00
Dmitriy Anisimov
28944336d4 updated linux installation documentation 2014-11-14 12:32:42 +03:00
Tom Stellard
42b1bd56cc ocl: Move static oclMat variables into FarnebackOpticalFlow class
Move some static functions into the FarnebackOpticalFlow class as well,
so they can access these new class variables.

oclMat objects cannot be declared statically, because their destructor
depends on the statically defined __module variable from cl_context.cpp.
Since statically defined variables in separate compilation units have
an undefined destruction order there is always the possibility the
__module will be destructed before an oclMat object, which results
in a segfault.
2014-11-13 11:16:10 -05:00
Vadim Pisarevsky
eedde323ce Merge pull request #3421 from SpecLad:ncv-algorithm 2014-11-13 15:40:29 +00:00
Roman Donchenko
da6a38f9f6 NCV.cu: include <algorithm>
It's needed for std::max.
2014-11-13 16:16:26 +03:00
Vadim Pisarevsky
92e08c9863 Merge pull request #3412 from StevenPuttemans:ieee1934_camera_set_params 2014-11-13 07:27:33 +00:00
Vadim Pisarevsky
4b97e8c51c Merge pull request #3399 from mshabunin:doxygen-core 2014-11-13 07:25:27 +00:00
Vadim Pisarevsky
d4db7807df Merge pull request #3415 from jet47:fix-gpu-perf-sample 2014-11-13 07:21:02 +00:00
Vadim Pisarevsky
773e621190 Merge pull request #3414 from SpecLad:vg-stereogc 2014-11-13 07:20:30 +00:00
Alexander Alekhin
d2f19a3a0d Merge pull request #3418 from tstellarAMD:2.4-hog-crash-fix 2014-11-13 01:49:06 +00:00
Alexander Alekhin
a16a11f32b Merge pull request #3413 from wangyan42164:denoising_opencl_improvement 2014-11-13 01:47:01 +00:00
Samyak Datta
a3f05474c9 C++ sample code to detect facial features 2014-11-12 23:35:02 +05:30
Maksim Shabunin
2d8673197c Merge pull request #3417 from ilya-lavrenov:dox_warn 2014-11-12 17:48:43 +00:00
Ilya Lavrenov
d8ca61b01b attemp to fix dox warning 2014-11-12 19:18:45 +03:00
Vladislav Vinogradov
1189606cd8 fix gpu performance sample compilation 2014-11-12 18:07:20 +03:00
Tom Stellard
ec335b7398 ocl: Fix crash during destruction of gauss_w_lut object in hog.cpp
gauss_w_lut is a statically defined variable of type oclMat.  The oclMat
destructor calls openCLFree() which via getInitializationMutex() accesses
the __module variable which has been statically defined in cl_context.cpp

Since the destruction order of statically defined variables in different
compilation units is undefined, it is possible that __module will
be destructed before gauss_w_lut, which would result in a segfault when
getInitializationMutex() is called while destructing gauss_w_lut.

In order to avoid this issue, we need to make gauss_w_lut a private
member of the HOGDescriptors class so we know it will be destroyed
before __module.
2014-11-12 10:07:07 -05:00
Yan Wang
a8b4c99ed6 Improve the performance of fast_nlmeans_denoising_opencl.
1. Remove unnecessary barriers.
2. Adjust CTA_SIZE based on the following cases for Intel platform:
   a) OCL_Photo_DenoisingGrayscale.DenoisingGrayscale
   b) OCL_Photo_DenoisingColored.DenoisingColored
2014-11-12 22:34:33 +08:00
Roman Donchenko
7d8e5f623a Fix uninitialized memory reads and memory leaks in StereoGC 2014-11-12 17:00:08 +03:00
StevenPuttemans
2b8229f716 adding extra buffer parameter 2014-11-12 13:09:53 +01:00
Vadim Pisarevsky
4763d8033a Merge pull request #3406 from shiquanwang:Fix-bug-#4003_build-python-binding-under-python3 2014-11-12 11:26:19 +00:00
Maksim Shabunin
6aa7a86ae9 Doxygen documentation for core module 2014-11-12 14:21:58 +03:00
Vadim Pisarevsky
23a81c0fb8 Merge pull request #3407 from wangyan42164:canny_bug_fix 2014-11-12 11:09:55 +00:00
Yan Wang
184b6e314c Fix canny segment fault (Bug #3978)
Avoid stack overflow based on std::vector cause
std::vector::resize() segmentation fault.
2014-11-12 17:48:05 +08:00
Vadim Pisarevsky
77be6d64c1 Merge pull request #3410 from mgharbi:master 2014-11-12 08:49:50 +00:00
eltermann
b3a60b9c22 Documentation fix on py_tutorials/py_feature2d 2014-11-11 17:10:33 -02:00
Michae Gharbi
28103ad386 Fix Cuda -Wl linker options
This line causes the following error when building custom projects that use OpenCV beta 3:
ld: warning: directory not found for option '-L/<project_root>/-Wl,/usr/local/cuda'
2014-11-11 12:12:28 -05:00
Vadim Pisarevsky
bea86deea9 Merge pull request #3408 from ilya-lavrenov:doc_fix 2014-11-11 13:29:46 +00:00
Vadim Pisarevsky
b80a3a91a8 Merge pull request #3401 from SpecLad:optflow-bogus-Warray-bounds 2014-11-11 13:27:41 +00:00
Alexander Bohn / FI$H2k
8340e31f1f Fixed OS X compilation error in window_cocoa.mm
Un-commented `NSApplicationActivationPolicyRegular` argument (in leu of zero) and got rid of problematic dereference
2014-11-11 04:35:35 -08:00
Roman Donchenko
13d67b6ae7 Suppress a bogus -Warray-bounds in modules/superres/src/optical_flow.cpp
This is actually the same warning that the suppression at the bottom
suppresses, but that one doesn't suppress it when using a native compiler
(go figure).

I remove the forced inclusion of precompiled headers into all sources,
since otherwise this workaround doesn't work - the header with the warning
is included before I can use a pragma.
2014-11-10 18:38:54 +03:00
Ilya Lavrenov
701d2386ce fixed doc 2014-11-10 16:19:27 +03:00
Shiquan Wang
7127634aa0 Mod: Open header files with io.open for Python 2/3 compatibility. 2014-11-10 21:09:43 +08:00
Alexander Alekhin
6550cb2a90 Merge tag '3.0.0-beta'
OpenCV 3.0.0 Beta
2014-11-10 14:42:47 +03:00
Vadim Pisarevsky
e05a0bc6c5 Merge pull request #3322 from StevenPuttemans:fix_pvpapi_interface 2014-11-10 08:27:42 +00:00
Vadim Pisarevsky
a181835549 Merge pull request #3405 from D-Alex:master 2014-11-10 08:19:29 +00:00
Vadim Pisarevsky
34f23b5917 Merge pull request #3404 from alalek:openni2_patch 2014-11-10 08:09:45 +00:00
Alexander Duda
60cacbfd66 solvePnPRansac: fix mask generation 2014-11-09 23:10:43 +01:00
Alexander Duda
ed55d13112 PnPRansacCallback::computeError: fix count in case of Nx3 matrices 2014-11-09 23:08:47 +01:00
Alexander Alekhin
2e05f1e3f8 openni_capture sample: enable OpenNI2 if available
Sample works with OpenNI2 with minimal code changes (CAP_OPENNI -> CAP_OPENNI2)
2014-11-08 02:22:29 +03:00
Alexander Alekhin
2981ee00d9 OpenNI2: prevent failure of setVideoMode() call with invalid parameters
Not all parameters are specified for openni::VideoMode, so
"selected" mode can be unsupported for device.
Replace default VideoMode constructor to result of getVideoMode() call.
2014-11-08 02:21:59 +03:00
Vadim Pisarevsky
3da1144cef Merge pull request #3305 from tSed:opencv-2.4.x/opencv.pc-generation-refactoring 2014-11-06 08:41:07 +00:00
Vadim Pisarevsky
b476bf2a00 Merge pull request #3294 from mshabunin:fix-ios-warnings-24 2014-11-05 11:35:19 +00:00
Vadim Pisarevsky
23b28a6700 Merge pull request #3376 from vriera:2.4 2014-11-05 11:13:03 +00:00
Samuel Martin
eceada586b cmake/OpenCVGenPkgconfig.cmake: rework opencv.pc generation
Using absolute path to locate the components in the "Libs:" field of the
*.pc can badly break cross-compilation, especially when building
statically linked objects.

Indeed, pkg-config automatically replaces the '-I...' and '-L...' paths
when the PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_LIBDIR environment
variables are set [1]. This feature is very helpful and common in
cross-compilation framework like Buildroot [2,3].

When there are absolute paths in the *.pc files, pkg-config won't be
able to do the path substitions for these paths when the afromentioned
environment variables are set.
In such case, since the prefix is the target one, not the sysroot one,
these libraries' abolute paths will point to:
- in the best case: a non-existing file (i.e. these files do not exists
  on the host system;
- at worst: the host system's libraries. This will make the linking
  failed because these host system's libraries will most likely not be
  build for the target architecture [4].

So, this patch replace the components' absolute paths by the form:
  -L<libdir> -l<libname>

This way, the linker will be able to resolve each dependency path,
whatever the kind of objects/build (shared object or static build) it
is dealing with.

Note that for static link, the library order does matter [5]. The order
of the opencv components has been carefully chosen to comply with this
requirement.

Fixes #3931

[1] http://linux.die.net/man/1/pkg-config
[2] http://buildroot.org/
[3] http://git.buildroot.net/buildroot/tree/package/pkgconf/pkg-config.in
[4] http://autobuild.buildroot.net/results/e8a/e8a859276db34aff87ef181b0cce98916b0afc90/build-end.log
[5] http://stackoverflow.com/questions/45135/linker-order-gcc

Signed-off-by: Samuel Martin <s.martin49@gmail.com>

---
Note: this patch properly applies on top of the master branch, though it
      has been written on top of the 2.4 branch.
2014-11-05 11:32:11 +01:00
Alexander Smorkalov
67635c6d65 Version++. 2014-11-05 08:46:55 +03:00
Vladislav Vinogradov
a26e496d00 minor fix for StereoCSBP data cost compute kernel and test
(cherry picked from commit 84f33d0578d3a836c8384608363ef5e2c24030fa)
2014-11-04 10:19:38 +03:00
Vladislav Vinogradov
d579d3e596 increase epsilons for some tests, which functions use floating point arithm
(cherry picked from commit 5c07e0b6d3f120c964ce8fac58bd2ab0ede96562)
2014-11-04 10:19:18 +03:00
Vladislav Vinogradov
5a77176654 avoid pointer arithmetic on register memory in color conversion
(cherry picked from commit e0827069c1c242ad9fceede43c642f8dfad0ef99)
2014-11-04 10:18:58 +03:00
Daniel Sjölie
323c922322 Use OPENNI2_INCLUDE64 environment variable.
(Set on windows with install from http://structure.io/openni).
2014-11-03 16:25:59 +01:00
Vadim Pisarevsky
a28cde9c3b Merge pull request #3382 from StevenPuttemans:fix_3982 2014-10-31 11:18:24 +00:00
Vadim Pisarevsky
529af7a90e Merge pull request #3364 from mshabunin:doxygen-docs-24 2014-10-30 10:42:25 +00:00
StevenPuttemans
8bf58937a9 fixing SVM negative value rounding 2014-10-29 13:50:20 +01:00
StevenPuttemans
7dce2d0b8f fixing cap_pvpapi interface and making sure both AVT Manta and Proscilla
series are supported. Testing this with both cams for Windows and Linux
exhaustively.

Optimizing memory footprint by removing unused calls.

Adapted with the input of Shai

Added small example that illustrates how it should work.
2014-10-28 15:33:37 +01:00
Vicente Olivert Riera
2e393ab833 superres: Fix return value VideoFrameSource_GPU
superres module fails to compile with the following error messages:

[100%] Building CXX object modules/superres/CMakeFiles/opencv_superres.dir/src/super_resolution.cpp.o
/opencv-2.4.10/modules/superres/src/frame_source.cpp: In function 'cv::Ptr<cv::superres::FrameSource> cv::superres::createFrameSource_Video_GPU(const string&)':
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:16: error: expected type-specifier before 'VideoFrameSource'
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:16: error: could not convert '(int*)operator new(4ul)' from 'int*' to 'cv::Ptr<cv::superres::FrameSource>'
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:16: error: expected ';' before 'VideoFrameSource'
/opencv-2.4.10/modules/superres/src/frame_source.cpp:263:41: error: 'VideoFrameSource' was not declared in this scope
/opencv-2.4.10/modules/superres/src/frame_source.cpp:264:1: error: control reaches end of non-void function [-Werror=return-type]
cc1plus: some warnings being treated as errors
make[3]: *** [modules/superres/CMakeFiles/opencv_superres.dir/src/frame_source.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....

This is caused because the return value of the createFrameSource_Video_GPU function should be a VideoFrameSource_GPU object.
2014-10-27 13:39:35 +00:00
Maksim Shabunin
0c3722be82 iOS framework build script changes from master branch 2014-10-27 15:28:21 +03:00
Maksim Shabunin
09fb7512ed Fixed iOS framework compilation warnings 2014-10-27 15:28:21 +03:00
Maksim Shabunin
b59aaae2dc iOS framework build script changes
- buildbot process support (break build in case of errors)
- disabled some warnings in cmake script
2014-10-27 15:28:05 +03:00
Maksim Shabunin
d77088b19b Merge pull request #3336 from BKNio:putText_develop2 2014-10-27 11:56:25 +00:00
Dinar Ahmatnurov
b5a6df4966 fixed issue with malformed UTF-8 string;
ocl: Change static variable order in cl_context.cpp to avoid crashes during destruction

ContextImpl::currentContext contains a reference to one of the
DeviceInfoImpl objects from:

static std::vector<DeviceInfoImpl> global_devices;

ContextImpl::currentContext is destroyed in the destructor
for the statically defined object __module, and relies on its
DeviceInfoImpl reference to query some hardware features while
being destroyed.

This means that we need to ensure that the global_devices vector is
destroyed affter __module, otherwise ContextImpl::currentContext's
DeviceInfoImpl reference will no longer be valid when __module is
destroyed.

Since these variables are all confined to a single compilation unit,
they will be destruct from bottom to top, so we need to make sure
that __module is the bottom definition so it can be destroyed first.

iOS: fix crash from overrelease in UIImageToMat

viz: fixed memory leak, issue 3961

fix installation layout for debian packages:

Install symlinks to shared libraries as a part of development package,
not runtime package.

It is default behavior for debian packages.

Fix test name.

TIFF loader: Allocate large enough buffer when (bpp * ncn) > 8.

TIFF loader: Pass buffer size to read functions.

replace not ascii and not cyrillic symbols with '?';

add test for putText;

fix warning;

minor fixes;
2014-10-27 12:47:53 +03:00
Vadim Pisarevsky
67e50b4415 Merge pull request #3362 from mshabunin:fix-drawing-24 2014-10-26 17:44:07 +00:00
Vadim Pisarevsky
0cf170587f Merge pull request #3363 from asmorkalov:qnx_support 2014-10-26 17:42:24 +00:00
Vadim Pisarevsky
0c2ccd3bae Merge pull request #3366 from jet47:fix-gpu-cuda-7.0 2014-10-26 17:41:14 +00:00
Vadim Pisarevsky
1692801fc5 Merge pull request #3356 from jet47:ctest-support 2014-10-26 17:40:35 +00:00
Vladislav Vinogradov
84f33d0578 minor fix for StereoCSBP data cost compute kernel and test 2014-10-23 19:33:44 +04:00
Vladislav Vinogradov
5c07e0b6d3 increase epsilons for some tests, which functions use floating point arithm 2014-10-23 19:33:42 +04:00
Vladislav Vinogradov
e0827069c1 avoid pointer arithmetic on register memory in color conversion 2014-10-23 18:39:23 +04:00
Maksim Shabunin
9b55c09999 Basic doxygen documentation support
- updated existing Doxyfile.in
- added corresponding cmake instructions
- added some specific files (layout, icon)
- clean existing doxygen warnings

Conflicts:
	CMakeLists.txt
	doc/CMakeLists.txt
	modules/core/include/opencv2/core.hpp
	modules/core/include/opencv2/core/base.hpp
	modules/core/include/opencv2/core/cuda.inl.hpp
	modules/core/include/opencv2/core/mat.hpp
	modules/core/include/opencv2/core/matx.hpp
	modules/core/include/opencv2/core/types.hpp
	modules/flann/include/opencv2/flann/lsh_table.h
	modules/imgproc/include/opencv2/imgproc.hpp
2014-10-23 18:27:26 +04:00
Alexander Smorkalov
6bb6039ebb Fixes for QNX 6.6 Neitrino support. 2014-10-23 17:17:35 +04:00
Maksim Shabunin
ba7c92b0e8 Fixed highgui drawing test
- changed image comparison technique
- removed old assert statements
2014-10-23 13:28:33 +04:00
Vladislav Vinogradov
4f8a1213bd determine test category (Public vs Extra) based on module location 2014-10-21 18:51:02 +04:00
Vladislav Vinogradov
edf54ac3a9 add CTest targets for sanity tests 2014-10-21 18:50:38 +04:00
Vladislav Vinogradov
f44c29ad7d disable CTest target for opencv_test_viz:
opencv_test_viz creates windows and waits until user close them,
it is not appropriate for automatic testing
2014-10-21 18:49:53 +04:00
Vladislav Vinogradov
0c57dc2e00 rewrite add_test command for accuracy tests:
* use new syntax introduced in CMake 2.8.0
* set OPENCV_TEST_DATA_PATH enviroment property
2014-10-21 18:48:46 +04:00
Vladislav Vinogradov
07bd58a0e8 turn on testing support in root binary directory 2014-10-21 18:45:47 +04:00
Vadim Pisarevsky
7bff337828 Merge pull request #3350 from Trundle:fix_some_tiff_crashes 2014-10-20 06:44:10 +00:00
Andreas Stührk
24580e348a TIFF loader: Pass buffer size to read functions. 2014-10-19 01:22:18 +02:00
Andreas Stührk
cfdcf9f2d2 TIFF loader: Allocate large enough buffer when (bpp * ncn) > 8. 2014-10-19 01:22:04 +02:00
Andreas Stührk
63ac69cadf Fix test name. 2014-10-19 01:13:35 +02:00
Vadim Pisarevsky
263621aed8 Merge pull request #3341 from jet47:deb-package-lib-symlinks 2014-10-18 17:00:52 +00:00
Vadim Pisarevsky
40efd17be4 Merge pull request #3346 from Nerei:fixed_memory_leak_in_viz 2014-10-18 16:57:55 +00:00
Anatoly Baksheev
0f2b7fbc45 viz: fixed memory leak, issue 3961 2014-10-18 18:12:36 +04:00
Vadim Pisarevsky
1ce31dcd62 Merge pull request #3340 from AdLantis:2.4 2014-10-17 11:36:24 +00:00
Vladislav Vinogradov
f55c1cc0fb fix installation layout for debian packages:
Install symlinks to shared libraries as a part of development package,
not runtime package.

It is default behavior for debian packages.
2014-10-17 13:23:23 +04:00
Thomas Weisbach
81c0537b0c iOS: fix crash from overrelease in UIImageToMat 2014-10-17 17:49:14 +09:00
Vadim Pisarevsky
32f978ff4b Merge pull request #3337 from tstellarAMD:2.4-ocl-context-cleanup-fix 2014-10-16 10:07:13 +00:00
Tom Stellard
8f3b876ee6 ocl: Change static variable order in cl_context.cpp to avoid crashes during destruction
ContextImpl::currentContext contains a reference to one of the
DeviceInfoImpl objects from:

static std::vector<DeviceInfoImpl> global_devices;

ContextImpl::currentContext is destroyed in the destructor
for the statically defined object __module, and relies on its
DeviceInfoImpl reference to query some hardware features while
being destroyed.

This means that we need to ensure that the global_devices vector is
destroyed affter __module, otherwise ContextImpl::currentContext's
DeviceInfoImpl reference will no longer be valid when __module is
destroyed.

Since these variables are all confined to a single compilation unit,
they will be destruct from bottom to top, so we need to make sure
that __module is the bottom definition so it can be destroyed first.
2014-10-14 20:54:13 -04:00
Vadim Pisarevsky
6b0cd392f0 Merge pull request #3331 from tSed:opencv-2.4.x/fix-x86-PIC-compilation 2014-10-12 13:42:38 +00:00
Samuel Martin
ea50be0529 core: fix x86 PIC code compilation
This bug was triggered by Buildroot autobuilders [1,2], causing this
kind of failures [3,4]:

  [ 14%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o
  /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp: In function '(static initializers for /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp)':
  /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp:280:10: error: inconsistent operand constraints in an 'asm'
  make[3]: *** [modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o] Error 1

[1] http://buildroot.org/
[2] http://autobuild.buildroot.org/
[3] http://autobuild.buildroot.org/?reason=opencv-2.4.10
[4] http://autobuild.buildroot.org/results/483/4838285b25d6293a5cf0bb9eadd5040a7c75d766/build-end.log

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
2014-10-12 12:45:20 +02:00
Vadim Pisarevsky
b11b08b478 Merge pull request #3265 from BKNio:putText_develop 2014-10-11 18:06:25 +00:00
Vadim Pisarevsky
a5e89bf724 Merge pull request #3329 from taka-no-me:patch-1 2014-10-11 17:41:23 +00:00
Vadim Pisarevsky
0d196529f7 Merge pull request #3300 from rohitrawat:bug_3787_docs_NAryMatIterator 2014-10-11 17:35:51 +00:00
Vadim Pisarevsky
77b57459c4 Merge pull request #3327 from JonasVautherin:patch_cmake_android_r10 2014-10-11 17:26:19 +00:00
Andrey Kamaev
5dde172452 silence cmake 3.0+ warnings on LOCATION attribute 2014-10-11 20:35:48 +04:00
Jonas Vautherin
d83372a8dc Patch for NDK r10 2014-10-10 15:16:51 +02:00
Dinar Ahmatnurov
5a797ae7de fix issue with font; 2014-10-10 17:11:20 +04:00
Vadim Pisarevsky
ff8e32453b Merge pull request #3307 from ilya-lavrenov:ffmpeg_rtsp 2014-10-10 11:02:50 +00:00
Ilya Lavrenov
fb2012def2 TCP instead of UDP 2014-10-09 19:23:51 +04:00
Vadim Pisarevsky
d7ba03a9cb Merge pull request #3298 from a-wi:DShow_capture 2014-10-09 15:00:25 +00:00
Vadim Pisarevsky
1e744bf5b1 Merge pull request #3309 from nisargthakkar:Thickness1NoLineCV_AA 2014-10-09 14:42:44 +00:00
Vadim Pisarevsky
8364ea3954 Merge pull request #3311 from BarneyBear:2.4-drawMatches-flag-fix 2014-10-09 14:20:23 +00:00
Vadim Pisarevsky
c24e6f7ae9 Merge pull request #3316 from nisargthakkar:Bug3887 2014-10-09 14:19:12 +00:00
Vadim Pisarevsky
ed2fb773cd Merge pull request #3319 from Trundle:tiff_infinite_rowsperstrip 2014-10-09 14:15:03 +00:00
Andreas Stührk
afb164cc15 Don't allocate lots of memory when reading TIFFs with infinite rows per strip.
Some TIFF images consist of only one strip. The magic value 2**32-1 for the
"rows per strip" tag reflects that fact, effectively meaning "infinite".
2014-10-08 23:31:30 +02:00
Nisarg Thakkar
474897ff01 Made some changes specefict to 4 channel images. Fixed step value for tptr 2014-10-08 22:08:14 +05:30
Nisarg Thakkar
29fb2b6e47 Fixed doc for Bug #3887
Fixed doc for Bug #3887
2014-10-08 19:52:35 +05:30
Niklas Frisk
af72e6b8f4 Fixes #3910, flags in _prepareImgAndDrawKeypoints are now binary OR'ed instead of added. 2014-10-07 09:40:56 +02:00
Samuel Martin
38bb0db9db cmake: fix gstreamer check conditions
The current situation of the Gstreamer detection does not always honor
all the configurations set by the user, among this:
- if both WITH_GSTREAMER and WITH_GSTREAMER_0_10 are off, but
  Gstreamer 0.10 is installed in the system, Gstreamer 0.10 support will
  be enable;
- if both WITH_GSTREAMER and WITH_GSTREAMER_0_10 are on, only checks for
  Gstreamer 0.10 will be run.

This patch fixes the Gstreamer detection like this:

  |        -DWITH_...          | Package installed  ||    OpenCV    |
  | GSTREAMER | GSTREAMER_0_10 | gst-1.x | gst-0.10 || gst. support |
  +===========+================+=========+==========##==============+
  |    OFF    |      OFF       |    -    |    -     ||     none     |
  |    OFF    |      ON        |    -    |    no    ||     none     |
  |    OFF    |      ON        |    -    |   yes    ||   gst-0.10   |
  |    ON     |      OFF       |    no   |    no    ||     none     |
  |    ON     |      OFF       |    no   |   yes    ||   gst-0.10   |
  |    ON     |      OFF       |   yes   |    -     ||    gst-1.x   |
  |    ON     |      ON        |   yes   |    -     ||    gst-1.x   |

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
2014-10-06 21:40:55 +02:00
Rohit Rawat
2ad8c6dbd0 Fixing bug in NAryMatIterator documentation(Bug #3787).
Fixed the non-working code example for NAryMatIterator.
The documentation of NAryMatIterator in file:
modules/core/include/opencv2/core/core.hpp has a working example which
was used for these edits.
2014-10-02 18:48:31 -05:00
Artur Wieczorek
5c96021172 Fixed getting CV_CAP_PROP_FOURCC property value
Save selected FCC in order to return proper CV_CAP_PROP_FOURCC property value (currently FCC for RGB24 is always returned).
2014-10-02 21:41:54 +02:00
Artur Wieczorek
4b1bb702ce Fixed media type GUID for I420 format in DShow capture.
FOURCC code bytes should be placed in the reverse order.
2014-10-02 13:07:50 +02:00
Maksim Shabunin
a77a2f357c Merge pull request #3297 from asmorkalov:ocv_docs_fix 2014-10-02 10:56:08 +00:00
Artur Wieczorek
7e78b5d06e Fixed selecting media type in DShow video capture.
Set correct value of sample size when calling IAMStreamConfig::SetFormat function. For non-RGB media type it can be set to zero value.
(See http://msdn.microsoft.com/en-us/library/windows/desktop/dd373477%28v=vs.85%29.aspx)
2014-10-02 12:08:37 +02:00
Alexander Smorkalov
11c81067dc doc/check_docs2.py warnings fixes 2014-10-02 13:40:30 +04:00
Andrey Pavlenko
7018f94959 Merge pull request #3288 from StevenPuttemans:fix_ts_dependencies 2014-10-01 07:33:36 +00:00
Andrey Pavlenko
533fde66e3 Merge pull request #3281 from a-wi:MSMF_remove_ATL_dependency 2014-10-01 07:26:25 +00:00
Andrey Pavlenko
5bd18155be Merge pull request #3290 from asmorkalov:android_disable_fisheye.rectify_for_tegra 2014-10-01 07:26:04 +00:00
Andrey Pavlenko
aa6b5ac124 Merge pull request #3291 from asmorkalov:android_superres_video_check 2014-10-01 07:25:15 +00:00
Alexander Smorkalov
ca40a749b6 Turn off superres accuracy tests if video i/o is not supported. 2014-10-01 09:15:24 +04:00
Roman Donchenko
d54d580f79 Merge pull request #3275 from asmorkalov:ocv_gstreamer_backport 2014-09-30 15:55:26 +00:00
Roman Donchenko
774d6c1d0a Merge pull request #3285 from asmorkalov:android_servive_big.little_fix 2014-09-30 15:19:07 +00:00
Roman Donchenko
302d80d744 Merge pull request #3287 from asmorkalov:android_manager_version_inc5 2014-09-30 14:44:36 +00:00
Alexander Smorkalov
286c6b496d OpenCV Manager hardware detector workaround for not detected ARM SoC support. 2014-09-30 18:43:11 +04:00
Maksim Shabunin
44da1f795f Merge pull request #3282 from asmorkalov:android_exclude_ocl 2014-09-30 10:53:16 +00:00
Alexander Smorkalov
71c4e96e17 Test fisheye.rectify disabled for Tegra. 2014-09-30 14:49:33 +04:00
StevenPuttemans
60fd5c2a3a fixing dependencies 2014-09-30 11:53:46 +02:00
Alexander Smorkalov
8271c4e9c4 Highgui_Video.prop_fps disabled as fails with FFmpeg in Ubuntu 14.04. 2014-09-30 13:35:19 +04:00
Alexander Smorkalov
1f4fe3bb27 GStreamer 1.0 backport from master branch. 2014-09-30 12:30:09 +04:00
Alexander Smorkalov
a0431acb37 OpenCV Manager version++. 2014-09-30 12:05:46 +04:00
Artur Wieczorek
e3f1d722e7 Remove ATL dependency from MSMF capture code
Use _com_ptr_t instead of CComPtr in ComPtr wrapper to avoid ATL dependency.
2014-09-30 01:35:59 +02:00
Alexander Smorkalov
1c3c94fd2c Exclude OpenCL tests from default test list for Android as they are experimental. 2014-09-29 20:45:12 +04:00
Roman Donchenko
45a1063c4a Merge pull request #3263 from asmorkalov:python_tests_package_lintian 2014-09-29 14:53:02 +00:00
Alexander Smorkalov
1cc80f10ba Added implicit dependency from python and python-py to debian packages. 2014-09-29 17:43:54 +04:00
Maksim Shabunin
a160158cb3 Merge pull request #3272 from mgeorg:reset_ffmpeg_mutex_2_4 2014-09-29 12:07:22 +00:00
Vadim Pisarevsky
6a53cb9307 Merge pull request #3266 from mshabunin:arm_warning 2014-09-27 13:06:44 +00:00
Vadim Pisarevsky
1920232268 Merge pull request #3260 from a-wi:MSMF_file_error 2014-09-27 13:06:18 +00:00
Manfred Georg
7f4eb4f6c6 set ffmpeg mutex to NULL on destruction.
The Mutex manager registered with ffmpeg must reset the mutex to NULL after destruction, otherwise ffmpeg will give the invalid mutex to the next mutex manager when it asks it to CREATE a new mutex.
See ffmpeg code: http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/utils.c;h=28c5785398fcf11a3d3c70a8cd09e9df798e2734;hb=HEAD#l3423

Cherry picked from head (file has moved but issue is the same).
Conflicts:
	modules/videoio/src/cap_ffmpeg_impl.hpp
2014-09-26 10:19:34 -07:00
Dinar Ahmatnurov
de6edcc48a fixing issue with "ёЁ"; 2014-09-26 11:32:14 +04:00
Maksim Shabunin
e88a36621e Fixed warning during cross compile for ARM 2014-09-25 12:27:48 +04:00
Dinar Ahmatnurov
e9f7c4aeba added Cyrillic;
added Cyrillic;

replace binary format with hex;

move duplicated code to inline function;
2014-09-25 11:15:20 +04:00
Vadim Pisarevsky
467f5fc90f Merge pull request #3261 from a-wi:CMake_FFMPEG_config 2014-09-24 17:03:08 +00:00
Vadim Pisarevsky
ad018da224 Merge pull request #3262 from StevenPuttemans:fix_window_param 2014-09-24 12:22:20 +00:00
StevenPuttemans
90a1c6b1f0 fixing some wrong CPP prefixes - still old interface 2014-09-24 09:33:22 +02:00
Artur Wieczorek
93d1ceae43 Use FFMPEG capture only if HAVE_FFMPEG flag is defined. 2014-09-24 02:11:59 +02:00
Artur Wieczorek
073a7ff95a Fixed CMake issue with FFMPEG highgui configuration
Currently, FFMPEG source files are included in highgui project file regardless of CMake WITH_FFMPEG option.
After applying this PR FFMPEG files are included only if WITH_FFMPEG option is enabled.
2014-09-23 23:46:03 +02:00
Artur Wieczorek
5bf1a4c08c Fixed MSMF file capture error while opening the file containing unsupported video stream format 2014-09-23 20:21:53 +02:00
Vadim Pisarevsky
562ff9d111 Merge pull request #3255 from bhack:fix_cuda_macosx 2014-09-23 15:40:23 +00:00
bhack
32f6e1a554 Fix for bug #3469 CV_XADD failing in clang+nvcc combination
Taken from 3f0765523113ae7fc1b300f27dd78c642bb2b6c7
2014-09-23 12:39:16 +02:00
Vadim Pisarevsky
10bbcca11e Merge pull request #3251 from a-wi:MSMF_camera_errors 2014-09-23 08:42:57 +00:00
Vadim Pisarevsky
19b3aab23f Merge pull request #3244 from tstellarAMD:2.4-ocl-inline-fix-v2 2014-09-23 07:19:38 +00:00
Vadim Pisarevsky
df28bb5ccd Merge pull request #3190 from StevenPuttemans:fix_simpleblobdetector 2014-09-23 07:18:01 +00:00
StevenPuttemans
d4ec359f11 Fixing errors 2014-09-22 22:12:27 +02:00
Artur Wieczorek
3603102c89 Fixed assertion warning in MSMF frame grabber 2014-09-22 19:38:04 +02:00
Artur Wieczorek
a615102947 Fixed MSMF video capture initialization 2014-09-22 19:35:36 +02:00
Vadim Pisarevsky
9c91d0103f Merge pull request #3247 from a-wi:CMake_MSMF_configuration 2014-09-22 15:31:09 +00:00
Vadim Pisarevsky
37a1767286 Merge pull request #3243 from a-wi:MSMF_linking_error 2014-09-22 15:29:32 +00:00
StevenPuttemans
03662c0589 fix blobdetector 2014-09-22 13:58:45 +02:00
Artur Wieczorek
7c354c14f7 CMake configuration for MSMF capture 2014-09-21 21:03:41 +02:00
Artur Wieczorek
d2ba09e6ff Fix linking error under Win 7 - do not import MinCore_Downlevel.lib if target is Win 7 or earlier. 2014-09-19 22:46:09 +02:00
Tom Stellard
934394c5e2 ocl: Don't use 'inline' attribute on functions
In C99 'inline' is not a hint to the compiler to inline the function,
it is an attribute that affects the linkage of the function.  'inline'
functions are required to have a definition in a different compiliation
unit, so compilers are free to delete 'inline' functions if they want to.

This issue can be seen in Clang when compiling at -O0.  Clang
will sometimes delete 'inline' functions which creates an invalid
program.

Issue 3746: http://code.opencv.org/issues/3746
2014-09-19 16:13:57 -04:00
Vadim Pisarevsky
6c3cadbd73 Merge pull request #3240 from a-wi:MSMF_compilation_errors 2014-09-19 17:36:13 +00:00
Vadim Pisarevsky
4dda2002f6 Merge pull request #3241 from WilhelmHannemann:bugfix_brute_force_match_cl 2014-09-19 17:35:07 +00:00
Artur Wieczorek
539f8032dc Fixed compilation errors under VS 2010 and Win 7 2014-09-19 17:07:52 +02:00
WilhelmHannemann
f8c5128729 Merge branch 'bugfix_brute_force_match_cl' of https://github.com/WilhelmHannemann/opencv into bugfix_brute_force_match_cl 2014-09-19 16:42:59 +02:00
WilhelmHannemann
150487feda Bugfix brute_force_match.cl (see http://code.opencv.org/issues/2837): wrong results for non-float descriptors in OpenCL BruteForceMatcher 2014-09-19 16:41:54 +02:00
WilhelmHannemann
b767613d20 Bugfix brute_force_match.cl (Bug #2837): wrong results for non-float descriptors in OpenCL BruteForceMatcher 2014-09-19 16:31:11 +02:00
Vadim Pisarevsky
197b2e75e1 Merge pull request #3238 from vpisarev:bfmatcher_fix 2014-09-19 13:21:05 +00:00
Vadim Pisarevsky
3516e14e05 Merge branch 'bug_3172' of https://github.com/elmarb/opencv into bfmatcher_fix;
use different fix for the problem, embedded right into the BFMatcher.
2014-09-19 15:31:21 +04:00
E Braun
d82b918a7b fix for bug 3172 2014-09-19 14:47:43 +04:00
E Braun
f60726b090 Revert "fix for bug 3172"
This reverts commit ed2cdb71e5821db85b57cf60d88689c2bf32aeeb.
2014-09-19 14:47:43 +04:00
E Braun
1675b23a64 fix for bug 3172 2014-09-19 14:47:43 +04:00
E Braun
aa9da6e433 regression test for bug 3172 2014-09-19 14:47:43 +04:00
Vadim Pisarevsky
772f6208db Merge pull request #3235 from Atanahel:gbt_bugfix 2014-09-19 09:42:01 +00:00
Vadim Pisarevsky
0cf1de8eea Merge pull request #3236 from vpisarev:fix_traincascade 2014-09-18 17:45:28 +00:00
Stephen Mell
5947519ff4 Check sure that we're not already below required leaf false alarm rate before continuing to get negative samples. 2014-09-18 16:54:22 +04:00
Benoit Seguin
084835ec30 Fixing a line where integer data was treated as floating point data. 2014-09-18 14:03:13 +02:00
Vadim Pisarevsky
a67484668e Merge pull request #2711 from GregoryMorse:patch-5 2014-09-18 11:28:58 +00:00
Vadim Pisarevsky
26fd37b27d Merge pull request #3212 from mshabunin:python_cross_build_2.4 2014-09-18 08:57:32 +00:00
Vadim Pisarevsky
ccaedaedc8 Merge pull request #2047 from GregoryMorse:patch-4 2014-09-17 12:48:45 +00:00
Vadim Pisarevsky
c5de129c36 Merge pull request #3222 from dmitrygribanov:dg/2.4-stitching-wave-correction-bugfix 2014-09-17 10:54:02 +00:00
Vadim Pisarevsky
533dd85299 Merge pull request #3225 from jormansa:bug_#3631 2014-09-17 10:40:42 +00:00
Vadim Pisarevsky
48dc18ed59 Merge pull request #3228 from PhilLab:patch-4 2014-09-17 09:50:09 +00:00
Philipp Hasper
bac492fff6 Doc: Fixing indentation 2014-09-17 09:30:19 +02:00
jormansa
1d2d579bd6 bug fixed 2014-09-15 18:09:44 +02:00
Andrey Pavlenko
80687c8a56 Merge pull request #3219 from mshabunin:png_iccp_strip_24 2014-09-15 13:54:19 +00:00
Dmitry Gribanov
8a1d3929cc Feature based stitching's wave correction bugfix.
When we have similar matrices in input, then algorithm returns matrices
with NaN values.
2014-09-15 17:04:08 +04:00
Alexander Alekhin
281ce7a054 Merge pull request #3221 from asmorkalov:ocv_2.4.10_version_inc 2014-09-15 11:12:02 +00:00
Alexander Smorkalov
343f4b3026 OpenCV version++. 2014-09-15 14:55:25 +04:00
Maksim Shabunin
882426a9b2 Stripped iCCP chunk from png files 2014-09-15 12:48:28 +04:00
Vadim Pisarevsky
cf15b9e8ad Merge pull request #3204 from parafin:ximea_unix-2.4 2014-09-14 18:44:23 +00:00
Vadim Pisarevsky
f4f7522fe7 Merge pull request #3202 from parafin:bug_3858-2.4 2014-09-14 18:43:48 +00:00
Maksim Shabunin
1b4e3ec35a Changed cmake python library search startegy for crosscompiling 2014-09-12 13:44:16 +04:00
GregoryMorse
b9d5f3f6e9 Add support for WinRT in the MF capture framework by removing the disallowed calls to enumerate devices and create a sample grabber sink and adding framework for the MediaCapture interface and a custom sink which interfaces with the sample grabber callback interface. The change requires discussion for making it completely functional as redundancy is required given that if the source is a video file, the old code pathways must be used. Otherwise all IMFMediaSession, IMFMediaSource, and IMFActivate code must use a MediaCapture code path and all sink code must use the CMediaSink custom sink.
Support for the custom sink is extended to non-WinRT not for compatibility as Windows Vista client is a minimum regardless, but because it offers more flexibility, could be faster and is able to be used as an optionally different code path during sink creation based on a future configuration parameter.

My discussion and proposal to finish this change:
 Devices are so easily enumerated through WinRT Windows.Devices namespace that wrapping the calls in a library is quite a chore for little benefit though to get the various modes and formats could still be a worthwhile project. For now conditional compilation to remove videodevices and any offending non-video file related activity in videodevice. In my opinion, this is a different , far less fundamental and important change which can possibly be done as a future project and also much more easily implemented in C++/CX.

ImageGrabber has the IMFSampleGrabberSinkCallback replaced with a base class (SharedSampleGrabber) which also be is base class for ImageGrabberRT. This change is necessary as the custom sink does not require a thread to pump events which is done through MediaCapture already. IMFSampleGrabberSinkCallback is the common element between both models and that piece can be shared. Initializing the new ImageGrabberRT is as simple as passing an already initialized MediaCapture object and any video format/encoding parameters.

The concurrency event is necessary to wait for completion and is the way the underlying, IAsyncAction wrappers in the task library work as well. Native WIN32 event objects would be an option if HAVE_CONCURRENCY is not defined. I could even imagine doing it with sleep/thread yield and InterlockedCompareExchange yet I am not enthusiastic about that approach either. Since there is a specific compiler HAVE_ for concurrency, I do not like pulling it in though I think for WinRT it is safe to say we will always have it available though should probably conditionally compile with the Interlocked option as WIN32 events would require HAVE_WIN32.

It looks like C++/CX cannot be used for the IMediaExtension sink (which should not be a problem) as using COM objects requires WRL and though deriving from IMediaExtension can be done, there is little purpose without COM. Objects from C++/CX can be swapped to interact with objects from native C++ as Inspectable* can reinterpret_cast to the ref object IInspectable^ and vice-versa. A solution to the COM class with C++/CX would be great so we could have dual support. Also without #define for every WRL object in use, the code will get quite muddy given that the */^ would need to be ifdef'd everywhere.

Update cap_msmf.cpp

Fixed bugs and completed the change.  I believe the new classes need to be moved to a header file as the file has become to large and more classes need to be added for handling all the asynchronous problems (one wrapping IAsyncAction in a task and another for making a task out of IAsyncAction).  Unfortunately, blocking on the UI thread is not an option in WinRT so a synchronous architecture is considered "illegal" by Microsoft's standards even if implementable (C++/CX ppltasks library throws errors if you try it).  Worse, either by design or a bug in the MF MediaCapture class with Custom Sinks causes a crash if stop/start previewing without reinitializing (spPreferredPreviewMediaType is fatally nulled).  After decompiling Windows.Media.dll, I worked around this in my own projects by using an activate-able custom sink ID which strangely assigns 1 to this pointer allowing it to be reinitialized in what can only be described as a hack by Microsoft.  This would add additional overhead to the project to implement especially for static libraries as it requires IDL/DLL exporting followed by manifest declaration.  Better to document that it is not supported.

Furthermore, an additional class for IMFAttributes should be implemented to make clean architecture for passing around attributes as opposed to directly calling non-COM interface calls on the objects and making use of SetProperties which would also be a set up for an object that uses the RuntimeClass activation ID.

The remaining changes are not difficult and will be complete soon along with debug tracing messages.

Update and rename cap_msmf.h to cap_msmf.hpp

Successful test - samples are grabbed

Library updated and cleaned up with comments, marshaling, exceptions and linker settings
Fixed trailing whitespace

VS 2013 support and cleanup consistency plus C++/CX new object fixed

VS 2013 Update 2 library bug fix integrated

Various minor cleanup

Create agile_wrl.h

a-wi's changes integrated

Update cap_msmf.hpp

Update cap_msmf.cpp

Regression test fixes and simplifications
2014-09-10 17:21:38 +08:00
GregoryMorse
587402859e Add VS2013 support
Fix indentation in output that made it look like changes were dependent on WinRT when they are independent libraries.

Defaults needed flipping otherwise undesired behavior.  Change is tested with combinations.

Fixed and tested

Windows Phone v8.0/v8.1 SDK for Universal Windows Apps (Windows Phone v8.1 Silverlight App support not included) and fix initial cache causing problem
2014-09-10 17:18:41 +08:00
Igor Kuzmin
0421da78b3 XIMEA cam support: allow on OS X too 2014-09-09 19:17:13 +04:00
Igor Kuzmin
b027a84fa1 XIMEA cam support: use correct library for 64 bit Linux 2014-09-09 19:15:03 +04:00
Igor Kuzmin
fbbf4e380f fix for issue 3858 (remove unneeded #include's)
also use correct include path on Linux
2014-09-09 19:10:05 +04:00
Vadim Pisarevsky
faed8f43d6 Merge pull request #3194 from stonier:2.4 2014-09-09 06:33:15 +00:00
Vadim Pisarevsky
9a15c7a899 Merge pull request #3197 from asmorkalov:python_tests_package 2014-09-09 06:31:18 +00:00
Alexander Smorkalov
35768ed638 Python tests added to -tests deb package. 2014-09-08 18:11:12 +04:00
Daniel Stonier
161f50962d make sure children are included in the moveToThread 2014-09-08 04:31:37 +09:00
Daniel Stonier
e638b9e805 support invokation of cv windows from parallel threads to an external qt application. 2014-09-08 03:19:56 +09:00
Roman Donchenko
d7737528d1 Merge pull request #3156 from sergregory:CreateSamplesMod 2014-09-05 09:49:55 +00:00
Grigory Serebryakov
18c0511d3c Warning on converting int to bool fixed 2014-09-05 11:27:43 +04:00
Grigory Serebryakov
06a1c90679 Include for cvSameImage corrected 2014-09-05 10:45:54 +04:00
Alexander Smorkalov
e929dd4d98 GPU MatchTemplate32F test epsilon increased. 2014-09-02 20:24:49 +04:00
E Braun
bdb82d181f fix for bug 3172 2014-09-02 18:05:23 +02:00
Vladislav Vinogradov
10a2c51c52 fix OpenCVConfig.cmake template - missing parentheses
(cherry picked from commit 67b562d543154b29e3b5f8f9c79a03790da40712)
2014-09-02 19:30:35 +04:00
Alexander Smorkalov
4664a339ae Fix non-Android cross compilation with OpenCVConfig.cmake
(cherry picked from commit e8376c789d675d9d4b536066320e2981b9981b49)
2014-09-02 19:29:59 +04:00
Vladislav Vinogradov
fb81e4df1c fix CUDA cvtColor after corresponding change in CPU version
see https://github.com/Itseez/opencv/pull/3137
(cherry picked from commit ebe36d6e7c99430b16f61e6b2ee832b91f155ff7)
2014-09-02 16:48:20 +04:00
E Braun
89833853fa Revert "fix for bug 3172"
This reverts commit ed2cdb71e5821db85b57cf60d88689c2bf32aeeb.
2014-09-02 13:56:13 +02:00
Alexander Karsakov
cb1e9adc63 Fixed getConversionInfo() for YUV2RGBA_* conversions
(cherry picked from commit 023a42ba55859932861f4a849fbec4cf1bd3ead7)
2014-09-02 15:05:13 +04:00
Vladislav Vinogradov
562796e41b fix cv::gpu::resize for INTER_LINEAR, now it produces the same result as CPU version
(cherry picked from commit da9be8231fc153fd70ac4f4d41091d1653d00fd2)
2014-09-02 13:17:47 +04:00
Alexander Smorkalov
bb93c53948 OpenCV version++. 2014-09-02 11:54:54 +04:00
Alexander Karsakov
00575b346d Fixed range for 'v' channel for 8U images.
(cherry picked from commit b027eac173ed9bc610f08d12a05c90fde395a07e)
2014-09-02 11:41:08 +04:00
Grigory Serebryakov
25d125fba1 Documentation update: createsamples usage 2014-09-02 10:55:45 +04:00
Vladislav Vinogradov
7316676c41 fix CUDA LUT implementation
In CUDA 6.0 there was a bug in NPP LUT implementation (invalid results when
src == 255). In CUDA 6.5 the bug was fixed.

Replaced NPP LUT call with own implementation (ported from master branch)
to be independant from CUDA Toolkit version.
(cherry picked from commit eaaa2d27d5ab334c74c2d10550a6097f437fb297)
2014-09-02 08:34:42 +04:00
Grigory Serebryakov
d1229efeec No output image resize in case of PNG dataset 2014-09-01 13:02:27 +04:00
Vadim Pisarevsky
fd7a2defae Merge pull request #3178 from jimcamel:freak_sse_bugfix 2014-09-01 06:15:36 +00:00
Adrian Clark
fcc481e751 Fixed crash in SSE implementation of FREAK descriptor when number of pairs is set to something other than 512.
See http://code.opencv.org/issues/3889 for more details
2014-09-01 09:37:33 +12:00
Vadim Pisarevsky
1984aacb27 Merge pull request #3164 from jet47:fix-cuda-lut 2014-08-29 08:11:29 +00:00
Vladislav Vinogradov
eaaa2d27d5 fix CUDA LUT implementation
In CUDA 6.0 there was a bug in NPP LUT implementation (invalid results when
src == 255). In CUDA 6.5 the bug was fixed.

Replaced NPP LUT call with own implementation (ported from master branch) 
to be independant from CUDA Toolkit version.
2014-08-28 14:47:26 +04:00
Alexander Smorkalov
77585bf8af Several fixes for lintian varnings
(cherry picked from commit 634ffed488052efb5cab1fb5cdd90d192f0121a9)
2014-08-27 16:44:18 +04:00
Vladislav Vinogradov
c821cb1489 fix BGR->BGR5x5 color convertion
(cherry picked from commit 62f27b28edb6406b6cf8f2c16370187ce8c24e30)
2014-08-27 16:44:18 +04:00
Vladislav Vinogradov
86c1babd03 use downscaled frames in FGDStatModel test
(cherry picked from commit 599f5ef51bfb7a9e71a8c4e50a5f942fb2898cdb)
2014-08-27 16:44:18 +04:00
Vladislav Vinogradov
2205b2f5bc increase epsilon for ResizeSameAsHost test
(cherry picked from commit 86e12b607416644ec037ca8b34e4eebc6a585165)
2014-08-27 16:44:18 +04:00
Vladislav Vinogradov
975e40f1c0 increase epsilon for TVL1 sanity test
(cherry picked from commit 5dff283b39139008923eeb81d0ef5d351ac04522)
2014-08-27 16:44:18 +04:00
Grigory Serebryakov
74d8527f8a Naming fixes and code beautification 2014-08-27 12:41:18 +04:00
Grigory Serebryakov
57cf3d1766 Class naming update
Documentation improvement
Bug in output format for JPG set fixed
2014-08-26 10:02:50 +04:00
Grigory Serebryakov
f81b3101e8 Typo in string fixed 2014-08-25 18:46:23 +04:00
Grigory Serebryakov
81aefed13a Can create training set in PNG format
The format of the training set can be changed with the `-pngoutput` key.
Output image will be resized to a 640x480 size if greater.
2014-08-25 18:14:27 +04:00
Vadim Pisarevsky
41040e589f Merge pull request #3147 from asmorkalov:ocv_deb_lintian_fixes 2014-08-22 11:49:52 +00:00
Vadim Pisarevsky
6eb26c1519 Merge pull request #3109 from jet47:gpu-test-fixes 2014-08-22 07:22:23 +00:00
Vadim Pisarevsky
ad7a871708 Merge pull request #3143 from jet47:cuda-cvt-color-fix 2014-08-22 07:21:46 +00:00
Alexander Smorkalov
634ffed488 Several fixes for lintian varnings 2014-08-22 10:53:33 +04:00
Vladislav Vinogradov
ebe36d6e7c fix CUDA cvtColor after corresponding change in CPU version
see https://github.com/Itseez/opencv/pull/3137
2014-08-21 14:14:06 +04:00
Vadim Pisarevsky
d68e62c968 Merge pull request #3137 from akarsakov:fix_cvtcolor_luv_rgb 2014-08-21 05:39:18 +00:00
Alexander Karsakov
b027eac173 Fixed range for 'v' channel for 8U images. 2014-08-20 11:09:21 +04:00
Vadim Pisarevsky
2ed24876af Merge pull request #3120 from StevenPuttemans:fix_bug3863 2014-08-18 15:39:30 +00:00
Vadim Pisarevsky
b08a6ccd9d Merge pull request #3118 from akarsakov:fix_cvtcolor_perf 2014-08-18 12:45:35 +00:00
StevenPuttemans
d558260a8e fixing GT and GE comparison symbol 2014-08-18 13:33:40 +02:00
Alexander Karsakov
023a42ba55 Fixed getConversionInfo() for YUV2RGBA_* conversions 2014-08-18 13:01:19 +04:00
Vadim Pisarevsky
7409f21e9f Merge pull request #3108 from LeszekSwirski:fix-gemm-buf-allocate-2.4 2014-08-16 06:03:28 +00:00
Vladislav Vinogradov
62f27b28ed fix BGR->BGR5x5 color convertion 2014-08-15 14:10:15 +04:00
Vladislav Vinogradov
599f5ef51b use downscaled frames in FGDStatModel test 2014-08-15 13:42:25 +04:00
Vladislav Vinogradov
86e12b6074 increase epsilon for ResizeSameAsHost test 2014-08-15 13:42:06 +04:00
Vladislav Vinogradov
5dff283b39 increase epsilon for TVL1 sanity test 2014-08-15 13:41:47 +04:00
Leszek Swirski
341c3d5933 Fix reallocation of D buffer in gemm
Conflicts:
	modules/core/src/matmul.cpp
2014-08-15 09:57:46 +01:00
Alexander Smorkalov
628b23acc8 GCC 4.8 warning array subscript is above array bounds fixed.
(cherry picked from commit e11333dd831ef43f962e513e26f3dfa6dc789155)
2014-08-15 10:20:31 +04:00
Vadim Pisarevsky
988555a5d9 Merge pull request #3093 from asmorkalov:ocv_array_bound_fix 2014-08-13 14:08:51 +00:00
Alexander Smorkalov
e11333dd83 GCC 4.8 warning array subscript is above array bounds fixed. 2014-08-13 17:12:08 +04:00
Vadim Pisarevsky
af2434c547 Merge pull request #2827 from Alexander-Petrikov-ELVEES-NEOTEK:neon-stereobm 2014-08-13 13:04:02 +00:00
Vadim Pisarevsky
a4c883c098 Merge pull request #3076 from vpisarev:fix_small_filters 2014-08-11 16:10:15 +00:00
Aleksandr Petrikov
0a531815c5 fix bug 3733 for imgproc/filter.cpp 2014-08-11 16:00:21 +04:00
Vadim Pisarevsky
a15db2d9cf Merge pull request #3058 from PhilLab:patch-2 2014-08-11 11:10:17 +00:00
PhilLab
efc1c39315 Fixed self-assignment in cv::Ptr::operator =
A self-assignment leads to a call of release() with refcount being 2. In the release() method, refcount is decremented and then successfully checked for being 1. As a consequence, the underlying data is released. To prevent this, we test for a self-assignment
2014-08-08 17:39:12 +02:00
Vadim Pisarevsky
3334b1437b Merge pull request #3046 from StevenPuttemans:fix_Qt_locale 2014-08-07 06:40:38 +00:00
StevenPuttemans
34103ef1cb fixing setting the locale back to what should be expected
fix should be applyed for every window interface and generation
2014-08-05 16:20:08 +02:00
Vadim Pisarevsky
e7f348e720 Merge pull request #3026 from jet47:fix-gpu-resize-linear 2014-08-02 21:52:51 +00:00
Vladislav Vinogradov
da9be8231f fix cv::gpu::resize for INTER_LINEAR, now it produces the same result as CPU version 2014-08-01 11:33:29 +04:00
E Braun
ed2cdb71e5 fix for bug 3172 2014-08-01 07:47:59 +02:00
E Braun
bbe48eaac6 regression test for bug 3172 2014-08-01 00:17:17 +02:00
Alexander Alekhin
bab826a381 Merge pull request #3019 from alalek:ocl_fix_pyrUp_test 2014-07-30 13:02:45 +00:00
Alexander Smorkalov
77294855d7 Android native camera rebuilt after sources update. 2014-07-30 14:52:01 +04:00
Alexander Smorkalov
d8187f7518 Merge branch 'fix_androidcamera_preview_usage_bits' into 2.4 2014-07-30 14:35:00 +04:00
Alexander Alekhin
9e83463128 ocl: fix pyrUp perf test 2014-07-30 13:27:36 +04:00
Vadim Pisarevsky
e98c9a7ce3 Merge pull request #2968 from LeonidBeynenson:bugfix_crash_gpu_feature_matcher_in_stitcher 2014-07-29 13:48:19 +00:00
Vadim Pisarevsky
204651e0e2 Merge pull request #3014 from vpisarev:fix_python_tests 2014-07-29 11:54:36 +00:00
Vadim Pisarevsky
042892f0d7 hopefully fixed Python tests 2014-07-29 12:27:31 +04:00
Vadim Pisarevsky
7cefaa49dd Merge pull request #2816 from ehren:avcapturesession_leak 2014-07-25 13:18:06 +00:00
Vadim Pisarevsky
fc41e8850b Merge pull request #2836 from s98felix:2.4 2014-07-25 12:59:41 +00:00
Vadim Pisarevsky
38b3698b97 Merge pull request #2997 from mojoritty:bugfix_3767 2014-07-25 12:39:30 +00:00
Vadim Pisarevsky
c2746b5d2a Merge pull request #3001 from asmorkalov:cuda_6.5_support 2014-07-25 11:25:36 +00:00
Alexander Smorkalov
daff2a0674 More accurate deb package build fix for CUDA 6.5 and newer.
(cherry picked from commit b2790973a32eb662c165a921afe03dbfd2c65269)
(cherry picked from commit f8758da289c092fcce10baa4723d6388c4e41cb3)
2014-07-24 15:08:29 +04:00
Alexander Smorkalov
ad5c2de97c Deb package build fix for CUDA 6.5 and newer.
(cherry picked from commit e650d87e470b2e6a8f87ad4dd81977748a136aee)
(cherry picked from commit ca9c52ac9778d01eba933a786b4303c79d0162be)
2014-07-24 15:08:27 +04:00
Alexander Smorkalov
f8758da289 More accurate deb package build fix for CUDA 6.5 and newer.
(cherry picked from commit b2790973a32eb662c165a921afe03dbfd2c65269)
2014-07-24 15:06:38 +04:00
Alexander Smorkalov
ca9c52ac97 Deb package build fix for CUDA 6.5 and newer.
(cherry picked from commit e650d87e470b2e6a8f87ad4dd81977748a136aee)
2014-07-24 15:06:35 +04:00
Martijn Liem
9c285da329 Bugfix for bug #3767
Fixed a memory leak in cap_dshow.cpp in videoInput::setVideoSettingCamera(). The leak was caused by not releasing an IBaseFilter object created in a call to getDevice(). Tho object is now properly released.
2014-07-23 12:33:51 +02:00
Richard Yoo
de37cfc224 Enable Intel AVX/AVX2 compilation on Windows. 2014-07-21 13:26:50 -07:00
Vadim Pisarevsky
946c09f58c Merge pull request #2985 from StevenPuttemans:fix_3777_redo 2014-07-19 18:02:20 +00:00
StevenPuttemans
4e168ffdf3 fixing bug 3777 2014-07-18 12:49:56 +02:00
Vadim Pisarevsky
d7bbafd683 Merge pull request #2948 from PhilLab:patch-1 2014-07-18 10:10:44 +00:00
Vadim Pisarevsky
e90c233551 Merge pull request #2984 from cambyse:2.4 2014-07-18 10:05:22 +00:00
Vadim Pisarevsky
06897dbdb5 Merge pull request #2980 from akarsakov:revert_dft_dst_fix 2014-07-18 09:57:51 +00:00
Vadim Pisarevsky
39020fc9cf Merge pull request #2898 from PhilLab:2.4 2014-07-18 09:26:50 +00:00
PhilLab
d5489f3a68 Clarified DescriptorExtractor::compute 2014-07-18 10:57:54 +02:00
Camille
5a5a487612 bug fix 3381 2014-07-18 00:06:31 +02:00
Camille
46775ad186 bug fix 3381 2014-07-17 22:57:31 +02:00
Alexander Karsakov
901d9b70b0 Revert changes by PR#2930 since it breaks logic of inverse mode. 2014-07-17 15:11:06 +04:00
Vadim Pisarevsky
0b4e043442 Merge pull request #2970 from PhilLab:patch-3 2014-07-16 19:26:46 +00:00
unknown
d0c3c4c373 Function for drawing arrows 2014-07-15 14:12:16 +02:00
Vadim Pisarevsky
6c5dc17a1e Merge pull request #2909 from StevenPuttemans:bugfix_profileface_model 2014-07-15 09:47:52 +00:00
Vadim Pisarevsky
cf3757448d Merge pull request #2965 from soulslicer:patch-2 2014-07-15 09:44:32 +00:00
LeonidBeynenson
8578f9c565 Added a TODO comment about changes which should be done in GpuMatcher::match 2014-07-15 13:27:59 +04:00
Vadim Pisarevsky
c9c09262f7 Merge pull request #2966 from PhilLab:patch-2 2014-07-15 08:10:33 +00:00
Vadim Pisarevsky
faac7f18c7 Merge pull request #2967 from LeonidBeynenson:bugfix_wave_correction_wrong_result 2014-07-15 08:10:04 +00:00
Alexander Smorkalov
b2790973a3 More accurate deb package build fix for CUDA 6.5 and newer. 2014-07-14 23:58:05 +04:00
Vadim Pisarevsky
8d58b238ca Merge pull request #2780 from hbadino:Feature_3692_2.4 2014-07-14 19:00:52 +00:00
Vadim Pisarevsky
51bd56f19d Merge pull request #2959 from StevenPuttemans:add_notice_loaded_parameters 2014-07-14 18:47:13 +00:00
Vadim Pisarevsky
b111fb94b7 Merge pull request #2957 from cambyse:2.4 2014-07-14 18:42:49 +00:00
Vadim Pisarevsky
544dd8b130 Merge pull request #2971 from ruslo:docfix 2014-07-14 18:40:39 +00:00
Vadim Pisarevsky
246a793d82 Merge pull request #2972 from apavlenko:24_face_rec_sample 2014-07-14 18:35:37 +00:00
Alexander Smorkalov
e650d87e47 Deb package build fix for CUDA 6.5 and newer. 2014-07-14 21:27:23 +04:00
Alexander Smorkalov
feb74b125d Build fixes for CUDA 6.5
(cherry picked from commit 60a5ada4541e777bd2ad3fe0322180706351e58b)
2014-07-14 16:39:23 +04:00
Alexander Smorkalov
3c0b0b0f94 Build fixes for CUDA 6.5
(cherry picked from commit 60a5ada4541e777bd2ad3fe0322180706351e58b)
2014-07-14 16:37:50 +04:00
Roman Donchenko
d31a0eab9e Merge pull request #2815 from Aletheios:Bugfix#3705 2014-07-14 12:19:31 +00:00
Roman Donchenko
ccbc764c02 Merge pull request #2975 from asmorkalov:ocv_cuda_6.5_fix 2014-07-14 12:11:49 +00:00
Alexander Smorkalov
60a5ada454 Build fixes for CUDA 6.5 2014-07-14 14:26:50 +04:00
Roman Donchenko
d3c2b15f82 Merge pull request #2955 from SpecLad:find-libv4l2 2014-07-14 08:21:24 +00:00
Ruslan Baratov
b030d7e6a1 Doc: fix definition of macro CV_MAKETYPE
At least this is how it's defined in core/types_c.h
2014-07-12 19:35:22 +04:00
Andrey Pavlenko
64d8cf1e2e improving face-rec sample:
* CSV can contain dir-s and wildcards
* save trained model
2014-07-12 19:28:43 +04:00
Roman Donchenko
d262b04d99 Merge pull request #2903 from mmaraya:2.4 2014-07-11 14:15:59 +00:00
Leonid Beynenson
cce2d9927e Fixed bug which caused crash of GPU version of feature matcher in stitcher
The bug caused crash of GPU version of feature matcher in stitcher when
we use ORB features.
2014-07-11 16:37:30 +04:00
Leonid Beynenson
79878a57a9 Fixed bug in cv::detail::waveCorrect
The function makes wave correction of a stitched panorama.
Earlier it gave wrong results for panorama made from 1 frame.
2014-07-11 15:47:41 +04:00
StevenPuttemans
03fe86f0a3 added extra warning about the automatic parameter loading for traincascade application when the param.xml file already exists 2014-07-11 11:42:13 +02:00
PhilLab
13a0c14e6c Added publication reference 2014-07-11 09:22:55 +02:00
Raaj
6e022dcb06 Update facedetect.cpp
Somebody forgot to add curly brackets
2014-07-10 17:44:40 -07:00
Richard Yoo
c38023f4e7 Modifications to support dynamic vector dispatch. 2014-07-09 16:55:39 -07:00
Camille
cbb5fc0acc bug fix 3696 2014-07-09 22:35:56 +02:00
Alexander Alekhin
2df3abe16b Merge pull request #2954 from ilya-lavrenov:doc_fix 2014-07-09 14:57:46 +00:00
Ilya Lavrenov
ecec53f509 fixed docs 2014-07-09 17:48:28 +04:00
Roman Donchenko
023102c804 cap_libv4l.cpp depends on both libv4l 1 and 2, so search for both
How this worked before, I do not know.
2014-07-09 16:55:40 +04:00
unknown
52c05e75cc Fixed C++11 compatibility warning 2014-07-09 14:19:15 +02:00
Roman Donchenko
3d48994a72 Merge pull request #2883 from berak:b_3756_24 2014-07-09 07:49:47 +00:00
berak
7b160fa3cb added missing impl for multi-dim Mat::ones, Mat::zeros (issue #3756) 2014-07-08 18:04:56 +02:00
Roman Donchenko
71d3654832 Merge pull request #2558 from asmorkalov:ocv_matop_init_fix 2014-07-08 12:14:55 +00:00
PhilLab
2c29ee9e00 Added cast and removed formatting error 2014-07-08 13:24:35 +02:00
PhilLab
aafda43df1 Double precision for solvePnPRansac()
solvePnPRansac() and pnpTask() now accept object or image points with double precision.
2014-07-08 11:52:42 +02:00
Vadim Pisarevsky
39127d942e Merge pull request #2908 from mmaraya:bug_3737 2014-07-07 13:29:38 +00:00
Vadim Pisarevsky
b068e63618 Merge pull request #2930 from akarsakov:dft_dst_size_fix 2014-07-07 11:21:12 +00:00
Alexander Karsakov
4b8fb6c246 Fixed dst size 2014-07-03 15:17:51 +04:00
StevenPuttemans
939c60bcaa fixed two models, adding xml identifier to correct position 2014-07-01 10:27:36 +02:00
Mike Maraya
7936faf9a3 Fixes build failure on Mac OS X 10.10 Yosemite Beta due to highgui/src/window_cocoa.mm (Bug #3737) 2014-06-27 08:34:40 -04:00
Mike Maraya
5c85f816c9 Revert "Fixes build failure on Mac OS X 10.10 Yosemite Beta due to highgui/src/window_cocoa.mm (Bug #3737)"
This reverts commit 56683e6d112a808fbd51c74917f0c4d9d752f502.
2014-06-27 08:20:22 -04:00
Mike Maraya
56683e6d11 Fixes build failure on Mac OS X 10.10 Yosemite Beta due to highgui/src/window_cocoa.mm (Bug #3737) 2014-06-27 08:02:01 -04:00
Mike Maraya
fbac578c79 Fixes resizeWindow() on OS X (Bug #3200) 2014-06-27 23:26:09 -04:00
unknown
ade46bd428 Fixed typos in comments 2014-06-26 16:29:45 +02:00
Alexander Petrikov
6882970248 Add CV_Assert (ndisp % 8 == 0) to NEON version 2014-06-23 11:08:51 +04:00
Richard Yoo
11a09ef5cc Changes to support Intel AVX/AVX2 in cvResize(). 2014-06-06 15:39:09 -07:00
Aleksandr Petrikov
1a1cd9b4e9 add NEON realization for StereoBM(findCorrespondence, prefilterXSobel) 2014-06-04 12:06:33 +04:00
Ehren Metcalfe
cd3aa0184a Fix resource leak with iOS camera due to failure to remove AVCaptureSession input/outputs on stop (Bug #3389) 2014-05-31 19:41:16 -04:00
aletheios
1020a93fa3 Bugfix #3705: params.setRecordingHint(true) breaks camera preview on Samsung Galaxy S2 2014-05-31 18:44:32 +02:00
Hernan Badino
8a3b93773d Merge branch 'Itseez-2.4' into Feature_3692_2.4 2014-05-20 09:28:11 -04:00
Hernan Badino
bcd63766ce Merge branch '2.4' of https://github.com/Itseez/opencv into Itseez-2.4 2014-05-20 09:27:59 -04:00
Hernan Badino
ca40d635e4 Switched insertion of connected components in filterSpecklesImpl 2014-05-19 10:12:07 -04:00
Vladislav Vinogradov
942401de16 fix output matrix allocation in cv::subtract(cherry picked from commit 629461c83652e2416ccb6c8685a0788bb6fb15f5) 2014-05-07 20:16:27 +04:00
Vladislav Vinogradov
f9ff9c5618 fix cv::subtract function:
call dst.create(...) before using it(cherry picked from commit 4c66614e07319b66537b6327e2dcf871c5aa6829)
2014-05-07 16:54:20 +04:00
Jüri Aedla
6fb83f869c Android camera qcom HAL doesn't like it when no consumer usage bits are set. Set a usage bit for preview BufferQueue. 2014-05-01 16:03:39 +03:00
Alexander Smorkalov
0c30b18769 Bug #3611 Initializing static cv::Mat with cv::Mat::zeros causes segmentation fault fixed. 2014-04-01 18:00:44 -07:00
Vladislav Vinogradov
b4845d8c9f temporary disable performance test for alphaComp function(cherry picked from commit 1ce5165cb7ccabdd0280970e3f1b6bc180055a3d) 2014-02-14 17:12:31 +04:00
Alexander Smorkalov
ea51396731 Dead code removed as this cannot be null in Java.
(cherry picked from commit dbe7634286d405161adb30677aa4d07cc17e0de2)
2014-02-13 20:13:47 +04:00
Vladislav Vinogradov
aa82f921cc temporary disable perf test for StereoBeliefPropagation(cherry picked from commit eb247d826f04673a23e4d050ee5cf0395bde82c2) 2014-02-13 20:13:38 +04:00
Vladislav Vinogradov
2da7eae2c4 increase epsilon for AlphaComp sanity test for integer input(cherry picked from commit 9e69e2a07a9798d75a0949ab2b4ad063dd84e8f2) 2014-02-13 20:13:27 +04:00
Alexander Smorkalov
25159d8e81 Application pause/resume fix for Android sample NativeActivity.
(cherry picked from commit 7da3e98dfd1539c027b26fd67f9225e93af8d144)
2014-02-13 17:59:23 +04:00
Alexander Smorkalov
f40ffe4763 LICENSE and README files installation rules added.
(cherry picked from commit e55f2b26028a5261806fb8e972b6165c40593357)
2014-02-12 19:36:52 +04:00
Alexander Smorkalov
116311b7b4 opencv_run_all_tests.sh implemented for Android SDK.
(cherry picked from commit d02c2911607b199e18988c29c3fb9df141555974)
2014-02-12 19:36:43 +04:00
Alexander Smorkalov
f1ef3a4865 OpenCV version++. 2014-02-11 10:15:02 +04:00
Vladislav Vinogradov
9997aa8187 decrease input size for several gpu tests to fix "timed out" error:
* BruteForceNonLocalMeans
* OpticalFlowBM(cherry picked from commit 8b44a42a403548c244aaea6852fb09935a0741e9)
2014-02-10 15:48:52 +04:00
Vladislav Vinogradov
f15b42018c fix nonfree module compilation without CUDA(cherry picked from commit 3e1f74f2cafc5c38d0e64928149edb87d9b28d28) 2014-02-10 15:48:52 +04:00
Alexander Smorkalov
f9e9ae85bd dynamicuda module disabled in OpenCv.mk for all arches except armeabi-v7a.
(cherry picked from commit b10d4b05ed3eb9947bcb3dd183da69e44be5e30a)
2014-02-10 15:48:52 +04:00
Alexander Smorkalov
a49beb7c73 Multiple improvements in OpenCV examples build.
EMBED_CUDA and FORCE_EMBED_OPENCV flags added to cmake macro add_android_project;
INSTALL_CUDA_LIBRARIES option added to OpenCV.mk
opencv_dynamicuda library installation with enabled OPENCV_INSTALL_MODULES flag fixed;
CUDA initialization apportunity added to OpenCVLoader.initDebug();
Tutorial-4-CUDA sample reimplemented with static OpenCV and CUDA initialization.
(cherry picked from commit 6ae4a9b09bf4b3572b2d31136528f1faa809a065)
2014-02-10 15:48:52 +04:00
Alexander Smorkalov
51dff5b9e8 project.properties file generation fixed for per-component installation.
(cherry picked from commit 65b4d779597ffdfe909cb01f6163b1c404b040c2)
2014-02-10 15:48:52 +04:00
Alexander Smorkalov
826fc00374 Tests install path fix for Android SDK.
(cherry picked from commit 0cd0e4749bd74c2050b3e3cf082ced6bdc489376)
2014-02-10 15:48:52 +04:00
Vladislav Vinogradov
c10692deff save previous values of LOCAL_* variables and restore them at the end(cherry picked from commit 286fe261d07a7faf481ac907c6f09b3fece4aa64) 2014-02-10 15:48:52 +04:00
Vladislav Vinogradov
daa7b9ce5f fix path to CUDA libraries (use targets/armv7-linux-androideabi/lib)(cherry picked from commit a098fb1803a6bd4d6ebe58c4a1dd0f2dfea464ab) 2014-02-10 15:48:52 +04:00
Vladislav Vinogradov
1ab02631b0 update stitching sample
(cherry picked from commit 214cbabc4073c17413c2982ce06266e777e73654)
2014-02-10 15:48:52 +04:00
Vladislav Vinogradov
3e755b2290 turn on CUDA part of stitching module on Android for non-dynamic build(cherry picked from commit a138e5a6a585e9dfc686d76b9769adeff02672b3) 2014-02-10 15:48:51 +04:00
Vladislav Vinogradov
f15a167df4 turn on CUDA part of nonfree module on Android for non-dynamic build(cherry picked from commit d8f7377122a65512db2f443535a9d01ea336470c) 2014-02-10 15:48:51 +04:00
Ilya Lavrenov
f6367a2ea5 eliminated possible memory leak
(cherry picked from commit e7e63fac6c3eaa65a8eb0926c7c9557f0614ab03)
2014-02-10 15:48:51 +04:00
Vladislav Vinogradov
5f88e2b496 fix #3477:
CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING property is not supported
by all VideoCapture backends. Some backends can return 0.0 or -1.0.(cherry picked from commit c41e8006c7e9a3e796b5f78d3bfc5a97a9e87c4c)
2014-02-10 15:48:51 +04:00
Seunghoon Park
2c7cf52e3b fixing bug #3345. use norm to make sure two matrices are the same.
(cherry picked from commit eb9d7c4dd54eea87950d98b843b349db7a95c951)
2014-02-10 15:48:51 +04:00
Andrey Pavlenko
b7c5083a87 removing duplicated legacy license, the actual instance is in 'opencv/LICENSE'
(cherry picked from commit dca56841459dadfa01ac74eb1ac01cd7e05d8522)
2014-02-10 15:48:51 +04:00
Vladislav Vinogradov
d5d88efd5d fix GpuMat::copyTo method with mask:
fill destination matrix with zeros if it was reallocated(cherry picked from commit dda999545c9dd1cca56081a4b2d56755210b840a)
2014-02-10 15:48:51 +04:00
Drew Jetter
6cb7a7be18 Fixed bug #3489: The code assumed that two global variables would be constructed in a particular order, but global variable initialization order is compiler-dependent.
(cherry picked from commit 6bf599b1bca8a58c7a656ddc169f7be0fc3094c6)
2014-02-10 15:48:51 +04:00
Pierre-Emmanuel Viel
cdea6b532f Fix: freeing previous elements has to be done before loading new parameters to avoid trying to delete unexisting objects if arrays size was modified
(cherry picked from commit 3f458c6eb114bd46ce7f08b8ca471822ea16d26e)
2014-02-10 15:48:51 +04:00
ComFreek
d01e3529a6 Corrected package name in tutorial
See also #2101(cherry picked from commit ae795e5797ba3b85812d56edc7fe497d05cc2d77)
2014-02-10 15:48:51 +04:00
Nghia Ho
7c13d3277c Fixed a valgrind 'Conditional jump or move depends on uninitialised value(s)' on cv::kmeans(...). The original code used points(sampleCount, 1, CV_32FC2), which confused generateCentersPP into thinking it is a 1 dimensional center, instead of 2. As a result it would set only the x variable and leave y unitialised.
(cherry picked from commit 601b7d1dd3a3ec9e8af5df461d43632d98ed3a7a)
2014-02-10 15:48:51 +04:00
Robbert Klarenbeek
345b3b0bdd Fix algorithm setter argument validation for uchar(cherry picked from commit e21c6e19db0183e40d12b6634aec2d1923496336) 2014-02-10 15:48:51 +04:00
Kazuki Matsuda
a65d7d4dd3 Fix typo of SparseMat_<_Tp>::SparseMat_(const SparseMat& m)
Fix compilation erros when compiling this constructor.
First argument type of "convertTo" should be instance, not a pointer of instance.

First pull request was created for master branch.
But it should be marged for 2.4.
https://github.com/Itseez/opencv/pull/2113
(cherry picked from commit 2ae20c74a2661d5975529211f4c95206e8558243)
2014-02-10 15:48:51 +04:00
Ilya Lavrenov
5e986f3347 fixed bug #3319
(cherry picked from commit 4f9c081dc313f8fdfee3f0a4572779ae13e27e40)
2014-02-10 15:48:50 +04:00
Seunghoon Park
27a8bb471b fixing bug #3345. don't use BORDER_ISOLATED alone. it should be combined with some border type
(cherry picked from commit 2272a5876972f74684c43f2069c3046bd2888d01)
2014-02-10 15:48:50 +04:00
Seunghoon Park
7868733002 fixing bug #3345
(cherry picked from commit b036fc756a65c8be5b9b0e4d77d94b6f8099fc20)
2014-02-10 15:48:50 +04:00
Ilya Lavrenov
469aef2e5e fixed bug #3341
(cherry picked from commit 09d25e11c65fa20f9ddba1d25ee4f3344ba4e655)
2014-02-10 15:48:50 +04:00
Roman Donchenko
5e00fc6afe Fixed MinGW build by declaring the minimal required Windows version.
Also deleted miscellaneous remaining multimon cruft.
Deleted #include <winuser.h>, because <windows.h> includes it
already.

This should have a nice side effect of preventing us from
accidentally using any Windows API that's too new.
(cherry picked from commit 795c108f2bf2880a81a8d0db1ddc2da71c91864e)
2014-02-10 15:48:50 +04:00
Vladislav Vinogradov
5170f0b5da fixed several bugs in CUDA Canny implementation:
* out of border access in edgesHysteresisLocalKernel
* incorrect usage of atomicAdd(cherry picked from commit 5dbdadb769e97f47b64655b5b3144787c57e2740)
2014-02-07 20:59:13 +04:00
Vladislav Vinogradov
dc2dbb4173 Revert "disable gpu Canny and HoughCircles perf tests:"
This reverts commit dbce90692acd84fbf46bde4da4b1726049f42857.
(cherry picked from commit bfc27271e2543bb0807f6dc000f770993a740581)
2014-02-07 20:58:49 +04:00
Vladislav Vinogradov
79e4f7eb78 Revert "disable CUDA generalized Hough Transform"
This reverts commit 33d42b740c6fe938b63a0b25c9ad51741aba48c3.
(cherry picked from commit 5d099df57864d083881f026ffe32637afac6ba2e)
2014-02-07 18:24:57 +04:00
Vladislav Vinogradov
cc73c7000f fix epsilons for several gpu tests
(cherry picked from commit 3e4bb371c8a364315dec18df14674d9164b7523d)
2014-02-07 18:24:44 +04:00
Vladislav Vinogradov
8bb26fa5de Revert "disable gpu CvtColor.*2HSV tests:"
This reverts commit 952027a8536215a5e4308c79a59308c6b3426354.
(cherry picked from commit b6ba1f226c3da6ba726416f92550410145e89c10)
2014-02-07 18:24:35 +04:00
Vladislav Vinogradov
48612d7c58 Revert "disable gpu Subtract_Array test:"
This reverts commit e91bf95d5832e87aa70240c50f0bf7fcc587e8c8.
(cherry picked from commit da44a2fac1c0be45d2a987c165298a9629757723)
2014-02-07 18:24:23 +04:00
Alexander Smorkalov
8ba84f4b47 Implicit testdata directory permissions setup added.
(cherry picked from commit b86088b89c43ba1b7db2d8435f222489722e62c9)
2014-02-07 18:24:11 +04:00
Alexander Smorkalov
bc653add74 Absolute path to tests in opencv_run_app_tests.sh fixed.
(cherry picked from commit 530702c5f2350c58f0e9078b5fde8185af6a3c77)
2014-02-06 17:16:21 +04:00
Alexander Smorkalov
215f78eee2 Merge branch 'android_manager_version_inc4' into 2.4.8.1-prep 2014-01-31 22:25:36 +04:00
Vladislav Vinogradov
4425dac7f4 disable gpu CvtColor.*2HSV tests:
possible bug in CPU version(cherry picked from commit 3cb8b352e52f85847d98d2b0ece32ba5bdb5c31b)
2014-01-31 22:24:20 +04:00
Vladislav Vinogradov
4f79b9de48 disable gpu Subtract_Array test:
possible bug in CPU version(cherry picked from commit 59155c1eefb6f22e362e34a8d73b31841eb3413a)
2014-01-31 22:23:55 +04:00
Vladislav Vinogradov
397ac5e68f disable gpu Canny and HoughCircles perf tests:
it fails because driver terminates CUDA kernels after time out
(cherry picked from commit fa5bbb5f8dc1a86cfe004fb258d66e56c90560d6)
2014-01-31 22:23:39 +04:00
Vladislav Vinogradov
43c75c64b5 disable NPP for GpuMat methods and for copyMakeBorder(cherry picked from commit 316d49fc0fb7a609ebb0a65efc207faea6b978a4) 2014-01-31 22:23:22 +04:00
Vladislav Vinogradov
c319625a07 disable some gpu tests if library was built without CUFFT(cherry picked from commit b4b929d27cc25822dd15b5b96b8d335c59d4408c) 2014-01-31 22:23:05 +04:00
Vladislav Vinogradov
a7d0448faa gpu test output files moved from cwd to temp folder(cherry picked from commit 49731ad5303a714302ff053aaeb32900845304bf) 2014-01-31 22:22:49 +04:00
Alexander Smorkalov
ca10e5e8ae Highgui test output fixes.
Useless output to console fixed;
Test output files moved from cwd to temp folder.
(cherry picked from commit 87935f35600228a746d8a29cb1a5c108e710429d)
2014-01-31 22:22:33 +04:00
Vladislav Vinogradov
32414afe72 disable performance test for gpu generalized hough(cherry picked from commit 063d8b421136b2ed0f537c663b89828f6a2b263c) 2014-01-31 22:22:14 +04:00
Alexander Smorkalov
ed10f50d25 Reports path fix for opencv_run_all_tests.sh.in script.
(cherry picked from commit 3d261e8a010eda45908592d3b2caa76d939d342c)
2014-01-31 22:21:57 +04:00
Alexander Smorkalov
48d9be70d5 Android toolchain file sync with original project.
Original project: https://github.com/taka-no-me/android-cmake/
Revision: 5db45cfb87fec180b74963d3680dd60d4d8d8c3a
(cherry picked from commit c8150436073a4c25ec4f4273b80c1b76201b8be1)
2014-01-31 22:21:34 +04:00
Alexander Smorkalov
c6b31481b6 OpenCV Manager version++. 2014-01-31 12:15:22 +04:00
Alexander Smorkalov
514b714cc2 opencv_run_all_tests.sh script added to -tests package.
(cherry picked from commit d45350a06a287a8ab8a812659d5afea898ffe95a)
2014-01-29 17:41:59 +04:00
Alexander Smorkalov
7fec87d3f6 Multiple fixes for tests deb package build.
Added opencv_testing.sh.in file;
opencv_testing.sh installation guarded by OS check.
(cherry picked from commit d9dc5ffa918639e5d8be76644aef4385def13688)
2014-01-28 17:56:22 +04:00
Alexander Smorkalov
00d555f051 Code review notes fixed.
Env setup for testing package implemented using /etc/profile.d;
Variable with path for all native samples added;
Path for test binaries and test data updated.
(cherry picked from commit 39201e68e2649955f40936a1d07f2d1c64c560f5)
2014-01-27 21:37:01 +04:00
Alexander Smorkalov
6cf7d6ef4e OpenCV C/C++/OCL/CUDA samples install path fixed. Install rools for tests added.
(cherry picked from commit f332cba14b2a86017e1d2081130db110c2048c00)
2014-01-27 21:36:43 +04:00
Alexander Smorkalov
3ebdcafdd3 All installed files marked with component names for install customization.
(cherry picked from commit b75cbfde45c00fc956f033d0af7fe6d63312fd33)

Conflicts:

	cmake/OpenCVModule.cmake
2014-01-24 17:13:22 +04:00
Alexander Smorkalov
a348f3eeaa OpenCV version++ 2014-01-24 14:49:56 +04:00
Alexander Smorkalov
33f423de04 Improvements in package build.
(cherry picked from commit 086792ec06ff78a45fdd5e1b2fa7f72fe3b7c9a2)
2014-01-24 14:48:51 +04:00
Alexander Smorkalov
d6ba52c3f9 Initial Linux packages build rools for CPack.
(cherry picked from commit 7821fe2bde331c6b1abd612315ca9fc59da58619)

Conflicts:

	cmake/OpenCVModule.cmake
2014-01-24 14:48:19 +04:00
Vladislav Vinogradov
e9638d0997 disable CUDA generalized Hough Transform
(cherry picked from commit 33d42b740c6fe938b63a0b25c9ad51741aba48c3)
2014-01-24 14:46:36 +04:00
Vladislav Vinogradov
5cb0084547 split CUDA Hough sources
(cherry picked from commit d84738769422aad33038d90681c47486e47a0380)
2014-01-24 14:46:16 +04:00
2892 changed files with 716103 additions and 199967 deletions

30
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,30 @@
<!--
If you have a question rather than reporting a bug please go to http://answers.opencv.org where you get much faster responses.
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).
This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
-->
##### System information (version)
<!-- Example
- OpenCV => 3.1
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2015
-->
- OpenCV => :grey_question:
- Operating System / Platform => :grey_question:
- Compiler => :grey_question:
##### Detailed description
<!-- your description -->
##### Steps to reproduce
<!-- to add code example fence it with triple backticks and optional file extension
```.cpp
// C++ code example
```
or attach as .txt or .zip file
-->

9
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,9 @@
<!-- Please use this line to close one or multiple issues when this pullrequest gets merged
You can add another line right under the first one:
resolves #1234
resolves #1235
-->
### This pullrequest changes
<!-- Please describe what your pullrequest is changing -->

15
.gitignore vendored
View File

@ -8,3 +8,18 @@
Thumbs.db
tags
tegra/
bin/
*.sdf
*.opensdf
*.obj
*.stamp
*.depend
*.rule
*.tmp
*/debug
*/CMakeFiles
CMakeCache.txt
*.suo
*.log
*.tlog
build

8
3rdparty/carotene/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# Gedit temp files
*~
# Qt Creator file
*.user
# MacOS-specific (Desktop Services Store)
.DS_Store

42
3rdparty/carotene/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,42 @@
cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR)
project(Carotene)
set(CAROTENE_NS "carotene" CACHE STRING "Namespace for Carotene definitions")
set(CAROTENE_INCLUDE_DIR include)
set(CAROTENE_SOURCE_DIR src)
file(GLOB_RECURSE carotene_headers RELATIVE "${CMAKE_CURRENT_LIST_DIR}" "${CAROTENE_INCLUDE_DIR}/*.hpp")
file(GLOB_RECURSE carotene_sources RELATIVE "${CMAKE_CURRENT_LIST_DIR}" "${CAROTENE_SOURCE_DIR}/*.cpp"
"${CAROTENE_SOURCE_DIR}/*.hpp")
include_directories(${CAROTENE_INCLUDE_DIR})
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_CXX_FLAGS "-fvisibility=hidden ${CMAKE_CXX_FLAGS}")
# allow more inlines - these parameters improve performance for:
# - matchTemplate about 5-10%
# - goodFeaturesToTrack 10-20%
# - cornerHarris 30% for some cases
set_source_files_properties(${carotene_sources} COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
endif()
add_library(carotene_objs OBJECT
${carotene_headers}
${carotene_sources}
)
if(NOT CAROTENE_NS STREQUAL "carotene")
target_compile_definitions(carotene_objs PUBLIC "-DCAROTENE_NS=${CAROTENE_NS}")
endif()
if(WITH_NEON)
target_compile_definitions(carotene_objs PRIVATE "-DWITH_NEON")
endif()
set_target_properties(carotene_objs PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
add_library(carotene STATIC EXCLUDE_FROM_ALL "$<TARGET_OBJECTS:carotene_objs>")

2
3rdparty/carotene/README.md vendored Normal file
View File

@ -0,0 +1,2 @@
This is Carotene, a low-level library containing optimized CPU routines
that are useful for computer vision algorithms.

112
3rdparty/carotene/hal/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,112 @@
cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(TEGRA_HAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(CAROTENE_DIR "${TEGRA_HAL_DIR}/../")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm.*|ARM.*)")
set(ARM TRUE)
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64.*|AARCH64.*")
set(AARCH64 TRUE)
endif()
set(TEGRA_COMPILER_FLAGS "")
if(CMAKE_COMPILER_IS_GNUCXX)
# Generate unwind information even for functions that can't throw/propagate exceptions.
# This lets debuggers and such get non-broken backtraces for such functions, even without debugging symbols.
list(APPEND TEGRA_COMPILER_FLAGS -funwind-tables)
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
if(X86 OR ARMEABI_V6 OR (MIPS AND ANDROID_COMPILER_VERSION VERSION_LESS "4.6"))
list(APPEND TEGRA_COMPILER_FLAGS -fweb -fwrapv -frename-registers -fsched-stalled-insns-dep=100 -fsched-stalled-insns=2)
else()
list(APPEND TEGRA_COMPILER_FLAGS -fweb -fwrapv -frename-registers -fsched2-use-superblocks -fsched2-use-traces
-fsched-stalled-insns-dep=100 -fsched-stalled-insns=2)
endif()
if((ANDROID_COMPILER_IS_CLANG OR NOT ANDROID_COMPILER_VERSION VERSION_LESS "4.7") AND ANDROID_NDK_RELEASE STRGREATER "r8d" )
list(APPEND TEGRA_COMPILER_FLAGS -fgraphite -fgraphite-identity -floop-block -floop-flatten -floop-interchange
-floop-strip-mine -floop-parallelize-all -ftree-loop-linear)
endif()
endif()
string(REPLACE ";" " " TEGRA_COMPILER_FLAGS "${TEGRA_COMPILER_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TEGRA_COMPILER_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TEGRA_COMPILER_FLAGS}")
if(ARMEABI_V7A)
if (CMAKE_COMPILER_IS_GNUCXX)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vectorize" )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-tree-vectorize" )
endif()
endif()
if(WITH_LOGS)
add_definitions(-DHAVE_LOGS)
endif()
set(CAROTENE_NS "carotene_o4t" CACHE STRING "" FORCE)
function(compile_carotene)
if(ENABLE_NEON)
set(WITH_NEON ON)
endif()
add_subdirectory("${CAROTENE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/carotene")
if(ARM OR AARCH64)
if(CMAKE_BUILD_TYPE)
set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
endif()
check_cxx_compiler_flag("-mfpu=neon" CXX_HAS_MFPU_NEON)
check_c_compiler_flag("-mfpu=neon" C_HAS_MFPU_NEON)
if(${CXX_HAS_MFPU_NEON} AND ${C_HAS_MFPU_NEON})
get_target_property(old_flags "carotene_objs" COMPILE_FLAGS)
if(old_flags)
set_target_properties("carotene_objs" PROPERTIES COMPILE_FLAGS "${old_flags} -mfpu=neon")
else()
set_target_properties("carotene_objs" PROPERTIES COMPILE_FLAGS "-mfpu=neon")
endif()
endif()
endif()
endfunction()
compile_carotene()
include_directories("${CAROTENE_DIR}/include")
get_target_property(carotene_defs carotene_objs INTERFACE_COMPILE_DEFINITIONS)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${carotene_defs})
if (CMAKE_COMPILER_IS_GNUCXX)
# allow more inlines - these parameters improve performance for:
# matchTemplate about 5-10%
# goodFeaturesToTrack 10-20%
# cornerHarris 30% for some cases
set_source_files_properties(impl.cpp $<TARGET_OBJECTS:carotene_objs> COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
# set_source_files_properties(impl.cpp $<TARGET_OBJECTS:carotene_objs> COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
endif()
add_library(tegra_hal STATIC $<TARGET_OBJECTS:carotene_objs>)
set_target_properties(tegra_hal PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
set_target_properties(tegra_hal PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH})
set(OPENCV_SRC_DIR "${CMAKE_SOURCE_DIR}")
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(tegra_hal EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
endif()
target_include_directories(tegra_hal PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${OPENCV_SRC_DIR}/modules/core/include)
set(CAROTENE_HAL_VERSION "0.0.1" PARENT_SCOPE)
set(CAROTENE_HAL_LIBRARIES "tegra_hal" PARENT_SCOPE)
set(CAROTENE_HAL_HEADERS "carotene/tegra_hal.hpp" PARENT_SCOPE)
set(CAROTENE_HAL_INCLUDE_DIRS "${CMAKE_BINARY_DIR}" PARENT_SCOPE)
configure_file("tegra_hal.hpp" "${CMAKE_BINARY_DIR}/carotene/tegra_hal.hpp" COPYONLY)
configure_file("${CAROTENE_DIR}/include/carotene/definitions.hpp" "${CMAKE_BINARY_DIR}/carotene/definitions.hpp" COPYONLY)
configure_file("${CAROTENE_DIR}/include/carotene/functions.hpp" "${CMAKE_BINARY_DIR}/carotene/functions.hpp" COPYONLY)
configure_file("${CAROTENE_DIR}/include/carotene/types.hpp" "${CMAKE_BINARY_DIR}/carotene/types.hpp" COPYONLY)

1851
3rdparty/carotene/hal/tegra_hal.hpp vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,47 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#ifndef CAROTENE_DEFINITIONS_HPP
#define CAROTENE_DEFINITIONS_HPP
#ifndef CAROTENE_NS
#define CAROTENE_NS carotene
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,125 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#ifndef CAROTENE_TYPES_HPP
#define CAROTENE_TYPES_HPP
#include <carotene/definitions.hpp>
#include <stdint.h>
#include <cstddef>
#ifndef UINT32_MAX
#define UINT32_MAX (4294967295U)
#endif
namespace CAROTENE_NS {
using std::size_t;
using std::ptrdiff_t;
typedef int8_t s8;
typedef uint8_t u8;
typedef int16_t s16;
typedef uint16_t u16;
typedef int32_t s32;
typedef uint32_t u32;
typedef float f32;
typedef int64_t s64;
typedef uint64_t u64;
typedef double f64;
typedef ptrdiff_t stride_t;
enum CONVERT_POLICY
{
CONVERT_POLICY_WRAP,
CONVERT_POLICY_SATURATE
};
enum BORDER_MODE
{
BORDER_MODE_UNDEFINED,
BORDER_MODE_CONSTANT,
BORDER_MODE_REPLICATE,
BORDER_MODE_REFLECT,
BORDER_MODE_REFLECT101,
BORDER_MODE_WRAP
};
enum FLIP_MODE
{
FLIP_HORIZONTAL_MODE = 1,
FLIP_VERTICAL_MODE = 2,
FLIP_BOTH_MODE = FLIP_HORIZONTAL_MODE | FLIP_VERTICAL_MODE
};
enum COLOR_SPACE
{
COLOR_SPACE_BT601,
COLOR_SPACE_BT709
};
struct Size2D {
Size2D() : width(0), height(0) {}
Size2D(size_t width_, size_t height_) : width(width_), height(height_) {}
size_t width;
size_t height;
inline size_t total() const
{
return width * height;
}
};
struct Margin {
Margin() : left(0), right(0), top(0), bottom(0) {}
Margin(size_t left_, size_t right_, size_t top_, size_t bottom_)
: left(left_), right(right_), top(top_), bottom(bottom_) {}
// these are measured in elements
size_t left, right, top, bottom;
};
struct KeypointStore {
virtual void push(f32 kpX, f32 kpY, f32 kpSize, f32 kpAngle=-1, f32 kpResponse=0, s32 kpOctave=0, s32 kpClass_id=-1) = 0;
virtual ~KeypointStore() {};
};
}
#endif

241
3rdparty/carotene/src/absdiff.cpp vendored Normal file
View File

@ -0,0 +1,241 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include <algorithm>
#include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
template <typename T>
struct AbsDiff
{
typedef T type;
void operator() (const typename internal::VecTraits<T>::vec128 & v_src0,
const typename internal::VecTraits<T>::vec128 & v_src1,
typename internal::VecTraits<T>::vec128 & v_dst) const
{
v_dst = internal::vabdq(v_src0, v_src1);
}
void operator() (const typename internal::VecTraits<T>::vec64 & v_src0,
const typename internal::VecTraits<T>::vec64 & v_src1,
typename internal::VecTraits<T>::vec64 & v_dst) const
{
v_dst = internal::vabd(v_src0, v_src1);
}
void operator() (const T * src0, const T * src1, T * dst) const
{
dst[0] = src0[0] >= src1[0] ? src0[0] - src1[0] : src1[0] - src0[0];
}
};
template <typename T>
struct AbsDiffSigned
{
typedef T type;
void operator() (const typename internal::VecTraits<T>::vec128 & v_src0,
const typename internal::VecTraits<T>::vec128 & v_src1,
typename internal::VecTraits<T>::vec128 & v_dst) const
{
typename internal::VecTraits<T>::vec128 v_min = internal::vminq(v_src0, v_src1);
typename internal::VecTraits<T>::vec128 v_max = internal::vmaxq(v_src0, v_src1);
v_dst = internal::vqsubq(v_max, v_min);
}
void operator() (const typename internal::VecTraits<T>::vec64 & v_src0,
const typename internal::VecTraits<T>::vec64 & v_src1,
typename internal::VecTraits<T>::vec64 & v_dst) const
{
typename internal::VecTraits<T>::vec64 v_min = internal::vmin(v_src0, v_src1);
typename internal::VecTraits<T>::vec64 v_max = internal::vmax(v_src0, v_src1);
v_dst = internal::vqsub(v_max, v_min);
}
void operator() (const T * src0, const T * src1, T * dst) const
{
dst[0] = internal::saturate_cast<T>(src0[0] >= src1[0] ? (s64)src0[0] - src1[0] : (s64)src1[0] - src0[0]);
}
};
} // namespace
#endif
void absDiff(const Size2D &size,
const u8 *src0Base, ptrdiff_t src0Stride,
const u8 *src1Base, ptrdiff_t src1Stride,
u8 *dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride, AbsDiff<u8>());
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
#endif
}
void absDiff(const Size2D &size,
const u16 *src0Base, ptrdiff_t src0Stride,
const u16 *src1Base, ptrdiff_t src1Stride,
u16 *dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride, AbsDiff<u16>());
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
#endif
}
void absDiff(const Size2D &size,
const s8 *src0Base, ptrdiff_t src0Stride,
const s8 *src1Base, ptrdiff_t src1Stride,
s8 *dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride, AbsDiffSigned<s8>());
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
#endif
}
void absDiff(const Size2D &size,
const s16 *src0Base, ptrdiff_t src0Stride,
const s16 *src1Base, ptrdiff_t src1Stride,
s16 *dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride, AbsDiffSigned<s16>());
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
#endif
}
void absDiff(const Size2D &size,
const s32 *src0Base, ptrdiff_t src0Stride,
const s32 *src1Base, ptrdiff_t src1Stride,
s32 *dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride, AbsDiffSigned<s32>());
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
#endif
}
void absDiff(const Size2D &size,
const f32 * src0Base, ptrdiff_t src0Stride,
const f32 * src1Base, ptrdiff_t src1Stride,
f32 * dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride, AbsDiff<f32>());
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
#endif
}
} // namespace CAROTENE_NS

408
3rdparty/carotene/src/accumulate.cpp vendored Normal file
View File

@ -0,0 +1,408 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include "vtransform.hpp"
#include <cstring>
namespace CAROTENE_NS {
void accumulate(const Size2D &size,
const u8 *srcBase, ptrdiff_t srcStride,
s16 *dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0; i < size.height; ++i)
{
const u8* src = internal::getRowPtr(srcBase, srcStride, i);
s16* dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
for (; j < roiw16; j += 16)
{
internal::prefetch(src + j);
internal::prefetch(dst + j);
uint8x16_t v_src = vld1q_u8(src + j);
int16x8_t v_dst0 = vld1q_s16(dst + j);
int16x8_t v_dst1 = vld1q_s16(dst + j + 8);
int16x8_t v_src0 = vreinterpretq_s16_u16(vmovl_u8(vget_low_u8(v_src)));
int16x8_t v_src1 = vreinterpretq_s16_u16(vmovl_u8(vget_high_u8(v_src)));
v_dst0 = vqaddq_s16(v_dst0, v_src0);
v_dst1 = vqaddq_s16(v_dst1, v_src1);
vst1q_s16(dst + j, v_dst0);
vst1q_s16(dst + j + 8, v_dst1);
}
for (; j < roiw8; j += 8)
{
uint8x8_t v_src = vld1_u8(src + j);
int16x8_t v_src16 = vreinterpretq_s16_u16(vmovl_u8(v_src));
int16x8_t v_dst = vld1q_s16(dst + j);
v_dst = vqaddq_s16(v_dst, v_src16);
vst1q_s16(dst + j, v_dst);
}
for (; j < size.width; j++)
dst[j] = internal::saturate_cast<s16>(src[j] + dst[j]);
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
#endif
}
#ifdef CAROTENE_NEON
namespace {
template <int shift>
void accumulateSquareConst(const Size2D &size,
const u8 *srcBase, ptrdiff_t srcStride,
s16 *dstBase, ptrdiff_t dstStride)
{
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0; i < size.height; ++i)
{
const u8* src = internal::getRowPtr(srcBase, srcStride, i);
s16* dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
for (; j < roiw16; j += 16)
{
internal::prefetch(src + j);
internal::prefetch(dst + j);
uint8x16_t v_src = vld1q_u8(src + j);
int16x8_t v_dst0 = vld1q_s16(dst + j), v_dst1 = vld1q_s16(dst + j + 8);
int16x8_t v_src0 = vreinterpretq_s16_u16(vmovl_u8(vget_low_u8(v_src)));
int16x8_t v_src1 = vreinterpretq_s16_u16(vmovl_u8(vget_high_u8(v_src)));
int16x4_t v_srclo = vget_low_s16(v_src0), v_srchi = vget_high_s16(v_src0);
v_dst0 = vcombine_s16(vqmovn_s32(vaddw_s16(vshrq_n_s32(vmull_s16(v_srclo, v_srclo), shift), vget_low_s16(v_dst0))),
vqmovn_s32(vaddw_s16(vshrq_n_s32(vmull_s16(v_srchi, v_srchi), shift), vget_high_s16(v_dst0))));
v_srclo = vget_low_s16(v_src1);
v_srchi = vget_high_s16(v_src1);
v_dst1 = vcombine_s16(vqmovn_s32(vaddw_s16(vshrq_n_s32(vmull_s16(v_srclo, v_srclo), shift), vget_low_s16(v_dst1))),
vqmovn_s32(vaddw_s16(vshrq_n_s32(vmull_s16(v_srchi, v_srchi), shift), vget_high_s16(v_dst1))));
vst1q_s16(dst + j, v_dst0);
vst1q_s16(dst + j + 8, v_dst1);
}
for (; j < roiw8; j += 8)
{
int16x8_t v_src = vreinterpretq_s16_u16(vmovl_u8(vld1_u8(src + j)));
int16x8_t v_dst = vld1q_s16(dst + j);
int16x4_t v_srclo = vget_low_s16(v_src), v_srchi = vget_high_s16(v_src);
v_dst = vcombine_s16(vqmovn_s32(vaddw_s16(vshrq_n_s32(vmull_s16(v_srclo, v_srclo), shift), vget_low_s16(v_dst))),
vqmovn_s32(vaddw_s16(vshrq_n_s32(vmull_s16(v_srchi, v_srchi), shift), vget_high_s16(v_dst))));
vst1q_s16(dst + j, v_dst);
}
for (; j < size.width; j++)
{
s32 srcVal = src[j];
dst[j] = internal::saturate_cast<s16>(dst[j] + ((srcVal * srcVal) >> shift));
}
}
}
template <>
void accumulateSquareConst<0>(const Size2D &size,
const u8 *srcBase, ptrdiff_t srcStride,
s16 *dstBase, ptrdiff_t dstStride)
{
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0; i < size.height; ++i)
{
const u8* src = internal::getRowPtr(srcBase, srcStride, i);
s16* dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
for (; j < roiw16; j += 16)
{
internal::prefetch(src + j);
internal::prefetch(dst + j);
uint8x16_t v_src = vld1q_u8(src + j);
int16x8_t v_dst0 = vld1q_s16(dst + j), v_dst1 = vld1q_s16(dst + j + 8);
int16x8_t v_src0 = vreinterpretq_s16_u16(vmovl_u8(vget_low_u8(v_src)));
int16x8_t v_src1 = vreinterpretq_s16_u16(vmovl_u8(vget_high_u8(v_src)));
int16x4_t v_srclo = vget_low_s16(v_src0), v_srchi = vget_high_s16(v_src0);
v_dst0 = vcombine_s16(vqmovn_s32(vaddw_s16(vmull_s16(v_srclo, v_srclo), vget_low_s16(v_dst0))),
vqmovn_s32(vaddw_s16(vmull_s16(v_srchi, v_srchi), vget_high_s16(v_dst0))));
v_srclo = vget_low_s16(v_src1);
v_srchi = vget_high_s16(v_src1);
v_dst1 = vcombine_s16(vqmovn_s32(vaddw_s16(vmull_s16(v_srclo, v_srclo), vget_low_s16(v_dst1))),
vqmovn_s32(vaddw_s16(vmull_s16(v_srchi, v_srchi), vget_high_s16(v_dst1))));
vst1q_s16(dst + j, v_dst0);
vst1q_s16(dst + j + 8, v_dst1);
}
for (; j < roiw8; j += 8)
{
int16x8_t v_src = vreinterpretq_s16_u16(vmovl_u8(vld1_u8(src + j)));
int16x8_t v_dst = vld1q_s16(dst + j);
int16x4_t v_srclo = vget_low_s16(v_src), v_srchi = vget_high_s16(v_src);
v_dst = vcombine_s16(vqmovn_s32(vaddw_s16(vmull_s16(v_srclo, v_srclo), vget_low_s16(v_dst))),
vqmovn_s32(vaddw_s16(vmull_s16(v_srchi, v_srchi), vget_high_s16(v_dst))));
vst1q_s16(dst + j, v_dst);
}
for (; j < size.width; j++)
{
s32 srcVal = src[j];
dst[j] = internal::saturate_cast<s16>(dst[j] + srcVal * srcVal);
}
}
}
typedef void (* accumulateSquareConstFunc)(const Size2D &size,
const u8 *srcBase, ptrdiff_t srcStride,
s16 *dstBase, ptrdiff_t dstStride);
} // namespace
#endif
void accumulateSquare(const Size2D &size,
const u8 *srcBase, ptrdiff_t srcStride,
s16 *dstBase, ptrdiff_t dstStride,
u32 shift)
{
if (shift >= 16)
{
for (size_t i = 0; i < size.height; ++i)
{
s16 * dst = internal::getRowPtr(dstBase, dstStride, i);
std::memset(dst, 0, sizeof(s16) * size.width);
}
return;
}
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
// this ugly contruction is needed to avoid:
// /usr/lib/gcc/arm-linux-gnueabihf/4.8/include/arm_neon.h:3581:59: error: argument must be a constant
// return (int16x8_t)__builtin_neon_vshr_nv8hi (__a, __b, 1);
accumulateSquareConstFunc funcs[16] =
{
accumulateSquareConst<0>,
accumulateSquareConst<1>,
accumulateSquareConst<2>,
accumulateSquareConst<3>,
accumulateSquareConst<4>,
accumulateSquareConst<5>,
accumulateSquareConst<6>,
accumulateSquareConst<7>,
accumulateSquareConst<8>,
accumulateSquareConst<9>,
accumulateSquareConst<10>,
accumulateSquareConst<11>,
accumulateSquareConst<12>,
accumulateSquareConst<13>,
accumulateSquareConst<14>,
accumulateSquareConst<15>
}, func = funcs[shift];
func(size, srcBase, srcStride, dstBase, dstStride);
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)shift;
#endif
}
#ifdef CAROTENE_NEON
namespace {
struct AccumulateWeightedHalf
{
typedef u8 type;
void operator() (const uint8x16_t & v_src0, const uint8x16_t & v_src1,
uint8x16_t & v_dst) const
{
v_dst = vhaddq_u8(v_src0, v_src1);
}
void operator() (const uint8x8_t & v_src0, const uint8x8_t & v_src1,
uint8x8_t & v_dst) const
{
v_dst = vhadd_u8(v_src0, v_src1);
}
void operator() (const u8 * src0, const u8 * src1, u8 * dst) const
{
dst[0] = ((u16)(src0[0]) + src1[0]) >> 1;
}
};
struct AccumulateWeighted
{
typedef u8 type;
float alpha, beta;
float32x4_t v_alpha, v_beta;
explicit AccumulateWeighted(float _alpha) :
alpha(_alpha), beta(1 - _alpha)
{
v_alpha = vdupq_n_f32(alpha);
v_beta = vdupq_n_f32(beta);
}
void operator() (const uint8x16_t & v_src0, const uint8x16_t & v_src1,
uint8x16_t & v_dst) const
{
uint16x8_t v_src0_p = vmovl_u8(vget_low_u8(v_src0));
uint16x8_t v_src1_p = vmovl_u8(vget_low_u8(v_src1));
float32x4_t v_dst0f = vmlaq_f32(vmulq_f32(vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src1_p))), v_beta),
v_alpha, vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src0_p))));
float32x4_t v_dst1f = vmlaq_f32(vmulq_f32(vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src1_p))), v_beta),
v_alpha, vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src0_p))));
uint16x8_t v_dst0 = vcombine_u16(vmovn_u32(vcvtq_u32_f32(v_dst0f)),
vmovn_u32(vcvtq_u32_f32(v_dst1f)));
v_src0_p = vmovl_u8(vget_high_u8(v_src0));
v_src1_p = vmovl_u8(vget_high_u8(v_src1));
v_dst0f = vmlaq_f32(vmulq_f32(vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src1_p))), v_beta),
v_alpha, vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src0_p))));
v_dst1f = vmlaq_f32(vmulq_f32(vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src1_p))), v_beta),
v_alpha, vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src0_p))));
uint16x8_t v_dst1 = vcombine_u16(vmovn_u32(vcvtq_u32_f32(v_dst0f)),
vmovn_u32(vcvtq_u32_f32(v_dst1f)));
v_dst = vcombine_u8(vmovn_u16(v_dst0), vmovn_u16(v_dst1));
}
void operator() (const uint8x8_t & _v_src0, const uint8x8_t & _v_src1,
uint8x8_t & v_dst) const
{
uint16x8_t v_src0 = vmovl_u8(_v_src0), v_src1 = vmovl_u8(_v_src1);
float32x4_t v_dst0f = vmlaq_f32(vmulq_f32(vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src1))), v_beta),
v_alpha, vcvtq_f32_u32(vmovl_u16(vget_low_u16(v_src0))));
float32x4_t v_dst1f = vmlaq_f32(vmulq_f32(vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src1))), v_beta),
v_alpha, vcvtq_f32_u32(vmovl_u16(vget_high_u16(v_src0))));
uint16x8_t _v_dst = vcombine_u16(vmovn_u32(vcvtq_u32_f32(v_dst0f)),
vmovn_u32(vcvtq_u32_f32(v_dst1f)));
v_dst = vmovn_u16(_v_dst);
}
void operator() (const u8 * src0, const u8 * src1, u8 * dst) const
{
dst[0] = beta * src1[0] + alpha * src0[0];
}
};
} // namespace
#endif
void accumulateWeighted(const Size2D &size,
const u8 *srcBase, ptrdiff_t srcStride,
u8 *dstBase, ptrdiff_t dstStride,
f32 alpha)
{
if (alpha == 0.0f)
return;
if (alpha == 1.0f)
{
for (size_t i = 0; i < size.height; ++i)
{
const u8 * src = internal::getRowPtr(srcBase, srcStride, i);
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
std::memcpy(dst, src, sizeof(u8) * size.width);
}
return;
}
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
// in this case we can use the following scheme:
// dst[p] = (src[p] + dst[p]) >> 1
// which is faster
if (alpha == 0.5f)
{
internal::vtransform(size,
srcBase, srcStride,
dstBase, dstStride,
dstBase, dstStride,
AccumulateWeightedHalf());
return;
}
internal::vtransform(size,
srcBase, srcStride,
dstBase, dstStride,
dstBase, dstStride,
AccumulateWeighted(alpha));
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)alpha;
#endif
}
} //namespace CAROTENE_NS

475
3rdparty/carotene/src/add.cpp vendored Normal file
View File

@ -0,0 +1,475 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
template <typename T, typename WT>
struct AddWrap
{
typedef T type;
void operator() (const typename internal::VecTraits<T>::vec128 & v_src0,
const typename internal::VecTraits<T>::vec128 & v_src1,
typename internal::VecTraits<T>::vec128 & v_dst) const
{
v_dst = internal::vaddq(v_src0, v_src1);
}
void operator() (const typename internal::VecTraits<T>::vec64 & v_src0,
const typename internal::VecTraits<T>::vec64 & v_src1,
typename internal::VecTraits<T>::vec64 & v_dst) const
{
v_dst = internal::vadd(v_src0, v_src1);
}
void operator() (const T * src0, const T * src1, T * dst) const
{
dst[0] = (T)((WT)src0[0] + (WT)src1[0]);
}
};
template <typename T, typename WT>
struct AddSaturate
{
typedef T type;
void operator() (const typename internal::VecTraits<T>::vec128 & v_src0,
const typename internal::VecTraits<T>::vec128 & v_src1,
typename internal::VecTraits<T>::vec128 & v_dst) const
{
v_dst = internal::vqaddq(v_src0, v_src1);
}
void operator() (const typename internal::VecTraits<T>::vec64 & v_src0,
const typename internal::VecTraits<T>::vec64 & v_src1,
typename internal::VecTraits<T>::vec64 & v_dst) const
{
v_dst = internal::vqadd(v_src0, v_src1);
}
void operator() (const T * src0, const T * src1, T * dst) const
{
dst[0] = internal::saturate_cast<T>((WT)src0[0] + (WT)src1[0]);
}
};
} // namespace
#endif
void add(const Size2D &size,
const u8 * src0Base, ptrdiff_t src0Stride,
const u8 * src1Base, ptrdiff_t src1Stride,
u8 *dstBase, ptrdiff_t dstStride,
CONVERT_POLICY policy)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
if (policy == CONVERT_POLICY_SATURATE)
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
AddSaturate<u8, u16>());
}
else
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
AddWrap<u8, u16>());
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
(void)policy;
#endif
}
void add(const Size2D &size,
const s8 * src0Base, ptrdiff_t src0Stride,
const s8 * src1Base, ptrdiff_t src1Stride,
s8 *dstBase, ptrdiff_t dstStride,
CONVERT_POLICY policy)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
if (policy == CONVERT_POLICY_SATURATE)
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
AddSaturate<s8, s16>());
}
else
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
AddWrap<s8, s16>());
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
(void)policy;
#endif
}
void add(const Size2D &size,
const u8 * src0Base, ptrdiff_t src0Stride,
const u8 * src1Base, ptrdiff_t src1Stride,
s16 *dstBase, ptrdiff_t dstStride,
CONVERT_POLICY)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0; i < size.height; ++i)
{
const u8 * src0 = internal::getRowPtr(src0Base, src0Stride, i);
const u8 * src1 = internal::getRowPtr(src1Base, src1Stride, i);
u16 * dst = internal::getRowPtr((u16 *)dstBase, dstStride, i);
size_t j = 0;
for (; j < roiw32; j += 32)
{
internal::prefetch(src0 + j);
internal::prefetch(src1 + j);
uint8x16_t v_src00 = vld1q_u8(src0 + j), v_src01 = vld1q_u8(src0 + j + 16);
uint8x16_t v_src10 = vld1q_u8(src1 + j), v_src11 = vld1q_u8(src1 + j + 16);
vst1q_u16(dst + j, vaddl_u8(vget_low_u8(v_src00), vget_low_u8(v_src10)));
vst1q_u16(dst + j + 8, vaddl_u8(vget_high_u8(v_src00), vget_high_u8(v_src10)));
vst1q_u16(dst + j + 16, vaddl_u8(vget_low_u8(v_src01), vget_low_u8(v_src11)));
vst1q_u16(dst + j + 24, vaddl_u8(vget_high_u8(v_src01), vget_high_u8(v_src11)));
}
for (; j < roiw8; j += 8)
{
uint8x8_t v_src0 = vld1_u8(src0 + j);
uint8x8_t v_src1 = vld1_u8(src1 + j);
vst1q_u16(dst + j, vaddl_u8(v_src0, v_src1));
}
for (; j < size.width; j++)
dst[j] = (u16)src0[j] + (u16)src1[j];
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
#endif
}
void add(const Size2D &size,
const u8 * src0Base, ptrdiff_t src0Stride,
const s16 * src1Base, ptrdiff_t src1Stride,
s16 *dstBase, ptrdiff_t dstStride,
CONVERT_POLICY policy)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0; i < size.height; ++i)
{
const u8 * src0 = internal::getRowPtr(src0Base, src0Stride, i);
const s16 * src1 = internal::getRowPtr(src1Base, src1Stride, i);
s16 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
if (policy == CONVERT_POLICY_SATURATE)
{
for (; j < roiw16; j += 16)
{
internal::prefetch(src0 + j);
internal::prefetch(src1 + j);
uint8x16_t v_src0 = vld1q_u8(src0 + j);
int16x8_t v_src00 = vreinterpretq_s16_u16(vmovl_u8(vget_low_u8(v_src0)));
int16x8_t v_src01 = vreinterpretq_s16_u16(vmovl_u8(vget_high_u8(v_src0)));
int16x8_t v_src10 = vld1q_s16(src1 + j), v_src11 = vld1q_s16(src1 + j + 8);
int16x8_t v_dst0 = vqaddq_s16(v_src00, v_src10);
int16x8_t v_dst1 = vqaddq_s16(v_src01, v_src11);
vst1q_s16(dst + j, v_dst0);
vst1q_s16(dst + j + 8, v_dst1);
}
for (; j < roiw8; j += 8)
{
int16x8_t v_src0 = vreinterpretq_s16_u16(vmovl_u8(vld1_u8(src0 + j)));
int16x8_t v_src1 = vld1q_s16(src1 + j);
int16x8_t v_dst = vqaddq_s16(v_src0, v_src1);
vst1q_s16(dst + j, v_dst);
}
for (; j < size.width; j++)
dst[j] = internal::saturate_cast<s16>((s32)src0[j] + (s32)src1[j]);
}
else
{
for (; j < roiw16; j += 16)
{
internal::prefetch(src0 + j);
internal::prefetch(src1 + j);
uint8x16_t v_src0 = vld1q_u8(src0 + j);
int16x8_t v_src00 = vreinterpretq_s16_u16(vmovl_u8(vget_low_u8(v_src0)));
int16x8_t v_src01 = vreinterpretq_s16_u16(vmovl_u8(vget_high_u8(v_src0)));
int16x8_t v_src10 = vld1q_s16(src1 + j), v_src11 = vld1q_s16(src1 + j + 8);
int16x8_t v_dst0 = vaddq_s16(v_src00, v_src10);
int16x8_t v_dst1 = vaddq_s16(v_src01, v_src11);
vst1q_s16(dst + j, v_dst0);
vst1q_s16(dst + j + 8, v_dst1);
}
for (; j < roiw8; j += 8)
{
int16x8_t v_src0 = vreinterpretq_s16_u16(vmovl_u8(vld1_u8(src0 + j)));
int16x8_t v_src1 = vld1q_s16(src1 + j);
int16x8_t v_dst = vaddq_s16(v_src0, v_src1);
vst1q_s16(dst + j, v_dst);
}
for (; j < size.width; j++)
dst[j] = (s16)((s32)src0[j] + (s32)src1[j]);
}
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
(void)policy;
#endif
}
void add(const Size2D &size,
const s16 * src0Base, ptrdiff_t src0Stride,
const s16 * src1Base, ptrdiff_t src1Stride,
s16 *dstBase, ptrdiff_t dstStride,
CONVERT_POLICY policy)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
if (policy == CONVERT_POLICY_SATURATE)
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
AddSaturate<s16, s32>());
}
else
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
AddWrap<s16, s32>());
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
(void)policy;
#endif
}
void add(const Size2D &size,
const u16 * src0Base, ptrdiff_t src0Stride,
const u16 * src1Base, ptrdiff_t src1Stride,
u16 * dstBase, ptrdiff_t dstStride,
CONVERT_POLICY policy)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
if (policy == CONVERT_POLICY_SATURATE)
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
AddSaturate<u16, u32>());
}
else
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
AddWrap<u16, u32>());
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
(void)policy;
#endif
}
void add(const Size2D &size,
const s32 * src0Base, ptrdiff_t src0Stride,
const s32 * src1Base, ptrdiff_t src1Stride,
s32 *dstBase, ptrdiff_t dstStride,
CONVERT_POLICY policy)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
if (policy == CONVERT_POLICY_SATURATE)
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
AddSaturate<s32, s64>());
}
else
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
AddWrap<s32, s64>());
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
(void)policy;
#endif
}
void add(const Size2D &size,
const u32 * src0Base, ptrdiff_t src0Stride,
const u32 * src1Base, ptrdiff_t src1Stride,
u32 * dstBase, ptrdiff_t dstStride,
CONVERT_POLICY policy)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
if (policy == CONVERT_POLICY_SATURATE)
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
AddSaturate<u32, u64>());
}
else
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
AddWrap<u32, u64>());
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
(void)policy;
#endif
}
void add(const Size2D &size,
const f32 * src0Base, ptrdiff_t src0Stride,
const f32 * src1Base, ptrdiff_t src1Stride,
f32 * dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
AddWrap<f32, f32>());
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
#endif
}
} // namespace CAROTENE_NS

265
3rdparty/carotene/src/add_weighted.cpp vendored Normal file
View File

@ -0,0 +1,265 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2012-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
using namespace internal;
template <typename T> struct TypeTraits;
template <> struct TypeTraits< u8> { typedef u16 wide; typedef u8 unsign; typedef uint8x16_t vec128; };
template <> struct TypeTraits< s8> { typedef s16 wide; typedef u8 unsign; typedef int8x16_t vec128; };
template <> struct TypeTraits<u16> { typedef u32 wide; typedef u8 narrow; typedef u16 unsign; typedef uint16x8_t vec128; };
template <> struct TypeTraits<s16> { typedef s32 wide; typedef s8 narrow; typedef u16 unsign; typedef int16x8_t vec128; };
template <> struct TypeTraits<u32> { typedef u64 wide; typedef u16 narrow; typedef u32 unsign; typedef uint32x4_t vec128; };
template <> struct TypeTraits<s32> { typedef s64 wide; typedef s16 narrow; typedef u32 unsign; typedef int32x4_t vec128; };
template <> struct TypeTraits<f32> { typedef f64 wide; typedef float32x4_t vec128; };
template <typename T> struct wAdd
{
typedef T type;
f32 alpha, beta, gamma;
typedef typename TypeTraits<T>::wide wtype;
wAdd<wtype> wideAdd;
wAdd(f32 _alpha, f32 _beta, f32 _gamma):
alpha(_alpha), beta(_beta), gamma(_gamma),
wideAdd(_alpha, _beta, _gamma) {}
void operator() (const typename VecTraits<T>::vec128 & v_src0,
const typename VecTraits<T>::vec128 & v_src1,
typename VecTraits<T>::vec128 & v_dst) const
{
typename VecTraits<wtype>::vec128 vrl, vrh;
wideAdd(vmovl( vget_low(v_src0)), vmovl( vget_low(v_src1)), vrl);
wideAdd(vmovl(vget_high(v_src0)), vmovl(vget_high(v_src1)), vrh);
v_dst = vcombine(vqmovn(vrl), vqmovn(vrh));
}
void operator() (const typename VecTraits<T>::vec64 & v_src0,
const typename VecTraits<T>::vec64 & v_src1,
typename VecTraits<T>::vec64 & v_dst) const
{
typename VecTraits<wtype>::vec128 vr;
wideAdd(vmovl(v_src0), vmovl(v_src1), vr);
v_dst = vqmovn(vr);
}
void operator() (const T * src0, const T * src1, T * dst) const
{
dst[0] = saturate_cast<T>(alpha*src0[0] + beta*src1[0] + gamma);
}
};
template <> struct wAdd<s32>
{
typedef s32 type;
f32 alpha, beta, gamma;
float32x4_t valpha, vbeta, vgamma;
wAdd(f32 _alpha, f32 _beta, f32 _gamma):
alpha(_alpha), beta(_beta), gamma(_gamma)
{
valpha = vdupq_n_f32(_alpha);
vbeta = vdupq_n_f32(_beta);
vgamma = vdupq_n_f32(_gamma + 0.5);
}
void operator() (const typename VecTraits<s32>::vec128 & v_src0,
const typename VecTraits<s32>::vec128 & v_src1,
typename VecTraits<s32>::vec128 & v_dst) const
{
float32x4_t vs1 = vcvtq_f32_s32(v_src0);
float32x4_t vs2 = vcvtq_f32_s32(v_src1);
vs1 = vmlaq_f32(vgamma, vs1, valpha);
vs1 = vmlaq_f32(vs1, vs2, vbeta);
v_dst = vcvtq_s32_f32(vs1);
}
void operator() (const typename VecTraits<s32>::vec64 & v_src0,
const typename VecTraits<s32>::vec64 & v_src1,
typename VecTraits<s32>::vec64 & v_dst) const
{
float32x2_t vs1 = vcvt_f32_s32(v_src0);
float32x2_t vs2 = vcvt_f32_s32(v_src1);
vs1 = vmla_f32(vget_low(vgamma), vs1, vget_low(valpha));
vs1 = vmla_f32(vs1, vs2, vget_low(vbeta));
v_dst = vcvt_s32_f32(vs1);
}
void operator() (const s32 * src0, const s32 * src1, s32 * dst) const
{
dst[0] = saturate_cast<s32>(alpha*src0[0] + beta*src1[0] + gamma);
}
};
template <> struct wAdd<u32>
{
typedef u32 type;
f32 alpha, beta, gamma;
float32x4_t valpha, vbeta, vgamma;
wAdd(f32 _alpha, f32 _beta, f32 _gamma):
alpha(_alpha), beta(_beta), gamma(_gamma)
{
valpha = vdupq_n_f32(_alpha);
vbeta = vdupq_n_f32(_beta);
vgamma = vdupq_n_f32(_gamma + 0.5);
}
void operator() (const typename VecTraits<u32>::vec128 & v_src0,
const typename VecTraits<u32>::vec128 & v_src1,
typename VecTraits<u32>::vec128 & v_dst) const
{
float32x4_t vs1 = vcvtq_f32_u32(v_src0);
float32x4_t vs2 = vcvtq_f32_u32(v_src1);
vs1 = vmlaq_f32(vgamma, vs1, valpha);
vs1 = vmlaq_f32(vs1, vs2, vbeta);
v_dst = vcvtq_u32_f32(vs1);
}
void operator() (const typename VecTraits<u32>::vec64 & v_src0,
const typename VecTraits<u32>::vec64 & v_src1,
typename VecTraits<u32>::vec64 & v_dst) const
{
float32x2_t vs1 = vcvt_f32_u32(v_src0);
float32x2_t vs2 = vcvt_f32_u32(v_src1);
vs1 = vmla_f32(vget_low(vgamma), vs1, vget_low(valpha));
vs1 = vmla_f32(vs1, vs2, vget_low(vbeta));
v_dst = vcvt_u32_f32(vs1);
}
void operator() (const u32 * src0, const u32 * src1, u32 * dst) const
{
dst[0] = saturate_cast<u32>(alpha*src0[0] + beta*src1[0] + gamma);
}
};
template <> struct wAdd<f32>
{
typedef f32 type;
f32 alpha, beta, gamma;
float32x4_t valpha, vbeta, vgamma;
wAdd(f32 _alpha, f32 _beta, f32 _gamma):
alpha(_alpha), beta(_beta), gamma(_gamma)
{
valpha = vdupq_n_f32(_alpha);
vbeta = vdupq_n_f32(_beta);
vgamma = vdupq_n_f32(_gamma + 0.5);
}
void operator() (const typename VecTraits<f32>::vec128 & v_src0,
const typename VecTraits<f32>::vec128 & v_src1,
typename VecTraits<f32>::vec128 & v_dst) const
{
float32x4_t vs1 = vmlaq_f32(vgamma, v_src0, valpha);
v_dst = vmlaq_f32(vs1, v_src1, vbeta);
}
void operator() (const typename VecTraits<f32>::vec64 & v_src0,
const typename VecTraits<f32>::vec64 & v_src1,
typename VecTraits<f32>::vec64 & v_dst) const
{
float32x2_t vs1 = vmla_f32(vget_low(vgamma), v_src0, vget_low(valpha));
v_dst = vmla_f32(vs1, v_src1, vget_low(vbeta));
}
void operator() (const f32 * src0, const f32 * src1, f32 * dst) const
{
dst[0] = alpha*src0[0] + beta*src1[0] + gamma;
}
};
} // namespace
#define IMPL_ADDWEIGHTED(type) \
void addWeighted(const Size2D &size, \
const type * src0Base, ptrdiff_t src0Stride, \
const type * src1Base, ptrdiff_t src1Stride, \
type * dstBase, ptrdiff_t dstStride, \
f32 alpha, f32 beta, f32 gamma) \
{ \
internal::assertSupportedConfiguration(); \
wAdd<type> wgtAdd(alpha, \
beta, \
gamma); \
internal::vtransform(size, \
src0Base, src0Stride, \
src1Base, src1Stride, \
dstBase, dstStride, \
wgtAdd); \
}
#else
#define IMPL_ADDWEIGHTED(type) \
void addWeighted(const Size2D &, \
const type *, ptrdiff_t, \
const type *, ptrdiff_t, \
type *, ptrdiff_t, \
f32, f32, f32) \
{ \
internal::assertSupportedConfiguration(); \
}
#endif
IMPL_ADDWEIGHTED(u8)
IMPL_ADDWEIGHTED(s8)
IMPL_ADDWEIGHTED(u16)
IMPL_ADDWEIGHTED(s16)
IMPL_ADDWEIGHTED(u32)
IMPL_ADDWEIGHTED(s32)
IMPL_ADDWEIGHTED(f32)
} // namespace CAROTENE_NS

225
3rdparty/carotene/src/bitwise.cpp vendored Normal file
View File

@ -0,0 +1,225 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
struct BitwiseAnd
{
typedef u8 type;
void operator() (const uint8x16_t & v_src0, const uint8x16_t & v_src1,
uint8x16_t & v_dst) const
{
v_dst = vandq_u8(v_src0, v_src1);
}
void operator() (const uint8x8_t & v_src0, const uint8x8_t & v_src1,
uint8x8_t & v_dst) const
{
v_dst = vand_u8(v_src0, v_src1);
}
void operator() (const u8 * src0, const u8 * src1, u8 * dst) const
{
dst[0] = src0[0] & src1[0];
}
};
struct BitwiseOr
{
typedef u8 type;
void operator() (const uint8x16_t & v_src0, const uint8x16_t & v_src1,
uint8x16_t & v_dst) const
{
v_dst = vorrq_u8(v_src0, v_src1);
}
void operator() (const uint8x8_t & v_src0, const uint8x8_t & v_src1,
uint8x8_t & v_dst) const
{
v_dst = vorr_u8(v_src0, v_src1);
}
void operator() (const u8 * src0, const u8 * src1, u8 * dst) const
{
dst[0] = src0[0] | src1[0];
}
};
struct BitwiseXor
{
typedef u8 type;
void operator() (const uint8x16_t & v_src0, const uint8x16_t & v_src1,
uint8x16_t & v_dst) const
{
v_dst = veorq_u8(v_src0, v_src1);
}
void operator() (const uint8x8_t & v_src0, const uint8x8_t & v_src1,
uint8x8_t & v_dst) const
{
v_dst = veor_u8(v_src0, v_src1);
}
void operator() (const u8 * src0, const u8 * src1, u8 * dst) const
{
dst[0] = src0[0] ^ src1[0];
}
};
#endif
void bitwiseNot(const Size2D &size,
const u8 *srcBase, ptrdiff_t srcStride,
u8 *dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0; i < size.height; ++i)
{
const u8* src = internal::getRowPtr(srcBase, srcStride, i);
u8* dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
for (; j < roiw32; j += 32)
{
internal::prefetch(src + j);
uint8x16_t v_src0 = vld1q_u8(src + j), v_src1 = vld1q_u8(src + j + 16);
uint8x16_t v_dst0 = vmvnq_u8(v_src0), v_dst1 = vmvnq_u8(v_src1);
vst1q_u8(dst + j, v_dst0);
vst1q_u8(dst + j + 16, v_dst1);
}
for (; j < roiw8; j += 8)
{
uint8x8_t v_src = vld1_u8(src + j);
uint8x8_t v_dst = vmvn_u8(v_src);
vst1_u8(dst + j, v_dst);
}
for (; j < size.width; j++)
{
dst[j] = ~src[j];
}
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
#endif
}
void bitwiseAnd(const Size2D &size,
const u8 *src0Base, ptrdiff_t src0Stride,
const u8 *src1Base, ptrdiff_t src1Stride,
u8 *dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride, BitwiseAnd());
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
#endif
}
void bitwiseOr(const Size2D &size,
const u8 *src0Base, ptrdiff_t src0Stride,
const u8 *src1Base, ptrdiff_t src1Stride,
u8 *dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride, BitwiseOr());
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
#endif
}
void bitwiseXor(const Size2D &size,
const u8 *src0Base, ptrdiff_t src0Stride,
const u8 *src1Base, ptrdiff_t src1Stride,
u8 *dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride, BitwiseXor());
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
#endif
}
} // namespace CAROTENE_NS

1337
3rdparty/carotene/src/blur.cpp vendored Normal file

File diff suppressed because it is too large Load Diff

773
3rdparty/carotene/src/canny.cpp vendored Normal file
View File

@ -0,0 +1,773 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2012-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include "saturate_cast.hpp"
#include <vector>
#include <cstring>
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
struct RowFilter3x3Canny
{
inline RowFilter3x3Canny(const ptrdiff_t borderxl, const ptrdiff_t borderxr)
{
vfmask = vreinterpret_u8_u64(vmov_n_u64(borderxl ? 0x0000FFffFFffFFffULL : 0x0100FFffFFffFFffULL));
vtmask = vreinterpret_u8_u64(vmov_n_u64(borderxr ? 0x0707060504030201ULL : 0x0706050403020100ULL));
lookLeft = offsetk - borderxl;
lookRight = offsetk - borderxr;
}
inline void operator()(const u8* src, s16* dstx, s16* dsty, ptrdiff_t width)
{
uint8x8_t l = vtbl1_u8(vld1_u8(src - lookLeft), vfmask);
ptrdiff_t i = 0;
for (; i < width - 8 + lookRight; i += 8)
{
internal::prefetch(src + i);
uint8x8_t l18u = vld1_u8(src + i + 1);
uint8x8_t l2 = l18u;
uint8x8_t l0 = vext_u8(l, l18u, 6);
int16x8_t l1x2 = vreinterpretq_s16_u16(vshll_n_u8(vext_u8(l, l18u, 7), 1));
l = l18u;
int16x8_t l02 = vreinterpretq_s16_u16(vaddl_u8(l2, l0));
int16x8_t ldx = vreinterpretq_s16_u16(vsubl_u8(l2, l0));
int16x8_t ldy = vaddq_s16(l02, l1x2);
vst1q_s16(dstx + i, ldx);
vst1q_s16(dsty + i, ldy);
}
//tail
if (lookRight == 0 || i != width)
{
uint8x8_t tail0 = vld1_u8(src + (width - 9));//can't get left 1 pixel another way if width==8*k+1
uint8x8_t tail2 = vtbl1_u8(vld1_u8(src + (width - 8 + lookRight)), vtmask);
uint8x8_t tail1 = vext_u8(vreinterpret_u8_u64(vshl_n_u64(vreinterpret_u64_u8(tail0), 8*6)), tail2, 7);
int16x8_t tail02 = vreinterpretq_s16_u16(vaddl_u8(tail2, tail0));
int16x8_t tail1x2 = vreinterpretq_s16_u16(vshll_n_u8(tail1, 1));
int16x8_t taildx = vreinterpretq_s16_u16(vsubl_u8(tail2, tail0));
int16x8_t taildy = vqaddq_s16(tail02, tail1x2);
vst1q_s16(dstx + (width - 8), taildx);
vst1q_s16(dsty + (width - 8), taildy);
}
}
uint8x8_t vfmask;
uint8x8_t vtmask;
enum { offsetk = 1};
ptrdiff_t lookLeft;
ptrdiff_t lookRight;
};
template <bool L2gradient>
inline void ColFilter3x3Canny(const s16* src0, const s16* src1, const s16* src2, s16* dstx, s16* dsty, s32* mag, ptrdiff_t width)
{
ptrdiff_t j = 0;
for (; j <= width - 8; j += 8)
{
ColFilter3x3CannyL1Loop:
int16x8_t line0x = vld1q_s16(src0 + j);
int16x8_t line1x = vld1q_s16(src1 + j);
int16x8_t line2x = vld1q_s16(src2 + j);
int16x8_t line0y = vld1q_s16(src0 + j + width);
int16x8_t line2y = vld1q_s16(src2 + j + width);
int16x8_t l02 = vaddq_s16(line0x, line2x);
int16x8_t l1x2 = vshlq_n_s16(line1x, 1);
int16x8_t dy = vsubq_s16(line2y, line0y);
int16x8_t dx = vaddq_s16(l1x2, l02);
int16x8_t dya = vabsq_s16(dy);
int16x8_t dxa = vabsq_s16(dx);
int16x8_t norm = vaddq_s16(dya, dxa);
int32x4_t normh = vmovl_s16(vget_high_s16(norm));
int32x4_t norml = vmovl_s16(vget_low_s16(norm));
vst1q_s16(dsty + j, dy);
vst1q_s16(dstx + j, dx);
vst1q_s32(mag + j + 4, normh);
vst1q_s32(mag + j, norml);
}
if (j != width)
{
j = width - 8;
goto ColFilter3x3CannyL1Loop;
}
}
template <>
inline void ColFilter3x3Canny<true>(const s16* src0, const s16* src1, const s16* src2, s16* dstx, s16* dsty, s32* mag, ptrdiff_t width)
{
ptrdiff_t j = 0;
for (; j <= width - 8; j += 8)
{
ColFilter3x3CannyL2Loop:
int16x8_t line0x = vld1q_s16(src0 + j);
int16x8_t line1x = vld1q_s16(src1 + j);
int16x8_t line2x = vld1q_s16(src2 + j);
int16x8_t line0y = vld1q_s16(src0 + j + width);
int16x8_t line2y = vld1q_s16(src2 + j + width);
int16x8_t l02 = vaddq_s16(line0x, line2x);
int16x8_t l1x2 = vshlq_n_s16(line1x, 1);
int16x8_t dy = vsubq_s16(line2y, line0y);
int16x8_t dx = vaddq_s16(l1x2, l02);
int32x4_t norml = vmull_s16(vget_low_s16(dx), vget_low_s16(dx));
int32x4_t normh = vmull_s16(vget_high_s16(dy), vget_high_s16(dy));
norml = vmlal_s16(norml, vget_low_s16(dy), vget_low_s16(dy));
normh = vmlal_s16(normh, vget_high_s16(dx), vget_high_s16(dx));
vst1q_s16(dsty + j, dy);
vst1q_s16(dstx + j, dx);
vst1q_s32(mag + j, norml);
vst1q_s32(mag + j + 4, normh);
}
if (j != width)
{
j = width - 8;
goto ColFilter3x3CannyL2Loop;
}
}
template <bool L2gradient>
inline void NormCanny(const ptrdiff_t colscn, s16* _dx, s16* _dy, s32* _norm)
{
ptrdiff_t j = 0;
if (colscn >= 8)
{
int16x8_t vx = vld1q_s16(_dx);
int16x8_t vy = vld1q_s16(_dy);
for (; j <= colscn - 16; j+=8)
{
internal::prefetch(_dx);
internal::prefetch(_dy);
int16x8_t vx2 = vld1q_s16(_dx + j + 8);
int16x8_t vy2 = vld1q_s16(_dy + j + 8);
int16x8_t vabsx = vabsq_s16(vx);
int16x8_t vabsy = vabsq_s16(vy);
int16x8_t norm = vaddq_s16(vabsx, vabsy);
int32x4_t normh = vmovl_s16(vget_high_s16(norm));
int32x4_t norml = vmovl_s16(vget_low_s16(norm));
vst1q_s32(_norm + j + 4, normh);
vst1q_s32(_norm + j + 0, norml);
vx = vx2;
vy = vy2;
}
int16x8_t vabsx = vabsq_s16(vx);
int16x8_t vabsy = vabsq_s16(vy);
int16x8_t norm = vaddq_s16(vabsx, vabsy);
int32x4_t normh = vmovl_s16(vget_high_s16(norm));
int32x4_t norml = vmovl_s16(vget_low_s16(norm));
vst1q_s32(_norm + j + 4, normh);
vst1q_s32(_norm + j + 0, norml);
}
for (; j < colscn; j++)
_norm[j] = std::abs(s32(_dx[j])) + std::abs(s32(_dy[j]));
}
template <>
inline void NormCanny<true>(const ptrdiff_t colscn, s16* _dx, s16* _dy, s32* _norm)
{
ptrdiff_t j = 0;
if (colscn >= 8)
{
int16x8_t vx = vld1q_s16(_dx);
int16x8_t vy = vld1q_s16(_dy);
for (; j <= colscn - 16; j+=8)
{
internal::prefetch(_dx);
internal::prefetch(_dy);
int16x8_t vxnext = vld1q_s16(_dx + j + 8);
int16x8_t vynext = vld1q_s16(_dy + j + 8);
int32x4_t norml = vmull_s16(vget_low_s16(vx), vget_low_s16(vx));
int32x4_t normh = vmull_s16(vget_high_s16(vy), vget_high_s16(vy));
norml = vmlal_s16(norml, vget_low_s16(vy), vget_low_s16(vy));
normh = vmlal_s16(normh, vget_high_s16(vx), vget_high_s16(vx));
vst1q_s32(_norm + j + 0, norml);
vst1q_s32(_norm + j + 4, normh);
vx = vxnext;
vy = vynext;
}
int32x4_t norml = vmull_s16(vget_low_s16(vx), vget_low_s16(vx));
int32x4_t normh = vmull_s16(vget_high_s16(vy), vget_high_s16(vy));
norml = vmlal_s16(norml, vget_low_s16(vy), vget_low_s16(vy));
normh = vmlal_s16(normh, vget_high_s16(vx), vget_high_s16(vx));
vst1q_s32(_norm + j + 0, norml);
vst1q_s32(_norm + j + 4, normh);
}
for (; j < colscn; j++)
_norm[j] = s32(_dx[j])*_dx[j] + s32(_dy[j])*_dy[j];
}
template <bool L2gradient>
inline void prepareThresh(f64 low_thresh, f64 high_thresh,
s32 &low, s32 &high)
{
if (low_thresh > high_thresh)
std::swap(low_thresh, high_thresh);
#if defined __GNUC__
low = (s32)low_thresh;
high = (s32)high_thresh;
low -= (low > low_thresh);
high -= (high > high_thresh);
#else
low = internal::round(low_thresh);
high = internal::round(high_thresh);
f32 ldiff = (f32)(low_thresh - low);
f32 hdiff = (f32)(high_thresh - high);
low -= (ldiff < 0);
high -= (hdiff < 0);
#endif
}
template <>
inline void prepareThresh<true>(f64 low_thresh, f64 high_thresh,
s32 &low, s32 &high)
{
if (low_thresh > high_thresh)
std::swap(low_thresh, high_thresh);
if (low_thresh > 0) low_thresh *= low_thresh;
if (high_thresh > 0) high_thresh *= high_thresh;
#if defined __GNUC__
low = (s32)low_thresh;
high = (s32)high_thresh;
low -= (low > low_thresh);
high -= (high > high_thresh);
#else
low = internal::round(low_thresh);
high = internal::round(high_thresh);
f32 ldiff = (f32)(low_thresh - low);
f32 hdiff = (f32)(high_thresh - high);
low -= (ldiff < 0);
high -= (hdiff < 0);
#endif
}
template <bool L2gradient, bool externalSobel>
struct _normEstimator
{
ptrdiff_t magstep;
ptrdiff_t dxOffset;
ptrdiff_t dyOffset;
ptrdiff_t shxOffset;
ptrdiff_t shyOffset;
std::vector<u8> buffer;
const ptrdiff_t offsetk;
ptrdiff_t borderyt, borderyb;
RowFilter3x3Canny sobelRow;
inline _normEstimator(const Size2D &size, s32, Margin borderMargin,
ptrdiff_t &mapstep, s32** mag_buf, u8* &map):
offsetk(1),
sobelRow(std::max<ptrdiff_t>(0, offsetk - (ptrdiff_t)borderMargin.left),
std::max<ptrdiff_t>(0, offsetk - (ptrdiff_t)borderMargin.right))
{
mapstep = size.width + 2;
magstep = size.width + 2 + size.width * (4 * sizeof(s16)/sizeof(s32));
dxOffset = mapstep * sizeof(s32)/sizeof(s16);
dyOffset = dxOffset + size.width * 1;
shxOffset = dxOffset + size.width * 2;
shyOffset = dxOffset + size.width * 3;
buffer.resize( (size.width+2)*(size.height+2) + magstep*3*sizeof(s32) );
mag_buf[0] = (s32*)&buffer[0];
mag_buf[1] = mag_buf[0] + magstep;
mag_buf[2] = mag_buf[1] + magstep;
memset(mag_buf[0], 0, mapstep * sizeof(s32));
map = (u8*)(mag_buf[2] + magstep);
memset(map, 1, mapstep);
memset(map + mapstep*(size.height + 1), 1, mapstep);
borderyt = std::max<ptrdiff_t>(0, offsetk - (ptrdiff_t)borderMargin.top);
borderyb = std::max<ptrdiff_t>(0, offsetk - (ptrdiff_t)borderMargin.bottom);
}
inline void firstRow(const Size2D &size, s32,
const u8 *srcBase, ptrdiff_t srcStride,
s16*, ptrdiff_t,
s16*, ptrdiff_t,
s32** mag_buf)
{
//sobelH row #0
const u8* _src = internal::getRowPtr(srcBase, srcStride, 0);
sobelRow(_src, ((s16*)mag_buf[0]) + shxOffset, ((s16*)mag_buf[0]) + shyOffset, size.width);
//sobelH row #1
_src = internal::getRowPtr(srcBase, srcStride, 1);
sobelRow(_src, ((s16*)mag_buf[1]) + shxOffset, ((s16*)mag_buf[1]) + shyOffset, size.width);
mag_buf[1][0] = mag_buf[1][size.width+1] = 0;
if (borderyt == 0)
{
//sobelH row #-1
_src = internal::getRowPtr(srcBase, srcStride, -1);
sobelRow(_src, ((s16*)mag_buf[2]) + shxOffset, ((s16*)mag_buf[2]) + shyOffset, size.width);
ColFilter3x3Canny<L2gradient>( ((s16*)mag_buf[2]) + shxOffset, ((s16*)mag_buf[0]) + shxOffset, ((s16*)mag_buf[1]) + shxOffset,
((s16*)mag_buf[1]) + dxOffset, ((s16*)mag_buf[1]) + dyOffset, mag_buf[1] + 1, size.width);
}
else
{
ColFilter3x3Canny<L2gradient>( ((s16*)mag_buf[0]) + shxOffset, ((s16*)mag_buf[0]) + shxOffset, ((s16*)mag_buf[1]) + shxOffset,
((s16*)mag_buf[1]) + dxOffset, ((s16*)mag_buf[1]) + dyOffset, mag_buf[1] + 1, size.width);
}
}
inline void nextRow(const Size2D &size, s32,
const u8 *srcBase, ptrdiff_t srcStride,
s16*, ptrdiff_t,
s16*, ptrdiff_t,
const ptrdiff_t &mapstep, s32** mag_buf,
size_t i, const s16* &_x, const s16* &_y)
{
mag_buf[2][0] = mag_buf[2][size.width+1] = 0;
if (i < size.height - borderyb)
{
const u8* _src = internal::getRowPtr(srcBase, srcStride, i+1);
//sobelH row #i+1
sobelRow(_src, ((s16*)mag_buf[2]) + shxOffset, ((s16*)mag_buf[2]) + shyOffset, size.width);
ColFilter3x3Canny<L2gradient>( ((s16*)mag_buf[0]) + shxOffset, ((s16*)mag_buf[1]) + shxOffset, ((s16*)mag_buf[2]) + shxOffset,
((s16*)mag_buf[2]) + dxOffset, ((s16*)mag_buf[2]) + dyOffset, mag_buf[2] + 1, size.width);
}
else if (i < size.height)
{
ColFilter3x3Canny<L2gradient>( ((s16*)mag_buf[0]) + shxOffset, ((s16*)mag_buf[1]) + shxOffset, ((s16*)mag_buf[1]) + shxOffset,
((s16*)mag_buf[2]) + dxOffset, ((s16*)mag_buf[2]) + dyOffset, mag_buf[2] + 1, size.width);
}
else
memset(mag_buf[2], 0, mapstep*sizeof(s32));
_x = ((s16*)mag_buf[1]) + dxOffset;
_y = ((s16*)mag_buf[1]) + dyOffset;
}
};
template <bool L2gradient>
struct _normEstimator<L2gradient, true>
{
std::vector<u8> buffer;
inline _normEstimator(const Size2D &size, s32 cn, Margin,
ptrdiff_t &mapstep, s32** mag_buf, u8* &map)
{
mapstep = size.width + 2;
buffer.resize( (size.width+2)*(size.height+2) + cn*mapstep*3*sizeof(s32) );
mag_buf[0] = (s32*)&buffer[0];
mag_buf[1] = mag_buf[0] + mapstep*cn;
mag_buf[2] = mag_buf[1] + mapstep*cn;
memset(mag_buf[0], 0, /* cn* */mapstep * sizeof(s32));
map = (u8*)(mag_buf[2] + mapstep*cn);
memset(map, 1, mapstep);
memset(map + mapstep*(size.height + 1), 1, mapstep);
}
inline void firstRow(const Size2D &size, s32 cn,
const u8 *, ptrdiff_t,
s16* dxBase, ptrdiff_t dxStride,
s16* dyBase, ptrdiff_t dyStride,
s32** mag_buf)
{
s32* _norm = mag_buf[1] + 1;
s16* _dx = internal::getRowPtr(dxBase, dxStride, 0);
s16* _dy = internal::getRowPtr(dyBase, dyStride, 0);
NormCanny<L2gradient>(size.width*cn, _dx, _dy, _norm);
if(cn > 1)
{
for(size_t j = 0, jn = 0; j < size.width; ++j, jn += cn)
{
size_t maxIdx = jn;
for(s32 k = 1; k < cn; ++k)
if(_norm[jn + k] > _norm[maxIdx]) maxIdx = jn + k;
_norm[j] = _norm[maxIdx];
_dx[j] = _dx[maxIdx];
_dy[j] = _dy[maxIdx];
}
}
_norm[-1] = _norm[size.width] = 0;
}
inline void nextRow(const Size2D &size, s32 cn,
const u8 *, ptrdiff_t,
s16* dxBase, ptrdiff_t dxStride,
s16* dyBase, ptrdiff_t dyStride,
const ptrdiff_t &mapstep, s32** mag_buf,
size_t i, const s16* &_x, const s16* &_y)
{
s32* _norm = mag_buf[(i > 0) + 1] + 1;
if (i < size.height)
{
s16* _dx = internal::getRowPtr(dxBase, dxStride, i);
s16* _dy = internal::getRowPtr(dyBase, dyStride, i);
NormCanny<L2gradient>(size.width*cn, _dx, _dy, _norm);
if(cn > 1)
{
for(size_t j = 0, jn = 0; j < size.width; ++j, jn += cn)
{
size_t maxIdx = jn;
for(s32 k = 1; k < cn; ++k)
if(_norm[jn + k] > _norm[maxIdx]) maxIdx = jn + k;
_norm[j] = _norm[maxIdx];
_dx[j] = _dx[maxIdx];
_dy[j] = _dy[maxIdx];
}
}
_norm[-1] = _norm[size.width] = 0;
}
else
memset(_norm-1, 0, /* cn* */mapstep*sizeof(s32));
_x = internal::getRowPtr(dxBase, dxStride, i-1);
_y = internal::getRowPtr(dyBase, dyStride, i-1);
}
};
template <bool L2gradient, bool externalSobel>
inline void Canny3x3(const Size2D &size, s32 cn,
const u8 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
s16 * dxBase, ptrdiff_t dxStride,
s16 * dyBase, ptrdiff_t dyStride,
f64 low_thresh, f64 high_thresh,
Margin borderMargin)
{
s32 low, high;
prepareThresh<L2gradient>(low_thresh, high_thresh, low, high);
ptrdiff_t mapstep;
s32* mag_buf[3];
u8* map;
_normEstimator<L2gradient, externalSobel> normEstimator(size, cn, borderMargin, mapstep, mag_buf, map);
size_t maxsize = std::max<size_t>( 1u << 10, size.width * size.height / 10 );
std::vector<u8*> stack( maxsize );
u8 **stack_top = &stack[0];
u8 **stack_bottom = &stack[0];
/* sector numbers
(Top-Left Origin)
1 2 3
* * *
* * *
0*******0
* * *
* * *
3 2 1
*/
#define CANNY_PUSH(d) *(d) = u8(2), *stack_top++ = (d)
#define CANNY_POP(d) (d) = *--stack_top
//i == 0
normEstimator.firstRow(size, cn, srcBase, srcStride, dxBase, dxStride, dyBase, dyStride, mag_buf);
// calculate magnitude and angle of gradient, perform non-maxima supression.
// fill the map with one of the following values:
// 0 - the pixel might belong to an edge
// 1 - the pixel can not belong to an edge
// 2 - the pixel does belong to an edge
for (size_t i = 1; i <= size.height; i++)
{
const s16 *_x, *_y;
normEstimator.nextRow(size, cn, srcBase, srcStride, dxBase, dxStride, dyBase, dyStride, mapstep, mag_buf, i, _x, _y);
u8* _map = map + mapstep*i + 1;
_map[-1] = _map[size.width] = 1;
s32* _mag = mag_buf[1] + 1; // take the central row
ptrdiff_t magstep1 = mag_buf[2] - mag_buf[1];
ptrdiff_t magstep2 = mag_buf[0] - mag_buf[1];
if ((stack_top - stack_bottom) + size.width > maxsize)
{
ptrdiff_t sz = (ptrdiff_t)(stack_top - stack_bottom);
maxsize = maxsize * 3/2;
stack.resize(maxsize);
stack_bottom = &stack[0];
stack_top = stack_bottom + sz;
}
s32 prev_flag = 0;
for (ptrdiff_t j = 0; j < (ptrdiff_t)size.width; j++)
{
#define CANNY_SHIFT 15
const s32 TG22 = (s32)(0.4142135623730950488016887242097*(1<<CANNY_SHIFT) + 0.5);
s32 m = _mag[j];
if (m > low)
{
s32 xs = _x[j];
s32 ys = _y[j];
s32 x = abs(xs);
s32 y = abs(ys) << CANNY_SHIFT;
s32 tg22x = x * TG22;
if (y < tg22x)
{
if (m > _mag[j-1] && m >= _mag[j+1]) goto __push;
}
else
{
s32 tg67x = tg22x + (x << (CANNY_SHIFT+1));
if (y > tg67x)
{
if (m > _mag[j+magstep2] && m >= _mag[j+magstep1]) goto __push;
}
else
{
s32 s = (xs ^ ys) < 0 ? -1 : 1;
if(m > _mag[j+magstep2-s] && m > _mag[j+magstep1+s]) goto __push;
}
}
}
prev_flag = 0;
_map[j] = u8(1);
continue;
__push:
if (!prev_flag && m > high && _map[j-mapstep] != 2)
{
CANNY_PUSH(_map + j);
prev_flag = 1;
}
else
_map[j] = 0;
}
// scroll the ring buffer
_mag = mag_buf[0];
mag_buf[0] = mag_buf[1];
mag_buf[1] = mag_buf[2];
mag_buf[2] = _mag;
}
// now track the edges (hysteresis thresholding)
while (stack_top > stack_bottom)
{
u8* m;
if ((size_t)(stack_top - stack_bottom) + 8u > maxsize)
{
ptrdiff_t sz = (ptrdiff_t)(stack_top - stack_bottom);
maxsize = maxsize * 3/2;
stack.resize(maxsize);
stack_bottom = &stack[0];
stack_top = stack_bottom + sz;
}
CANNY_POP(m);
if (!m[-1]) CANNY_PUSH(m - 1);
if (!m[1]) CANNY_PUSH(m + 1);
if (!m[-mapstep-1]) CANNY_PUSH(m - mapstep - 1);
if (!m[-mapstep]) CANNY_PUSH(m - mapstep);
if (!m[-mapstep+1]) CANNY_PUSH(m - mapstep + 1);
if (!m[mapstep-1]) CANNY_PUSH(m + mapstep - 1);
if (!m[mapstep]) CANNY_PUSH(m + mapstep);
if (!m[mapstep+1]) CANNY_PUSH(m + mapstep + 1);
}
// the final pass, form the final image
uint8x16_t v2 = vmovq_n_u8(2);
const u8* ptrmap = map + mapstep + 1;
for (size_t i = 0; i < size.height; i++, ptrmap += mapstep)
{
u8* _dst = internal::getRowPtr(dstBase, dstStride, i);
ptrdiff_t j = 0;
for (; j < (ptrdiff_t)size.width - 16; j += 16)
{
internal::prefetch(ptrmap);
uint8x16_t vmap = vld1q_u8(ptrmap + j);
uint8x16_t vdst = vceqq_u8(vmap, v2);
vst1q_u8(_dst+j, vdst);
}
for (; j < (ptrdiff_t)size.width; j++)
_dst[j] = (u8)-(ptrmap[j] >> 1);
}
}
} // namespace
#endif
bool isCanny3x3Supported(const Size2D &size)
{
return isSupportedConfiguration() &&
size.height >= 2 && size.width >= 9;
}
void Canny3x3L1(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
f64 low_thresh, f64 high_thresh,
Margin borderMargin)
{
internal::assertSupportedConfiguration(isCanny3x3Supported(size));
#ifdef CAROTENE_NEON
Canny3x3<false, false>(size, 1,
srcBase, srcStride,
dstBase, dstStride,
NULL, 0,
NULL, 0,
low_thresh, high_thresh,
borderMargin);
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)low_thresh;
(void)high_thresh;
(void)borderMargin;
#endif
}
void Canny3x3L2(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
f64 low_thresh, f64 high_thresh,
Margin borderMargin)
{
internal::assertSupportedConfiguration(isCanny3x3Supported(size));
#ifdef CAROTENE_NEON
Canny3x3<true, false>(size, 1,
srcBase, srcStride,
dstBase, dstStride,
NULL, 0,
NULL, 0,
low_thresh, high_thresh,
borderMargin);
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)low_thresh;
(void)high_thresh;
(void)borderMargin;
#endif
}
void Canny3x3L1(const Size2D &size, s32 cn,
s16 * dxBase, ptrdiff_t dxStride,
s16 * dyBase, ptrdiff_t dyStride,
u8 * dstBase, ptrdiff_t dstStride,
f64 low_thresh, f64 high_thresh)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
Canny3x3<false, true>(size, cn,
NULL, 0,
dstBase, dstStride,
dxBase, dxStride,
dyBase, dyStride,
low_thresh, high_thresh,
Margin());
#else
(void)size;
(void)cn;
(void)dstBase;
(void)dstStride;
(void)dxBase;
(void)dxStride;
(void)dyBase;
(void)dyStride;
(void)low_thresh;
(void)high_thresh;
#endif
}
void Canny3x3L2(const Size2D &size, s32 cn,
s16 * dxBase, ptrdiff_t dxStride,
s16 * dyBase, ptrdiff_t dyStride,
u8 * dstBase, ptrdiff_t dstStride,
f64 low_thresh, f64 high_thresh)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
Canny3x3<true, true>(size, cn,
NULL, 0,
dstBase, dstStride,
dxBase, dxStride,
dyBase, dyStride,
low_thresh, high_thresh,
Margin());
#else
(void)size;
(void)cn;
(void)dstBase;
(void)dstStride;
(void)dxBase;
(void)dxStride;
(void)dyBase;
(void)dyStride;
(void)low_thresh;
(void)high_thresh;
#endif
}
} // namespace CAROTENE_NS

View File

@ -0,0 +1,486 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
void extract2(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
u32 coi)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
#ifndef ANDROID
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
#endif
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0u; i < size.height; ++i)
{
const u8 * src = internal::getRowPtr(srcBase, srcStride, i);
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t sj = 0u, dj = 0u;
#ifndef ANDROID
for (; dj < roiw32; sj += 64, dj += 32)
{
internal::prefetch(src + sj);
uint8x16x2_t v_src = vld2q_u8(src + sj);
vst1q_u8(dst + dj, v_src.val[coi]);
v_src = vld2q_u8(src + sj + 32);
vst1q_u8(dst + dj + 16, v_src.val[coi]);
}
#endif
for (; dj < roiw8; sj += 16, dj += 8)
{
uint8x8x2_t v_src = vld2_u8(src + sj);
vst1_u8(dst + dj, v_src.val[coi]);
}
for (; dj < size.width; sj += 2, ++dj)
{
dst[dj] = src[sj + coi];
}
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)coi;
#endif
}
void extract3(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
u32 coi)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
#ifndef ANDROID
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
#endif
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0u; i < size.height; ++i)
{
const u8 * src = internal::getRowPtr(srcBase, srcStride, i);
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t sj = 0u, dj = 0u;
#ifndef ANDROID
for (; dj < roiw32; sj += 96, dj += 32)
{
internal::prefetch(src + sj);
uint8x16x3_t v_src = vld3q_u8(src + sj);
vst1q_u8(dst + dj, v_src.val[coi]);
v_src = vld3q_u8(src + sj + 48);
vst1q_u8(dst + dj + 16, v_src.val[coi]);
}
#endif
for (; dj < roiw8; sj += 24, dj += 8)
{
uint8x8x3_t v_src = vld3_u8(src + sj);
vst1_u8(dst + dj, v_src.val[coi]);
}
for (; dj < size.width; sj += 3, ++dj)
{
dst[dj] = src[sj + coi];
}
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)coi;
#endif
}
void extract4(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
u32 coi)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
#ifndef ANDROID
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
#endif
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0u; i < size.height; ++i)
{
const u8 * src = internal::getRowPtr(srcBase, srcStride, i);
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t sj = 0u, dj = 0u;
#ifndef ANDROID
for (; dj < roiw32; sj += 128, dj += 32)
{
internal::prefetch(src + sj);
uint8x16x4_t v_src = vld4q_u8(src + sj);
vst1q_u8(dst + dj, v_src.val[coi]);
v_src = vld4q_u8(src + sj + 64);
vst1q_u8(dst + dj + 16, v_src.val[coi]);
}
#endif
for (; dj < roiw8; sj += 32, dj += 8)
{
uint8x8x4_t v_src = vld4_u8(src + sj);
vst1_u8(dst + dj, v_src.val[coi]);
}
for (; dj < size.width; sj += 4, ++dj)
{
dst[dj] = src[sj + coi];
}
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)coi;
#endif
}
#define FILL_LINES2(macro,type) \
macro##_LINE(type,0) \
macro##_LINE(type,1)
#define FILL_LINES3(macro,type) \
FILL_LINES2(macro,type) \
macro##_LINE(type,2)
#define FILL_LINES4(macro,type) \
FILL_LINES3(macro,type) \
macro##_LINE(type,3)
#define FARG_LINE(type, n) , type * dst##n##Base, ptrdiff_t dst##n##Stride
#ifdef CAROTENE_NEON
#define VROW_LINE(type, n) type * dst##n = internal::getRowPtr(dst##n##Base, dst##n##Stride, i);
#define VST1Q_LINE(type, n) vst1q_##type(dst##n + dj, v_src.val[n]);
#define VST1_LINE(type, n) vst1_##type(dst##n + dj, v_src.val[n]);
#define SST_LINE(type, n) dst##n[dj] = src[sj + n];
#define MUL2(val) (val << 1)
#define MUL3(val) (MUL2(val) + val)
#define MUL4(val) (val << 2)
#define CONTDST2 srcStride == dst0Stride && \
srcStride == dst1Stride &&
#define CONTDST3 srcStride == dst0Stride && \
srcStride == dst1Stride && \
srcStride == dst2Stride &&
#define CONTDST4 srcStride == dst0Stride && \
srcStride == dst1Stride && \
srcStride == dst2Stride && \
srcStride == dst3Stride &&
#if __GNUC__ == 4 && __GNUC_MINOR__ < 7
#define SPLIT_ASM2(sgn, bits) __asm__ ( \
"vld2." #bits " {d0, d2}, [%[in0]] \n\t" \
"vld2." #bits " {d1, d3}, [%[in1]] \n\t" \
"vst1." #bits " {d0-d1}, [%[out0]] \n\t" \
"vst1." #bits " {d2-d3}, [%[out1]] \n\t" \
: \
: [out0] "r" (dst0 + dj), [out1] "r" (dst1 + dj), \
[in0] "r" (src + sj), [in1] "r" (src + sj + MUL2(8)/sizeof(sgn##bits)) \
: "d0","d1","d2","d3" \
);
#define SPLIT_ASM3(sgn, bits) __asm__ ( \
"vld3." #bits " {d0, d2, d4}, [%[in0]] \n\t" \
"vld3." #bits " {d1, d3, d5}, [%[in1]] \n\t" \
"vst1." #bits " {d0-d1}, [%[out0]] \n\t" \
"vst1." #bits " {d2-d3}, [%[out1]] \n\t" \
"vst1." #bits " {d4-d5}, [%[out2]] \n\t" \
: \
: [out0] "r" (dst0 + dj), [out1] "r" (dst1 + dj), [out2] "r" (dst2 + dj), \
[in0] "r" (src + sj), [in1] "r" (src + sj + MUL3(8)/sizeof(sgn##bits)) \
: "d0","d1","d2","d3","d4","d5" \
);
#define SPLIT_ASM4(sgn, bits) __asm__ ( \
"vld4." #bits " {d0, d2, d4, d6}, [%[in0]] \n\t" \
"vld4." #bits " {d1, d3, d5, d7}, [%[in1]] \n\t" \
"vst1." #bits " {d0-d1}, [%[out0]] \n\t" \
"vst1." #bits " {d2-d3}, [%[out1]] \n\t" \
"vst1." #bits " {d4-d5}, [%[out2]] \n\t" \
"vst1." #bits " {d6-d7}, [%[out3]] \n\t" \
: \
: [out0] "r" (dst0 + dj), [out1] "r" (dst1 + dj), [out2] "r" (dst2 + dj), [out3] "r" (dst3 + dj), \
[in0] "r" (src + sj), [in1] "r" (src + sj + MUL4(8)/sizeof(sgn##bits)) \
: "d0","d1","d2","d3","d4","d5","d6","d7" \
);
#define SPLIT_QUAD(sgn, bits, n) { \
internal::prefetch(src + sj); \
SPLIT_ASM##n(sgn, bits) \
}
#else
#define SPLIT_QUAD(sgn, bits, n) { \
internal::prefetch(src + sj); \
vec128 v_src = vld##n##q_##sgn##bits(src + sj); \
FILL_LINES##n(VST1Q, sgn##bits) \
}
#endif // __GNUC__ == 4 && __GNUC_MINOR__ < 7
#define SPLIT(sgn,bits,n) void split##n(const Size2D &_size, \
const sgn##bits * srcBase, ptrdiff_t srcStride \
FILL_LINES##n(FARG, sgn##bits) ) \
{ \
internal::assertSupportedConfiguration(); \
Size2D size(_size); \
if (CONTDST##n \
dst0Stride == (ptrdiff_t)(size.width)) \
{ \
size.width *= size.height; \
size.height = 1; \
} \
typedef internal::VecTraits<sgn##bits, n>::vec128 vec128; \
size_t roiw16 = size.width >= (16/sizeof(sgn##bits)-1) ? size.width - (16/sizeof(sgn##bits)-1) : 0; \
typedef internal::VecTraits<sgn##bits, n>::vec64 vec64; \
size_t roiw8 = size.width >= (8/sizeof(sgn##bits)-1) ? size.width - (8/sizeof(sgn##bits)-1) : 0; \
\
for (size_t i = 0u; i < size.height; ++i) \
{ \
const sgn##bits * src = internal::getRowPtr(srcBase, srcStride, i); \
FILL_LINES##n(VROW, sgn##bits) \
size_t sj = 0u, dj = 0u; \
\
for (; dj < roiw16; sj += MUL##n(16)/sizeof(sgn##bits), dj += 16/sizeof(sgn##bits)) \
SPLIT_QUAD(sgn, bits, n) \
\
if (dj < roiw8) \
{ \
vec64 v_src = vld##n##_##sgn##bits(src + sj); \
FILL_LINES##n(VST1, sgn##bits) \
sj += MUL##n(8)/sizeof(sgn##bits); \
dj += 8/sizeof(sgn##bits); \
} \
\
for (; dj < size.width; sj += n, ++dj) \
{ \
FILL_LINES##n(SST, sgn##bits) \
} \
} \
}
#define SPLIT64(sgn,n) void split##n(const Size2D &_size, \
const sgn##64 * srcBase, ptrdiff_t srcStride \
FILL_LINES##n(FARG, sgn##64) ) \
{ \
internal::assertSupportedConfiguration(); \
Size2D size(_size); \
if (CONTDST##n \
dst0Stride == (ptrdiff_t)(size.width)) \
{ \
size.width *= size.height; \
size.height = 1; \
} \
typedef internal::VecTraits<sgn##64, n>::vec64 vec64; \
\
for (size_t i = 0u; i < size.height; ++i) \
{ \
const sgn##64 * src = internal::getRowPtr(srcBase, srcStride, i); \
FILL_LINES##n(VROW, sgn##64) \
size_t sj = 0u, dj = 0u; \
\
for (; dj < size.width; sj += n, ++dj) \
{ \
vec64 v_src = vld##n##_##sgn##64(src + sj); \
FILL_LINES##n(VST1, sgn##64) \
} \
} \
}
#if __GNUC__ == 4 && __GNUC_MINOR__ < 7
#define ALPHA_QUAD(sgn, bits) { \
internal::prefetch(src + sj); \
__asm__ ( \
"vld4." #bits " {d0, d2, d4, d6}, [%[in0]] \n\t" \
"vld4." #bits " {d1, d3, d5, d7}, [%[in1]] \n\t" \
"vst3." #bits " {d0, d2, d4}, [%[out3_1]] \n\t" \
"vst3." #bits " {d1, d3, d5}, [%[out3_2]] \n\t" \
"vst1." #bits " {d6-d7}, [%[out1]] \n\t" \
: \
: [out3_1] "r" (dst3 + d3j), [out3_2] "r" (dst3 + d3j + 24/sizeof(sgn##bits)), [out1] "r" (dst1 + d1j), \
[in0] "r" (src + sj), [in1] "r" (src + sj + 32/sizeof(sgn##bits)) \
: "d0","d1","d2","d3","d4","d5","d6","d7" \
); \
}
#else
#define ALPHA_QUAD(sgn, bits) { \
internal::prefetch(src + sj); \
union { vec128_4 v4; vec128_3 v3; } vals; \
vals.v4 = vld4q_##sgn##bits(src + sj); \
vst3q_##sgn##bits(dst3 + d3j, vals.v3); \
vst1q_##sgn##bits(dst1 + d1j, vals.v4.val[3]); \
}
#endif // __GNUC__ == 4 && __GNUC_MINOR__ < 7
#define SPLIT4ALPHA(sgn,bits) void split4(const Size2D &_size, \
const sgn##bits * srcBase, ptrdiff_t srcStride, \
sgn##bits * dst3Base, ptrdiff_t dst3Stride, \
sgn##bits * dst1Base, ptrdiff_t dst1Stride) \
{ \
internal::assertSupportedConfiguration(); \
Size2D size(_size); \
if (srcStride == dst3Stride && \
srcStride == dst1Stride && \
srcStride == (ptrdiff_t)(size.width)) \
{ \
size.width *= size.height; \
size.height = 1; \
} \
typedef internal::VecTraits<sgn##bits, 4>::vec128 vec128_4; \
typedef internal::VecTraits<sgn##bits, 3>::vec128 vec128_3; \
size_t roiw16 = size.width >= (16/sizeof(sgn##bits)-1) ? size.width - (16/sizeof(sgn##bits)-1) : 0; \
typedef internal::VecTraits<sgn##bits, 4>::vec64 vec64_4; \
typedef internal::VecTraits<sgn##bits, 3>::vec64 vec64_3; \
size_t roiw8 = size.width >= (8/sizeof(sgn##bits)-1) ? size.width - (8/sizeof(sgn##bits)-1) : 0; \
\
for (size_t i = 0u; i < size.height; ++i) \
{ \
const sgn##bits * src = internal::getRowPtr(srcBase, srcStride, i); \
sgn##bits * dst3 = internal::getRowPtr(dst3Base, dst3Stride, i); \
sgn##bits * dst1 = internal::getRowPtr(dst1Base, dst1Stride, i); \
size_t sj = 0u, d3j = 0u, d1j = 0u; \
\
for (; d1j < roiw16; sj += MUL4(16)/sizeof(sgn##bits), d3j += MUL3(16)/sizeof(sgn##bits), \
d1j += 16/sizeof(sgn##bits)) \
ALPHA_QUAD(sgn, bits) \
\
if (d1j < roiw8) \
{ \
union { vec64_4 v4; vec64_3 v3; } vals; \
vals.v4 = vld4_##sgn##bits(src + sj); \
vst3_u8(dst3 + d3j, vals.v3); \
vst1_u8(dst1 + d1j, vals.v4.val[3]); \
sj += MUL4(8)/sizeof(sgn##bits); \
d3j += MUL3(8)/sizeof(sgn##bits); \
d1j += 8/sizeof(sgn##bits); \
} \
\
for (; d1j < size.width; sj += 4, d3j += 3, ++d1j) \
{ \
dst3[d3j+0] = src[sj + 0]; \
dst3[d3j+1] = src[sj + 1]; \
dst3[d3j+2] = src[sj + 2]; \
dst1[d1j] = src[sj + 3]; \
} \
} \
}
#else
#define VOID_LINE(type, n) (void)dst##n##Base; (void)dst##n##Stride;
#define SPLIT(sgn,bits,n) void split##n(const Size2D &size, \
const sgn##bits * srcBase, ptrdiff_t srcStride \
FILL_LINES##n(FARG, sgn##bits) ) \
{ \
internal::assertSupportedConfiguration(); \
(void)size; \
(void)srcBase; \
(void)srcStride; \
FILL_LINES##n(VOID, sgn##bits) \
}
#define SPLIT64(sgn,n) SPLIT(sgn,64,n)
#define SPLIT4ALPHA(sgn,bits) void split4(const Size2D &size, \
const sgn##bits * srcBase, ptrdiff_t srcStride, \
sgn##bits * dst3Base, ptrdiff_t dst3Stride, \
sgn##bits * dst1Base, ptrdiff_t dst1Stride) \
{ \
internal::assertSupportedConfiguration(); \
(void)size; \
(void)srcBase; \
(void)srcStride; \
(void)dst3Base; \
(void)dst3Stride; \
(void)dst1Base; \
(void)dst1Stride; \
}
#endif //CAROTENE_NEON
SPLIT(u, 8,2)
SPLIT(u, 8,3)
SPLIT(u, 8,4)
SPLIT(u,16,2)
SPLIT(u,16,3)
SPLIT(u,16,4)
SPLIT(s,32,2)
SPLIT(s,32,3)
SPLIT(s,32,4)
SPLIT64(s, 2)
SPLIT64(s, 3)
SPLIT64(s, 4)
SPLIT4ALPHA(u,8)
} // namespace CAROTENE_NS

View File

@ -0,0 +1,389 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#define FILL_LINES2(macro,type) \
macro##_LINE(type,0) \
macro##_LINE(type,1)
#define FILL_LINES3(macro,type) \
FILL_LINES2(macro,type) \
macro##_LINE(type,2)
#define FILL_LINES4(macro,type) \
FILL_LINES3(macro,type) \
macro##_LINE(type,3)
#define FARG_LINE(type, n) , const type * src##n##Base, ptrdiff_t src##n##Stride
#ifdef CAROTENE_NEON
#define VROW_LINE(type, n) const type * src##n = internal::getRowPtr(src##n##Base, src##n##Stride, i);
#define PREF_LINE(type, n) internal::prefetch(src##n + sj);
#define VLD1Q_LINE(type, n) v_dst.val[n] = vld1q_##type(src##n + sj);
#define PRLD_LINE(type, n) internal::prefetch(src##n + sj); v_dst.val[n] = vld1q_##type(src##n + sj);
#define VLD1_LINE(type, n) v_dst.val[n] = vld1_##type(src##n + sj);
#define SLD_LINE(type, n) dst[dj + n] = src##n[sj];
#define MUL2(val) (val << 1)
#define MUL3(val) (MUL2(val) + val)
#define MUL4(val) (val << 2)
#define CONTSRC2 dstStride == src0Stride && \
dstStride == src1Stride &&
#define CONTSRC3 dstStride == src0Stride && \
dstStride == src1Stride && \
dstStride == src2Stride &&
#define CONTSRC4 dstStride == src0Stride && \
dstStride == src1Stride && \
dstStride == src2Stride && \
dstStride == src3Stride &&
#if __GNUC__ == 4 && __GNUC_MINOR__ < 7
#define MERGE_ASM2(sgn, bits) __asm__ ( \
"vld1." #bits " {d0-d1}, [%[in0]] \n\t" \
"vld1." #bits " {d2-d3}, [%[in1]] \n\t" \
"vst2." #bits " {d0, d2}, [%[out0]] \n\t" \
"vst2." #bits " {d1, d3}, [%[out1]] \n\t" \
: \
: [in0] "r" (src0 + sj), [in1] "r" (src1 + sj), \
[out0] "r" (dst + dj), [out1] "r" (dst + dj + MUL2(8)/sizeof(sgn##bits)) \
: "d0","d1","d2","d3" \
);
#define MERGE_ASM3(sgn, bits) __asm__ ( \
"vld1." #bits " {d0-d1}, [%[in0]] \n\t" \
"vld1." #bits " {d2-d3}, [%[in1]] \n\t" \
"vld1." #bits " {d4-d5}, [%[in2]] \n\t" \
"vst3." #bits " {d0, d2, d4}, [%[out0]] \n\t" \
"vst3." #bits " {d1, d3, d5}, [%[out1]] \n\t" \
: \
: [in0] "r" (src0 + sj), [in1] "r" (src1 + sj), [in2] "r" (src2 + sj), \
[out0] "r" (dst + dj), [out1] "r" (dst + dj + MUL3(8)/sizeof(sgn##bits)) \
: "d0","d1","d2","d3","d4","d5" \
);
#define MERGE_ASM4(sgn, bits) __asm__ ( \
"vld1." #bits " {d0-d1}, [%[in0]] \n\t" \
"vld1." #bits " {d2-d3}, [%[in1]] \n\t" \
"vld1." #bits " {d4-d5}, [%[in2]] \n\t" \
"vld1." #bits " {d6-d7}, [%[in3]] \n\t" \
"vst4." #bits " {d0, d2, d4, d6}, [%[out0]] \n\t" \
"vst4." #bits " {d1, d3, d5, d7}, [%[out1]] \n\t" \
: \
: [in0] "r" (src0 + sj), [in1] "r" (src1 + sj), [in2] "r" (src2 + sj), [in3] "r" (src3 + sj), \
[out0] "r" (dst + dj), [out1] "r" (dst + dj + MUL4(8)/sizeof(sgn##bits)) \
: "d0","d1","d2","d3","d4","d5","d6","d7" \
);
#define MERGE_QUAD(sgn, bits, n) { \
FILL_LINES##n(PREF, sgn##bits) \
MERGE_ASM##n(sgn, bits) \
}
#else
#define MERGE_QUAD(sgn, bits, n) { \
vec128 v_dst; \
/*FILL_LINES##n(PREF, sgn##bits) \
FILL_LINES##n(VLD1Q, sgn##bits)*/ \
FILL_LINES##n(PRLD, sgn##bits) \
vst##n##q_##sgn##bits(dst + dj, v_dst); \
}
#endif // __GNUC__ == 4 && __GNUC_MINOR__ < 7
#define COMBINE(sgn,bits,n) void combine##n(const Size2D &_size \
FILL_LINES##n(FARG, sgn##bits), \
sgn##bits * dstBase, ptrdiff_t dstStride) \
{ \
internal::assertSupportedConfiguration(); \
Size2D size(_size); \
if (CONTSRC##n \
dstStride == (ptrdiff_t)(size.width)) \
{ \
size.width *= size.height; \
size.height = 1; \
} \
typedef internal::VecTraits<sgn##bits, n>::vec128 vec128; \
size_t roiw16 = size.width >= (16/sizeof(sgn##bits) - 1) ? size.width - (16/sizeof(sgn##bits) - 1) : 0; \
typedef internal::VecTraits<sgn##bits, n>::vec64 vec64; \
size_t roiw8 = size.width >= (8/sizeof(sgn##bits) - 1) ? size.width - (8/sizeof(sgn##bits) - 1) : 0; \
\
for (size_t i = 0u; i < size.height; ++i) \
{ \
FILL_LINES##n(VROW, sgn##bits) \
sgn##bits * dst = internal::getRowPtr(dstBase, dstStride, i); \
size_t sj = 0u, dj = 0u; \
\
for (; sj < roiw16; sj += 16/sizeof(sgn##bits), dj += MUL##n(16)/sizeof(sgn##bits)) \
MERGE_QUAD(sgn, bits, n) \
\
if ( sj < roiw8 ) \
{ \
vec64 v_dst; \
FILL_LINES##n(VLD1, sgn##bits) \
vst##n##_##sgn##bits(dst + dj, v_dst); \
sj += 8/sizeof(sgn##bits); dj += MUL##n(8)/sizeof(sgn##bits); \
} \
\
for (; sj < size.width; ++sj, dj += n) \
{ \
FILL_LINES##n(SLD, sgn##bits) \
} \
} \
}
#define COMBINE64(sgn,n) void combine##n(const Size2D &_size \
FILL_LINES##n(FARG, sgn##64), \
sgn##64 * dstBase, ptrdiff_t dstStride) \
{ \
internal::assertSupportedConfiguration(); \
Size2D size(_size); \
if (CONTSRC##n \
dstStride == (ptrdiff_t)(size.width)) \
{ \
size.width *= size.height; \
size.height = 1; \
} \
typedef internal::VecTraits<sgn##64, n>::vec64 vec64; \
\
for (size_t i = 0u; i < size.height; ++i) \
{ \
FILL_LINES##n(VROW, sgn##64) \
sgn##64 * dst = internal::getRowPtr(dstBase, dstStride, i); \
size_t sj = 0u, dj = 0u; \
\
for (; sj < size.width; ++sj, dj += n) \
{ \
vec64 v_dst; \
FILL_LINES##n(VLD1, sgn##64) \
vst##n##_##sgn##64(dst + dj, v_dst); \
/*FILL_LINES##n(SLD, sgn##64)*/ \
} \
} \
}
#else
#define VOID_LINE(type, n) (void)src##n##Base; (void)src##n##Stride;
#define COMBINE(sgn,bits,n) void combine##n(const Size2D &size \
FILL_LINES##n(FARG, sgn##bits), \
sgn##bits * dstBase, ptrdiff_t dstStride) \
{ \
internal::assertSupportedConfiguration(); \
(void)size; \
FILL_LINES##n(VOID, sgn##bits) \
(void)dstBase; \
(void)dstStride; \
}
#define COMBINE64(sgn,n) COMBINE(sgn,64,n)
#endif //CAROTENE_NEON
COMBINE(u, 8,2)
COMBINE(u, 8,3)
COMBINE(u, 8,4)
COMBINE(u,16,2)
COMBINE(u,16,3)
COMBINE(u,16,4)
COMBINE(s,32,2)
COMBINE(s,32,3)
COMBINE(s,32,4)
COMBINE64(s, 2)
COMBINE64(s, 3)
COMBINE64(s, 4)
void combineYUYV(const Size2D &size,
const u8 * srcyBase, ptrdiff_t srcyStride,
const u8 * srcuBase, ptrdiff_t srcuStride,
const u8 * srcvBase, ptrdiff_t srcvStride,
u8 * dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
#ifndef ANDROID
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
#endif
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0u; i < size.height; i += 1)
{
const u8 * srcy = internal::getRowPtr(srcyBase, srcyStride, i);
const u8 * srcu = internal::getRowPtr(srcuBase, srcuStride, i);
const u8 * srcv = internal::getRowPtr(srcvBase, srcvStride, i);
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t syj = 0u, sj = 0u, dj = 0u;
#ifndef ANDROID
for (; sj < roiw32; sj += 32, syj += 64, dj += 128)
{
internal::prefetch(srcy + syj);
internal::prefetch(srcu + sj);
internal::prefetch(srcv + sj);
uint8x16x2_t v_y = vld2q_u8(srcy + syj);
uint8x16x4_t v_dst;
v_dst.val[0] = v_y.val[0];
v_dst.val[1] = vld1q_u8(srcu + sj);
v_dst.val[2] = v_y.val[1];
v_dst.val[3] = vld1q_u8(srcv + sj);
vst4q_u8(dst + dj, v_dst);
v_y = vld2q_u8(srcy + syj + 32);
v_dst.val[0] = v_y.val[0];
v_dst.val[1] = vld1q_u8(srcu + sj + 16);
v_dst.val[2] = v_y.val[1];
v_dst.val[3] = vld1q_u8(srcv + sj + 16);
vst4q_u8(dst + dj + 64, v_dst);
}
#endif
for (; sj < roiw8; sj += 8, syj += 16, dj += 32)
{
uint8x8x2_t v_y = vld2_u8(srcy + syj);
uint8x8x4_t v_dst;
v_dst.val[0] = v_y.val[0];
v_dst.val[1] = vld1_u8(srcu + sj);
v_dst.val[2] = v_y.val[1];
v_dst.val[3] = vld1_u8(srcv + sj);
vst4_u8(dst + dj, v_dst);
}
for (; sj < size.width; ++sj, syj += 2, dj += 4)
{
dst[dj] = srcy[syj];
dst[dj + 1] = srcu[sj];
dst[dj + 2] = srcy[syj + 1];
dst[dj + 3] = srcv[sj];
}
}
#else
(void)size;
(void)srcyBase;
(void)srcyStride;
(void)srcuBase;
(void)srcuStride;
(void)srcvBase;
(void)srcvStride;
(void)dstBase;
(void)dstStride;
#endif
}
void combineUYVY(const Size2D &size,
const u8 * srcyBase, ptrdiff_t srcyStride,
const u8 * srcuBase, ptrdiff_t srcuStride,
const u8 * srcvBase, ptrdiff_t srcvStride,
u8 * dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
#ifndef ANDROID
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
#endif
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0u; i < size.height; ++i)
{
const u8 * srcy = internal::getRowPtr(srcyBase, srcyStride, i);
const u8 * srcu = internal::getRowPtr(srcuBase, srcuStride, i);
const u8 * srcv = internal::getRowPtr(srcvBase, srcvStride, i);
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t syj = 0u, sj = 0u, dj = 0u;
#ifndef ANDROID
for (; sj < roiw32; sj += 32, syj += 64, dj += 128)
{
internal::prefetch(srcy + syj);
internal::prefetch(srcu + sj);
internal::prefetch(srcv + sj);
uint8x16x2_t v_y = vld2q_u8(srcy + syj);
uint8x16x4_t v_dst;
v_dst.val[0] = vld1q_u8(srcu + sj);
v_dst.val[1] = v_y.val[0];
v_dst.val[2] = vld1q_u8(srcv + sj);
v_dst.val[3] = v_y.val[1];
vst4q_u8(dst + dj, v_dst);
v_y = vld2q_u8(srcy + syj + 32);
v_dst.val[0] = vld1q_u8(srcu + sj + 16);
v_dst.val[1] = v_y.val[0];
v_dst.val[2] = vld1q_u8(srcv + sj + 16);
v_dst.val[3] = v_y.val[1];
vst4q_u8(dst + dj + 64, v_dst);
}
#endif
for (; sj < roiw8; sj += 8, syj += 16, dj += 32)
{
uint8x8x2_t v_y = vld2_u8(srcy + syj);
uint8x8x4_t v_dst;
v_dst.val[0] = vld1_u8(srcu + sj);
v_dst.val[1] = v_y.val[0];
v_dst.val[2] = vld1_u8(srcv + sj);
v_dst.val[3] = v_y.val[1];
vst4_u8(dst + dj, v_dst);
}
for (; sj < size.width; ++sj, syj += 2, dj += 4)
{
dst[dj] = srcu[sj];
dst[dj + 1] = srcy[syj];
dst[dj + 2] = srcv[sj];
dst[dj + 3] = srcy[syj + 1];
}
}
#else
(void)size;
(void)srcyBase;
(void)srcyStride;
(void)srcuBase;
(void)srcuStride;
(void)srcvBase;
(void)srcvStride;
(void)dstBase;
(void)dstStride;
#endif
}
} // namespace CAROTENE_NS

340
3rdparty/carotene/src/cmp.cpp vendored Normal file
View File

@ -0,0 +1,340 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
inline void vnst(u8* dst, uint8x16_t v1, uint8x16_t v2) { vst1q_u8(dst, v1); vst1q_u8(dst+16, v2); }
inline void vnst(u8* dst, uint16x8_t v1, uint16x8_t v2) { vst1q_u8(dst, vcombine_u8(vmovn_u16(v1), vmovn_u16(v2))); }
inline void vnst(u8* dst, uint32x4_t v1, uint32x4_t v2) { vst1_u8(dst, vmovn_u16(vcombine_u16(vmovn_u32(v1), vmovn_u32(v2)))); }
template <typename Op, int elsize> struct vtail
{
static inline void compare(const typename Op::type * src0, const typename Op::type * src1,
u8 * dst, const Op & op,
size_t &x, size_t width)
{
//do nothing since there couldn't be enough data
(void)src0;
(void)src1;
(void)dst;
(void)op;
(void)x;
(void)width;
}
};
template <typename Op> struct vtail<Op, 2>
{
static inline void compare(const typename Op::type * src0, const typename Op::type * src1,
u8 * dst, const Op & op,
size_t &x, size_t width)
{
typedef typename Op::type type;
typedef typename internal::VecTraits<type>::vec128 vec128;
typedef typename internal::VecTraits<type>::unsign::vec128 uvec128;
//There no more than 15 elements in the tail, so we could handle 8 element vector only once
if( x + 8 < width)
{
vec128 v_src0, v_src1;
uvec128 v_dst;
v_src0 = internal::vld1q(src0 + x);
v_src1 = internal::vld1q(src1 + x);
op(v_src0, v_src1, v_dst);
internal::vst1(dst + x, internal::vmovn(v_dst));
x+=8;
}
}
};
template <typename Op> struct vtail<Op, 1>
{
static inline void compare(const typename Op::type * src0, const typename Op::type * src1,
u8 * dst, const Op & op,
size_t &x, size_t width)
{
typedef typename Op::type type;
typedef typename internal::VecTraits<type>::vec128 vec128;
typedef typename internal::VecTraits<type>::unsign::vec128 uvec128;
typedef typename internal::VecTraits<type>::vec64 vec64;
typedef typename internal::VecTraits<type>::unsign::vec64 uvec64;
//There no more than 31 elements in the tail, so we could handle once 16+8 or 16 or 8 elements
if( x + 16 < width)
{
vec128 v_src0, v_src1;
uvec128 v_dst;
v_src0 = internal::vld1q(src0 + x);
v_src1 = internal::vld1q(src1 + x);
op(v_src0, v_src1, v_dst);
internal::vst1q(dst + x, v_dst);
x+=16;
}
if( x + 8 < width)
{
vec64 v_src0, v_src1;
uvec64 v_dst;
v_src0 = internal::vld1(src0 + x);
v_src1 = internal::vld1(src1 + x);
op(v_src0, v_src1, v_dst);
internal::vst1(dst + x, v_dst);
x+=8;
}
}
};
template <typename Op>
void vcompare(Size2D size,
const typename Op::type * src0Base, ptrdiff_t src0Stride,
const typename Op::type * src1Base, ptrdiff_t src1Stride,
u8 * dstBase, ptrdiff_t dstStride, const Op & op)
{
typedef typename Op::type type;
typedef typename internal::VecTraits<type>::vec128 vec128;
typedef typename internal::VecTraits<type>::unsign::vec128 uvec128;
if (src0Stride == src1Stride && src0Stride == dstStride &&
src0Stride == (ptrdiff_t)(size.width * sizeof(type)))
{
size.width *= size.height;
size.height = 1;
}
const u32 step_base = 32 / sizeof(type);
size_t roiw_base = size.width >= (step_base - 1) ? size.width - step_base + 1 : 0;
for (size_t y = 0; y < size.height; ++y)
{
const type * src0 = internal::getRowPtr(src0Base, src0Stride, y);
const type * src1 = internal::getRowPtr(src1Base, src1Stride, y);
u8 * dst = internal::getRowPtr(dstBase, dstStride, y);
size_t x = 0;
for( ; x < roiw_base; x += step_base )
{
internal::prefetch(src0 + x);
internal::prefetch(src1 + x);
vec128 v_src00 = internal::vld1q(src0 + x), v_src01 = internal::vld1q(src0 + x + 16 / sizeof(type));
vec128 v_src10 = internal::vld1q(src1 + x), v_src11 = internal::vld1q(src1 + x + 16 / sizeof(type));
uvec128 v_dst0;
uvec128 v_dst1;
op(v_src00, v_src10, v_dst0);
op(v_src01, v_src11, v_dst1);
vnst(dst + x, v_dst0, v_dst1);
}
vtail<Op, sizeof(type)>::compare(src0, src1, dst, op, x, size.width);
for (; x < size.width; ++x)
{
op(src0 + x, src1 + x, dst + x);
}
}
}
template<typename T>
struct OpCmpEQ
{
typedef T type;
void operator() (const typename internal::VecTraits<T>::vec128 & v_src0, const typename internal::VecTraits<T>::vec128 & v_src1,
typename internal::VecTraits<T>::unsign::vec128 & v_dst) const
{
v_dst = internal::vceqq(v_src0, v_src1);
}
void operator() (const typename internal::VecTraits<T>::vec64 & v_src0, const typename internal::VecTraits<T>::vec64 & v_src1,
typename internal::VecTraits<T>::unsign::vec64 & v_dst) const
{
v_dst = internal::vceq(v_src0, v_src1);
}
void operator() (const T * src0, const T * src1, u8 * dst) const
{
dst[0] = src0[0] == src1[0] ? 255 : 0;
}
};
template<typename T>
struct OpCmpNE
{
typedef T type;
void operator() (const typename internal::VecTraits<T>::vec128 & v_src0, const typename internal::VecTraits<T>::vec128 & v_src1,
typename internal::VecTraits<T>::unsign::vec128 & v_dst) const
{
v_dst = internal::vmvnq(internal::vceqq(v_src0, v_src1));
}
void operator() (const typename internal::VecTraits<T>::vec64 & v_src0, const typename internal::VecTraits<T>::vec64 & v_src1,
typename internal::VecTraits<T>::unsign::vec64 & v_dst) const
{
v_dst = internal::vmvn(internal::vceq(v_src0, v_src1));
}
void operator() (const T * src0, const T * src1, u8 * dst) const
{
dst[0] = src0[0] == src1[0] ? 0 : 255;
}
};
template<typename T>
struct OpCmpGT
{
typedef T type;
void operator() (const typename internal::VecTraits<T>::vec128 & v_src0, const typename internal::VecTraits<T>::vec128 & v_src1,
typename internal::VecTraits<T>::unsign::vec128 & v_dst) const
{
v_dst = internal::vcgtq(v_src0, v_src1);
}
void operator() (const typename internal::VecTraits<T>::vec64 & v_src0, const typename internal::VecTraits<T>::vec64 & v_src1,
typename internal::VecTraits<T>::unsign::vec64 & v_dst) const
{
v_dst = internal::vcgt(v_src0, v_src1);
}
void operator() (const T * src0, const T * src1, u8 * dst) const
{
dst[0] = src0[0] > src1[0] ? 255 : 0;
}
};
template<typename T>
struct OpCmpGE
{
typedef T type;
void operator() (const typename internal::VecTraits<T>::vec128 & v_src0, const typename internal::VecTraits<T>::vec128 & v_src1,
typename internal::VecTraits<T>::unsign::vec128 & v_dst) const
{
v_dst = internal::vcgeq(v_src0, v_src1);
}
void operator() (const typename internal::VecTraits<T>::vec64 & v_src0, const typename internal::VecTraits<T>::vec64 & v_src1,
typename internal::VecTraits<T>::unsign::vec64 & v_dst) const
{
v_dst = internal::vcge(v_src0, v_src1);
}
void operator() (const T * src0, const T * src1, u8 * dst) const
{
dst[0] = src0[0] >= src1[0] ? 255 : 0;
}
};
}
#define IMPL_CMPOP(op, type) \
void cmp##op(const Size2D &size, \
const type * src0Base, ptrdiff_t src0Stride, \
const type * src1Base, ptrdiff_t src1Stride, \
u8 *dstBase, ptrdiff_t dstStride) \
{ \
internal::assertSupportedConfiguration(); \
vcompare(size, \
src0Base, src0Stride, \
src1Base, src1Stride, \
dstBase, dstStride, \
OpCmp##op<type>()); \
}
#else
#define IMPL_CMPOP(op, type) \
void cmp##op(const Size2D &size, \
const type * src0Base, ptrdiff_t src0Stride, \
const type * src1Base, ptrdiff_t src1Stride, \
u8 *dstBase, ptrdiff_t dstStride) \
{ \
internal::assertSupportedConfiguration(); \
(void)size; \
(void)src0Base; \
(void)src0Stride; \
(void)src1Base; \
(void)src1Stride; \
(void)dstBase; \
(void)dstStride; \
}
#endif
IMPL_CMPOP(EQ, u8)
IMPL_CMPOP(EQ, s8)
IMPL_CMPOP(EQ, u16)
IMPL_CMPOP(EQ, s16)
IMPL_CMPOP(EQ, u32)
IMPL_CMPOP(EQ, s32)
IMPL_CMPOP(EQ, f32)
IMPL_CMPOP(NE, u8)
IMPL_CMPOP(NE, s8)
IMPL_CMPOP(NE, u16)
IMPL_CMPOP(NE, s16)
IMPL_CMPOP(NE, u32)
IMPL_CMPOP(NE, s32)
IMPL_CMPOP(NE, f32)
IMPL_CMPOP(GT, u8)
IMPL_CMPOP(GT, s8)
IMPL_CMPOP(GT, u16)
IMPL_CMPOP(GT, s16)
IMPL_CMPOP(GT, u32)
IMPL_CMPOP(GT, s32)
IMPL_CMPOP(GT, f32)
IMPL_CMPOP(GE, u8)
IMPL_CMPOP(GE, s8)
IMPL_CMPOP(GE, u16)
IMPL_CMPOP(GE, s16)
IMPL_CMPOP(GE, u32)
IMPL_CMPOP(GE, s32)
IMPL_CMPOP(GE, f32)
} // namespace CAROTENE_NS

2846
3rdparty/carotene/src/colorconvert.cpp vendored Normal file

File diff suppressed because it is too large Load Diff

108
3rdparty/carotene/src/common.cpp vendored Normal file
View File

@ -0,0 +1,108 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include <cstdlib>
#include <iostream>
#include "common.hpp"
namespace CAROTENE_NS {
bool isSupportedConfiguration()
{
#ifdef CAROTENE_NEON
return true;
#else
return false;
#endif
}
namespace internal {
void assertSupportedConfiguration(bool parametersSupported)
{
if (!isSupportedConfiguration()) {
std::cerr << "internal error: attempted to use an unavailable function" << std::endl;
std::abort();
}
if (!parametersSupported) {
std::cerr << "internal error: attempted to use a function with unsupported parameters" << std::endl;
std::abort();
}
}
ptrdiff_t borderInterpolate(ptrdiff_t _p, size_t _len, BORDER_MODE borderType, size_t startMargin, size_t endMargin)
{
ptrdiff_t p = _p + (ptrdiff_t)startMargin;
size_t len = _len + startMargin + endMargin;
if( (size_t)p < len )
return _p;
else if( borderType == BORDER_MODE_REPLICATE )
p = p < 0 ? 0 : (ptrdiff_t)len - 1;
else if( borderType == BORDER_MODE_REFLECT || borderType == BORDER_MODE_REFLECT101 )
{
s32 delta = borderType == BORDER_MODE_REFLECT101;
if( len == 1 )
return 0;
do
{
if( p < 0 )
p = -p - 1 + delta;
else
p = (ptrdiff_t)len - 1 - (p - (ptrdiff_t)len) - delta;
}
while( (size_t)p >= len );
}
else if( borderType == BORDER_MODE_WRAP )
{
if( p < 0 )
p -= ((p-(ptrdiff_t)len+1)/(ptrdiff_t)len)*(ptrdiff_t)len;
if( p >= (ptrdiff_t)len )
p %= (ptrdiff_t)len;
}
else if( borderType == BORDER_MODE_CONSTANT )
p = -1;
else
internal::assertSupportedConfiguration(false);
return p - (ptrdiff_t)startMargin;
}
} // namespace internal
} // namespace CAROTENE_NS

96
3rdparty/carotene/src/common.hpp vendored Normal file
View File

@ -0,0 +1,96 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#ifndef CAROTENE_SRC_COMMON_HPP
#define CAROTENE_SRC_COMMON_HPP
#include <cstddef>
#include <algorithm>
#if defined WITH_NEON && (defined __ARM_NEON__ || defined __ARM_NEON)
#define CAROTENE_NEON
#endif
#ifdef CAROTENE_NEON
#include <arm_neon.h>
#include "intrinsics.hpp"
#endif
#include <carotene/functions.hpp>
#include "saturate_cast.hpp"
namespace CAROTENE_NS { namespace internal {
inline void prefetch(const void *ptr, size_t offset = 32*10)
{
#if defined __GNUC__
__builtin_prefetch(reinterpret_cast<const char*>(ptr) + offset);
#elif defined _MSC_VER && defined CAROTENE_NEON
__prefetch(reinterpret_cast<const char*>(ptr) + offset);
#else
(void)ptr;
(void)offset;
#endif
}
template <typename T>
inline T *getRowPtr(T *base, ptrdiff_t stride, size_t row)
{
char *baseRaw = const_cast<char *>(reinterpret_cast<const char *>(base));
return reinterpret_cast<T *>(baseRaw + ptrdiff_t(row) * stride);
}
void assertSupportedConfiguration(bool parametersSupported = true);
ptrdiff_t borderInterpolate(ptrdiff_t _p, size_t _len, BORDER_MODE borderType, size_t startMargin = 0, size_t endMargin = 0);
/*!
* Aligns pointer by the certain number of bytes
*
* This small inline function aligns the pointer by the certain number of bytes by shifting
* it forward by 0 or a positive offset.
*/
template<typename T> inline T* alignPtr(T* ptr, size_t n=sizeof(T))
{
return (T*)(((size_t)ptr + n-1) & -n);
}
}}
#endif

1331
3rdparty/carotene/src/convert.cpp vendored Normal file

File diff suppressed because it is too large Load Diff

399
3rdparty/carotene/src/convert_depth.cpp vendored Normal file
View File

@ -0,0 +1,399 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include <cstring>
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
template <int shift>
void lshiftConst(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
s16 * dstBase, ptrdiff_t dstStride)
{
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0; i < size.height; ++i)
{
const u8 * src = internal::getRowPtr(srcBase, srcStride, i);
s16 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
for (; j < roiw16; j += 16)
{
internal::prefetch(src + j);
uint8x16_t v_src = vld1q_u8(src + j);
int16x8_t v_dst0 = vreinterpretq_s16_u16(vmovl_u8(vget_low_u8(v_src)));
int16x8_t v_dst1 = vreinterpretq_s16_u16(vmovl_u8(vget_high_u8(v_src)));
vst1q_s16(dst + j, vshlq_n_s16(v_dst0, shift));
vst1q_s16(dst + j + 8, vshlq_n_s16(v_dst1, shift));
}
for (; j < roiw8; j += 8)
{
int16x8_t v_dst = vreinterpretq_s16_u16(vmovl_u8(vld1_u8(src + j)));
vst1q_s16(dst + j, vshlq_n_s16(v_dst, shift));
}
for (; j < size.width; j++)
{
dst[j] = ((s16)src[j] << shift);
}
}
}
template <>
void lshiftConst<0>(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
s16 * dstBase, ptrdiff_t dstStride)
{
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0; i < size.height; ++i)
{
const u8 * src = internal::getRowPtr(srcBase, srcStride, i);
s16 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
for (; j < roiw16; j += 16)
{
internal::prefetch(src + j);
uint8x16_t v_src = vld1q_u8(src + j);
int16x8_t v_dst0 = vreinterpretq_s16_u16(vmovl_u8(vget_low_u8(v_src)));
int16x8_t v_dst1 = vreinterpretq_s16_u16(vmovl_u8(vget_high_u8(v_src)));
vst1q_s16(dst + j, v_dst0);
vst1q_s16(dst + j + 8, v_dst1);
}
for (; j < roiw8; j += 8)
{
int16x8_t v_dst = vreinterpretq_s16_u16(vmovl_u8(vld1_u8(src + j)));
vst1q_s16(dst + j, v_dst);
}
for (; j < size.width; j++)
{
dst[j] = (s16)src[j];
}
}
}
template <int shift>
void rshiftConst(const Size2D &size,
const s16 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
CONVERT_POLICY cpolicy)
{
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0; i < size.height; ++i)
{
const s16 * src = internal::getRowPtr(srcBase, srcStride, i);
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
if (cpolicy == CONVERT_POLICY_SATURATE)
{
for (; j < roiw16; j += 16)
{
internal::prefetch(src + j);
int16x8_t v_src0 = vshrq_n_s16(vld1q_s16(src + j), shift),
v_src1 = vshrq_n_s16(vld1q_s16(src + j + 8), shift);
uint8x16_t v_dst = vcombine_u8(vqmovun_s16(v_src0),
vqmovun_s16(v_src1));
vst1q_u8(dst + j, v_dst);
}
for (; j < roiw8; j += 8)
{
int16x8_t v_src = vshrq_n_s16(vld1q_s16(src + j), shift);
vst1_u8(dst + j, vqmovun_s16(v_src));
}
for (; j < size.width; j++)
{
dst[j] = internal::saturate_cast<u8>((src[j] >> shift));
}
}
else // CONVERT_POLICY_WRAP
{
for (; j < roiw16; j += 16)
{
internal::prefetch(src + j);
int16x8_t v_src0 = vshrq_n_s16(vld1q_s16(src + j), shift),
v_src1 = vshrq_n_s16(vld1q_s16(src + j + 8), shift);
int8x16_t v_dst = vcombine_s8(vmovn_s16(v_src0),
vmovn_s16(v_src1));
vst1q_u8(dst + j, vreinterpretq_u8_s8(v_dst));
}
for (; j < roiw8; j += 8)
{
int16x8_t v_src = vshrq_n_s16(vld1q_s16(src + j), shift);
vst1_u8(dst + j, vreinterpret_u8_s8(vmovn_s16(v_src)));
}
for (; j < size.width; j++)
{
dst[j] = (u8)((src[j] >> shift));
}
}
}
}
template <>
void rshiftConst<0>(const Size2D &size,
const s16 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
CONVERT_POLICY cpolicy)
{
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0; i < size.height; ++i)
{
const s16 * src = internal::getRowPtr(srcBase, srcStride, i);
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
if (cpolicy == CONVERT_POLICY_SATURATE)
{
for (; j < roiw16; j += 16)
{
internal::prefetch(src + j);
int16x8_t v_src0 = vld1q_s16(src + j), v_src1 = vld1q_s16(src + j + 8);
uint8x16_t v_dst = vcombine_u8(vqmovun_s16(v_src0), vqmovun_s16(v_src1));
vst1q_u8(dst + j, v_dst);
}
for (; j < roiw8; j += 8)
{
int16x8_t v_src = vld1q_s16(src + j);
vst1_u8(dst + j, vqmovun_s16(v_src));
}
for (; j < size.width; j++)
{
dst[j] = internal::saturate_cast<u8>(src[j]);
}
}
else // CONVERT_POLICY_WRAP
{
for (; j < roiw16; j += 16)
{
internal::prefetch(src + j);
int16x8_t v_src0 = vld1q_s16(src + j), v_src1 = vld1q_s16(src + j + 8);
int8x16_t v_dst = vcombine_s8(vmovn_s16(v_src0), vmovn_s16(v_src1));
vst1q_u8(dst + j, vreinterpretq_u8_s8(v_dst));
}
for (; j < roiw8; j += 8)
{
int16x8_t v_src = vld1q_s16(src + j);
vst1_u8(dst + j, vreinterpret_u8_s8(vmovn_s16(v_src)));
}
for (; j < size.width; j++)
{
dst[j] = (u8)src[j];
}
}
}
}
typedef void (* lshiftConstFunc)(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
s16 * dstBase, ptrdiff_t dstStride);
typedef void (* rshiftConstFunc)(const Size2D &size,
const s16 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
CONVERT_POLICY cpolicy);
} // namespace
#endif
void lshift(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
s16 * dstBase, ptrdiff_t dstStride,
u32 shift)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
if (shift >= 16u)
{
for (size_t i = 0; i < size.height; ++i)
{
s16 * dst = internal::getRowPtr(dstBase, dstStride, i);
std::memset(dst, 0, sizeof(s16) * size.width);
}
return;
}
// this ugly contruction is needed to avoid:
// /usr/lib/gcc/arm-linux-gnueabihf/4.8/include/arm_neon.h:3581:59: error: argument must be a constant
// return (int16x8_t)__builtin_neon_vshl_nv8hi (__a, __b, 1);
lshiftConstFunc funcs[16] =
{
lshiftConst<0>,
lshiftConst<1>,
lshiftConst<2>,
lshiftConst<3>,
lshiftConst<4>,
lshiftConst<5>,
lshiftConst<6>,
lshiftConst<7>,
lshiftConst<8>,
lshiftConst<9>,
lshiftConst<10>,
lshiftConst<11>,
lshiftConst<12>,
lshiftConst<13>,
lshiftConst<14>,
lshiftConst<15>
}, func = funcs[shift];
func(size, srcBase, srcStride, dstBase, dstStride);
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)shift;
#endif
}
void rshift(const Size2D &size,
const s16 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
u32 shift, CONVERT_POLICY cpolicy)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
if (shift >= 16)
{
if (cpolicy == CONVERT_POLICY_WRAP)
{
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
int16x8_t v_zero = vdupq_n_s16(0);
for (size_t i = 0; i < size.height; ++i)
{
const s16 * src = internal::getRowPtr(srcBase, srcStride, i);
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
for (; j < roiw16; j += 16)
{
internal::prefetch(src + j);
int16x8_t v_src0 = vld1q_s16(src + j), v_src1 = vld1q_s16(src + j + 8);
uint8x16_t v_dst = vcombine_u8(vmovn_u16(vcltq_s16(v_src0, v_zero)),
vmovn_u16(vcltq_s16(v_src1, v_zero)));
vst1q_u8(dst + j, v_dst);
}
for (; j < roiw8; j += 8)
{
int16x8_t v_src = vld1q_s16(src + j);
vst1_u8(dst + j, vmovn_u16(vcltq_s16(v_src, v_zero)));
}
for (; j < size.width; j++)
{
dst[j] = src[j] >= 0 ? 0 : 255;
}
}
}
else
{
for (size_t i = 0; i < size.height; ++i)
{
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
std::memset(dst, 0, sizeof(u8) * size.width);
}
}
return;
}
// this ugly contruction is needed to avoid:
// /usr/lib/gcc/arm-linux-gnueabihf/4.8/include/arm_neon.h:3581:59: error: argument must be a constant
// return (int16x8_t)__builtin_neon_vshr_nv8hi (__a, __b, 1);
rshiftConstFunc funcs[16] =
{
rshiftConst<0>,
rshiftConst<1>,
rshiftConst<2>,
rshiftConst<3>,
rshiftConst<4>,
rshiftConst<5>,
rshiftConst<6>,
rshiftConst<7>,
rshiftConst<8>,
rshiftConst<9>,
rshiftConst<10>,
rshiftConst<11>,
rshiftConst<12>,
rshiftConst<13>,
rshiftConst<14>,
rshiftConst<15>
}, func = funcs[shift];
func(size, srcBase, srcStride, dstBase, dstStride, cpolicy);
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)shift;
(void)cpolicy;
#endif
}
} // namespace CAROTENE_NS

2498
3rdparty/carotene/src/convert_scale.cpp vendored Normal file

File diff suppressed because it is too large Load Diff

340
3rdparty/carotene/src/convolution.cpp vendored Normal file
View File

@ -0,0 +1,340 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include "saturate_cast.hpp"
namespace CAROTENE_NS {
bool isConvolutionSupported(const Size2D &size, const Size2D &ksize,
BORDER_MODE border)
{
return isSupportedConfiguration() && size.width >= 8 &&
(border == BORDER_MODE_CONSTANT ||
border == BORDER_MODE_REPLICATE) &&
(ksize.width == 3) && (ksize.height == 3);
}
#ifdef CAROTENE_NEON
namespace {
template <int shift>
int32x4_t vshrq_s32(int32x4_t value)
{
return vshrq_n_s32(value, shift);
}
template <>
int32x4_t vshrq_s32<0>(int32x4_t value)
{
return value;
}
} // namespace
typedef int32x4_t (* vshrq_s32_func)(int32x4_t value);
#endif
void convolution(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
BORDER_MODE border, u8 borderValue,
const Size2D & ksize, s16 * kernelBase, u32 scale)
{
internal::assertSupportedConfiguration(isConvolutionSupported(size, ksize, border));
#ifdef CAROTENE_NEON
const uint8x8_t v_zero_u8 = vdup_n_u8(0);
const uint8x8_t v_border = vdup_n_u8(borderValue);
const int32x4_t v_zero_s32 = vdupq_n_s32(0);
uint8x8_t tprev[3] = { v_zero_u8, v_zero_u8, v_zero_u8 },
tcurr[3] = { v_zero_u8, v_zero_u8, v_zero_u8 },
tnext[3] = { v_zero_u8, v_zero_u8, v_zero_u8 };
uint8x8_t t0 = v_zero_u8, t1 = v_zero_u8, t2 = v_zero_u8;
ptrdiff_t width = (ptrdiff_t)size.width, height = (ptrdiff_t)size.height;
static const vshrq_s32_func vshrq_s32_a[33] =
{
vshrq_s32<0>,
vshrq_s32<1>,
vshrq_s32<2>,
vshrq_s32<3>,
vshrq_s32<4>,
vshrq_s32<5>,
vshrq_s32<6>,
vshrq_s32<7>,
vshrq_s32<8>,
vshrq_s32<9>,
vshrq_s32<10>,
vshrq_s32<11>,
vshrq_s32<12>,
vshrq_s32<13>,
vshrq_s32<14>,
vshrq_s32<15>,
vshrq_s32<16>,
vshrq_s32<17>,
vshrq_s32<18>,
vshrq_s32<19>,
vshrq_s32<20>,
vshrq_s32<21>,
vshrq_s32<22>,
vshrq_s32<23>,
vshrq_s32<24>,
vshrq_s32<25>,
vshrq_s32<26>,
vshrq_s32<27>,
vshrq_s32<28>,
vshrq_s32<29>,
vshrq_s32<30>,
vshrq_s32<31>,
vshrq_s32<32>
};
vshrq_s32_func vshrq_s32_p = vshrq_s32_a[scale];
for (ptrdiff_t y = 0; y < height; ++y)
{
const u8 * srow0 = y == 0 && border == BORDER_MODE_CONSTANT ? NULL : internal::getRowPtr(srcBase, srcStride, std::max<ptrdiff_t>(y - 1, 0));
const u8 * srow1 = internal::getRowPtr(srcBase, srcStride, y);
const u8 * srow2 = y + 1 == height && border == BORDER_MODE_CONSTANT ? NULL : internal::getRowPtr(srcBase, srcStride, std::min(y + 1, height - 1));
u8 * drow = internal::getRowPtr(dstBase, dstStride, y);
u8 prevx[3] = { 0, 0, 0 },
currx[3] = { 0, 0, 0 },
nextx[3] = { 0, 0, 0 };
ptrdiff_t x = 0;
const ptrdiff_t bwidth = y + 2 < height ? width : (width - 8);
// perform vertical convolution
for ( ; x <= bwidth; x += 8)
{
internal::prefetch(srow0 + x);
internal::prefetch(srow1 + x);
internal::prefetch(srow2 + x);
uint8x8_t x0 = !srow0 ? v_border : vld1_u8(srow0 + x);
uint8x8_t x1 = vld1_u8(srow1 + x);
uint8x8_t x2 = !srow2 ? v_border : vld1_u8(srow2 + x);
// calculate values for plain CPU part below if needed
if (x + 8 >= bwidth)
{
ptrdiff_t x3 = x == width ? width - 1 : x;
ptrdiff_t x4 = border == BORDER_MODE_CONSTANT ? x3 - 1 : std::max<ptrdiff_t>(x3 - 1, 0);
if (border == BORDER_MODE_CONSTANT && x4 < 0)
prevx[0] = prevx[1] = prevx[2] = borderValue;
else
{
prevx[0] = srow0 ? srow0[x4] : borderValue;
prevx[1] = srow1[x4] ;
prevx[2] = srow2 ? srow2[x4] : borderValue;
}
currx[0] = srow0 ? srow0[x3] : borderValue;
currx[1] = srow1[x3] ;
currx[2] = srow2 ? srow2[x3] : borderValue;
}
// make shift
if (x)
{
tprev[0] = tcurr[0];
tcurr[0] = tnext[0];
tprev[1] = tcurr[1];
tcurr[1] = tnext[1];
tprev[2] = tcurr[2];
tcurr[2] = tnext[2];
}
tnext[0] = x0;
tnext[1] = x1;
tnext[2] = x2;
// make extrapolation for the first elements
if (!x)
{
// make border
if (border == BORDER_MODE_CONSTANT)
tcurr[0] = tcurr[1] = tcurr[2] = v_border;
else if (border == BORDER_MODE_REPLICATE)
{
tcurr[0] = vdup_n_u8(vget_lane_u8(tnext[0], 0));
tcurr[1] = vdup_n_u8(vget_lane_u8(tnext[1], 0));
tcurr[2] = vdup_n_u8(vget_lane_u8(tnext[2], 0));
}
continue;
}
int32x4_t v_dst0 = v_zero_s32, v_dst1 = v_zero_s32;
{
// combine 3 "shifted" vectors
t0 = vext_u8(tprev[0], tcurr[0], 7);
t1 = tcurr[0];
t2 = vext_u8(tcurr[0], tnext[0], 1);
int16x8_t t0_16s = vreinterpretq_s16_u16(vmovl_u8(t0));
int16x8_t t1_16s = vreinterpretq_s16_u16(vmovl_u8(t1));
int16x8_t t2_16s = vreinterpretq_s16_u16(vmovl_u8(t2));
v_dst0 = vmlal_n_s16(v_dst0, vget_low_s16(t0_16s), kernelBase[8]);
v_dst0 = vmlal_n_s16(v_dst0, vget_low_s16(t1_16s), kernelBase[7]);
v_dst0 = vmlal_n_s16(v_dst0, vget_low_s16(t2_16s), kernelBase[6]);
v_dst1 = vmlal_n_s16(v_dst1, vget_high_s16(t0_16s), kernelBase[8]);
v_dst1 = vmlal_n_s16(v_dst1, vget_high_s16(t1_16s), kernelBase[7]);
v_dst1 = vmlal_n_s16(v_dst1, vget_high_s16(t2_16s), kernelBase[6]);
}
{
// combine 3 "shifted" vectors
t0 = vext_u8(tprev[1], tcurr[1], 7);
t1 = tcurr[1];
t2 = vext_u8(tcurr[1], tnext[1], 1);
int16x8_t t0_16s = vreinterpretq_s16_u16(vmovl_u8(t0));
int16x8_t t1_16s = vreinterpretq_s16_u16(vmovl_u8(t1));
int16x8_t t2_16s = vreinterpretq_s16_u16(vmovl_u8(t2));
v_dst0 = vmlal_n_s16(v_dst0, vget_low_s16(t0_16s), kernelBase[5]);
v_dst0 = vmlal_n_s16(v_dst0, vget_low_s16(t1_16s), kernelBase[4]);
v_dst0 = vmlal_n_s16(v_dst0, vget_low_s16(t2_16s), kernelBase[3]);
v_dst1 = vmlal_n_s16(v_dst1, vget_high_s16(t0_16s), kernelBase[5]);
v_dst1 = vmlal_n_s16(v_dst1, vget_high_s16(t1_16s), kernelBase[4]);
v_dst1 = vmlal_n_s16(v_dst1, vget_high_s16(t2_16s), kernelBase[3]);
}
{
// combine 3 "shifted" vectors
t0 = vext_u8(tprev[2], tcurr[2], 7);
t1 = tcurr[2];
t2 = vext_u8(tcurr[2], tnext[2], 1);
int16x8_t t0_16s = vreinterpretq_s16_u16(vmovl_u8(t0));
int16x8_t t1_16s = vreinterpretq_s16_u16(vmovl_u8(t1));
int16x8_t t2_16s = vreinterpretq_s16_u16(vmovl_u8(t2));
v_dst0 = vmlal_n_s16(v_dst0, vget_low_s16(t0_16s), kernelBase[2]);
v_dst0 = vmlal_n_s16(v_dst0, vget_low_s16(t1_16s), kernelBase[1]);
v_dst0 = vmlal_n_s16(v_dst0, vget_low_s16(t2_16s), kernelBase[0]);
v_dst1 = vmlal_n_s16(v_dst1, vget_high_s16(t0_16s), kernelBase[2]);
v_dst1 = vmlal_n_s16(v_dst1, vget_high_s16(t1_16s), kernelBase[1]);
v_dst1 = vmlal_n_s16(v_dst1, vget_high_s16(t2_16s), kernelBase[0]);
}
// make scale
v_dst0 = vshrq_s32_p(v_dst0);
v_dst1 = vshrq_s32_p(v_dst1);
// and add them
vst1_u8(drow + x - 8, vqmovn_u16(vcombine_u16(vqmovun_s32(v_dst0),
vqmovun_s32(v_dst1))));
}
x -= 8;
if (x == width)
--x;
for ( ; x < width; ++x)
{
// make extrapolation for the last elements
if (x + 1 >= width)
{
if (border == BORDER_MODE_CONSTANT)
{
nextx[0] = borderValue;
nextx[1] = borderValue;
nextx[2] = borderValue;
}
else if (border == BORDER_MODE_REPLICATE)
{
nextx[0] = srow0[x];
nextx[1] = srow1[x];
nextx[2] = srow2[x];
}
}
else
{
nextx[0] = srow0 ? srow0[x + 1] : borderValue;
nextx[1] = srow1[x + 1] ;
nextx[2] = srow2 ? srow2[x + 1] : borderValue;
}
s32 val = 0;
for (s32 _y = 0; _y < 3; ++_y)
val += prevx[_y] * kernelBase[(2 - _y) * 3 + 2] +
currx[_y] * kernelBase[(2 - _y) * 3 + 1] +
nextx[_y] * kernelBase[(2 - _y) * 3 + 0];
drow[x] = internal::saturate_cast<u8>(val >> scale);
// make shift
prevx[0] = currx[0];
currx[0] = nextx[0];
prevx[1] = currx[1];
currx[1] = nextx[1];
prevx[2] = currx[2];
currx[2] = nextx[2];
}
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)border;
(void)borderValue;
(void)ksize;
(void)kernelBase;
(void)scale;
#endif
}
} // namespace CAROTENE_NS

430
3rdparty/carotene/src/count_nonzero.cpp vendored Normal file
View File

@ -0,0 +1,430 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2012-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include <limits>
namespace CAROTENE_NS {
s32 countNonZero(const Size2D &_size,
const u8 * srcBase, ptrdiff_t srcStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
Size2D size(_size);
if (srcStride == (ptrdiff_t)(size.width))
{
size.width *= size.height;
size.height = 1;
}
size_t roiw16 = size.width & ~15u;
s32 result = 0;
for(size_t k = 0; k < size.height; ++k)
{
const u8* src = internal::getRowPtr( srcBase, srcStride, k);
size_t i = 0;
#define COUNTNONZERO8U_BLOCK_SIZE (16*255)
uint8x16_t vc1 = vmovq_n_u8(1);
for (; i < roiw16;)
{
size_t lim = std::min(i + COUNTNONZERO8U_BLOCK_SIZE, size.width) - 16;
uint8x16_t vs = vmovq_n_u8(0);
for (; i <= lim; i+= 16)
{
internal::prefetch(src + i);
uint8x16_t vln = vld1q_u8(src + i);
uint8x16_t vnz = vminq_u8(vln, vc1);
vs = vaddq_u8(vs, vnz);
}
uint32x4_t vs4 = vpaddlq_u16(vpaddlq_u8(vs));
uint32x2_t vs2 = vadd_u32(vget_low_u32(vs4), vget_high_u32(vs4));
s32 s[2];
vst1_u32((u32*)s, vs2);
if (s[0] < 0 || s[1] < 0)//saturate in case of overflow ~ 2GB of non-zeros...
{
return 0x7fFFffFF;
}
result += (s[0] += s[1]);
if (s[0] < 0 || result < 0)
{
return 0x7fFFffFF;
}
}
for (; i < size.width; i++)
result += (src[i] != 0)?1:0;
if (result < 0)//saturate in case of overflow ~ 2GB of non-zeros...
{
return 0x7fFFffFF;
}
}
return result;
#else
(void)_size;
(void)srcBase;
(void)srcStride;
return 0;
#endif
}
s32 countNonZero(const Size2D &_size,
const u16 * srcBase, ptrdiff_t srcStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
Size2D size(_size);
if (srcStride == (ptrdiff_t)(size.width))
{
size.width *= size.height;
size.height = 1;
}
size_t roiw8 = size.width & ~7u;
s32 result = 0;
for(size_t k = 0; k < size.height; ++k)
{
const u16* src = internal::getRowPtr( srcBase, srcStride, k);
size_t i = 0;
#define COUNTNONZERO16U_BLOCK_SIZE (8*(256*256-1))
uint16x8_t vc1 = vmovq_n_u16(1);
for (; i < roiw8;)
{
size_t lim = std::min(i + COUNTNONZERO16U_BLOCK_SIZE, size.width) - 8;
uint16x8_t vs = vmovq_n_u16(0);
for (; i <= lim; i+= 8)
{
internal::prefetch(src + i);
uint16x8_t vln = vld1q_u16(src + i);
uint16x8_t vnz = vminq_u16(vln, vc1);
vs = vaddq_u16(vs, vnz);
}
uint32x4_t vs4 = vpaddlq_u16(vs);
uint32x2_t vs2 = vadd_u32(vget_low_u32(vs4), vget_high_u32(vs4));
s32 s[2];
vst1_u32((u32*)s, vs2);
if (s[0] < 0 || s[1] < 0)//saturate in case of overflow ~ 4GB of non-zeros...
{
return 0x7fFFffFF;
}
result += (s[0] += s[1]);
if (s[0] < 0 || result < 0)
{
return 0x7fFFffFF;
}
}
for (; i < size.width; i++)
result += (src[i] != 0)?1:0;
if (result < 0)//saturate in case of overflow ~ 4GB of non-zeros...
{
return 0x7fFFffFF;
}
}
return result;
#else
(void)_size;
(void)srcBase;
(void)srcStride;
return 0;
#endif
}
s32 countNonZero(const Size2D &_size,
const s32 * srcBase, ptrdiff_t srcStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
Size2D size(_size);
if (srcStride == (ptrdiff_t)(size.width))
{
size.width *= size.height;
size.height = 1;
}
size_t roiw4 = size.width & ~3u;
s32 result = 0;
for(size_t k = 0; k < size.height; ++k)
{
const u32* src = (const u32*)internal::getRowPtr( srcBase, srcStride, k);
u32 i = 0;
uint32x4_t vc1 = vmovq_n_u32(1);
uint32x4_t vs = vmovq_n_u32(0);
for (; i < roiw4; i += 4 )
{
internal::prefetch(src + i);
uint32x4_t vln = vld1q_u32(src + i);
uint32x4_t vnz = vminq_u32(vln, vc1);
vs = vqaddq_u32(vs, vnz);
}
uint32x2_t vs2 = vqadd_u32(vget_low_u32(vs), vget_high_u32(vs));
s32 s[2];
vst1_u32((u32*)s, vs2);
if (s[0] < 0 || s[1] < 0)//saturate in case of overflow ~ 8GB of non-zeros...
{
return 0x7fFFffFF;
}
result += (s[0] += s[1]);
if (s[0] < 0 || result < 0)
{
return 0x7fFFffFF;
}
for (; i < size.width; i++)
result += (src[i] != 0)?1:0;
if (result < 0)//saturate in case of overflow ~ 8GB of non-zeros...
{
return 0x7fFFffFF;
}
}
return result;
#else
(void)_size;
(void)srcBase;
(void)srcStride;
return 0;
#endif
}
s32 countNonZero(const Size2D &_size,
const f32 * srcBase, ptrdiff_t srcStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
Size2D size(_size);
if (srcStride == (ptrdiff_t)(size.width))
{
size.width *= size.height;
size.height = 1;
}
size_t roiw4 = size.width & ~3u;
s32 result = 0;
for(size_t k = 0; k < size.height; ++k)
{
const f32* src = internal::getRowPtr( srcBase, srcStride, k);
size_t i = 0;
float32x4_t vc0 = vmovq_n_f32(0);
int32x4_t vs = vmovq_n_s32(0);
for (; i < roiw4; i += 4 )
{
internal::prefetch(src + i);
float32x4_t vln = vld1q_f32(src + i);
int32x4_t vnz = vreinterpretq_s32_u32(vmvnq_u32(vceqq_f32(vln, vc0)));
vs = vqaddq_s32(vs, vnz);
}
int32x2_t vs2 = vqneg_s32(vqadd_s32(vget_low_s32(vs), vget_high_s32(vs)));
int s[2];
vst1_s32(s, vs2);
result += (s[0] += s[1]);
if (s[0] < 0 || result < 0)//case of overflow ~ 8GB of non-zeros...
{
return 0x7fFFffFF;
}
for (; i < size.width; i++)
result += (src[i] < std::numeric_limits<float>::min() && src[i] > -std::numeric_limits<float>::min())?0:1;
if (result < 0)
{
return 0x7fFFffFF;
}
}
return result;
#else
(void)_size;
(void)srcBase;
(void)srcStride;
return 0;
#endif
}
s32 countNonZero(const Size2D &_size,
const f64 * srcBase, ptrdiff_t srcStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
Size2D size(_size);
if (srcStride == (ptrdiff_t)(size.width))
{
size.width *= size.height;
size.height = 1;
}
size_t roiw8 = size.width & ~7u;
size_t roiw4 = size.width & ~3u;
size_t roiw2 = size.width & ~1u;
uint64x2_t vmask1 = vdupq_n_u64(0x7fFFffFFffFFffFFULL); //will treat denormals as non-zero
uint32x4_t vc0 = vmovq_n_u32(0);
s32 result = 0;
for(size_t k = 0; k < size.height; ++k)
{
const f64* src = internal::getRowPtr( srcBase, srcStride, k);
size_t i = 0;
int32x2_t vs1 = vmov_n_s32(0);
int32x2_t vs2 = vmov_n_s32(0);
int32x2_t vs3 = vmov_n_s32(0);
int32x2_t vs4 = vmov_n_s32(0);
for (; i < roiw8; i += 8 )
{
internal::prefetch(src + i + 6);
uint64x2_t vln1 = vld1q_u64((const u64*)(src + i));
uint64x2_t vln2 = vld1q_u64((const u64*)(src + i + 2));
uint64x2_t vln3 = vld1q_u64((const u64*)(src + i + 4));
uint64x2_t vln4 = vld1q_u64((const u64*)(src + i + 6));
uint64x2_t vm1 = vandq_u64(vln1, vmask1);
uint64x2_t vm2 = vandq_u64(vln2, vmask1);
uint64x2_t vm3 = vandq_u64(vln3, vmask1);
uint64x2_t vm4 = vandq_u64(vln4, vmask1);
uint32x4_t vequ1 = vceqq_u32(vreinterpretq_u32_u64(vm1), vc0);
uint32x4_t vequ2 = vceqq_u32(vreinterpretq_u32_u64(vm2), vc0);
uint32x4_t vequ3 = vceqq_u32(vreinterpretq_u32_u64(vm3), vc0);
uint32x4_t vequ4 = vceqq_u32(vreinterpretq_u32_u64(vm4), vc0);
uint32x4_t vlx1 = vmvnq_u32(vequ1);
uint32x4_t vlx2 = vmvnq_u32(vequ2);
uint32x4_t vlx3 = vmvnq_u32(vequ3);
uint32x4_t vlx4 = vmvnq_u32(vequ4);
int32x2_t vnz1 = vreinterpret_s32_u32(vpmax_u32(vget_low_u32(vlx1), vget_high_u32(vlx1)));
int32x2_t vnz2 = vreinterpret_s32_u32(vpmax_u32(vget_low_u32(vlx2), vget_high_u32(vlx2)));
int32x2_t vnz3 = vreinterpret_s32_u32(vpmax_u32(vget_low_u32(vlx3), vget_high_u32(vlx3)));
int32x2_t vnz4 = vreinterpret_s32_u32(vpmax_u32(vget_low_u32(vlx4), vget_high_u32(vlx4)));
vs1 = vqadd_s32(vs1, vnz1);
vs2 = vqadd_s32(vs2, vnz2);
vs3 = vqadd_s32(vs3, vnz3);
vs4 = vqadd_s32(vs4, vnz4);
}
if (i < roiw4)
{
internal::prefetch(src + i + 2);
uint64x2_t vln1 = vld1q_u64((const u64*)(src + i));
uint64x2_t vln2 = vld1q_u64((const u64*)(src + i + 2));
uint64x2_t vm1 = vandq_u64(vln1, vmask1);
uint64x2_t vm2 = vandq_u64(vln2, vmask1);
uint32x4_t vequ1 = vceqq_u32(vreinterpretq_u32_u64(vm1), vc0);
uint32x4_t vequ2 = vceqq_u32(vreinterpretq_u32_u64(vm2), vc0);
uint32x4_t vlx1 = vmvnq_u32(vequ1);
uint32x4_t vlx2 = vmvnq_u32(vequ2);
int32x2_t vnz1 = vreinterpret_s32_u32(vpmax_u32(vget_low_u32(vlx1), vget_high_u32(vlx1)));
int32x2_t vnz2 = vreinterpret_s32_u32(vpmax_u32(vget_low_u32(vlx2), vget_high_u32(vlx2)));
vs1 = vqadd_s32(vs1, vnz1);
vs2 = vqadd_s32(vs2, vnz2);
i += 4;
}
if (i < roiw2)
{
internal::prefetch(src + i);
uint64x2_t vln1 = vld1q_u64((const u64*)(src + i));
uint64x2_t vm1 = vandq_u64(vln1, vmask1);
uint32x4_t vequ1 = vceqq_u32(vreinterpretq_u32_u64(vm1), vc0);
uint32x4_t vlx1 = vmvnq_u32(vequ1);
int32x2_t vnz1 = vreinterpret_s32_u32(vpmax_u32(vget_low_u32(vlx1), vget_high_u32(vlx1)));
vs1 = vqadd_s32(vs1, vnz1);
i += 2;
}
vs1 = vqadd_s32(vs1, vs2);
vs3 = vqadd_s32(vs3, vs4);
vs1 = vqadd_s32(vs1, vs3);
int32x2_t vsneg = vqneg_s32(vs1);
s32 s[2];
vst1_s32(s, vsneg);
result += (s[0] += s[1]);
if (s[0] < 0 || result < 0)//case of overflow ~ 16GB of non-zeros...
{
return 0x7fFFffFF;
}
for (; i < size.width; i++)
result += (src[i] < std::numeric_limits<double>::min() && src[i] > -std::numeric_limits<double>::min())?0:1;
if (result < 0)
{
return 0x7fFFffFF;
}
}
return result;
#else
(void)_size;
(void)srcBase;
(void)srcStride;
return 0;
#endif
}
} // namespace CAROTENE_NS

694
3rdparty/carotene/src/div.cpp vendored Normal file
View File

@ -0,0 +1,694 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2016, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include "vtransform.hpp"
#include <cstring>
#include <cfloat>
#include <cmath>
#include <limits>
namespace CAROTENE_NS {
namespace {
#ifdef CAROTENE_NEON
template <typename T>
inline T divSaturateQ(const T &v1, const T &v2, const float scale)
{
return internal::vcombine(internal::vqmovn(divSaturateQ(internal::vmovl(internal::vget_low(v1)),
internal::vmovl(internal::vget_low(v2)), scale)),
internal::vqmovn(divSaturateQ(internal::vmovl(internal::vget_high(v1)),
internal::vmovl(internal::vget_high(v2)), scale))
);
}
template <>
inline int32x4_t divSaturateQ<int32x4_t>(const int32x4_t &v1, const int32x4_t &v2, const float scale)
{ return vcvtq_s32_f32(vmulq_f32(vmulq_n_f32(vcvtq_f32_s32(v1), scale), internal::vrecpq_f32(vcvtq_f32_s32(v2)))); }
template <>
inline uint32x4_t divSaturateQ<uint32x4_t>(const uint32x4_t &v1, const uint32x4_t &v2, const float scale)
{ return vcvtq_u32_f32(vmulq_f32(vmulq_n_f32(vcvtq_f32_u32(v1), scale), internal::vrecpq_f32(vcvtq_f32_u32(v2)))); }
template <typename T>
inline T divSaturate(const T &v1, const T &v2, const float scale)
{
return internal::vqmovn(divSaturateQ(internal::vmovl(v1), internal::vmovl(v2), scale));
}
template <>
inline int32x2_t divSaturate<int32x2_t>(const int32x2_t &v1, const int32x2_t &v2, const float scale)
{ return vcvt_s32_f32(vmul_f32(vmul_n_f32(vcvt_f32_s32(v1), scale), internal::vrecp_f32(vcvt_f32_s32(v2)))); }
template <>
inline uint32x2_t divSaturate<uint32x2_t>(const uint32x2_t &v1, const uint32x2_t &v2, const float scale)
{ return vcvt_u32_f32(vmul_f32(vmul_n_f32(vcvt_f32_u32(v1), scale), internal::vrecp_f32(vcvt_f32_u32(v2)))); }
template <typename T>
inline T divWrapQ(const T &v1, const T &v2, const float scale)
{
return internal::vcombine(internal::vmovn(divWrapQ(internal::vmovl(internal::vget_low(v1)),
internal::vmovl(internal::vget_low(v2)), scale)),
internal::vmovn(divWrapQ(internal::vmovl(internal::vget_high(v1)),
internal::vmovl(internal::vget_high(v2)), scale))
);
}
template <>
inline int32x4_t divWrapQ<int32x4_t>(const int32x4_t &v1, const int32x4_t &v2, const float scale)
{ return vcvtq_s32_f32(vmulq_f32(vmulq_n_f32(vcvtq_f32_s32(v1), scale), internal::vrecpq_f32(vcvtq_f32_s32(v2)))); }
template <>
inline uint32x4_t divWrapQ<uint32x4_t>(const uint32x4_t &v1, const uint32x4_t &v2, const float scale)
{ return vcvtq_u32_f32(vmulq_f32(vmulq_n_f32(vcvtq_f32_u32(v1), scale), internal::vrecpq_f32(vcvtq_f32_u32(v2)))); }
template <typename T>
inline T divWrap(const T &v1, const T &v2, const float scale)
{
return internal::vmovn(divWrapQ(internal::vmovl(v1), internal::vmovl(v2), scale));
}
template <>
inline int32x2_t divWrap<int32x2_t>(const int32x2_t &v1, const int32x2_t &v2, const float scale)
{ return vcvt_s32_f32(vmul_f32(vmul_n_f32(vcvt_f32_s32(v1), scale), internal::vrecp_f32(vcvt_f32_s32(v2)))); }
template <>
inline uint32x2_t divWrap<uint32x2_t>(const uint32x2_t &v1, const uint32x2_t &v2, const float scale)
{ return vcvt_u32_f32(vmul_f32(vmul_n_f32(vcvt_f32_u32(v1), scale), internal::vrecp_f32(vcvt_f32_u32(v2)))); }
inline uint8x16_t vtstq(const uint8x16_t & v0, const uint8x16_t & v1) { return vtstq_u8 (v0, v1); }
inline uint16x8_t vtstq(const uint16x8_t & v0, const uint16x8_t & v1) { return vtstq_u16(v0, v1); }
inline uint32x4_t vtstq(const uint32x4_t & v0, const uint32x4_t & v1) { return vtstq_u32(v0, v1); }
inline int8x16_t vtstq(const int8x16_t & v0, const int8x16_t & v1) { return vreinterpretq_s8_u8 (vtstq_s8 (v0, v1)); }
inline int16x8_t vtstq(const int16x8_t & v0, const int16x8_t & v1) { return vreinterpretq_s16_u16(vtstq_s16(v0, v1)); }
inline int32x4_t vtstq(const int32x4_t & v0, const int32x4_t & v1) { return vreinterpretq_s32_u32(vtstq_s32(v0, v1)); }
inline uint8x8_t vtst(const uint8x8_t & v0, const uint8x8_t & v1) { return vtst_u8 (v0, v1); }
inline uint16x4_t vtst(const uint16x4_t & v0, const uint16x4_t & v1) { return vtst_u16(v0, v1); }
inline uint32x2_t vtst(const uint32x2_t & v0, const uint32x2_t & v1) { return vtst_u32(v0, v1); }
inline int8x8_t vtst(const int8x8_t & v0, const int8x8_t & v1) { return vreinterpret_s8_u8 (vtst_s8 (v0, v1)); }
inline int16x4_t vtst(const int16x4_t & v0, const int16x4_t & v1) { return vreinterpret_s16_u16(vtst_s16(v0, v1)); }
inline int32x2_t vtst(const int32x2_t & v0, const int32x2_t & v1) { return vreinterpret_s32_u32(vtst_s32(v0, v1)); }
#endif
template <typename T>
void div(const Size2D &size,
const T * src0Base, ptrdiff_t src0Stride,
const T * src1Base, ptrdiff_t src1Stride,
T * dstBase, ptrdiff_t dstStride,
f32 scale,
CONVERT_POLICY cpolicy)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
typedef typename internal::VecTraits<T>::vec128 vec128;
typedef typename internal::VecTraits<T>::vec64 vec64;
if (scale == 0.0f ||
(std::numeric_limits<T>::is_integer &&
(scale * std::numeric_limits<T>::max()) < 1.0f &&
(scale * std::numeric_limits<T>::max()) > -1.0f))
{
for (size_t y = 0; y < size.height; ++y)
{
T * dst = internal::getRowPtr(dstBase, dstStride, y);
std::memset(dst, 0, sizeof(T) * size.width);
}
return;
}
const size_t step128 = 16 / sizeof(T);
size_t roiw128 = size.width >= (step128 - 1) ? size.width - step128 + 1 : 0;
const size_t step64 = 8 / sizeof(T);
size_t roiw64 = size.width >= (step64 - 1) ? size.width - step64 + 1 : 0;
for (size_t i = 0; i < size.height; ++i)
{
const T * src0 = internal::getRowPtr(src0Base, src0Stride, i);
const T * src1 = internal::getRowPtr(src1Base, src1Stride, i);
T * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
if (cpolicy == CONVERT_POLICY_SATURATE)
{
for (; j < roiw128; j += step128)
{
internal::prefetch(src0 + j);
internal::prefetch(src1 + j);
vec128 v_src0 = internal::vld1q(src0 + j);
vec128 v_src1 = internal::vld1q(src1 + j);
vec128 v_mask = vtstq(v_src1,v_src1);
internal::vst1q(dst + j, internal::vandq(v_mask, divSaturateQ(v_src0, v_src1, scale)));
}
for (; j < roiw64; j += step64)
{
vec64 v_src0 = internal::vld1(src0 + j);
vec64 v_src1 = internal::vld1(src1 + j);
vec64 v_mask = vtst(v_src1,v_src1);
internal::vst1(dst + j, internal::vand(v_mask,divSaturate(v_src0, v_src1, scale)));
}
for (; j < size.width; j++)
{
dst[j] = src1[j] ? internal::saturate_cast<T>(scale * src0[j] / src1[j]) : 0;
}
}
else // CONVERT_POLICY_WRAP
{
for (; j < roiw128; j += step128)
{
internal::prefetch(src0 + j);
internal::prefetch(src1 + j);
vec128 v_src0 = internal::vld1q(src0 + j);
vec128 v_src1 = internal::vld1q(src1 + j);
vec128 v_mask = vtstq(v_src1,v_src1);
internal::vst1q(dst + j, internal::vandq(v_mask, divWrapQ(v_src0, v_src1, scale)));
}
for (; j < roiw64; j += step64)
{
vec64 v_src0 = internal::vld1(src0 + j);
vec64 v_src1 = internal::vld1(src1 + j);
vec64 v_mask = vtst(v_src1,v_src1);
internal::vst1(dst + j, internal::vand(v_mask,divWrap(v_src0, v_src1, scale)));
}
for (; j < size.width; j++)
{
dst[j] = src1[j] ? (T)((s32)trunc(scale * src0[j] / src1[j])) : 0;
}
}
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
(void)cpolicy;
(void)scale;
#endif
}
#ifdef CAROTENE_NEON
template <typename T>
inline T recipSaturateQ(const T &v2, const float scale)
{
return internal::vcombine(internal::vqmovn(recipSaturateQ(internal::vmovl(internal::vget_low(v2)), scale)),
internal::vqmovn(recipSaturateQ(internal::vmovl(internal::vget_high(v2)), scale))
);
}
template <>
inline int32x4_t recipSaturateQ<int32x4_t>(const int32x4_t &v2, const float scale)
{ return vcvtq_s32_f32(vmulq_n_f32(internal::vrecpq_f32(vcvtq_f32_s32(v2)), scale)); }
template <>
inline uint32x4_t recipSaturateQ<uint32x4_t>(const uint32x4_t &v2, const float scale)
{ return vcvtq_u32_f32(vmulq_n_f32(internal::vrecpq_f32(vcvtq_f32_u32(v2)), scale)); }
template <typename T>
inline T recipSaturate(const T &v2, const float scale)
{
return internal::vqmovn(recipSaturateQ(internal::vmovl(v2), scale));
}
template <>
inline int32x2_t recipSaturate<int32x2_t>(const int32x2_t &v2, const float scale)
{ return vcvt_s32_f32(vmul_n_f32(internal::vrecp_f32(vcvt_f32_s32(v2)), scale)); }
template <>
inline uint32x2_t recipSaturate<uint32x2_t>(const uint32x2_t &v2, const float scale)
{ return vcvt_u32_f32(vmul_n_f32(internal::vrecp_f32(vcvt_f32_u32(v2)), scale)); }
template <typename T>
inline T recipWrapQ(const T &v2, const float scale)
{
return internal::vcombine(internal::vmovn(recipWrapQ(internal::vmovl(internal::vget_low(v2)), scale)),
internal::vmovn(recipWrapQ(internal::vmovl(internal::vget_high(v2)), scale))
);
}
template <>
inline int32x4_t recipWrapQ<int32x4_t>(const int32x4_t &v2, const float scale)
{ return vcvtq_s32_f32(vmulq_n_f32(internal::vrecpq_f32(vcvtq_f32_s32(v2)), scale)); }
template <>
inline uint32x4_t recipWrapQ<uint32x4_t>(const uint32x4_t &v2, const float scale)
{ return vcvtq_u32_f32(vmulq_n_f32(internal::vrecpq_f32(vcvtq_f32_u32(v2)), scale)); }
template <typename T>
inline T recipWrap(const T &v2, const float scale)
{
return internal::vmovn(recipWrapQ(internal::vmovl(v2), scale));
}
template <>
inline int32x2_t recipWrap<int32x2_t>(const int32x2_t &v2, const float scale)
{ return vcvt_s32_f32(vmul_n_f32(internal::vrecp_f32(vcvt_f32_s32(v2)), scale)); }
template <>
inline uint32x2_t recipWrap<uint32x2_t>(const uint32x2_t &v2, const float scale)
{ return vcvt_u32_f32(vmul_n_f32(internal::vrecp_f32(vcvt_f32_u32(v2)), scale)); }
#endif
template <typename T>
void recip(const Size2D &size,
const T * src1Base, ptrdiff_t src1Stride,
T * dstBase, ptrdiff_t dstStride,
f32 scale,
CONVERT_POLICY cpolicy)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
typedef typename internal::VecTraits<T>::vec128 vec128;
typedef typename internal::VecTraits<T>::vec64 vec64;
if (scale == 0.0f ||
(std::numeric_limits<T>::is_integer &&
scale < 1.0f &&
scale > -1.0f))
{
for (size_t y = 0; y < size.height; ++y)
{
T * dst = internal::getRowPtr(dstBase, dstStride, y);
std::memset(dst, 0, sizeof(T) * size.width);
}
return;
}
const size_t step128 = 16 / sizeof(T);
size_t roiw128 = size.width >= (step128 - 1) ? size.width - step128 + 1 : 0;
const size_t step64 = 8 / sizeof(T);
size_t roiw64 = size.width >= (step64 - 1) ? size.width - step64 + 1 : 0;
for (size_t i = 0; i < size.height; ++i)
{
const T * src1 = internal::getRowPtr(src1Base, src1Stride, i);
T * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
if (cpolicy == CONVERT_POLICY_SATURATE)
{
for (; j < roiw128; j += step128)
{
internal::prefetch(src1 + j);
vec128 v_src1 = internal::vld1q(src1 + j);
vec128 v_mask = vtstq(v_src1,v_src1);
internal::vst1q(dst + j, internal::vandq(v_mask, recipSaturateQ(v_src1, scale)));
}
for (; j < roiw64; j += step64)
{
vec64 v_src1 = internal::vld1(src1 + j);
vec64 v_mask = vtst(v_src1,v_src1);
internal::vst1(dst + j, internal::vand(v_mask, recipSaturate(v_src1, scale)));
}
for (; j < size.width; j++)
{
dst[j] = src1[j] ? internal::saturate_cast<T>(scale / src1[j]) : 0;
}
}
else // CONVERT_POLICY_WRAP
{
for (; j < roiw128; j += step128)
{
internal::prefetch(src1 + j);
vec128 v_src1 = internal::vld1q(src1 + j);
vec128 v_mask = vtstq(v_src1,v_src1);
internal::vst1q(dst + j, internal::vandq(v_mask, recipWrapQ(v_src1, scale)));
}
for (; j < roiw64; j += step64)
{
vec64 v_src1 = internal::vld1(src1 + j);
vec64 v_mask = vtst(v_src1,v_src1);
internal::vst1(dst + j, internal::vand(v_mask, recipWrap(v_src1, scale)));
}
for (; j < size.width; j++)
{
dst[j] = src1[j] ? (T)((s32)trunc(scale / src1[j])) : 0;
}
}
}
#else
(void)size;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
(void)cpolicy;
(void)scale;
#endif
}
}
void div(const Size2D &size,
const u8 * src0Base, ptrdiff_t src0Stride,
const u8 * src1Base, ptrdiff_t src1Stride,
u8 * dstBase, ptrdiff_t dstStride,
f32 scale,
CONVERT_POLICY cpolicy)
{
div<u8>(size, src0Base, src0Stride, src1Base, src1Stride, dstBase, dstStride, scale, cpolicy);
}
void div(const Size2D &size,
const s8 * src0Base, ptrdiff_t src0Stride,
const s8 * src1Base, ptrdiff_t src1Stride,
s8 * dstBase, ptrdiff_t dstStride,
f32 scale,
CONVERT_POLICY cpolicy)
{
div<s8>(size, src0Base, src0Stride, src1Base, src1Stride, dstBase, dstStride, scale, cpolicy);
}
void div(const Size2D &size,
const u16 * src0Base, ptrdiff_t src0Stride,
const u16 * src1Base, ptrdiff_t src1Stride,
u16 * dstBase, ptrdiff_t dstStride,
f32 scale,
CONVERT_POLICY cpolicy)
{
div<u16>(size, src0Base, src0Stride, src1Base, src1Stride, dstBase, dstStride, scale, cpolicy);
}
void div(const Size2D &size,
const s16 * src0Base, ptrdiff_t src0Stride,
const s16 * src1Base, ptrdiff_t src1Stride,
s16 * dstBase, ptrdiff_t dstStride,
f32 scale,
CONVERT_POLICY cpolicy)
{
div<s16>(size, src0Base, src0Stride, src1Base, src1Stride, dstBase, dstStride, scale, cpolicy);
}
void div(const Size2D &size,
const s32 * src0Base, ptrdiff_t src0Stride,
const s32 * src1Base, ptrdiff_t src1Stride,
s32 * dstBase, ptrdiff_t dstStride,
f32 scale,
CONVERT_POLICY cpolicy)
{
div<s32>(size, src0Base, src0Stride, src1Base, src1Stride, dstBase, dstStride, scale, cpolicy);
}
void div(const Size2D &size,
const f32 * src0Base, ptrdiff_t src0Stride,
const f32 * src1Base, ptrdiff_t src1Stride,
f32 * dstBase, ptrdiff_t dstStride,
f32 scale)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
if (scale == 0.0f)
{
for (size_t y = 0; y < size.height; ++y)
{
f32 * dst = internal::getRowPtr(dstBase, dstStride, y);
std::memset(dst, 0, sizeof(f32) * size.width);
}
return;
}
float32x4_t v_zero = vdupq_n_f32(0.0f);
size_t roiw128 = size.width >= 3 ? size.width - 3 : 0;
size_t roiw64 = size.width >= 1 ? size.width - 1 : 0;
if (std::fabs(scale - 1.0f) < FLT_EPSILON)
{
for (size_t i = 0; i < size.height; ++i)
{
const f32 * src0 = internal::getRowPtr(src0Base, src0Stride, i);
const f32 * src1 = internal::getRowPtr(src1Base, src1Stride, i);
f32 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
for (; j < roiw128; j += 4)
{
internal::prefetch(src0 + j);
internal::prefetch(src1 + j);
float32x4_t v_src0 = vld1q_f32(src0 + j);
float32x4_t v_src1 = vld1q_f32(src1 + j);
uint32x4_t v_mask = vceqq_f32(v_src1,v_zero);
vst1q_f32(dst + j, vreinterpretq_f32_u32(vbicq_u32(
vreinterpretq_u32_f32(vmulq_f32(v_src0, internal::vrecpq_f32(v_src1))), v_mask)));
}
for (; j < roiw64; j += 2)
{
float32x2_t v_src0 = vld1_f32(src0 + j);
float32x2_t v_src1 = vld1_f32(src1 + j);
uint32x2_t v_mask = vceq_f32(v_src1,vget_low_f32(v_zero));
vst1_f32(dst + j, vreinterpret_f32_u32(vbic_u32(
vreinterpret_u32_f32(vmul_f32(v_src0, internal::vrecp_f32(v_src1))), v_mask)));
}
for (; j < size.width; j++)
{
dst[j] = src1[j] ? src0[j] / src1[j] : 0.0f;
}
}
}
else
{
for (size_t i = 0; i < size.height; ++i)
{
const f32 * src0 = internal::getRowPtr(src0Base, src0Stride, i);
const f32 * src1 = internal::getRowPtr(src1Base, src1Stride, i);
f32 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
for (; j < roiw128; j += 4)
{
internal::prefetch(src0 + j);
internal::prefetch(src1 + j);
float32x4_t v_src0 = vld1q_f32(src0 + j);
float32x4_t v_src1 = vld1q_f32(src1 + j);
uint32x4_t v_mask = vceqq_f32(v_src1,v_zero);
vst1q_f32(dst + j, vreinterpretq_f32_u32(vbicq_u32(
vreinterpretq_u32_f32(vmulq_f32(vmulq_n_f32(v_src0, scale),
internal::vrecpq_f32(v_src1))), v_mask)));
}
for (; j < roiw64; j += 2)
{
float32x2_t v_src0 = vld1_f32(src0 + j);
float32x2_t v_src1 = vld1_f32(src1 + j);
uint32x2_t v_mask = vceq_f32(v_src1,vget_low_f32(v_zero));
vst1_f32(dst + j, vreinterpret_f32_u32(vbic_u32(
vreinterpret_u32_f32(vmul_f32(vmul_n_f32(v_src0, scale),
internal::vrecp_f32(v_src1))), v_mask)));
}
for (; j < size.width; j++)
{
dst[j] = src1[j] ? src0[j] * scale / src1[j] : 0.0f;
}
}
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
(void)scale;
#endif
}
void reciprocal(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
f32 scale,
CONVERT_POLICY cpolicy)
{
recip<u8>(size, srcBase, srcStride, dstBase, dstStride, scale, cpolicy);
}
void reciprocal(const Size2D &size,
const s8 * srcBase, ptrdiff_t srcStride,
s8 * dstBase, ptrdiff_t dstStride,
f32 scale,
CONVERT_POLICY cpolicy)
{
recip<s8>(size, srcBase, srcStride, dstBase, dstStride, scale, cpolicy);
}
void reciprocal(const Size2D &size,
const u16 * srcBase, ptrdiff_t srcStride,
u16 * dstBase, ptrdiff_t dstStride,
f32 scale,
CONVERT_POLICY cpolicy)
{
recip<u16>(size, srcBase, srcStride, dstBase, dstStride, scale, cpolicy);
}
void reciprocal(const Size2D &size,
const s16 * srcBase, ptrdiff_t srcStride,
s16 * dstBase, ptrdiff_t dstStride,
f32 scale,
CONVERT_POLICY cpolicy)
{
recip<s16>(size, srcBase, srcStride, dstBase, dstStride, scale, cpolicy);
}
void reciprocal(const Size2D &size,
const s32 * srcBase, ptrdiff_t srcStride,
s32 * dstBase, ptrdiff_t dstStride,
f32 scale,
CONVERT_POLICY cpolicy)
{
recip<s32>(size, srcBase, srcStride, dstBase, dstStride, scale, cpolicy);
}
void reciprocal(const Size2D &size,
const f32 * srcBase, ptrdiff_t srcStride,
f32 * dstBase, ptrdiff_t dstStride,
f32 scale)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
if (scale == 0.0f)
{
for (size_t y = 0; y < size.height; ++y)
{
f32 * dst = internal::getRowPtr(dstBase, dstStride, y);
std::memset(dst, 0, sizeof(f32) * size.width);
}
return;
}
float32x4_t v_zero = vdupq_n_f32(0.0f);
size_t roiw128 = size.width >= 3 ? size.width - 3 : 0;
size_t roiw64 = size.width >= 1 ? size.width - 1 : 0;
if (std::fabs(scale - 1.0f) < FLT_EPSILON)
{
for (size_t i = 0; i < size.height; ++i)
{
const f32 * src1 = internal::getRowPtr(srcBase, srcStride, i);
f32 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
for (; j < roiw128; j += 4)
{
internal::prefetch(src1 + j);
float32x4_t v_src1 = vld1q_f32(src1 + j);
uint32x4_t v_mask = vceqq_f32(v_src1,v_zero);
vst1q_f32(dst + j, vreinterpretq_f32_u32(vbicq_u32(
vreinterpretq_u32_f32(internal::vrecpq_f32(v_src1)), v_mask)));
}
for (; j < roiw64; j += 2)
{
float32x2_t v_src1 = vld1_f32(src1 + j);
uint32x2_t v_mask = vceq_f32(v_src1,vget_low_f32(v_zero));
vst1_f32(dst + j, vreinterpret_f32_u32(vbic_u32(
vreinterpret_u32_f32(internal::vrecp_f32(v_src1)), v_mask)));
}
for (; j < size.width; j++)
{
dst[j] = src1[j] ? 1.0f / src1[j] : 0;
}
}
}
else
{
for (size_t i = 0; i < size.height; ++i)
{
const f32 * src1 = internal::getRowPtr(srcBase, srcStride, i);
f32 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
for (; j < roiw128; j += 4)
{
internal::prefetch(src1 + j);
float32x4_t v_src1 = vld1q_f32(src1 + j);
uint32x4_t v_mask = vceqq_f32(v_src1,v_zero);
vst1q_f32(dst + j, vreinterpretq_f32_u32(vbicq_u32(
vreinterpretq_u32_f32(vmulq_n_f32(internal::vrecpq_f32(v_src1),
scale)),v_mask)));
}
for (; j < roiw64; j += 2)
{
float32x2_t v_src1 = vld1_f32(src1 + j);
uint32x2_t v_mask = vceq_f32(v_src1,vget_low_f32(v_zero));
vst1_f32(dst + j, vreinterpret_f32_u32(vbic_u32(
vreinterpret_u32_f32(vmul_n_f32(internal::vrecp_f32(v_src1),
scale)), v_mask)));
}
for (; j < size.width; j++)
{
dst[j] = src1[j] ? scale / src1[j] : 0;
}
}
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)scale;
#endif
}
} // namespace CAROTENE_NS

260
3rdparty/carotene/src/dot_product.cpp vendored Normal file
View File

@ -0,0 +1,260 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2012-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
namespace CAROTENE_NS {
f64 dotProduct(const Size2D &_size,
const u8 * src0Base, ptrdiff_t src0Stride,
const u8 * src1Base, ptrdiff_t src1Stride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
Size2D size(_size);
if (src0Stride == src1Stride &&
src0Stride == (ptrdiff_t)(size.width))
{
size.width *= size.height;
size.height = 1;
}
// It is possible to accumulate up to 66051 uchar multiplication results in uint32 without overflow
// We process 16 elements and accumulate two new elements per step. So we could handle 66051/2*16 elements
#define DOT_UINT_BLOCKSIZE 66050*8
f64 result = 0.0;
for (size_t row = 0; row < size.height; ++row)
{
const u8 * src0 = internal::getRowPtr(src0Base, src0Stride, row);
const u8 * src1 = internal::getRowPtr(src1Base, src1Stride, row);
size_t i = 0;
uint64x2_t ws = vmovq_n_u64(0);
while(i + 16 <= size.width)
{
size_t lim = std::min(i + DOT_UINT_BLOCKSIZE, size.width) - 16;
uint32x4_t s1 = vmovq_n_u32(0);
uint32x4_t s2 = vmovq_n_u32(0);
for (; i <= lim; i += 16)
{
internal::prefetch(src0 + i);
internal::prefetch(src1 + i);
uint8x16_t vs1 = vld1q_u8(src0 + i);
uint8x16_t vs2 = vld1q_u8(src1 + i);
uint16x8_t vdot1 = vmull_u8(vget_low_u8(vs1), vget_low_u8(vs2));
uint16x8_t vdot2 = vmull_u8(vget_high_u8(vs1), vget_high_u8(vs2));
s1 = vpadalq_u16(s1, vdot1);
s2 = vpadalq_u16(s2, vdot2);
}
ws = vpadalq_u32(ws, s1);
ws = vpadalq_u32(ws, s2);
}
if(i + 8 <= size.width)
{
uint8x8_t vs1 = vld1_u8(src0 + i);
uint8x8_t vs2 = vld1_u8(src1 + i);
ws = vpadalq_u32(ws, vpaddlq_u16(vmull_u8(vs1, vs2)));
i += 8;
}
result += (double)vget_lane_u64(vadd_u64(vget_low_u64(ws), vget_high_u64(ws)), 0);
for (; i < size.width; ++i)
result += s32(src0[i]) * s32(src1[i]);
}
return result;
#else
(void)_size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
return 0;
#endif
}
f64 dotProduct(const Size2D &_size,
const s8 * src0Base, ptrdiff_t src0Stride,
const s8 * src1Base, ptrdiff_t src1Stride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
Size2D size(_size);
if (src0Stride == src1Stride &&
src0Stride == (ptrdiff_t)(size.width))
{
size.width *= size.height;
size.height = 1;
}
// It is possible to accumulate up to 131071 schar multiplication results in sint32 without overflow
// We process 16 elements and accumulate two new elements per step. So we could handle 131071/2*16 elements
#define DOT_INT_BLOCKSIZE 131070*8
f64 result = 0.0;
for (size_t row = 0; row < size.height; ++row)
{
const s8 * src0 = internal::getRowPtr(src0Base, src0Stride, row);
const s8 * src1 = internal::getRowPtr(src1Base, src1Stride, row);
size_t i = 0;
int64x2_t ws = vmovq_n_s64(0);
while(i + 16 <= size.width)
{
size_t lim = std::min(i + DOT_UINT_BLOCKSIZE, size.width) - 16;
int32x4_t s1 = vmovq_n_s32(0);
int32x4_t s2 = vmovq_n_s32(0);
for (; i <= lim; i += 16)
{
internal::prefetch(src0 + i);
internal::prefetch(src1 + i);
int8x16_t vs1 = vld1q_s8(src0 + i);
int8x16_t vs2 = vld1q_s8(src1 + i);
int16x8_t vdot1 = vmull_s8(vget_low_s8(vs1), vget_low_s8(vs2));
int16x8_t vdot2 = vmull_s8(vget_high_s8(vs1), vget_high_s8(vs2));
s1 = vpadalq_s16(s1, vdot1);
s2 = vpadalq_s16(s2, vdot2);
}
ws = vpadalq_s32(ws, s1);
ws = vpadalq_s32(ws, s2);
}
if(i + 8 <= size.width)
{
int8x8_t vs1 = vld1_s8(src0 + i);
int8x8_t vs2 = vld1_s8(src1 + i);
ws = vpadalq_s32(ws, vpaddlq_s16(vmull_s8(vs1, vs2)));
i += 8;
}
result += (double)vget_lane_s64(vadd_s64(vget_low_s64(ws), vget_high_s64(ws)), 0);
for (; i < size.width; ++i)
result += s32(src0[i]) * s32(src1[i]);
}
return result;
#else
(void)_size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
return 0;
#endif
}
f64 dotProduct(const Size2D &_size,
const f32 * src0Base, ptrdiff_t src0Stride,
const f32 * src1Base, ptrdiff_t src1Stride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
Size2D size(_size);
if (src0Stride == src1Stride &&
src0Stride == (ptrdiff_t)(size.width * sizeof(f32)))
{
size.width *= size.height;
size.height = 1;
}
#define DOT_FLOAT_BLOCKSIZE (1 << 13)
f64 result = 0.0;
for (size_t row = 0; row < size.height; ++row)
{
const f32 * src0 = internal::getRowPtr(src0Base, src0Stride, row);
const f32 * src1 = internal::getRowPtr(src1Base, src1Stride, row);
size_t i = 0;
while(i + 4 <= size.width)
{
size_t lim = std::min(i + DOT_FLOAT_BLOCKSIZE, size.width) - 4;
float32x4_t v_sum = vdupq_n_f32(0.0f);
for( ; i <= lim; i += 4 )
{
internal::prefetch(src0 + i);
internal::prefetch(src1 + i);
v_sum = vmlaq_f32(v_sum, vld1q_f32(src0 + i), vld1q_f32(src1 + i));
}
float32x2_t vres = vpadd_f32(vget_low_f32(v_sum),vget_high_f32(v_sum));
result += vget_lane_f32(vres, 0) + vget_lane_f32(vres, 1);
}
if(i + 2 <= size.width)
{
float32x2_t vres = vmul_f32(vld1_f32(src0 + i), vld1_f32(src1 + i));
result += vget_lane_f32(vres, 0) + vget_lane_f32(vres, 1);
i += 2;
}
for (; i < size.width; ++i)
result += src0[i] * src1[i];
}
return result;
#else
(void)_size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
return 0;
#endif
}
} // namespace CAROTENE_NS

428
3rdparty/carotene/src/fast.cpp vendored Normal file
View File

@ -0,0 +1,428 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2012-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
/* This is FAST corner detector, contributed to OpenCV by the author, Edward Rosten.
Below is the original copyright and the references */
/*
Copyright (c) 2006, 2008 Edward Rosten
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
*Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
*Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
*Neither the name of the University of Cambridge nor the names of
its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
The references are:
* Machine learning for high-speed corner detection,
E. Rosten and T. Drummond, ECCV 2006
* Faster and better: A machine learning approach to corner detection
E. Rosten, R. Porter and T. Drummond, PAMI, 2009
*/
#include "common.hpp"
#include <vector>
#include <cstring>
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace
{
void makeOffsets(ptrdiff_t pixel[], ptrdiff_t row_stride)
{
pixel[0] = 0 + row_stride * 3;
pixel[1] = 1 + row_stride * 3;
pixel[2] = 2 + row_stride * 2;
pixel[3] = 3 + row_stride * 1;
pixel[4] = 3 + row_stride * 0;
pixel[5] = 3 + row_stride * -1;
pixel[6] = 2 + row_stride * -2;
pixel[7] = 1 + row_stride * -3;
pixel[8] = 0 + row_stride * -3;
pixel[9] = -1 + row_stride * -3;
pixel[10] = -2 + row_stride * -2;
pixel[11] = -3 + row_stride * -1;
pixel[12] = -3 + row_stride * 0;
pixel[13] = -3 + row_stride * 1;
pixel[14] = -2 + row_stride * 2;
pixel[15] = -1 + row_stride * 3;
}
u8 cornerScore(const u8* ptr, const ptrdiff_t pixel[])
{
const s32 K = 8, N = 16 + K + 1;
s32 k, v = ptr[0];
s16 d[(N + 7) & ~7];
for( k = 0; k < N; k++ )
d[k] = (s16)(v - ptr[pixel[k]]);
int16x8_t q0 = vdupq_n_s16((s16)(-1000));
int16x8_t q1 = vdupq_n_s16((s16)(1000));
int16x8_t d0_7 = vld1q_s16(d + 0);
int16x8_t d8_15 = vld1q_s16(d + 8);
int16x8_t d16_23 = vld1q_s16(d + 16);
int16x8_t d24 = vld1q_s16(d + 24);
//k == 0
int16x8_t v0k0 = vextq_s16(d0_7, d8_15, 1);
int16x8_t v1k0 = vextq_s16(d0_7, d8_15, 2);
int16x8_t ak0 = vminq_s16(v0k0, v1k0);
int16x8_t bk0 = vmaxq_s16(v0k0, v1k0);
v0k0 = vextq_s16(d0_7, d8_15, 3);
ak0 = vminq_s16(ak0, v0k0);
bk0 = vmaxq_s16(bk0, v0k0);
v1k0 = vextq_s16(d0_7, d8_15, 4);
ak0 = vminq_s16(ak0, v1k0);
bk0 = vmaxq_s16(bk0, v1k0);
v0k0 = vextq_s16(d0_7, d8_15, 5);
ak0 = vminq_s16(ak0, v0k0);
bk0 = vmaxq_s16(bk0, v0k0);
v1k0 = vextq_s16(d0_7, d8_15, 6);
ak0 = vminq_s16(ak0, v1k0);
bk0 = vmaxq_s16(bk0, v1k0);
v0k0 = vextq_s16(d0_7, d8_15, 7);
ak0 = vminq_s16(ak0, v0k0);
bk0 = vmaxq_s16(bk0, v0k0);
ak0 = vminq_s16(ak0, d8_15);
bk0 = vmaxq_s16(bk0, d8_15);
q0 = vmaxq_s16(q0, vminq_s16(ak0, d0_7));
q1 = vminq_s16(q1, vmaxq_s16(bk0, d0_7));
v1k0 = vextq_s16(d8_15, d16_23, 1);
q0 = vmaxq_s16(q0, vminq_s16(ak0, v1k0));
q1 = vminq_s16(q1, vmaxq_s16(bk0, v1k0));
//k == 8
int16x8_t v0k8 = v1k0;
int16x8_t v1k8 = vextq_s16(d8_15, d16_23, 2);
int16x8_t ak8 = vminq_s16(v0k8, v1k8);
int16x8_t bk8 = vmaxq_s16(v0k8, v1k8);
v0k8 = vextq_s16(d8_15, d16_23, 3);
ak8 = vminq_s16(ak8, v0k8);
bk8 = vmaxq_s16(bk8, v0k8);
v1k8 = vextq_s16(d8_15, d16_23, 4);
ak8 = vminq_s16(ak8, v1k8);
bk8 = vmaxq_s16(bk8, v1k8);
v0k8 = vextq_s16(d8_15, d16_23, 5);
ak8 = vminq_s16(ak8, v0k8);
bk8 = vmaxq_s16(bk8, v0k8);
v1k8 = vextq_s16(d8_15, d16_23, 6);
ak8 = vminq_s16(ak8, v1k8);
bk8 = vmaxq_s16(bk8, v1k8);
v0k8 = vextq_s16(d8_15, d16_23, 7);
ak8 = vminq_s16(ak8, v0k8);
bk8 = vmaxq_s16(bk8, v0k8);
ak8 = vminq_s16(ak8, d16_23);
bk8 = vmaxq_s16(bk8, d16_23);
q0 = vmaxq_s16(q0, vminq_s16(ak8, d8_15));
q1 = vminq_s16(q1, vmaxq_s16(bk8, d8_15));
v1k8 = vextq_s16(d16_23, d24, 1);
q0 = vmaxq_s16(q0, vminq_s16(ak8, v1k8));
q1 = vminq_s16(q1, vmaxq_s16(bk8, v1k8));
//fin
int16x8_t q = vmaxq_s16(q0, vsubq_s16(vmovq_n_s16(0), q1));
int16x4_t q2 = vmax_s16(vget_low_s16(q), vget_high_s16(q));
int32x4_t q2w = vmovl_s16(q2);
int32x2_t q4 = vmax_s32(vget_low_s32(q2w), vget_high_s32(q2w));
int32x2_t q8 = vmax_s32(q4, vreinterpret_s32_s64(vshr_n_s64(vreinterpret_s64_s32(q4), 32)));
return (u8)(vget_lane_s32(q8, 0) - 1);
}
} //namespace
#endif
void FAST(const Size2D &size,
u8 *srcBase, ptrdiff_t srcStride,
KeypointStore *keypoints,
u8 threshold, bool nonmax_suppression)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
//keypoints.clear();
const s32 K = 8, N = 16 + K + 1;
ptrdiff_t i, j, k, pixel[N];
makeOffsets(pixel, srcStride);
for(k = 16; k < N; k++)
pixel[k] = pixel[k - 16];
uint8x16_t delta = vdupq_n_u8(128);
uint8x16_t t = vdupq_n_u8(threshold);
uint8x16_t K16 = vdupq_n_u8((u8)K);
u8 threshold_tab[512];
for( i = -255; i <= 255; i++ )
threshold_tab[i+255] = (u8)(i < -threshold ? 1 : i > threshold ? 2 : 0);
std::vector<u8> _buf((size.width+16)*3*(sizeof(ptrdiff_t) + sizeof(u8)) + 128);
u8* buf[3];
buf[0] = &_buf[0]; buf[1] = buf[0] + size.width; buf[2] = buf[1] + size.width;
ptrdiff_t* cpbuf[3];
cpbuf[0] = (ptrdiff_t*)internal::alignPtr(buf[2] + size.width, sizeof(ptrdiff_t)) + 1;
cpbuf[1] = cpbuf[0] + size.width + 1;
cpbuf[2] = cpbuf[1] + size.width + 1;
memset(buf[0], 0, size.width*3);
for(i = 3; i < (ptrdiff_t)size.height-2; i++)
{
const u8* ptr = internal::getRowPtr(srcBase, srcStride, i) + 3;
u8* curr = buf[(i - 3)%3];
ptrdiff_t* cornerpos = cpbuf[(i - 3)%3];
memset(curr, 0, size.width);
ptrdiff_t ncorners = 0;
if( i < (ptrdiff_t)size.height - 3 )
{
j = 3;
for(; j < (ptrdiff_t)size.width - 16 - 3; j += 16, ptr += 16)
{
internal::prefetch(ptr);
internal::prefetch(ptr + pixel[0]);
internal::prefetch(ptr + pixel[2]);
uint8x16_t v0 = vld1q_u8(ptr);
int8x16_t v1 = vreinterpretq_s8_u8(veorq_u8(vqsubq_u8(v0, t), delta));
int8x16_t v2 = vreinterpretq_s8_u8(veorq_u8(vqaddq_u8(v0, t), delta));
int8x16_t x0 = vreinterpretq_s8_u8(vsubq_u8(vld1q_u8(ptr + pixel[0]), delta));
int8x16_t x1 = vreinterpretq_s8_u8(vsubq_u8(vld1q_u8(ptr + pixel[4]), delta));
int8x16_t x2 = vreinterpretq_s8_u8(vsubq_u8(vld1q_u8(ptr + pixel[8]), delta));
int8x16_t x3 = vreinterpretq_s8_u8(vsubq_u8(vld1q_u8(ptr + pixel[12]), delta));
uint8x16_t m0 = vandq_u8(vcgtq_s8(x0, v2), vcgtq_s8(x1, v2));
uint8x16_t m1 = vandq_u8(vcgtq_s8(v1, x0), vcgtq_s8(v1, x1));
m0 = vorrq_u8(m0, vandq_u8(vcgtq_s8(x1, v2), vcgtq_s8(x2, v2)));
m1 = vorrq_u8(m1, vandq_u8(vcgtq_s8(v1, x1), vcgtq_s8(v1, x2)));
m0 = vorrq_u8(m0, vandq_u8(vcgtq_s8(x2, v2), vcgtq_s8(x3, v2)));
m1 = vorrq_u8(m1, vandq_u8(vcgtq_s8(v1, x2), vcgtq_s8(v1, x3)));
m0 = vorrq_u8(m0, vandq_u8(vcgtq_s8(x3, v2), vcgtq_s8(x0, v2)));
m1 = vorrq_u8(m1, vandq_u8(vcgtq_s8(v1, x3), vcgtq_s8(v1, x0)));
m0 = vorrq_u8(m0, m1);
u64 mask[2];
vst1q_u64(mask, vreinterpretq_u64_u8(m0));
if( mask[0] == 0 )
{
if (mask[1] != 0)
{
j -= 8;
ptr -= 8;
}
continue;
}
uint8x16_t c0 = vmovq_n_u8(0);
uint8x16_t c1 = vmovq_n_u8(0);
uint8x16_t max0 = vmovq_n_u8(0);
uint8x16_t max1 = vmovq_n_u8(0);
for( k = 0; k < N; k++ )
{
int8x16_t x = vreinterpretq_s8_u8(veorq_u8(vld1q_u8(ptr + pixel[k]), delta));
m0 = vcgtq_s8(x, v2);
m1 = vcgtq_s8(v1, x);
c0 = vandq_u8(vsubq_u8(c0, m0), m0);
c1 = vandq_u8(vsubq_u8(c1, m1), m1);
max0 = vmaxq_u8(max0, c0);
max1 = vmaxq_u8(max1, c1);
}
max0 = vmaxq_u8(max0, max1);
u8 m[16];
vst1q_u8(m, vcgtq_u8(max0, K16));
for( k = 0; k < 16; ++k )
if(m[k])
{
cornerpos[ncorners++] = j+k;
if(nonmax_suppression)
curr[j+k] = cornerScore(ptr+k, pixel);
}
}
for( ; j < (s32)size.width - 3; j++, ptr++ )
{
s32 v = ptr[0];
const u8* tab = &threshold_tab[0] - v + 255;
s32 d = tab[ptr[pixel[0]]] | tab[ptr[pixel[8]]];
if( d == 0 )
continue;
d &= tab[ptr[pixel[2]]] | tab[ptr[pixel[10]]];
d &= tab[ptr[pixel[4]]] | tab[ptr[pixel[12]]];
d &= tab[ptr[pixel[6]]] | tab[ptr[pixel[14]]];
if( d == 0 )
continue;
d &= tab[ptr[pixel[1]]] | tab[ptr[pixel[9]]];
d &= tab[ptr[pixel[3]]] | tab[ptr[pixel[11]]];
d &= tab[ptr[pixel[5]]] | tab[ptr[pixel[13]]];
d &= tab[ptr[pixel[7]]] | tab[ptr[pixel[15]]];
if( d & 1 )
{
s32 vt = v - threshold, count = 0;
for( k = 0; k < N; k++ )
{
s32 x = ptr[pixel[k]];
if(x < vt)
{
if( ++count > K )
{
cornerpos[ncorners++] = j;
if(nonmax_suppression)
curr[j] = cornerScore(ptr, pixel);
break;
}
}
else
count = 0;
}
}
if( d & 2 )
{
s32 vt = v + threshold, count = 0;
for( k = 0; k < N; k++ )
{
s32 x = ptr[pixel[k]];
if(x > vt)
{
if( ++count > K )
{
cornerpos[ncorners++] = j;
if(nonmax_suppression)
curr[j] = cornerScore(ptr, pixel);
break;
}
}
else
count = 0;
}
}
}
}
cornerpos[-1] = ncorners;
if( i == 3 )
continue;
const u8* prev = buf[(i - 4 + 3)%3];
const u8* pprev = buf[(i - 5 + 3)%3];
cornerpos = cpbuf[(i - 4 + 3)%3];
ncorners = cornerpos[-1];
for( k = 0; k < ncorners; k++ )
{
j = cornerpos[k];
s32 score = prev[j];
if( !nonmax_suppression ||
(score > prev[j+1] && score > prev[j-1] &&
score > pprev[j-1] && score > pprev[j] && score > pprev[j+1] &&
score > curr[j-1] && score > curr[j] && score > curr[j+1]) )
{
keypoints->push((f32)j, (f32)(i-1), 7.f, -1, (f32)score);
}
}
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)keypoints;
(void)threshold;
(void)nonmax_suppression;
#endif
}
} // namespace CAROTENE_NS

442
3rdparty/carotene/src/fill_minmaxloc.cpp vendored Normal file
View File

@ -0,0 +1,442 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
template <typename T>
void process(const T * src, size_t j0, size_t j1, size_t i,
T minVal, size_t * minLocPtr, s32 & minLocCount, s32 minLocCapacity,
T maxVal, size_t * maxLocPtr, s32 & maxLocCount, s32 maxLocCapacity)
{
for (size_t j = j0; j < j1; ++j)
{
T val = src[j];
if (val == maxVal)
{
if (maxLocCount < maxLocCapacity)
{
maxLocPtr[maxLocCount] = j;
maxLocPtr[maxLocCount + 1] = i;
}
maxLocCount += 2;
}
if (val == minVal)
{
if (minLocCount < minLocCapacity)
{
minLocPtr[minLocCount] = j;
minLocPtr[minLocCount + 1] = i;
}
minLocCount += 2;
}
}
}
} // namespace
#endif
void fillMinMaxLocs(const Size2D & size,
const u8 * srcBase, ptrdiff_t srcStride,
u8 minVal, size_t * minLocPtr, s32 & minLocCount, s32 minLocCapacity,
u8 maxVal, size_t * maxLocPtr, s32 & maxLocCount, s32 maxLocCapacity)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
uint8x16_t v_maxval16 = vdupq_n_u8(maxVal), v_minval16 = vdupq_n_u8(minVal);
uint8x8_t v_maxval8 = vdup_n_u8(maxVal), v_minval8 = vdup_n_u8(minVal);
u64 mask[2] = { 0ul };
minLocCapacity <<= 1;
maxLocCapacity <<= 1;
for (size_t i = 0; i < size.height; ++i)
{
const u8 * src = internal::getRowPtr(srcBase, srcStride, i);
size_t j = 0;
for ( ; j < roiw16; j += 16)
{
internal::prefetch(src + j);
uint8x16_t v_src = vld1q_u8(src + j);
uint8x16_t v_maxmask = vceqq_u8(v_src, v_maxval16);
uint8x16_t v_minmask = vceqq_u8(v_src, v_minval16);
uint8x16_t v_mask = vorrq_u8(v_maxmask, v_minmask);
vst1q_u8((u8 *)&mask[0], v_mask);
if (mask[0])
process(src, j, j + 8, i,
minVal, minLocPtr, minLocCount, minLocCapacity,
maxVal, maxLocPtr, maxLocCount, maxLocCapacity);
if (mask[1])
process(src, j + 8, j + 16, i,
minVal, minLocPtr, minLocCount, minLocCapacity,
maxVal, maxLocPtr, maxLocCount, maxLocCapacity);
}
for ( ; j < roiw8; j += 8)
{
uint8x8_t v_src = vld1_u8(src + j);
uint8x8_t v_maxmask = vceq_u8(v_src, v_maxval8);
uint8x8_t v_minmask = vceq_u8(v_src, v_minval8);
uint8x8_t v_mask = vorr_u8(v_maxmask, v_minmask);
vst1_u8((u8 *)&mask[0], v_mask);
if (mask[0])
process(src, j, j + 8, i,
minVal, minLocPtr, minLocCount, minLocCapacity,
maxVal, maxLocPtr, maxLocCount, maxLocCapacity);
}
process(src, j, size.width, i,
minVal, minLocPtr, minLocCount, minLocCapacity,
maxVal, maxLocPtr, maxLocCount, maxLocCapacity);
}
minLocCount >>= 1;
maxLocCount >>= 1;
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)minVal;
(void)minLocPtr;
(void)minLocCount;
(void)minLocCapacity;
(void)maxVal;
(void)maxLocPtr;
(void)maxLocCount;
(void)maxLocCapacity;
#endif
}
void fillMinMaxLocs(const Size2D & size,
const u16 * srcBase, ptrdiff_t srcStride,
u16 minVal, size_t * minLocPtr, s32 & minLocCount, s32 minLocCapacity,
u16 maxVal, size_t * maxLocPtr, s32 & maxLocCount, s32 maxLocCapacity)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
uint16x8_t v_maxval8 = vdupq_n_u16(maxVal),
v_minval8 = vdupq_n_u16(minVal);
u64 mask[2] = { 0ul };
minLocCapacity <<= 1;
maxLocCapacity <<= 1;
for (size_t i = 0; i < size.height; ++i)
{
const u16 * src = internal::getRowPtr(srcBase, srcStride, i);
size_t j = 0;
for ( ; j < roiw16; j += 16)
{
internal::prefetch(src + j);
uint16x8_t v_src0 = vld1q_u16(src + j), v_src1 = vld1q_u16(src + j + 8);
uint16x8_t v_mask0 = vorrq_u16(vceqq_u16(v_src0, v_maxval8), vceqq_u16(v_src0, v_minval8));
uint16x8_t v_mask1 = vorrq_u16(vceqq_u16(v_src1, v_maxval8), vceqq_u16(v_src1, v_minval8));
vst1q_u8((u8 *)&mask[0], vcombine_u8(vmovn_u16(v_mask0), vmovn_u16(v_mask1)));
if (mask[0])
process(src, j, j + 8, i,
minVal, minLocPtr, minLocCount, minLocCapacity,
maxVal, maxLocPtr, maxLocCount, maxLocCapacity);
if (mask[1])
process(src, j + 8, j + 16, i,
minVal, minLocPtr, minLocCount, minLocCapacity,
maxVal, maxLocPtr, maxLocCount, maxLocCapacity);
}
for ( ; j < roiw8; j += 8)
{
internal::prefetch(src + j);
uint16x8_t v_src = vld1q_u16(src + j);
uint16x8_t v_maxmask = vceqq_u16(v_src, v_maxval8);
uint16x8_t v_minmask = vceqq_u16(v_src, v_minval8);
uint16x8_t v_mask = vorrq_u16(v_maxmask, v_minmask);
vst1_u8((u8 *)&mask[0], vmovn_u16(v_mask));
if (mask[0])
process(src, j, j + 8, i,
minVal, minLocPtr, minLocCount, minLocCapacity,
maxVal, maxLocPtr, maxLocCount, maxLocCapacity);
}
process(src, j, size.width, i,
minVal, minLocPtr, minLocCount, minLocCapacity,
maxVal, maxLocPtr, maxLocCount, maxLocCapacity);
}
minLocCount >>= 1;
maxLocCount >>= 1;
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)minVal;
(void)minLocPtr;
(void)minLocCount;
(void)minLocCapacity;
(void)maxVal;
(void)maxLocPtr;
(void)maxLocCount;
(void)maxLocCapacity;
#endif
}
void fillMinMaxLocs(const Size2D & size,
const s16 * srcBase, ptrdiff_t srcStride,
s16 minVal, size_t * minLocPtr, s32 & minLocCount, s32 minLocCapacity,
s16 maxVal, size_t * maxLocPtr, s32 & maxLocCount, s32 maxLocCapacity)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
int16x8_t v_maxval8 = vdupq_n_s16(maxVal),
v_minval8 = vdupq_n_s16(minVal);
u64 mask[2] = { 0ul };
minLocCapacity <<= 1;
maxLocCapacity <<= 1;
for (size_t i = 0; i < size.height; ++i)
{
const s16 * src = internal::getRowPtr(srcBase, srcStride, i);
size_t j = 0;
for ( ; j < roiw16; j += 16)
{
internal::prefetch(src + j);
int16x8_t v_src0 = vld1q_s16(src + j), v_src1 = vld1q_s16(src + j + 8);
uint16x8_t v_mask0 = vorrq_u16(vceqq_s16(v_src0, v_maxval8), vceqq_s16(v_src0, v_minval8));
uint16x8_t v_mask1 = vorrq_u16(vceqq_s16(v_src1, v_maxval8), vceqq_s16(v_src1, v_minval8));
vst1q_u8((u8 *)&mask[0], vcombine_u8(vmovn_u16(v_mask0), vmovn_u16(v_mask1)));
if (mask[0])
process(src, j, j + 8, i,
minVal, minLocPtr, minLocCount, minLocCapacity,
maxVal, maxLocPtr, maxLocCount, maxLocCapacity);
if (mask[1])
process(src, j + 8, j + 16, i,
minVal, minLocPtr, minLocCount, minLocCapacity,
maxVal, maxLocPtr, maxLocCount, maxLocCapacity);
}
for ( ; j < roiw8; j += 8)
{
internal::prefetch(src + j);
int16x8_t v_src = vld1q_s16(src + j);
uint16x8_t v_maxmask = vceqq_s16(v_src, v_maxval8);
uint16x8_t v_minmask = vceqq_s16(v_src, v_minval8);
uint16x8_t v_mask = vorrq_u16(v_maxmask, v_minmask);
vst1_u8((u8 *)&mask[0], vmovn_u16(v_mask));
if (mask[0])
process(src, j, j + 8, i,
minVal, minLocPtr, minLocCount, minLocCapacity,
maxVal, maxLocPtr, maxLocCount, maxLocCapacity);
}
process(src, j, size.width, i,
minVal, minLocPtr, minLocCount, minLocCapacity,
maxVal, maxLocPtr, maxLocCount, maxLocCapacity);
}
minLocCount >>= 1;
maxLocCount >>= 1;
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)minVal;
(void)minLocPtr;
(void)minLocCount;
(void)minLocCapacity;
(void)maxVal;
(void)maxLocPtr;
(void)maxLocCount;
(void)maxLocCapacity;
#endif
}
void fillMinMaxLocs(const Size2D & size,
const s32 * srcBase, ptrdiff_t srcStride,
s32 minVal, size_t * minLocPtr, s32 & minLocCount, s32 minLocCapacity,
s32 maxVal, size_t * maxLocPtr, s32 & maxLocCount, s32 maxLocCapacity)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
int32x4_t v_maxval4 = vdupq_n_s32(maxVal),
v_minval4 = vdupq_n_s32(minVal);
u64 mask = 0ul;
minLocCapacity <<= 1;
maxLocCapacity <<= 1;
for (size_t i = 0; i < size.height; ++i)
{
const s32 * src = internal::getRowPtr(srcBase, srcStride, i);
size_t j = 0;
for ( ; j < roiw8; j += 8)
{
internal::prefetch(src + j);
int32x4_t v_src0 = vld1q_s32(src + j), v_src1 = vld1q_s32(src + j + 4);
uint32x4_t v_mask0 = vorrq_u32(vceqq_s32(v_src0, v_maxval4), vceqq_s32(v_src0, v_minval4));
uint32x4_t v_mask1 = vorrq_u32(vceqq_s32(v_src1, v_maxval4), vceqq_s32(v_src1, v_minval4));
vst1_u8((u8 *)&mask, vmovn_u16(vcombine_u16(vmovn_u32(v_mask0), vmovn_u32(v_mask1))));
if (mask)
process(src, j, j + 8, i,
minVal, minLocPtr, minLocCount, minLocCapacity,
maxVal, maxLocPtr, maxLocCount, maxLocCapacity);
}
process(src, j, size.width, i,
minVal, minLocPtr, minLocCount, minLocCapacity,
maxVal, maxLocPtr, maxLocCount, maxLocCapacity);
}
minLocCount >>= 1;
maxLocCount >>= 1;
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)minVal;
(void)minLocPtr;
(void)minLocCount;
(void)minLocCapacity;
(void)maxVal;
(void)maxLocPtr;
(void)maxLocCount;
(void)maxLocCapacity;
#endif
}
void fillMinMaxLocs(const Size2D & size,
const u32 * srcBase, ptrdiff_t srcStride,
u32 minVal, size_t * minLocPtr, s32 & minLocCount, s32 minLocCapacity,
u32 maxVal, size_t * maxLocPtr, s32 & maxLocCount, s32 maxLocCapacity)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
uint32x4_t v_maxval4 = vdupq_n_u32(maxVal),
v_minval4 = vdupq_n_u32(minVal);
u64 mask = 0ul;
minLocCapacity <<= 1;
maxLocCapacity <<= 1;
for (size_t i = 0; i < size.height; ++i)
{
const u32 * src = internal::getRowPtr(srcBase, srcStride, i);
size_t j = 0;
for ( ; j < roiw8; j += 8)
{
internal::prefetch(src + j);
uint32x4_t v_src0 = vld1q_u32(src + j), v_src1 = vld1q_u32(src + j + 4);
uint32x4_t v_mask0 = vorrq_u32(vceqq_u32(v_src0, v_maxval4), vceqq_u32(v_src0, v_minval4));
uint32x4_t v_mask1 = vorrq_u32(vceqq_u32(v_src1, v_maxval4), vceqq_u32(v_src1, v_minval4));
vst1_u8((u8 *)&mask, vmovn_u16(vcombine_u16(vmovn_u32(v_mask0), vmovn_u32(v_mask1))));
if (mask)
process(src, j, j + 8, i,
minVal, minLocPtr, minLocCount, minLocCapacity,
maxVal, maxLocPtr, maxLocCount, maxLocCapacity);
}
process(src, j, size.width, i,
minVal, minLocPtr, minLocCount, minLocCapacity,
maxVal, maxLocPtr, maxLocCount, maxLocCapacity);
}
minLocCount >>= 1;
maxLocCount >>= 1;
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)minVal;
(void)minLocPtr;
(void)minLocCount;
(void)minLocCapacity;
(void)maxVal;
(void)maxLocPtr;
(void)maxLocCount;
(void)maxLocCapacity;
#endif
}
} // namespace CAROTENE_NS

222
3rdparty/carotene/src/flip.cpp vendored Normal file
View File

@ -0,0 +1,222 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include "vtransform.hpp"
#include <cstring>
namespace CAROTENE_NS {
bool isFlipSupported(FLIP_MODE flipMode, u32 elemSize)
{
bool supportedElemSize = (elemSize == 1) || (elemSize == 2) || (elemSize == 3) || (elemSize == 4);
return isSupportedConfiguration() &&
((supportedElemSize && ((flipMode == FLIP_BOTH_MODE) || (flipMode == FLIP_HORIZONTAL_MODE))) ||
(flipMode == FLIP_VERTICAL_MODE));
}
#ifdef CAROTENE_NEON
namespace {
template <typename T>
void flip(const Size2D & size,
const void * srcBase, ptrdiff_t srcStride,
void * dstBase, ptrdiff_t dstStride,
FLIP_MODE flipMode)
{
using namespace internal;
typedef typename VecTraits<T>::vec128 vec128;
typedef typename VecTraits<T>::vec64 vec64;
u32 step_base = 16 / sizeof(T), step_tail = 8 / sizeof(T);
size_t roiw_base = size.width >= (step_base - 1) ? size.width - step_base + 1 : 0;
size_t roiw_tail = size.width >= (step_tail - 1) ? size.width - step_tail + 1 : 0;
for (size_t i = 0; i < size.height; ++i)
{
const T * src = getRowPtr((const T *)srcBase, srcStride, i);
T * dst = getRowPtr((T *)dstBase, dstStride, (flipMode & FLIP_VERTICAL_MODE) != 0 ? size.height - i - 1 : i);
size_t js = 0, jd = size.width;
for (; js < roiw_base; js += step_base, jd -= step_base)
{
prefetch(src + js);
vec128 v_src = vld1q(src + js);
vec128 v_dst = vrev64q(v_src);
v_dst = vcombine(vget_high(v_dst), vget_low(v_dst));
vst1q(dst + jd - step_base, v_dst);
}
for (; js < roiw_tail; js += step_tail, jd -= step_tail)
{
vec64 v_src = vld1(src + js);
vst1(dst + jd - step_tail, vrev64(v_src));
}
for (--jd; js < size.width; ++js, --jd)
dst[jd] = src[js];
}
}
template <typename T>
void flip3(const Size2D & size,
const void * srcBase, ptrdiff_t srcStride,
void * dstBase, ptrdiff_t dstStride,
FLIP_MODE flipMode)
{
using namespace internal;
#ifndef ANDROID
typedef typename VecTraits<T, 3>::vec128 vec128;
#endif
typedef typename VecTraits<T, 3>::vec64 vec64;
#ifndef ANDROID
u32 step_base = 16 / sizeof(T), step_base3 = step_base * 3;
size_t roiw_base = size.width >= (step_base - 1) ? size.width - step_base + 1 : 0;
#endif
u32 step_tail = 8 / sizeof(T), step_tail3 = step_tail * 3;
size_t roiw_tail = size.width >= (step_tail - 1) ? size.width - step_tail + 1 : 0;
for (size_t i = 0; i < size.height; ++i)
{
const T * src = getRowPtr((const T *)srcBase, srcStride, i);
T * dst = getRowPtr((T *)dstBase, dstStride, (flipMode & FLIP_VERTICAL_MODE) != 0 ? size.height - i - 1 : i);
size_t j = 0, js = 0, jd = size.width * 3;
#ifndef ANDROID
for (; j < roiw_base; j += step_base, js += step_base3, jd -= step_base3)
{
prefetch(src + js);
vec128 v_src = vld3q(src + js), v_dst;
v_src.val[0] = vrev64q(v_src.val[0]);
v_src.val[1] = vrev64q(v_src.val[1]);
v_src.val[2] = vrev64q(v_src.val[2]);
v_dst.val[0] = vcombine(vget_high(v_src.val[0]), vget_low(v_src.val[0]));
v_dst.val[1] = vcombine(vget_high(v_src.val[1]), vget_low(v_src.val[1]));
v_dst.val[2] = vcombine(vget_high(v_src.val[2]), vget_low(v_src.val[2]));
vst3q(dst + jd - step_base3, v_dst);
}
#endif // ANDROID
for (; j < roiw_tail; j += step_tail, js += step_tail3, jd -= step_tail3)
{
vec64 v_src = vld3(src + js), v_dst;
v_dst.val[0] = vrev64(v_src.val[0]);
v_dst.val[1] = vrev64(v_src.val[1]);
v_dst.val[2] = vrev64(v_src.val[2]);
vst3(dst + jd - step_tail3, v_dst);
}
for (jd -= 3; j < size.width; ++j, js += 3, jd -= 3)
{
dst[jd] = src[js];
dst[jd + 1] = src[js + 1];
dst[jd + 2] = src[js + 2];
}
}
}
typedef void (* flipFunc)(const Size2D &size,
const void * srcBase, ptrdiff_t srcStride,
void * dstBase, ptrdiff_t dstStride,
FLIP_MODE flipMode);
} // namespace
#endif
void flip(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
FLIP_MODE flipMode, u32 elemSize)
{
internal::assertSupportedConfiguration(isFlipSupported(flipMode, elemSize));
#ifdef CAROTENE_NEON
if (flipMode == FLIP_VERTICAL_MODE)
{
for (size_t y = 0; y < size.height; ++y)
{
const u8 * src_row = internal::getRowPtr(srcBase, srcStride, y);
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, size.height - y - 1);
std::memcpy(dst_row, src_row, elemSize * size.width);
}
return;
}
flipFunc func = NULL;
if (elemSize == (u32)sizeof(u8))
func = &flip<u8>;
if (elemSize == (u32)sizeof(u16))
func = &flip<u16>;
if (elemSize == (u32)sizeof(u32))
func = &flip<u32>;
if (elemSize == (u32)sizeof(u8) * 3)
func = &flip3<u8>;
if (func == NULL)
return;
func(size,
srcBase, srcStride,
dstBase, dstStride,
flipMode);
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)flipMode;
(void)elemSize;
#endif
}
} // namespace CAROTENE_NS

1059
3rdparty/carotene/src/gaussian_blur.cpp vendored Normal file

File diff suppressed because it is too large Load Diff

195
3rdparty/carotene/src/in_range.cpp vendored Normal file
View File

@ -0,0 +1,195 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2012-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
inline void vnst(u8* dst, uint8x16_t v1, uint8x16_t v2) { vst1q_u8(dst, v1); vst1q_u8(dst+16, v2); }
inline void vnst(u8* dst, uint16x8_t v1, uint16x8_t v2) { vst1q_u8(dst, vcombine_u8(vmovn_u16(v1), vmovn_u16(v2))); }
inline void vnst(u8* dst, uint32x4_t v1, uint32x4_t v2) { vst1_u8(dst, vmovn_u16(vcombine_u16(vmovn_u32(v1), vmovn_u32(v2)))); }
template <typename T, int elsize> struct vtail
{
static inline void inRange(const T *, const T *, const T *,
u8 *, size_t &, size_t)
{
//do nothing since there couldn't be enough data
}
};
template <typename T> struct vtail<T, 2>
{
static inline void inRange(const T * src, const T * rng1, const T * rng2,
u8 * dst, size_t &x, size_t width)
{
typedef typename internal::VecTraits<T>::vec128 vec128;
typedef typename internal::VecTraits<T>::unsign::vec128 uvec128;
//There no more than 15 elements in the tail, so we could handle 8 element vector only once
if( x + 8 < width)
{
vec128 vs = internal::vld1q( src + x);
vec128 vr1 = internal::vld1q(rng1 + x);
vec128 vr2 = internal::vld1q(rng2 + x);
uvec128 vd = internal::vandq(internal::vcgeq(vs, vr1), internal::vcgeq(vr2, vs));
internal::vst1(dst + x, internal::vmovn(vd));
x+=8;
}
}
};
template <typename T> struct vtail<T, 1>
{
static inline void inRange(const T * src, const T * rng1, const T * rng2,
u8 * dst, size_t &x, size_t width)
{
typedef typename internal::VecTraits<T>::vec128 vec128;
typedef typename internal::VecTraits<T>::unsign::vec128 uvec128;
typedef typename internal::VecTraits<T>::vec64 vec64;
typedef typename internal::VecTraits<T>::unsign::vec64 uvec64;
//There no more than 31 elements in the tail, so we could handle once 16+8 or 16 or 8 elements
if( x + 16 < width)
{
vec128 vs = internal::vld1q( src + x);
vec128 vr1 = internal::vld1q(rng1 + x);
vec128 vr2 = internal::vld1q(rng2 + x);
uvec128 vd = internal::vandq(internal::vcgeq(vs, vr1), internal::vcgeq(vr2, vs));
internal::vst1q(dst + x, vd);
x+=16;
}
if( x + 8 < width)
{
vec64 vs = internal::vld1( src + x);
vec64 vr1 = internal::vld1(rng1 + x);
vec64 vr2 = internal::vld1(rng2 + x);
uvec64 vd = internal::vand(internal::vcge(vs, vr1), internal::vcge(vr2, vs));
internal::vst1(dst + x, vd);
x+=8;
}
}
};
template <typename T>
inline void inRangeCheck(const Size2D &_size,
const T * srcBase, ptrdiff_t srcStride,
const T * rng1Base, ptrdiff_t rng1Stride,
const T * rng2Base, ptrdiff_t rng2Stride,
u8 * dstBase, ptrdiff_t dstStride)
{
typedef typename internal::VecTraits<T>::vec128 vec128;
typedef typename internal::VecTraits<T>::unsign::vec128 uvec128;
Size2D size(_size);
if (srcStride == dstStride &&
srcStride == rng1Stride &&
srcStride == rng2Stride &&
srcStride == (ptrdiff_t)(size.width))
{
size.width *= size.height;
size.height = 1;
}
const size_t width = size.width & ~( 32/sizeof(T) - 1 );
for(size_t j = 0; j < size.height; ++j)
{
const T * src = internal::getRowPtr( srcBase, srcStride, j);
const T * rng1 = internal::getRowPtr(rng1Base, rng1Stride, j);
const T * rng2 = internal::getRowPtr(rng2Base, rng2Stride, j);
u8 * dst = internal::getRowPtr( dstBase, dstStride, j);
size_t i = 0;
for( ; i < width; i += 32/sizeof(T) )
{
internal::prefetch(src + i);
internal::prefetch(rng1 + i);
internal::prefetch(rng2 + i);
vec128 vs = internal::vld1q( src + i);
vec128 vr1 = internal::vld1q(rng1 + i);
vec128 vr2 = internal::vld1q(rng2 + i);
uvec128 vd1 = internal::vandq(internal::vcgeq(vs, vr1), internal::vcgeq(vr2, vs));
vs = internal::vld1q( src + i + 16/sizeof(T));
vr1 = internal::vld1q(rng1 + i + 16/sizeof(T));
vr2 = internal::vld1q(rng2 + i + 16/sizeof(T));
uvec128 vd2 = internal::vandq(internal::vcgeq(vs, vr1), internal::vcgeq(vr2, vs));
vnst(dst + i, vd1, vd2);
}
vtail<T, sizeof(T)>::inRange(src, rng1, rng2, dst, i, size.width);
for( ; i < size.width; i++ )
dst[i] = (u8)(-(rng1[i] <= src[i] && src[i] <= rng2[i]));
}
}
}
#define INRANGEFUNC(T) \
void inRange(const Size2D &_size, \
const T * srcBase, ptrdiff_t srcStride, \
const T * rng1Base, ptrdiff_t rng1Stride, \
const T * rng2Base, ptrdiff_t rng2Stride, \
u8 * dstBase, ptrdiff_t dstStride) \
{ \
internal::assertSupportedConfiguration(); \
inRangeCheck(_size, srcBase, srcStride, \
rng1Base, rng1Stride, rng2Base, rng2Stride, \
dstBase, dstStride); \
}
#else
#define INRANGEFUNC(T) \
void inRange(const Size2D &, \
const T *, ptrdiff_t, \
const T *, ptrdiff_t, \
const T *, ptrdiff_t, \
u8 *, ptrdiff_t) \
{ \
internal::assertSupportedConfiguration(); \
}
#endif
INRANGEFUNC(u8)
INRANGEFUNC(s8)
INRANGEFUNC(u16)
INRANGEFUNC(s16)
INRANGEFUNC(s32)
INRANGEFUNC(f32)
} // namespace CAROTENE_NS

238
3rdparty/carotene/src/integral.cpp vendored Normal file
View File

@ -0,0 +1,238 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2012-2014, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
namespace CAROTENE_NS {
void integral(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
u32 * sumBase, ptrdiff_t sumStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
uint32x4_t v_zero = vmovq_n_u32(0u);
// the first iteration
const u8 * src = internal::getRowPtr(srcBase, srcStride, 0);
u32 * sum = internal::getRowPtr(sumBase, sumStride, 0);
uint32x4_t prev = v_zero;
size_t j = 0u;
for ( ; j + 7 < size.width; j += 8)
{
internal::prefetch(sum + j);
internal::prefetch(src + j);
uint8x8_t el8shr0 = vld1_u8(src + j);
uint8x8_t el8shr1 = vreinterpret_u8_u64(vshl_n_u64(vreinterpret_u64_u8(el8shr0), 8));
uint8x8_t el8shr2 = vreinterpret_u8_u64(vshl_n_u64(vreinterpret_u64_u8(el8shr0), 16));
uint8x8_t el8shr3 = vreinterpret_u8_u64(vshl_n_u64(vreinterpret_u64_u8(el8shr0), 24));
uint16x8_t el8shr12 = vaddl_u8(el8shr1, el8shr2);
uint16x8_t el8shr03 = vaddl_u8(el8shr0, el8shr3);
uint16x8_t el8 = vaddq_u16(el8shr12, el8shr03);
uint16x4_t el4h = vadd_u16(vget_low_u16(el8), vget_high_u16(el8));
uint32x4_t vsuml = vaddw_u16(prev, vget_low_u16(el8));
uint32x4_t vsumh = vaddw_u16(prev, el4h);
vst1q_u32(sum + j, vsuml);
vst1q_u32(sum + j + 4, vsumh);
prev = vaddw_u16(prev, vdup_lane_u16(el4h, 3));
}
for (u32 v = vgetq_lane_u32(prev, 3); j < size.width; ++j)
sum[j] = (v += src[j]);
// the others
for (size_t i = 1; i < size.height ; ++i)
{
src = internal::getRowPtr(srcBase, srcStride, i);
u32 * prevSum = internal::getRowPtr(sumBase, sumStride, i - 1);
sum = internal::getRowPtr(sumBase, sumStride, i);
prev = v_zero;
j = 0u;
for ( ; j + 7 < size.width; j += 8)
{
internal::prefetch(sum + j);
internal::prefetch(src + j);
uint32x4_t vsuml = vld1q_u32(prevSum + j);
uint32x4_t vsumh = vld1q_u32(prevSum + j + 4);
uint8x8_t el8shr0 = vld1_u8(src + j);
uint8x8_t el8shr1 = vreinterpret_u8_u64(vshl_n_u64(vreinterpret_u64_u8(el8shr0), 8));
uint8x8_t el8shr2 = vreinterpret_u8_u64(vshl_n_u64(vreinterpret_u64_u8(el8shr0), 16));
uint8x8_t el8shr3 = vreinterpret_u8_u64(vshl_n_u64(vreinterpret_u64_u8(el8shr0), 24));
vsuml = vaddq_u32(vsuml, prev);
vsumh = vaddq_u32(vsumh, prev);
uint16x8_t el8shr12 = vaddl_u8(el8shr1, el8shr2);
uint16x8_t el8shr03 = vaddl_u8(el8shr0, el8shr3);
uint16x8_t el8 = vaddq_u16(el8shr12, el8shr03);
uint16x4_t el4h = vadd_u16(vget_low_u16(el8), vget_high_u16(el8));
vsuml = vaddw_u16(vsuml, vget_low_u16(el8));
vsumh = vaddw_u16(vsumh, el4h);
vst1q_u32(sum + j, vsuml);
vst1q_u32(sum + j + 4, vsumh);
prev = vaddw_u16(prev, vdup_lane_u16(el4h, 3));
}
for (u32 v = vgetq_lane_u32(prev, 3); j < size.width; ++j)
sum[j] = (v += src[j]) + prevSum[j];
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)sumBase;
(void)sumStride;
#endif
}
void sqrIntegral(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
f64 * sqsumBase, ptrdiff_t sqsumStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
uint16x8_t v_zero8 = vmovq_n_u16(0u);
// the first iteration
const u8 * src = internal::getRowPtr(srcBase, srcStride, 0);
f64 * sqsum = internal::getRowPtr(sqsumBase, sqsumStride, 0);
double prev = 0.;
size_t j = 0u;
for ( ; j + 7 < size.width; j += 8)
{
internal::prefetch(sqsum + j);
internal::prefetch(src + j);
uint8x8_t vsrc = vld1_u8(src + j);
uint16x8_t el8shr0 = vmull_u8(vsrc, vsrc);
uint16x8_t el8shr1 = vextq_u16(v_zero8, el8shr0, 7);
uint32x4_t el8shr01l = vaddl_u16(vget_low_u16(el8shr0), vget_low_u16(el8shr1));
uint32x4_t el8shr01h = vaddl_u16(vget_high_u16(el8shr0), vget_high_u16(el8shr1));
uint32x4_t el4h = vaddq_u32(el8shr01l, el8shr01h);
uint32x2_t el2l = vadd_u32(vget_low_u32(el8shr01l), vget_high_u32(el8shr01l));
uint32x2_t el2hl = vadd_u32(vget_low_u32(el4h), vget_high_u32(el8shr01l));
uint32x2_t el2hh = vadd_u32(vget_low_u32(el4h), vget_high_u32(el4h));
u32 buf[8];
vst1_u32(buf, vget_low_u32(el8shr01l));
vst1_u32(buf+2, el2l);
vst1_u32(buf+4, el2hl);
vst1_u32(buf+6, el2hh);
for(u32 k=0; k < 8; k++)
sqsum[j+k] = prev + buf[k];
prev += buf[7];
}
for (; j < size.width; ++j)
sqsum[j] = (prev += src[j]*src[j]);
// the others
for (size_t i = 1; i < size.height ; ++i)
{
src = internal::getRowPtr(srcBase, srcStride, i);
f64 * prevSqSum = internal::getRowPtr(sqsumBase, sqsumStride, i - 1);
sqsum = internal::getRowPtr(sqsumBase, sqsumStride, i);
prev = 0.;
j = 0u;
for ( ; j + 7 < size.width; j += 8)
{
internal::prefetch(sqsum + j);
internal::prefetch(src + j);
uint8x8_t vsrc = vld1_u8(src + j);
uint16x8_t el8shr0 = vmull_u8(vsrc, vsrc);
uint16x8_t el8shr1 = vextq_u16(v_zero8, el8shr0, 7);
uint32x4_t el8shr01l = vaddl_u16(vget_low_u16(el8shr0), vget_low_u16(el8shr1));
uint32x4_t el8shr01h = vaddl_u16(vget_high_u16(el8shr0), vget_high_u16(el8shr1));
uint32x4_t el4h = vaddq_u32(el8shr01l, el8shr01h);
uint32x2_t el2l = vadd_u32(vget_low_u32(el8shr01l), vget_high_u32(el8shr01l));
uint32x2_t el2hl = vadd_u32(vget_low_u32(el4h), vget_high_u32(el8shr01l));
uint32x2_t el2hh = vadd_u32(vget_low_u32(el4h), vget_high_u32(el4h));
u32 buf[8];
vst1_u32(buf, vget_low_u32(el8shr01l));
vst1_u32(buf+2, el2l);
vst1_u32(buf+4, el2hl);
vst1_u32(buf+6, el2hh);
for(u32 k=0; k < 8; k++)
sqsum[j+k] = prev + prevSqSum[j+k] + buf[k];
prev += buf[7];
}
for (; j < size.width; ++j)
sqsum[j] = (prev += src[j]*src[j]) + prevSqSum[j];
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)sqsumBase;
(void)sqsumStride;
#endif
}
} // namespace CAROTENE_NS

112
3rdparty/carotene/src/intrinsics.hpp vendored Normal file
View File

@ -0,0 +1,112 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#ifndef CAROTENE_INTRINSICS_HPP
#define CAROTENE_INTRINSICS_HPP
#include <carotene/definitions.hpp>
#include <arm_neon.h>
namespace CAROTENE_NS { namespace internal {
/////////////// Custom NEON intrinsics ///////////////////
// calculate reciprocal value
inline float32x4_t vrecpq_f32(float32x4_t val)
{
float32x4_t reciprocal = vrecpeq_f32(val);
reciprocal = vmulq_f32(vrecpsq_f32(val, reciprocal), reciprocal);
reciprocal = vmulq_f32(vrecpsq_f32(val, reciprocal), reciprocal);
return reciprocal;
}
inline float32x2_t vrecp_f32(float32x2_t val)
{
float32x2_t reciprocal = vrecpe_f32(val);
reciprocal = vmul_f32(vrecps_f32(val, reciprocal), reciprocal);
reciprocal = vmul_f32(vrecps_f32(val, reciprocal), reciprocal);
return reciprocal;
}
// caclulate sqrt value
inline float32x4_t vrsqrtq_f32(float32x4_t val)
{
float32x4_t e = vrsqrteq_f32(val);
e = vmulq_f32(vrsqrtsq_f32(vmulq_f32(e, e), val), e);
e = vmulq_f32(vrsqrtsq_f32(vmulq_f32(e, e), val), e);
return e;
}
inline float32x2_t vrsqrt_f32(float32x2_t val)
{
float32x2_t e = vrsqrte_f32(val);
e = vmul_f32(vrsqrts_f32(vmul_f32(e, e), val), e);
e = vmul_f32(vrsqrts_f32(vmul_f32(e, e), val), e);
return e;
}
inline float32x4_t vsqrtq_f32(float32x4_t val)
{
return vrecpq_f32(vrsqrtq_f32(val));
}
inline float32x2_t vsqrt_f32(float32x2_t val)
{
return vrecp_f32(vrsqrt_f32(val));
}
// table lookup with the table in a 128-bit register
inline uint8x8_t vqtbl1_u8 (uint8x16_t a, uint8x8_t b)
{
#ifdef __aarch64__
// AArch64 supports this natively
return ::vqtbl1_u8(a, b);
#else
union { uint8x16_t v; uint8x8x2_t w; } u = { a };
return vtbl2_u8(u.w, b);
#endif
}
} }
#endif

713
3rdparty/carotene/src/laplacian.cpp vendored Normal file
View File

@ -0,0 +1,713 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include "saturate_cast.hpp"
#include <vector>
namespace CAROTENE_NS {
bool isLaplacian3x3Supported(const Size2D &size, BORDER_MODE border)
{
return isSupportedConfiguration() && size.width >= 8 &&
(border == BORDER_MODE_CONSTANT ||
border == BORDER_MODE_REPLICATE);
}
void Laplacian3x3(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
BORDER_MODE border, u8 borderValue)
{
internal::assertSupportedConfiguration(isLaplacian3x3Supported(size, border));
#ifdef CAROTENE_NEON
const uint16x8_t v_border_x3 = vdupq_n_u16(borderValue * 3);
const uint16x8_t v_zero = vdupq_n_u16(0);
const uint8x8_t v_border = vdup_n_u8(borderValue);
uint8x8_t vsub;
uint16x8_t tprev = v_zero, tcurr = v_zero, tnext = v_zero;
uint16x8_t t0 = v_zero, t1 = v_zero, t2 = v_zero;
ptrdiff_t width = (ptrdiff_t)size.width, height = (ptrdiff_t)size.height;
for (ptrdiff_t y = 0; y < height; ++y)
{
const u8 * srow0 = y == 0 && border == BORDER_MODE_CONSTANT ? NULL : internal::getRowPtr(srcBase, srcStride, std::max<ptrdiff_t>(y - 1, 0));
const u8 * srow1 = internal::getRowPtr(srcBase, srcStride, y);
const u8 * srow2 = y + 1 == height && border == BORDER_MODE_CONSTANT ? NULL : internal::getRowPtr(srcBase, srcStride, std::min(y + 1, height - 1));
u8 * drow = internal::getRowPtr(dstBase, dstStride, y);
s16 prevx = 0, currx = 0, nextx = 0;
ptrdiff_t x = 0;
const ptrdiff_t bwidth = y + 2 < height ? width : (width - 8);
// perform vertical convolution
for ( ; x <= bwidth; x += 8)
{
internal::prefetch(srow0 + x);
internal::prefetch(srow1 + x);
internal::prefetch(srow2 + x);
uint8x8_t x0 = !srow0 ? v_border : vld1_u8(srow0 + x);
uint8x8_t x1 = vld1_u8(srow1 + x);
uint8x8_t x2 = !srow2 ? v_border : vld1_u8(srow2 + x);
// calculate values for plain CPU part below if needed
if (x + 8 >= bwidth)
{
ptrdiff_t x3 = x == width ? width - 1 : x;
ptrdiff_t x4 = border == BORDER_MODE_CONSTANT ? x3 - 1 : std::max<ptrdiff_t>(x3 - 1, 0);
if (border == BORDER_MODE_CONSTANT && x4 < 0)
prevx = borderValue;
else
prevx = (srow2 ? srow2[x4] : borderValue) + srow1[x4] + (srow0 ? srow0[x4] : borderValue);
currx = (srow2 ? srow2[x3] : borderValue) + srow1[x3] + (srow0 ? srow0[x3] : borderValue);
}
// make shift
if (x)
{
tprev = tcurr;
tcurr = tnext;
}
// and calculate next value
tnext = vaddw_u8(vaddl_u8(x0, x1), x2);
// make extrapolation for the first elements
if (!x)
{
// make border
if (border == BORDER_MODE_CONSTANT)
tcurr = v_border_x3;
else if (border == BORDER_MODE_REPLICATE)
tcurr = vdupq_n_u16(vgetq_lane_u16(tnext, 0));
vsub = x1;
continue;
}
// combine 3 "shifted" vectors
t0 = vextq_u16(tprev, tcurr, 7);
t1 = tcurr;
t2 = vextq_u16(tcurr, tnext, 1);
// and add them
t0 = vqaddq_u16(t0, vqaddq_u16(t1, t2));
int16x8_t tt0 = vsubq_s16(vreinterpretq_s16_u16(t0),
vreinterpretq_s16_u16(vaddw_u8(vshll_n_u8(vsub, 3), vsub)));
uint8x8_t it0 = vqmovun_s16(tt0);
vst1_u8(drow + x - 8, it0);
vsub = x1;
}
x -= 8;
if (x == width)
--x;
for ( ; x < width; ++x)
{
// make extrapolation for the last elements
if (x + 1 >= width)
{
if (border == BORDER_MODE_CONSTANT)
nextx = borderValue * 3;
else if (border == BORDER_MODE_REPLICATE)
nextx = srow2[x] + srow1[x] + srow0[x];
}
else
{
nextx = (srow2 ? srow2[x + 1] : borderValue) +
srow1[x + 1] +
(srow0 ? srow0[x + 1] : borderValue);
}
s32 val = (prevx + currx + nextx) - 9 * srow1[x];
drow[x] = internal::saturate_cast<u8>((s32)val);
// make shift
prevx = currx;
currx = nextx;
}
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)border;
(void)borderValue;
#endif
}
bool isLaplacianOpenCVSupported(const Size2D &size, BORDER_MODE border)
{
return isSupportedConfiguration() &&
size.width >= 8 && size.height >= 1 &&
(border == BORDER_MODE_CONSTANT ||
border == BORDER_MODE_REFLECT ||
border == BORDER_MODE_REFLECT101 ||
border == BORDER_MODE_REPLICATE);
}
void Laplacian1OpenCV(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
s16 * dstBase, ptrdiff_t dstStride,
BORDER_MODE border, u8 borderValue)
{
internal::assertSupportedConfiguration(isLaplacianOpenCVSupported(size, border));
#ifdef CAROTENE_NEON
ptrdiff_t rows = size.height, cols = size.width;
std::vector<u8> _tmp;
u8 *tmp = 0;
if (border == BORDER_MODE_CONSTANT)
{
_tmp.assign(cols + 4,borderValue);
tmp = &_tmp[2];
}
for( ptrdiff_t y = 0; y < rows; y++ )
{
const u8* v0 = 0;
const u8* v1 = internal::getRowPtr(srcBase, srcStride, y);
const u8* v2 = 0;
// make border
if (border == BORDER_MODE_REFLECT101) {
v0 = internal::getRowPtr(srcBase, srcStride, y > 0 ? y-1 : y+1);
v2 = internal::getRowPtr(srcBase, srcStride, y < rows-1 ? y+1 : rows > 1 ? rows-2 : 0);
} else if (border == BORDER_MODE_CONSTANT) {
v0 = y > 0 ? internal::getRowPtr(srcBase, srcStride, y-1) : tmp;
v2 = y < rows-1 ? internal::getRowPtr(srcBase, srcStride, y+1) : tmp;
} else {
v0 = internal::getRowPtr(srcBase, srcStride, y > 0 ? y-1 : 0);
v2 = internal::getRowPtr(srcBase, srcStride, y < rows-1 ? y+1 : rows > 0 ? rows-1 : 0);
}
s16* drow = internal::getRowPtr(dstBase, dstStride, y);
int16x8_t tcurr = vmovq_n_s16(0x0);
int16x8_t tnext = vmovq_n_s16(0x0);
int16x8_t t0, t2;
uint8x8_t xx0 = vmov_n_u8(0x0);
uint8x8_t xx1 = vmov_n_u8(0x0);
uint8x8_t xx2 = vmov_n_u8(0x0);
ptrdiff_t x = 0;
const ptrdiff_t bcols = y + 2 < rows ? cols : (cols - 8);
for( ; x <= bcols; x += 8 )
{
internal::prefetch(v0 + x);
internal::prefetch(v1 + x);
internal::prefetch(v2 + x);
uint8x8_t x0 = vld1_u8(v0 + x);
uint8x8_t x1 = vld1_u8(v1 + x);
uint8x8_t x2 = vld1_u8(v2 + x);
if(x) {
xx0 = xx1;
xx1 = xx2;
} else {
xx1 = x1;
// make border
if (border == BORDER_MODE_REPLICATE || border == BORDER_MODE_REFLECT)
{
xx1 = vset_lane_u8(vget_lane_u8(x1, 0),x1, 7);
}
else if (border == BORDER_MODE_CONSTANT)
{
xx1 = vset_lane_u8(borderValue, x1, 7);
}
else if (border == BORDER_MODE_REFLECT101)
{
xx1 = vset_lane_u8(vget_lane_u8(x1, 1),x1, 7);
}
}
xx2 = x1;
if(x) {
tcurr = tnext;
}
tnext = vsubq_s16(vreinterpretq_s16_u16(vaddl_u8(x0, x2)),
vreinterpretq_s16_u16(vshll_n_u8(x1, 2)));
if(!x) {
tcurr = tnext;
continue;
}
t0 = vreinterpretq_s16_u16(vmovl_u8(vext_u8(xx0, xx1, 7)));
t2 = vreinterpretq_s16_u16(vmovl_u8(vext_u8(xx1, xx2, 1)));
t0 = vaddq_s16(vqaddq_s16(t0, t2), tcurr);
vst1q_s16(drow + x - 8, t0);
}
x -= 8;
if(x == cols){
x--;
}
for( ; x < cols; x++ )
{
s16 nextx;
s16 prevx;
// make border
if (border == BORDER_MODE_REPLICATE || border == BORDER_MODE_REFLECT)
{
prevx = x == 0 ? v1[0] : v1[x-1];
nextx = x == cols-1 ? v1[x] : v1[x+1];
}
else if (border == BORDER_MODE_REFLECT101)
{
prevx = x == 0 ? v1[1] : v1[x-1];
nextx = x == cols-1 ? v1[x-1] : v1[x+1];
}
else //if (border == BORDER_MODE_CONSTANT)
{
prevx = x == 0 ? borderValue : v1[x-1];
nextx = x == cols-1 ? borderValue : v1[x+1];
}
*(drow+x) = prevx + nextx - 4*v1[x] + v0[x] + v2[x];
}
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)border;
(void)borderValue;
#endif
}
void Laplacian3OpenCV(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
s16 * dstBase, ptrdiff_t dstStride,
BORDER_MODE border, u8 borderValue)
{
internal::assertSupportedConfiguration(isLaplacianOpenCVSupported(size, border));
#ifdef CAROTENE_NEON
ptrdiff_t rows = size.height, cols = size.width;
std::vector<u8> _tmp;
u8 *tmp = 0;
if (border == BORDER_MODE_CONSTANT)
{
_tmp.assign(cols + 4,borderValue);
tmp = &_tmp[2];
}
for( ptrdiff_t y = 0; y < rows; y++ )
{
const u8* v0 = 0;
const u8* v1 = internal::getRowPtr(srcBase, srcStride, y);
const u8* v2 = 0;
// make border
if (border == BORDER_MODE_REFLECT101) {
v0 = internal::getRowPtr(srcBase, srcStride, y > 0 ? y-1 : y+1);
v2 = internal::getRowPtr(srcBase, srcStride, y < rows-1 ? y+1 : rows > 1 ? rows-2 : 0);
} else if (border == BORDER_MODE_CONSTANT) {
v0 = y > 0 ? internal::getRowPtr(srcBase, srcStride, y-1) : tmp;
v2 = y < rows-1 ? internal::getRowPtr(srcBase, srcStride, y+1) : tmp;
} else {
v0 = internal::getRowPtr(srcBase, srcStride, y > 0 ? y-1 : 0);
v2 = internal::getRowPtr(srcBase, srcStride, y < rows-1 ? y+1 : rows > 0 ? rows-1 : 0);
}
s16* drow = internal::getRowPtr(dstBase, dstStride, y);
int16x8_t tprev = vmovq_n_s16(0x0);
int16x8_t tcurr = vmovq_n_s16(0x0);
int16x8_t tnext = vmovq_n_s16(0x0);
int16x8_t tc = vmovq_n_s16(0x0);
int16x8_t t0, t2, tcnext;
ptrdiff_t x = 0;
const ptrdiff_t bcols = y + 2 < rows ? cols : (cols - 8);
for( ; x <= bcols; x += 8 )
{
internal::prefetch(v0 + x);
internal::prefetch(v1 + x);
internal::prefetch(v2 + x);
uint8x8_t x0 = vld1_u8(v0 + x);
uint8x8_t x1 = vld1_u8(v1 + x);
uint8x8_t x2 = vld1_u8(v2 + x);
tcnext = vreinterpretq_s16_u16(vshll_n_u8(x1, 2));
if(x) {
tprev = tcurr;
tcurr = tnext;
}
tnext = vreinterpretq_s16_u16(vaddl_u8(x0, x2));
if(!x) {
tcurr = tnext;
tc = tcnext;
// make border
if (border == BORDER_MODE_REPLICATE || border == BORDER_MODE_REFLECT)
{
tcurr = vsetq_lane_s16(vgetq_lane_s16(tcurr, 0),tcurr, 7);
}
else if (border == BORDER_MODE_CONSTANT)
{
tcurr = vsetq_lane_s16(borderValue, tcurr, 7);
}
else if (border == BORDER_MODE_REFLECT101)
{
tcurr = vsetq_lane_s16(vgetq_lane_s16(tcurr, 1),tcurr, 7);
}
continue;
}
t0 = vextq_s16(tprev, tcurr, 7);
t2 = vextq_s16(tcurr, tnext, 1);
t0 = vsubq_s16(vqaddq_s16(t0, t2), tc);
tc = tcnext;
t0 = vshlq_n_s16(t0, 1);
vst1q_s16(drow + x - 8, t0);
}
x -= 8;
if(x == cols){
x--;
}
for( ; x < cols; x++ )
{
s16 nextx, nextx2;
s16 prevx, prevx2;
// make border
if (border == BORDER_MODE_REPLICATE || border == BORDER_MODE_REFLECT)
{
prevx = x == 0 ? v0[0] : v0[x-1];
prevx2 = x == 0 ? v2[0] : v2[x-1];
nextx = x == cols-1 ? v0[x] : v0[x+1];
nextx2 = x == cols-1 ? v2[x] : v2[x+1];
}
else if (border == BORDER_MODE_REFLECT101)
{
prevx = x == 0 ? v0[1] : v0[x-1];
prevx2 = x == 0 ? v2[1] : v2[x-1];
nextx = x == cols-1 ? v0[x-1] : v0[x+1];
nextx2 = x == cols-1 ? v2[x-1] : v2[x+1];
}
else //if (border == BORDER_MODE_CONSTANT)
{
prevx = x == 0 ? borderValue : v0[x-1];
prevx2 = x == 0 ? borderValue : v2[x-1];
nextx = x == cols-1 ? borderValue : v0[x+1];
nextx2 = x == cols-1 ? borderValue : v2[x+1];
}
s16 res = prevx + nextx - 4*v1[x] + prevx2 + nextx2;
*(drow+x) = 2*res;
}
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)border;
(void)borderValue;
#endif
}
void Laplacian5OpenCV(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
s16 * dstBase, ptrdiff_t dstStride,
BORDER_MODE border, u8 borderValue)
{
internal::assertSupportedConfiguration(isLaplacianOpenCVSupported(size, border));
#ifdef CAROTENE_NEON
ptrdiff_t rows = size.height, cols = size.width;
std::vector<u8> _tmp;
u8 *tmp = 0;
if (border == BORDER_MODE_CONSTANT)
{
_tmp.assign(cols + 4,borderValue);
tmp = &_tmp[2];
}
for( ptrdiff_t y = 0; y < rows; y++ )
{
const u8* v0 = 0;
const u8* v1 = 0;
const u8* v2 = internal::getRowPtr(srcBase, srcStride, y);
const u8* v3 = 0;
const u8* v4 = 0;
// make border
if (border == BORDER_MODE_REPLICATE) {
v0 = internal::getRowPtr(srcBase, srcStride, y > 1 ? y-2 : 0);
v1 = internal::getRowPtr(srcBase, srcStride, y > 0 ? y-1 : 0);
v3 = internal::getRowPtr(srcBase, srcStride, y < rows-1 ? y+1 : rows > 0 ? rows-1 : 0);
v4 = internal::getRowPtr(srcBase, srcStride, y < rows-2 ? y+2 : rows > 0 ? rows-1 : 0);
} else if (border == BORDER_MODE_REFLECT) {
v0 = internal::getRowPtr(srcBase, srcStride, y > 1 ? y-2 : rows > 1 ? 1-y : 0);
v1 = internal::getRowPtr(srcBase, srcStride, y > 0 ? y-1 : 0);
v3 = internal::getRowPtr(srcBase, srcStride, y < rows-1 ? y+1 : rows > 0 ? rows-1 : 0);
v4 = internal::getRowPtr(srcBase, srcStride, y < rows-2 ? y+2 : rows > 1 ? 2*rows-(y+3) : 0);
} else if (border == BORDER_MODE_REFLECT101) {
v0 = internal::getRowPtr(srcBase, srcStride, y > 1 ? y-2 : rows > 2-y ? 2-y : 0); ///check
v1 = internal::getRowPtr(srcBase, srcStride, y > 0 ? y-1 : rows > 1 ? 1 : 0);
v3 = internal::getRowPtr(srcBase, srcStride, y < rows-1 ? y+1 : rows > 1 ? rows-2 : 0);
v4 = internal::getRowPtr(srcBase, srcStride, y < rows-2 ? y+2 : rows > 2 ? 2*rows-(y+4) : 0);///bad if rows=2 y=1 rows - 4 + (2,1)
} else if (border == BORDER_MODE_CONSTANT) {
v0 = y > 1 ? internal::getRowPtr(srcBase, srcStride, y-2) : tmp;
v1 = y > 0 ? internal::getRowPtr(srcBase, srcStride, y-1) : tmp;
v3 = y < rows-1 ? internal::getRowPtr(srcBase, srcStride, y+1) : tmp;
v4 = y < rows-2 ? internal::getRowPtr(srcBase, srcStride, y+2) : tmp;
}
s16* drow = internal::getRowPtr(dstBase, dstStride, y);
int16x8_t tnext, tc, t0;
int16x8_t tnext2, tnext3;
int16x8_t tnext1Old, tnext2Old, tnext3Old;
int16x8_t tnext4OldOldOld, tnext5OldOldOld;
int16x8_t tcurr1 = vmovq_n_s16(0x0);
int16x8_t tnext1 = vmovq_n_s16(0x0);
int16x8_t tprev1 = vmovq_n_s16(0x0);
int16x8_t tpprev1 = vmovq_n_s16(0x0);
int16x8_t tppprev1 = vmovq_n_s16(0x0);
int16x8_t tnext4Old = vmovq_n_s16(0x0);
int16x8_t tnext5Old = vmovq_n_s16(0x0);
int16x8_t tnext1OldOld = vmovq_n_s16(0x0);
int16x8_t tnext2OldOld = vmovq_n_s16(0x0);
int16x8_t tnext3OldOld = vmovq_n_s16(0x0);
int16x8_t tnext4OldOld = vmovq_n_s16(0x0);
int16x8_t tnext5OldOld = vmovq_n_s16(0x0);
// do vertical convolution
ptrdiff_t x = 0;
const ptrdiff_t bcols = y + 3 < rows ? cols : (cols - 8);
for( ; x <= bcols; x += 8 )
{
internal::prefetch(v0 + x);
internal::prefetch(v1 + x);
internal::prefetch(v2 + x);
internal::prefetch(v3 + x);
internal::prefetch(v4 + x);
uint8x8_t x0 = vld1_u8(v0 + x);
uint8x8_t x1 = vld1_u8(v1 + x);
uint8x8_t x2 = vld1_u8(v2 + x);
uint8x8_t x3 = vld1_u8(v3 + x);
uint8x8_t x4 = vld1_u8(v4 + x);
if(x) {
tcurr1 = tnext1;
}
tnext4OldOldOld = tnext4Old;
tnext5OldOldOld = tnext5Old;
tnext1Old = tnext1OldOld;
tnext2Old = tnext2OldOld;
tnext3Old = tnext3OldOld;
tnext4Old = tnext4OldOld;
tnext5Old = tnext5OldOld;
tnext3 = vreinterpretq_s16_u16(vaddq_u16(vaddl_u8(x3, x2),vaddl_u8(x2, x1)));
tnext3 = vshlq_n_s16(tnext3, 1);
tc = vreinterpretq_s16_u16(vsubl_u8(x4, x2));
tnext = vreinterpretq_s16_u16(vsubl_u8(x2, x0));
tnext2 = vsubq_s16(tc, tnext);
tnext1 = vaddq_s16(tnext3, tnext2);
// tnext1 = x0 + 2*x1 + 2*x2 + 2*x3 + x4
tnext2 = vshlq_n_s16(tnext2, 1);
// tnext2 = 2*x4 - 4*x2 + 2*x0
tnext3 = vsubq_s16(tnext2, vshlq_n_s16(tnext3, 1));
// tnext3 = 2*x0 - 4*x1 - 12*x2 - 4*x3 + 2*x4
tnext1OldOld = tnext1;
tnext2OldOld = tnext2;
tnext3OldOld = tnext3;
tnext4OldOld = tnext2;
tnext5OldOld = tnext1;
if(x) {
tnext1 = vextq_s16(tnext1Old, tnext1, 2);
tcurr1 = vextq_s16(tnext2Old, tnext2, 1);
tprev1 = tnext3Old;
if(x!=8) {
tpprev1 = vextq_s16(tnext4OldOldOld, tnext4Old, 7);
tppprev1 = vextq_s16(tnext5OldOldOld, tnext5Old, 6);
}
}
if(!x) {
// make border
if (border == BORDER_MODE_REPLICATE) {
tpprev1 = vextq_s16(tnext2, tnext2, 7);
tpprev1 = vsetq_lane_s16(vgetq_lane_s16(tpprev1, 1),tpprev1, 0);
tprev1 = vextq_s16(tnext1, tnext1, 6);
tprev1 = vsetq_lane_s16(vgetq_lane_s16(tprev1, 2),tprev1, 0);
tprev1 = vsetq_lane_s16(vgetq_lane_s16(tprev1, 2),tprev1, 1);
} else if (border == BORDER_MODE_REFLECT) {
tpprev1 = vextq_s16(tnext2, tnext2, 7);
tpprev1 = vsetq_lane_s16(vgetq_lane_s16(tpprev1, 1),tpprev1, 0);
tprev1 = vextq_s16(tnext1, tnext1, 6);
tprev1 = vsetq_lane_s16(vgetq_lane_s16(tprev1, 3),tprev1, 0);
tprev1 = vsetq_lane_s16(vgetq_lane_s16(tprev1, 2),tprev1, 1);
} else if (border == BORDER_MODE_REFLECT101) {
tpprev1 = vextq_s16(tnext2, tnext2, 7);
tpprev1 = vsetq_lane_s16(vgetq_lane_s16(tpprev1, 2),tpprev1, 0);
tprev1 = vextq_s16(tnext1, tnext1, 6);
tprev1 = vsetq_lane_s16(vgetq_lane_s16(tprev1, 3),tprev1, 1);
tprev1 = vsetq_lane_s16(vgetq_lane_s16(tprev1, 4),tprev1, 0);
} else if (border == BORDER_MODE_CONSTANT) {
tpprev1 = vextq_s16(tnext2, tnext2, 7);
tpprev1 = vsetq_lane_s16(borderValue, tpprev1, 0);
tprev1 = vextq_s16(tnext1, tnext1, 6);
tprev1 = vsetq_lane_s16(borderValue, tprev1, 0);
tprev1 = vsetq_lane_s16(borderValue, tprev1, 1);
}
tppprev1 = tprev1;
continue;
}
t0 = vaddq_s16(vaddq_s16(vqaddq_s16(tcurr1, tprev1), vqaddq_s16(tpprev1, tppprev1)), tnext1);
t0 = vaddq_s16(t0, t0);
vst1q_s16(drow + x - 8, t0);
}
x -= 8;
if(x >= cols - 1)
x = cols-2;
s16 pprevx = 0;
s16 prevx = 0;
s16 nextx = 0;
s16 nnextx = 0;
for( ; x < cols; x++ )
{
if (x == 0) {
// make border
if (border == BORDER_MODE_REPLICATE) {
pprevx = v0[0] + 2*v1[0] + 2*v2[0] + 2*v3[0] + v4[0];
prevx = 2*v0[0] - 4*v2[0] + 2*v4[0];
} else if (border == BORDER_MODE_REFLECT) {
pprevx = v0[1] + 2*v1[1] + 2*v2[1] + 2*v3[1] + v4[1];
prevx = 2*v0[0] - 4*v2[0] + 2*v4[0];
} else if (border == BORDER_MODE_REFLECT101) {
pprevx = v0[2] + 2*v1[2] + 2*v2[2] + 2*v3[2] + v4[2];
prevx = 2*v0[1] - 4*v2[1] + 2*v4[1];
} else if (border == BORDER_MODE_CONSTANT) {
pprevx = 8 * borderValue;
prevx = 0;
}
} else if (x == 1) {
// make border
if (border == BORDER_MODE_REPLICATE || border == BORDER_MODE_REFLECT) {
pprevx = v0[0] + 2*v1[0] + 2*v2[0] + 2*v3[0] + v4[0];
} else if (border == BORDER_MODE_REFLECT101) {
pprevx = v0[1] + 2*v1[1] + 2*v2[1] + 2*v3[1] + v4[1];
} else if (border == BORDER_MODE_CONSTANT) {
pprevx = 8 * borderValue;
}
prevx = 2*v0[0] - 4*v2[0] + 2*v4[0];
} else {
pprevx = v0[x-2] + 2*v1[x-2] + 2*v2[x-2] + 2*v3[x-2] + v4[x-2];
prevx = 2*v0[x-1] - 4*v2[x-1] + 2*v4[x-1];
}
s16 currx = 2*v0[x] - 4*v1[x] - 12*v2[x] - 4*v3[x] + 2*v4[x];
if (x == cols-1) {
// make border
if (border == BORDER_MODE_REPLICATE) {
nextx = 2*v0[x] - 4*v2[x] + 2*v4[x];
nnextx = v0[x] + 2*v1[x] + 2*v2[x] + 2*v3[x] + v4[x];
} else if (border == BORDER_MODE_REFLECT) {
nextx = 2*v0[x] - 4*v2[x] + 2*v4[x];
nnextx = v0[x-1] + 2*v1[x-1] + 2*v2[x-1] + 2*v3[x-1] + v4[x-1];
} else if (border == BORDER_MODE_REFLECT101) {
nextx = 2*v0[x-1] - 4*v2[x-1] + 2*v4[x-1];
nnextx = v0[x-2] + 2*v1[x-2] + 2*v2[x-2] + 2*v3[x-2] + v4[x-2];
} else if (border == BORDER_MODE_CONSTANT) {
nextx = 0;
nnextx = 8 * borderValue;
}
} else if (x == cols-2) {
// make border
if (border == BORDER_MODE_REPLICATE || border == BORDER_MODE_REFLECT) {
nnextx = v0[x+1] + 2*v1[x+1] + 2*v2[x+1] + 2*v3[x+1] + v4[x+1];
} else if (border == BORDER_MODE_REFLECT101) {
nnextx = v0[x] + 2*v1[x] + 2*v2[x] + 2*v3[x] + v4[x];
} else if (border == BORDER_MODE_CONSTANT) {
nnextx = 8 * borderValue;
}
nextx = 2*v0[x+1] - 4*v2[x+1] + 2*v4[x+1];
} else {
nextx = 2*v0[x+1] - 4*v2[x+1] + 2*v4[x+1];
nnextx = v0[x+2] + 2*v1[x+2] + 2*v2[x+2] + 2*v3[x+2] + v4[x+2];
}
s16 res = pprevx + prevx + currx + nextx + nnextx;
*(drow+x) = 2*res;
}
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)border;
(void)borderValue;
#endif
}
} // namespace CAROTENE_NS

160
3rdparty/carotene/src/magnitude.cpp vendored Normal file
View File

@ -0,0 +1,160 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include "vtransform.hpp"
#include <cmath>
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
struct Magnitude
{
typedef s16 type;
void operator() (const int16x8_t & v_src0, const int16x8_t & v_src1,
int16x8_t & v_dst) const
{
int16x4_t v_src0_p = vget_low_s16(v_src0), v_src1_p = vget_low_s16(v_src1);
float32x4_t v_sqr0 = vaddq_f32(vcvtq_f32_s32(vmull_s16(v_src0_p, v_src0_p)),
vcvtq_f32_s32(vmull_s16(v_src1_p, v_src1_p)));
v_src0_p = vget_high_s16(v_src0);
v_src1_p = vget_high_s16(v_src1);
float32x4_t v_sqr1 = vaddq_f32(vcvtq_f32_s32(vmull_s16(v_src0_p, v_src0_p)),
vcvtq_f32_s32(vmull_s16(v_src1_p, v_src1_p)));
int32x4_t v_sqrt0 = vcvtq_s32_f32(internal::vsqrtq_f32(v_sqr0));
int32x4_t v_sqrt1 = vcvtq_s32_f32(internal::vsqrtq_f32(v_sqr1));
v_dst = vcombine_s16(vqmovn_s32(v_sqrt0), vqmovn_s32(v_sqrt1));
}
void operator() (const int16x4_t & v_src0, const int16x4_t & v_src1,
int16x4_t & v_dst) const
{
float32x4_t v_tmp = vaddq_f32(vcvtq_f32_s32(vmull_s16(v_src0, v_src0)),
vcvtq_f32_s32(vmull_s16(v_src1, v_src1)));
int32x4_t v_sqrt = vcvtq_s32_f32(internal::vsqrtq_f32(v_tmp));
v_dst = vqmovn_s32(v_sqrt);
}
void operator() (const short * src0, const short * src1, short * dst) const
{
f32 src0val = (f32)src0[0], src1val = (f32)src1[0];
dst[0] = internal::saturate_cast<s16>((s32)sqrtf(src0val * src0val + src1val * src1val));
}
};
struct MagnitudeF32
{
typedef f32 type;
void operator() (const float32x4_t & v_src0, const float32x4_t & v_src1,
float32x4_t & v_dst) const
{
v_dst = internal::vsqrtq_f32(vaddq_f32(vmulq_f32(v_src0, v_src0), vmulq_f32(v_src1, v_src1)));
}
void operator() (const float32x2_t & v_src0, const float32x2_t & v_src1,
float32x2_t & v_dst) const
{
v_dst = internal::vsqrt_f32(vadd_f32(vmul_f32(v_src0, v_src0), vmul_f32(v_src1, v_src1)));
}
void operator() (const f32 * src0, const f32 * src1, f32 * dst) const
{
dst[0] = sqrtf(src0[0] * src0[0] + src1[0] * src1[0]);
}
};
} // namespace
#endif
void magnitude(const Size2D &size,
const s16 * src0Base, ptrdiff_t src0Stride,
const s16 * src1Base, ptrdiff_t src1Stride,
s16 * dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
Magnitude());
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
#endif
}
void magnitude(const Size2D &size,
const f32 * src0Base, ptrdiff_t src0Stride,
const f32 * src1Base, ptrdiff_t src1Stride,
f32 * dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
MagnitudeF32());
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
#endif
}
} // namespace CAROTENE_NS

163
3rdparty/carotene/src/meanstddev.cpp vendored Normal file
View File

@ -0,0 +1,163 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include <cmath>
namespace CAROTENE_NS {
void meanStdDev(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
f32 * pMean, f32 * pStdDev)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
f64 fsum = 0.0f, fsqsum = 0.0f;
sqsum(size, srcBase, srcStride, &fsum, &fsqsum, 1);
// calc mean and stddev
f64 itotal = 1.0 / size.total();
f64 mean = fsum * itotal;
f64 stddev = sqrt(std::max(fsqsum * itotal - mean * mean, 0.0));
if (pMean)
*pMean = mean;
if (pStdDev)
*pStdDev = stddev;
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)pMean;
(void)pStdDev;
#endif
}
void meanStdDev(const Size2D &size,
const u16 * srcBase, ptrdiff_t srcStride,
f32 * pMean, f32 * pStdDev)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
size_t blockSize0 = 1 << 10, roiw4 = size.width & ~3;
f64 fsum = 0.0f, fsqsum = 0.0f;
f32 arsum[8];
uint32x4_t v_zero = vdupq_n_u32(0u), v_sum;
float32x4_t v_zero_f = vdupq_n_f32(0.0f), v_sqsum;
for (size_t i = 0; i < size.height; ++i)
{
const u16 * src = internal::getRowPtr(srcBase, srcStride, i);
size_t j = 0u;
while (j < roiw4)
{
size_t blockSize = std::min(roiw4 - j, blockSize0) + j;
v_sum = v_zero;
v_sqsum = v_zero_f;
for ( ; j + 16 < blockSize ; j += 16)
{
internal::prefetch(src + j);
uint16x8_t v_src0 = vld1q_u16(src + j), v_src1 = vld1q_u16(src + j + 8);
// 0
uint32x4_t v_srclo = vmovl_u16(vget_low_u16(v_src0));
uint32x4_t v_srchi = vmovl_u16(vget_high_u16(v_src0));
v_sum = vaddq_u32(v_sum, vaddq_u32(v_srclo, v_srchi));
float32x4_t v_srclo_f = vcvtq_f32_u32(v_srclo);
float32x4_t v_srchi_f = vcvtq_f32_u32(v_srchi);
v_sqsum = vmlaq_f32(v_sqsum, v_srclo_f, v_srclo_f);
v_sqsum = vmlaq_f32(v_sqsum, v_srchi_f, v_srchi_f);
// 1
v_srclo = vmovl_u16(vget_low_u16(v_src1));
v_srchi = vmovl_u16(vget_high_u16(v_src1));
v_sum = vaddq_u32(v_sum, vaddq_u32(v_srclo, v_srchi));
v_srclo_f = vcvtq_f32_u32(v_srclo);
v_srchi_f = vcvtq_f32_u32(v_srchi);
v_sqsum = vmlaq_f32(v_sqsum, v_srclo_f, v_srclo_f);
v_sqsum = vmlaq_f32(v_sqsum, v_srchi_f, v_srchi_f);
}
for ( ; j < blockSize; j += 4)
{
uint32x4_t v_src = vmovl_u16(vld1_u16(src + j));
float32x4_t v_src_f = vcvtq_f32_u32(v_src);
v_sum = vaddq_u32(v_sum, v_src);
v_sqsum = vmlaq_f32(v_sqsum, v_src_f, v_src_f);
}
vst1q_f32(arsum, vcvtq_f32_u32(v_sum));
vst1q_f32(arsum + 4, v_sqsum);
fsum += (f64)arsum[0] + arsum[1] + arsum[2] + arsum[3];
fsqsum += (f64)arsum[4] + arsum[5] + arsum[6] + arsum[7];
}
// collect a few last elements in the current row
for ( ; j < size.width; ++j)
{
f32 srcval = src[j];
fsum += srcval;
fsqsum += srcval * srcval;
}
}
// calc mean and stddev
f64 itotal = 1.0 / size.total();
f64 mean = fsum * itotal;
f64 stddev = sqrt(std::max(fsqsum * itotal - mean * mean, 0.0));
if (pMean)
*pMean = mean;
if (pStdDev)
*pStdDev = stddev;
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)pMean;
(void)pStdDev;
#endif
}
} // namespace CAROTENE_NS

227
3rdparty/carotene/src/median_filter.cpp vendored Normal file
View File

@ -0,0 +1,227 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2012-2014, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
/*
* The code here is based on the code in
* <http://ndevilla.free.fr/median/median/src/optmed.c>, which is in public domain.
* See also <http://ndevilla.free.fr/median/median/index.html>.
*/
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
uint8x16_t getLeftReplicate(uint8x16_t r, u32 cn)
{
u8 buf[16+8];
vst1q_u8(buf+cn, r);
for (u32 i = 0; i < cn; ++i) buf[i] = buf[cn+i];
return vld1q_u8(buf);
}
uint8x8_t getRightReplicate(uint8x8_t r, u32 cn)
{
u8 buf[8+8];
vst1_u8(buf, r);
for (u32 i = 0; i < cn; ++i) buf[8+i] = buf[8-cn+i];
return vld1_u8(buf+cn);
}
} // namespace
//o------^-------^-----------------------------o 0
// | |
//o--^---v---^---|-------^---------------------o 1
// | | | |
//o--v-------v---|-------|-^-------^-------^---o 2
// | | | | |
//o------^-------v-----^-|-|-------|-------|---o 3
// | | | | | |
//o--^---v---^-----^---|-v-|---^---v---^---v---o 4
// | | | | | | |
//o--v-------v---^-|---|---v---|-------|-------o 5
// | | | | |
//o------^-------|-|---v-------|-------v-------o 6
// | | | |
//o--^---v---^---|-v-----------v---------------o 7
// | | |
//o--v-------v---v-----------------------------o 8
#define ELT(num, level) v ## num ## _lv ## level
#define PIX_SORT(a, alvl, b, blvl, newlvl) \
PIX_MIN(a, alvl, b, blvl, newlvl); \
PIX_MAX(a, alvl, b, blvl, newlvl);
#define SORT9 \
PIX_SORT(1, 00, 2, 00, 01); \
PIX_SORT(4, 00, 5, 00, 02); \
PIX_SORT(7, 00, 8, 00, 03); \
PIX_SORT(0, 00, 1, 01, 04); \
PIX_SORT(3, 00, 4, 02, 05); \
PIX_SORT(6, 00, 7, 03, 06); \
PIX_SORT(1, 04, 2, 01, 07); \
PIX_SORT(4, 05, 5, 02, 08); \
PIX_SORT(7, 06, 8, 03, 09); \
PIX_MAX (0, 04, 3, 05, 10); \
PIX_MIN (5, 08, 8, 09, 11); \
PIX_SORT(4, 08, 7, 09, 12); \
PIX_MAX (3, 10, 6, 06, 13); \
PIX_MAX (1, 07, 4, 12, 14); \
PIX_MIN (2, 07, 5, 11, 15); \
PIX_MIN (4, 14, 7, 12, 16); \
PIX_SORT(4, 16, 2, 15, 17); \
PIX_MAX (6, 13, 4, 17, 18); \
PIX_MIN (4, 18, 2, 17, 19);
#endif
bool isMedianFilter3x3Supported(const Size2D &size, u32 numChannels)
{
return isSupportedConfiguration() && size.width >= 16 + numChannels && numChannels <= 8;
}
void medianFilter3x3(const Size2D &size, u32 numChannels,
const u8 *srcBase, ptrdiff_t srcStride,
const Margin &srcMargin,
u8 *dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration(isMedianFilter3x3Supported(size, numChannels));
#ifdef CAROTENE_NEON
u32 cn = numChannels;
size_t colsn = size.width * cn;
for (size_t i = 0; i < size.height; ++i) {
const u8* psrc1 = internal::getRowPtr(srcBase, srcStride, i);
const u8* psrc0 = i == 0 && srcMargin.top == 0 ? psrc1 : psrc1 - srcStride;
const u8* psrc2 = i + 1 == size.height && srcMargin.bottom == 0 ? psrc1 : psrc1 + srcStride;
u8* pdst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
{
uint8x16_t v3_lv00 = vld1q_u8(psrc0);
uint8x16_t v4_lv00 = vld1q_u8(psrc1);
uint8x16_t v5_lv00 = vld1q_u8(psrc2);
uint8x16_t v6_lv00 = vld1q_u8(psrc0 + cn);
uint8x16_t v7_lv00 = vld1q_u8(psrc1 + cn);
uint8x16_t v8_lv00 = vld1q_u8(psrc2 + cn);
uint8x16_t v0_lv00 = srcMargin.left > 0 ? vld1q_u8(psrc0 - cn) : getLeftReplicate(v3_lv00, cn);
uint8x16_t v1_lv00 = srcMargin.left > 0 ? vld1q_u8(psrc1 - cn) : getLeftReplicate(v4_lv00, cn);
uint8x16_t v2_lv00 = srcMargin.left > 0 ? vld1q_u8(psrc2 - cn) : getLeftReplicate(v5_lv00, cn);
goto medianBlur3x3_mainBody;
for (; j < colsn - 16; j += 16) {
internal::prefetch(psrc0 + j);
internal::prefetch(psrc1 + j);
internal::prefetch(psrc2 + j);
v0_lv00 = vld1q_u8(psrc0 + j - cn);
v1_lv00 = vld1q_u8(psrc1 + j - cn);
v2_lv00 = vld1q_u8(psrc2 + j - cn);
v3_lv00 = vld1q_u8(psrc0 + j);
v4_lv00 = vld1q_u8(psrc1 + j);
v5_lv00 = vld1q_u8(psrc2 + j);
v6_lv00 = vld1q_u8(psrc0 + j + cn);
v7_lv00 = vld1q_u8(psrc1 + j + cn);
v8_lv00 = vld1q_u8(psrc2 + j + cn);
medianBlur3x3_mainBody:
#define PIX_MIN(a, alvl, b, blvl, newlvl) uint8x16_t ELT(a, newlvl) = vminq_u8(ELT(a, alvl), ELT(b, blvl))
#define PIX_MAX(a, alvl, b, blvl, newlvl) uint8x16_t ELT(b, newlvl) = vmaxq_u8(ELT(a, alvl), ELT(b, blvl))
SORT9;
#undef PIX_MAX
#undef PIX_MIN
vst1q_u8(pdst + j, v4_lv19);
}
}
{
size_t k = colsn - 8;
uint8x8_t v0_lv00 = vld1_u8(psrc0 + k - cn);
uint8x8_t v1_lv00 = vld1_u8(psrc1 + k - cn);
uint8x8_t v2_lv00 = vld1_u8(psrc2 + k - cn);
uint8x8_t v3_lv00 = vld1_u8(psrc0 + k);
uint8x8_t v4_lv00 = vld1_u8(psrc1 + k);
uint8x8_t v5_lv00 = vld1_u8(psrc2 + k);
uint8x8_t v6_lv00 = srcMargin.right > 0 ? vld1_u8(psrc0 + k + cn) : getRightReplicate(v3_lv00, cn);
uint8x8_t v7_lv00 = srcMargin.right > 0 ? vld1_u8(psrc1 + k + cn) : getRightReplicate(v4_lv00, cn);
uint8x8_t v8_lv00 = srcMargin.right > 0 ? vld1_u8(psrc2 + k + cn) : getRightReplicate(v5_lv00, cn);
goto medianBlur3x3_tailBody;
for (; k >= j - 8; k -= 8) {
v0_lv00 = vld1_u8(psrc0 + k - cn);
v1_lv00 = vld1_u8(psrc1 + k - cn);
v2_lv00 = vld1_u8(psrc2 + k - cn);
v3_lv00 = vld1_u8(psrc0 + k);
v4_lv00 = vld1_u8(psrc1 + k);
v5_lv00 = vld1_u8(psrc2 + k);
v6_lv00 = vld1_u8(psrc0 + k + cn);
v7_lv00 = vld1_u8(psrc1 + k + cn);
v8_lv00 = vld1_u8(psrc2 + k + cn);
medianBlur3x3_tailBody:
#define PIX_MIN(a, alvl, b, blvl, newlvl) uint8x8_t ELT(a, newlvl) = vmin_u8(ELT(a, alvl), ELT(b, blvl))
#define PIX_MAX(a, alvl, b, blvl, newlvl) uint8x8_t ELT(b, newlvl) = vmax_u8(ELT(a, alvl), ELT(b, blvl))
SORT9;
#undef PIX_MAX
#undef PIX_MIN
vst1_u8(pdst + k, v4_lv19);
}
}
}
#else
(void)size;
(void)numChannels;
(void)srcBase;
(void)srcStride;
(void)srcMargin;
(void)dstBase;
(void)dstStride;
#endif
}
} // namespace CAROTENE_NS

139
3rdparty/carotene/src/min_max.cpp vendored Normal file
View File

@ -0,0 +1,139 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include <algorithm>
#include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
template <typename T>
struct Min
{
typedef T type;
void operator() (const typename internal::VecTraits<T>::vec128 & v_src0,
const typename internal::VecTraits<T>::vec128 & v_src1,
typename internal::VecTraits<T>::vec128 & v_dst) const
{
v_dst = internal::vminq(v_src0, v_src1);
}
void operator() (const typename internal::VecTraits<T>::vec64 & v_src0,
const typename internal::VecTraits<T>::vec64 & v_src1,
typename internal::VecTraits<T>::vec64 & v_dst) const
{
v_dst = internal::vmin(v_src0, v_src1);
}
void operator() (const T * src0, const T * src1, T * dst) const
{
dst[0] = std::min(src0[0], src1[0]);
}
};
template <typename T>
struct Max
{
typedef T type;
void operator() (const typename internal::VecTraits<T>::vec128 & v_src0,
const typename internal::VecTraits<T>::vec128 & v_src1,
typename internal::VecTraits<T>::vec128 & v_dst) const
{
v_dst = internal::vmaxq(v_src0, v_src1);
}
void operator() (const typename internal::VecTraits<T>::vec64 & v_src0,
const typename internal::VecTraits<T>::vec64 & v_src1,
typename internal::VecTraits<T>::vec64 & v_dst) const
{
v_dst = internal::vmax(v_src0, v_src1);
}
void operator() (const T * src0, const T * src1, T * dst) const
{
dst[0] = std::max(src0[0], src1[0]);
}
};
} // namespace
#define IMPL_OP(fun, op, type) \
void fun(const Size2D &size, \
const type * src0Base, ptrdiff_t src0Stride, \
const type * src1Base, ptrdiff_t src1Stride, \
type * dstBase, ptrdiff_t dstStride) \
{ \
internal::assertSupportedConfiguration(); \
internal::vtransform(size, \
src0Base, src0Stride, \
src1Base, src1Stride, \
dstBase, dstStride, op<type>()); \
}
#else
#define IMPL_OP(fun, op, type) \
void fun(const Size2D &, \
const type *, ptrdiff_t, \
const type *, ptrdiff_t, \
type *, ptrdiff_t) \
{ \
internal::assertSupportedConfiguration(); \
}
#endif
#define IMPL_MINMAX(type) IMPL_OP(min, Min, type) IMPL_OP(max, Max, type)
IMPL_MINMAX(u8)
IMPL_MINMAX(s8)
IMPL_MINMAX(u16)
IMPL_MINMAX(s16)
IMPL_MINMAX(u32)
IMPL_MINMAX(s32)
IMPL_MINMAX(f32)
} // namespace CAROTENE_NS

1340
3rdparty/carotene/src/minmaxloc.cpp vendored Normal file

File diff suppressed because it is too large Load Diff

728
3rdparty/carotene/src/morph.cpp vendored Normal file
View File

@ -0,0 +1,728 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include <algorithm>
#include <limits>
#include <vector>
#include <cstring>
namespace CAROTENE_NS {
bool isMorph3x3Supported(const Size2D &size, BORDER_MODE border)
{
return isSupportedConfiguration() && size.width >= 16 &&
(border == BORDER_MODE_CONSTANT ||
border == BORDER_MODE_REPLICATE);
}
#ifdef CAROTENE_NEON
namespace {
struct ErodeVecOp
{
ErodeVecOp():borderValue(0){}
ErodeVecOp(BORDER_MODE border, u8 borderValue_) :
borderValue(borderValue_)
{
if (border == BORDER_MODE_REPLICATE)
borderValue = std::numeric_limits<u8>::max();
}
inline uint8x16_t operator()(uint8x16_t a, uint8x16_t b) const
{
return vminq_u8(a, b);
}
inline uint8x8_t operator()(uint8x8_t a, uint8x8_t b) const
{
return vmin_u8(a, b);
}
inline u8 operator()(u8 a, u8 b) const
{
return std::min(a, b);
}
u8 borderValue;
};
struct DilateVecOp
{
DilateVecOp():borderValue(0){}
DilateVecOp(BORDER_MODE border, u8 borderValue_) :
borderValue(borderValue_)
{
if (border == BORDER_MODE_REPLICATE)
borderValue = std::numeric_limits<u8>::min();
}
inline uint8x16_t operator()(uint8x16_t a, uint8x16_t b) const
{
return vmaxq_u8(a, b);
}
inline uint8x8_t operator()(uint8x8_t a, uint8x8_t b) const
{
return vmax_u8(a, b);
}
inline u8 operator()(u8 a, u8 b) const
{
return std::max(a, b);
}
u8 borderValue;
};
template <typename VecOp>
void morph3x3(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
BORDER_MODE border, const VecOp & vop)
{
u8 borderValue = vop.borderValue;
ptrdiff_t width = (ptrdiff_t)size.width, height = (ptrdiff_t)size.height;
const uint8x16_t v_zero = vdupq_n_u8(0);
const uint8x16_t v_border = vdupq_n_u8(borderValue);
uint8x16_t tprev = v_zero, tcurr = v_zero, tnext = v_zero;
uint8x16_t t0 = v_zero, t1 = v_zero, t2 = v_zero;
for (ptrdiff_t y = 0; y < height; ++y)
{
const u8 * srow0 = y == 0 && border == BORDER_MODE_CONSTANT ? NULL : internal::getRowPtr(srcBase, srcStride, std::max<ptrdiff_t>(y - 1, 0));
const u8 * srow1 = internal::getRowPtr(srcBase, srcStride, y);
const u8 * srow2 = y + 1 == height && border == BORDER_MODE_CONSTANT ? NULL : internal::getRowPtr(srcBase, srcStride, std::min(y + 1, height - 1));
u8 * drow = internal::getRowPtr(dstBase, dstStride, y);
u8 prevx = 0, currx = 0, nextx = 0;
ptrdiff_t x = 0;
const ptrdiff_t bwidth = y + 2 < height ? width : (width - 16);
// perform vertical convolution
for ( ; x <= bwidth; x += 16)
{
internal::prefetch(srow0 + x);
internal::prefetch(srow1 + x);
internal::prefetch(srow2 + x);
uint8x16_t x0 = !srow0 ? v_border : vld1q_u8(srow0 + x);
uint8x16_t x1 = vld1q_u8(srow1 + x);
uint8x16_t x2 = !srow2 ? v_border : vld1q_u8(srow2 + x);
// calculate values for plain CPU part below if needed
if (x + 16 >= bwidth)
{
ptrdiff_t x3 = x == width ? width - 1 : x;
ptrdiff_t x4 = border == BORDER_MODE_CONSTANT ? x3 - 1 : std::max<ptrdiff_t>(x3 - 1, 0);
if (border == BORDER_MODE_CONSTANT && x4 < 0)
prevx = borderValue;
else
prevx = vop(srow1[x4],
vop(srow2 ? srow2[x4] : borderValue,
srow0 ? srow0[x4] : borderValue));
currx = vop(srow2 ? srow2[x3] : borderValue, vop(srow1[x3], srow0 ? srow0[x3] : borderValue));
}
// make shift
if (x)
{
tprev = tcurr;
tcurr = tnext;
}
// and calculate next value
tnext = vop(vop(x0, x1), x2);
// make extrapolation for the first elements
if (!x)
{
// make border
if (border == BORDER_MODE_CONSTANT)
tcurr = v_border;
else if (border == BORDER_MODE_REPLICATE)
tcurr = vdupq_n_u8(vgetq_lane_u8(tnext, 0));
continue;
}
// combine 3 "shifted" vectors
t0 = vextq_u8(tprev, tcurr, 15);
t1 = tcurr;
t2 = vextq_u8(tcurr, tnext, 1);
// and add them
t0 = vop(t0, vop(t1, t2));
vst1q_u8(drow + x - 16, t0);
}
x -= 16;
if (x == width)
--x;
for ( ; x < width; ++x)
{
// make extrapolation for the last elements
if (x + 1 >= width)
{
if (border == BORDER_MODE_CONSTANT)
nextx = borderValue;
else if (border == BORDER_MODE_REPLICATE)
nextx = vop(srow2[x], vop(srow1[x], srow0[x]));
}
else
nextx = vop(vop(srow2 ? srow2[x + 1] : borderValue,
srow0 ? srow0[x + 1] : borderValue),
srow1[x + 1]);
drow[x] = vop(prevx, vop(currx, nextx));
// make shift
prevx = currx;
currx = nextx;
}
}
}
} // namespace
#endif
void erode3x3(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
BORDER_MODE border, u8 borderValue)
{
internal::assertSupportedConfiguration(isMorph3x3Supported(size, border));
#ifdef CAROTENE_NEON
morph3x3(size,
srcBase, srcStride,
dstBase, dstStride,
border, ErodeVecOp(border, borderValue));
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)border;
(void)borderValue;
#endif
}
void dilate3x3(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
BORDER_MODE border, u8 borderValue)
{
internal::assertSupportedConfiguration(isMorph3x3Supported(size, border));
#ifdef CAROTENE_NEON
morph3x3(size,
srcBase, srcStride,
dstBase, dstStride,
border, DilateVecOp(border, borderValue));
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)border;
(void)borderValue;
#endif
}
#ifdef CAROTENE_NEON
namespace {
template<class VecUpdate>
void MorphRow(const u8* src, u8* dst, size_t width, s32 cn, size_t ksize)
{
size_t i, j, k;
size_t width16 = (width & -16) * cn;
size_t width8 = (width & -8) * cn;
width *= cn;
if (ksize == 1)
{
for (i = 0; i < width; i++)
dst[i] = src[i];
return;
}
ksize = ksize*cn;
VecUpdate updateOp;
switch(cn)
{
case 1:
for (i = 0; i < width16; i += 16)
{
const u8* sptr = src + i;
uint8x16_t s = vld1q_u8(sptr);
internal::prefetch(sptr);
for( k = 1; k < ksize; ++k)
s = updateOp(s, vld1q_u8(sptr + k));
vst1q_u8(dst + i, s);
}
for (; i < width8; i += 8)
{
const u8* sptr = src + i;
uint8x8_t s = vld1_u8(sptr);
internal::prefetch(sptr);
for( k = 1; k < ksize; ++k)
s = updateOp(s, vld1_u8(sptr + k));
vst1_u8(dst + i, s);
}
break;
default:
for (i = 0; i < width16; i += 16)
{
uint8x16_t s = vld1q_u8(src + i);
internal::prefetch(src + i);
for (k = cn; k < ksize; k += cn)
s = updateOp(s, vld1q_u8(src + i + k));
vst1q_u8(dst + i, s);
}
for (; i < width8; i += 8)
{
uint8x8_t s = vld1_u8(src + i);
internal::prefetch(src + i);
for (k = cn; k < ksize; k += cn)
s = updateOp(s, vld1_u8(src + i + k));
vst1_u8(dst + i, s);
}
break;
}
ptrdiff_t i0 = i;
for( k = 0; k < (size_t)cn; k++, src++, dst++ )
{
for( i = i0; i <= width - cn*2; i += cn*2 )
{
const u8* s = src + i;
u8 m = s[cn];
for( j = cn*2; j < ksize; j += cn )
m = updateOp(m, s[j]);
dst[i] = updateOp(m, s[0]);
dst[i+cn] = updateOp(m, s[j]);
}
for( ; i < width; i += cn )
{
const u8* s = src + i;
u8 m = s[0];
for( j = cn; j < ksize; j += cn )
m = updateOp(m, s[j]);
dst[i] = m;
}
}
}
template<class VecUpdate>
void MorphColumn(const u8** src, u8* dst, ptrdiff_t dststep, size_t count, size_t width, size_t ksize)
{
size_t i, k;
size_t width32 = width & -32;
VecUpdate updateOp;
uint8x16_t x0,x1,s0,s1;
if (ksize == 3)
{
for (; count > 1; count -= 2, dst += dststep * 2, src += 2)
{
for (i = 0; i < width32; i += 32)
{
const u8* sptr = src[1] + i;
s0 = vld1q_u8(sptr);
s1 = vld1q_u8(sptr + 16);
internal::prefetch(sptr);
sptr = src[2] + i;
x0 = vld1q_u8(sptr);
x1 = vld1q_u8(sptr + 16);
internal::prefetch(sptr);
s0 = updateOp(s0, x0);
s1 = updateOp(s1, x1);
sptr = src[0] + i;
x0 = vld1q_u8(sptr);
x1 = vld1q_u8(sptr + 16);
internal::prefetch(sptr);
vst1q_u8(dst+i, updateOp(s0, x0));
vst1q_u8(dst+i+16, updateOp(s1, x1));
sptr = src[3] + i;
x0 = vld1q_u8(sptr);
x1 = vld1q_u8(sptr + 16);
internal::prefetch(sptr);
vst1q_u8(dst + dststep + i, updateOp(s0, x0));
vst1q_u8(dst + dststep + i + 16, updateOp(s1, x1));
}
for(; i < width; i++ )
{
u8 s = src[1][i];
for( k = 2; k < ksize; k++ )
s = updateOp(s, src[k][i]);
dst[i] = updateOp(s, src[0][i]);
dst[i+dststep] = updateOp(s, src[k][i]);
}
}
}
else if (ksize > 1)
for (; count > 1; count -= 2, dst += dststep*2, src += 2)
{
for (i = 0; i < width32; i += 32)
{
const u8* sptr = src[1] + i;
s0 = vld1q_u8(sptr);
s1 = vld1q_u8(sptr + 16);
internal::prefetch(sptr);
for (k = 2; k < ksize; k++)
{
sptr = src[k] + i;
x0 = vld1q_u8(sptr);
x1 = vld1q_u8(sptr + 16);
internal::prefetch(sptr);
s0 = updateOp(s0, x0);
s1 = updateOp(s1, x1);
}
sptr = src[0] + i;
x0 = vld1q_u8(sptr);
x1 = vld1q_u8(sptr + 16);
internal::prefetch(sptr);
vst1q_u8(dst+i, updateOp(s0, x0));
vst1q_u8(dst+i+16, updateOp(s1, x1));
sptr = src[k] + i;
x0 = vld1q_u8(sptr);
x1 = vld1q_u8(sptr + 16);
internal::prefetch(sptr);
vst1q_u8(dst + dststep + i, updateOp(s0, x0));
vst1q_u8(dst + dststep + i + 16, updateOp(s1, x1));
}
for(; i < width; i++ )
{
u8 s = src[1][i];
for( k = 2; k < ksize; k++ )
s = updateOp(s, src[k][i]);
dst[i] = updateOp(s, src[0][i]);
dst[i+dststep] = updateOp(s, src[k][i]);
}
}
for (; count > 0; count--, dst += dststep, src++)
{
for (i = 0; i < width32; i += 32)
{
const u8* sptr = src[0] + i;
s0 = vld1q_u8(sptr);
s1 = vld1q_u8(sptr + 16);
internal::prefetch(sptr);
for (k = 1; k < ksize; k++)
{
sptr = src[k] + i;
x0 = vld1q_u8(sptr);
x1 = vld1q_u8(sptr + 16);
internal::prefetch(sptr);
s0 = updateOp(s0, x0);
s1 = updateOp(s1, x1);
}
vst1q_u8(dst + i, s0);
vst1q_u8(dst + i + 16, s1);
}
for(; i < width; i++ )
{
u8 s = src[0][i];
for( k = 1; k < ksize; k++ )
s = updateOp(s, src[k][i]);
dst[i] = s;
}
}
}
template <class Op>
inline void morphology(const Size2D &ssize, u32 cn,
const u8 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
const Size2D &ksize,
size_t anchorX, size_t anchorY,
BORDER_MODE rowBorderType, BORDER_MODE columnBorderType,
const u8 * borderValues, Margin borderMargin)
{
//Temporary buffers common for all iterations
std::vector<u8> _srcRow(cn*(ssize.width + ksize.width - 1));
u8* srcRow = &_srcRow[0];
size_t bufRows = std::max<size_t>(ksize.height + 3, std::max<size_t>(anchorY, ksize.height-anchorY-1)*2+1);
std::vector<u8*> _rows(bufRows);
u8** rows = &_rows[0];
// adjust swidthcn so that the used part of buffers stays compact in memory
ptrdiff_t swidthcn = cn*((ssize.width + 15) & -16);// cn * (aligned ssize.width size)
std::vector<u8> _ringBuf(swidthcn*bufRows+16);
u8 * ringBuf = internal::alignPtr(&_ringBuf[0], 16);
size_t borderLength = std::max<size_t>(ksize.width - 1, 1) * cn;
std::vector<ptrdiff_t> _borderTab(borderLength);
ptrdiff_t * borderTab = &_borderTab[0];
std::vector<u8> _constBorderValue;
std::vector<u8> _constBorderRow;
u8 * constBorderValue = NULL;
u8 * constBorderRow = NULL;
if( rowBorderType == BORDER_MODE_CONSTANT || columnBorderType == BORDER_MODE_CONSTANT )
{
_constBorderValue.resize(borderLength);
constBorderValue = &_constBorderValue[0];
size_t i;
for(i = 0; i < cn; i++)
constBorderValue[i] = borderValues[i];
for(; i < borderLength; i++)
constBorderValue[i] = constBorderValue[i-cn];
if( columnBorderType == BORDER_MODE_CONSTANT )
{
_constBorderRow.resize(cn*(ssize.width + ksize.width - 1 + 16));
constBorderRow = internal::alignPtr(&_constBorderRow[0], 16);
size_t N = (ssize.width + ksize.width - 1)*cn;
for( i = 0; i < N; i += borderLength )
{
size_t n = std::min( borderLength, N - i );
for(size_t j = 0; j < n; j++)
srcRow[i+j] = constBorderValue[j];
}
MorphRow<Op>(srcRow, constBorderRow, ssize.width, cn, ksize.width);
}
}
Size2D wholeSize(ssize.width + borderMargin.left + borderMargin.right,
ssize.height + borderMargin.top + borderMargin.bottom);
ptrdiff_t dx1 = std::max<ptrdiff_t>(anchorX - (ptrdiff_t)borderMargin.left, 0);
ptrdiff_t dx2 = std::max<ptrdiff_t>((ptrdiff_t)ksize.width - anchorX - 1 - (ptrdiff_t)borderMargin.right, 0);
// recompute border tables
if( dx1 > 0 || dx2 > 0 )
{
if( rowBorderType == BORDER_MODE_CONSTANT )
{
memcpy( srcRow, &constBorderValue[0], dx1*cn );
memcpy( srcRow + (ssize.width + ksize.width - 1 - dx2)*cn, &constBorderValue[0], dx2*cn );
}
else
{
ptrdiff_t xofs1 = std::min<ptrdiff_t>(borderMargin.left, anchorX) - borderMargin.left;
ptrdiff_t wholeWidth = wholeSize.width;
ptrdiff_t i, j;
for( i = 0; i < dx1; i++ )
{
ptrdiff_t p0 = (internal::borderInterpolate(i-dx1, wholeWidth, rowBorderType) + xofs1)*cn;
for( j = 0; j < (ptrdiff_t)cn; j++ )
borderTab[i*cn + j] = p0 + j;
}
for( i = 0; i < dx2; i++ )
{
ptrdiff_t p0 = (internal::borderInterpolate(wholeWidth + i, wholeWidth, rowBorderType) + xofs1)*cn;
for( j = 0; j < (ptrdiff_t)cn; j++ )
borderTab[(i + dx1)*cn + j] = p0 + j;
}
}
}
ptrdiff_t startY, startY0, endY, rowCount;
startY = startY0 = std::max<ptrdiff_t>(borderMargin.top - anchorY, 0);
endY = std::min<ptrdiff_t>(borderMargin.top + ssize.height + ksize.height - anchorY - 1, wholeSize.height);
const u8* src = srcBase + (startY - borderMargin.top)*srcStride;
u8* dst = dstBase;
ptrdiff_t width = ssize.width, kwidth = ksize.width;
ptrdiff_t kheight = ksize.height, ay = anchorY;
ptrdiff_t width1 = ssize.width + kwidth - 1;
ptrdiff_t xofs1 = std::min<ptrdiff_t>(borderMargin.left, anchorX);
bool makeBorder = (dx1 > 0 || dx2 > 0) && rowBorderType != BORDER_MODE_CONSTANT;
ptrdiff_t dy = 0, i = 0;
src -= xofs1*cn;
ptrdiff_t count = endY - startY;
rowCount = 0;
for(;; dst += dstStride*i, dy += i)
{
ptrdiff_t dcount = bufRows - ay - startY - rowCount + borderMargin.top;
dcount = dcount > 0 ? dcount : bufRows - kheight + 1;
dcount = std::min(dcount, count);
count -= dcount;
for( ; dcount-- > 0; src += srcStride )
{
ptrdiff_t bi = (startY - startY0 + rowCount) % bufRows;
u8* brow = ringBuf + bi*swidthcn;
if( (size_t)(++rowCount) > bufRows )
{
--rowCount;
++startY;
}
memcpy( srcRow + dx1*cn, src, (width1 - dx2 - dx1)*cn );
if( makeBorder )
{
for( i = 0; i < (ptrdiff_t)(dx1*cn); i++ )
srcRow[i] = src[borderTab[i]];
for( i = 0; i < (ptrdiff_t)(dx2*cn); i++ )
srcRow[i + (width1 - dx2)*cn] = src[borderTab[i+dx1*cn]];
}
MorphRow<Op>(srcRow, brow, width, cn, ksize.width);
}
ptrdiff_t max_i = std::min<ptrdiff_t>(bufRows, ssize.height - dy + (kheight - 1));
for( i = 0; i < max_i; i++ )
{
ptrdiff_t srcY = internal::borderInterpolate(dy + i + borderMargin.top - ay,
wholeSize.height, columnBorderType);
if( srcY < 0 ) // can happen only with constant border type
rows[i] = constBorderRow;
else
{
if( srcY >= startY + rowCount )
break;
ptrdiff_t bi = (srcY - startY0) % bufRows;
rows[i] = ringBuf + bi*swidthcn;
}
}
if( i < kheight )
break;
i -= kheight - 1;
MorphColumn<Op>((const u8**)rows, dst, dstStride, i, ssize.width*cn, ksize.height);
}
}
} // namespace
#endif // CAROTENE_NEON
void erode(const Size2D &ssize, u32 cn,
const u8 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
const Size2D &ksize,
size_t anchorX, size_t anchorY,
BORDER_MODE rowBorderType, BORDER_MODE columnBorderType,
const u8 * borderValues, Margin borderMargin)
{
internal::assertSupportedConfiguration(ssize.width > 0 && ssize.height > 0 &&
anchorX < ksize.width && anchorY < ksize.height);
#ifdef CAROTENE_NEON
morphology<ErodeVecOp>(ssize, cn, srcBase, srcStride, dstBase, dstStride,
ksize, anchorX, anchorY, rowBorderType, columnBorderType,
borderValues, borderMargin);
#else
(void)cn;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)rowBorderType;
(void)columnBorderType;
(void)borderValues;
(void)borderMargin;
#endif
}
void dilate(const Size2D &ssize, u32 cn,
const u8 * srcBase, ptrdiff_t srcStride,
u8 * dstBase, ptrdiff_t dstStride,
const Size2D &ksize,
size_t anchorX, size_t anchorY,
BORDER_MODE rowBorderType, BORDER_MODE columnBorderType,
const u8 * borderValues, Margin borderMargin)
{
internal::assertSupportedConfiguration(ssize.width > 0 && ssize.height > 0 &&
anchorX < ksize.width && anchorY < ksize.height);
#ifdef CAROTENE_NEON
morphology<DilateVecOp>(ssize, cn, srcBase, srcStride, dstBase, dstStride,
ksize, anchorX, anchorY, rowBorderType, columnBorderType,
borderValues, borderMargin);
#else
(void)cn;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)rowBorderType;
(void)columnBorderType;
(void)borderValues;
(void)borderMargin;
#endif
}
} // namespace CAROTENE_NS

1572
3rdparty/carotene/src/mul.cpp vendored Normal file

File diff suppressed because it is too large Load Diff

1310
3rdparty/carotene/src/norm.cpp vendored Normal file

File diff suppressed because it is too large Load Diff

539
3rdparty/carotene/src/opticalflow.cpp vendored Normal file
View File

@ -0,0 +1,539 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2012-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include "saturate_cast.hpp"
#include <vector>
#include <float.h> // For FLT_EPSILON
namespace CAROTENE_NS {
#define CV_DESCALE(x,n) (((x) + (1 << ((n)-1))) >> (n))
/*
* Pyramidal Lucas-Kanade Optical Flow level processing
*/
void pyrLKOptFlowLevel(const Size2D &size, s32 cn,
const u8 *prevData, ptrdiff_t prevStride,
const s16 *prevDerivData, ptrdiff_t prevDerivStride,
const u8 *nextData, ptrdiff_t nextStride,
u32 ptCount,
const f32 *prevPts, f32 *nextPts,
u8 *status, f32 *err,
const Size2D &winSize,
u32 terminationCount, f64 terminationEpsilon,
u32 level, u32 maxLevel, bool useInitialFlow, bool getMinEigenVals,
f32 minEigThreshold)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
f32 halfWinX = (winSize.width-1)*0.5f, halfWinY = (winSize.height-1)*0.5f;
s32 cn2 = cn*2;
std::vector<s16> _buf(winSize.total()*(cn + cn2));
s16* IWinBuf = &_buf[0];
s32 IWinBufStride = winSize.width*cn;
s16* derivIWinBuf = &_buf[winSize.total()*cn];
s32 derivIWinBufStride = winSize.width*cn2;
for( u32 ptidx = 0; ptidx < ptCount; ptidx++ )
{
f32 levscale = (1./(1 << level));
u32 ptref = ptidx << 1;
f32 prevPtX = prevPts[ptref+0]*levscale;
f32 prevPtY = prevPts[ptref+1]*levscale;
f32 nextPtX;
f32 nextPtY;
if( level == maxLevel )
{
if( useInitialFlow )
{
nextPtX = nextPts[ptref+0]*levscale;
nextPtY = nextPts[ptref+1]*levscale;
}
else
{
nextPtX = prevPtX;
nextPtY = prevPtY;
}
}
else
{
nextPtX = nextPts[ptref+0]*2.f;
nextPtY = nextPts[ptref+1]*2.f;
}
nextPts[ptref+0] = nextPtX;
nextPts[ptref+1] = nextPtY;
s32 iprevPtX, iprevPtY;
s32 inextPtX, inextPtY;
prevPtX -= halfWinX;
prevPtY -= halfWinY;
iprevPtX = floor(prevPtX);
iprevPtY = floor(prevPtY);
if( iprevPtX < -(s32)winSize.width || iprevPtX >= (s32)size.width ||
iprevPtY < -(s32)winSize.height || iprevPtY >= (s32)size.height )
{
if( level == 0 )
{
if( status )
status[ptidx] = false;
if( err )
err[ptidx] = 0;
}
continue;
}
f32 a = prevPtX - iprevPtX;
f32 b = prevPtY - iprevPtY;
const s32 W_BITS = 14, W_BITS1 = 14;
const f32 FLT_SCALE = 1.f/(1 << 20);
s32 iw00 = round((1.f - a)*(1.f - b)*(1 << W_BITS));
s32 iw01 = round(a*(1.f - b)*(1 << W_BITS));
s32 iw10 = round((1.f - a)*b*(1 << W_BITS));
s32 iw11 = (1 << W_BITS) - iw00 - iw01 - iw10;
s32 dstep = prevDerivStride/sizeof(s16);
f32 A11 = 0, A12 = 0, A22 = 0;
int16x4_t viw00 = vmov_n_s16((s16)iw00);
int16x4_t viw01 = vmov_n_s16((s16)iw01);
int16x4_t viw10 = vmov_n_s16((s16)iw10);
int16x4_t viw11 = vmov_n_s16((s16)iw11);
float32x4_t vA11 = vmovq_n_f32(0);
float32x4_t vA12 = vmovq_n_f32(0);
float32x4_t vA22 = vmovq_n_f32(0);
s32 wwcn = winSize.width*cn;
// extract the patch from the first image, compute covariation matrix of derivatives
s32 x = 0;
for(s32 y = 0; y < (s32)winSize.height; y++ )
{
const u8* src = prevData + prevStride*(y + iprevPtY) + iprevPtX*cn;
const s16* dsrc = prevDerivData + dstep*(y + iprevPtY) + iprevPtX*cn2;
s16* Iptr = IWinBuf + y*IWinBufStride;
s16* dIptr = derivIWinBuf + y*derivIWinBufStride;
internal::prefetch(src + x + prevStride * 2, 0);
for(x = 0; x <= wwcn - 8; x += 8)
{
uint8x8_t vsrc00 = vld1_u8(src + x);
uint8x8_t vsrc10 = vld1_u8(src + x + prevStride);
uint8x8_t vsrc01 = vld1_u8(src + x + cn);
uint8x8_t vsrc11 = vld1_u8(src + x + prevStride + cn);
int16x8_t vs00 = vreinterpretq_s16_u16(vmovl_u8(vsrc00));
int16x8_t vs10 = vreinterpretq_s16_u16(vmovl_u8(vsrc10));
int16x8_t vs01 = vreinterpretq_s16_u16(vmovl_u8(vsrc01));
int16x8_t vs11 = vreinterpretq_s16_u16(vmovl_u8(vsrc11));
int32x4_t vsuml = vmull_s16(vget_low_s16(vs00), viw00);
int32x4_t vsumh = vmull_s16(vget_high_s16(vs10), viw10);
vsuml = vmlal_s16(vsuml, vget_low_s16(vs01), viw01);
vsumh = vmlal_s16(vsumh, vget_high_s16(vs11), viw11);
vsuml = vmlal_s16(vsuml, vget_low_s16(vs10), viw10);
vsumh = vmlal_s16(vsumh, vget_high_s16(vs00), viw00);
vsuml = vmlal_s16(vsuml, vget_low_s16(vs11), viw11);
vsumh = vmlal_s16(vsumh, vget_high_s16(vs01), viw01);
int16x4_t vsumnl = vrshrn_n_s32(vsuml, W_BITS1-5);
int16x4_t vsumnh = vrshrn_n_s32(vsumh, W_BITS1-5);
vst1q_s16(Iptr + x, vcombine_s16(vsumnl, vsumnh));
}
for(; x <= wwcn - 4; x += 4)
{
uint8x8_t vsrc00 = vld1_u8(src + x);
uint8x8_t vsrc10 = vld1_u8(src + x + prevStride);
uint8x8_t vsrc01 = vld1_u8(src + x + cn);
uint8x8_t vsrc11 = vld1_u8(src + x + prevStride + cn);
int16x4_t vs00 = vget_low_s16(vreinterpretq_s16_u16(vmovl_u8(vsrc00)));
int16x4_t vs10 = vget_low_s16(vreinterpretq_s16_u16(vmovl_u8(vsrc10)));
int16x4_t vs01 = vget_low_s16(vreinterpretq_s16_u16(vmovl_u8(vsrc01)));
int16x4_t vs11 = vget_low_s16(vreinterpretq_s16_u16(vmovl_u8(vsrc11)));
int32x4_t vsuml1 = vmull_s16(vs00, viw00);
int32x4_t vsuml2 = vmull_s16(vs01, viw01);
vsuml1 = vmlal_s16(vsuml1, vs10, viw10);
vsuml2 = vmlal_s16(vsuml2, vs11, viw11);
int32x4_t vsuml = vaddq_s32(vsuml1, vsuml2);
int16x4_t vsumnl = vrshrn_n_s32(vsuml, W_BITS1-5);
vst1_s16(Iptr + x, vsumnl);
}
internal::prefetch(dsrc + dstep * 2, 0);
for(x = 0; x <= wwcn - 4; x += 4, dsrc += 4*2, dIptr += 4*2 )
{
#if __GNUC_MINOR__ < 0
__asm__ (
"vld2.16 {d0-d1}, [%[dsrc00]] \n\t"
"vld2.16 {d2-d3}, [%[dsrc10]] \n\t"
"vld2.16 {d4-d5}, [%[dsrc01]] \n\t"
"vld2.16 {d6-d7}, [%[dsrc11]] \n\t"
"vmull.s16 q4, d3, %P[viw10] \n\t"
"vmull.s16 q5, d0, %P[viw00] \n\t"
"vmlal.s16 q4, d7, %P[viw11] \n\t"
"vmlal.s16 q5, d4, %P[viw01] \n\t"
"vmlal.s16 q4, d1, %P[viw00] \n\t"
"vmlal.s16 q5, d2, %P[viw10] \n\t"
"vmlal.s16 q4, d5, %P[viw01] \n\t"
"vmlal.s16 q5, d6, %P[viw11] \n\t"
"vrshrn.s32 d13, q4, %[W_BITS1] \n\t"
"vrshrn.s32 d12, q5, %[W_BITS1] \n\t"
"vmull.s16 q3, d13, d13 \n\t"
"vmull.s16 q4, d12, d12 \n\t"
"vmull.s16 q5, d13, d12 \n\t"
"vcvt.f32.s32 q3, q3 \n\t"
"vcvt.f32.s32 q4, q4 \n\t"
"vcvt.f32.s32 q5, q5 \n\t"
"vadd.f32 %q[vA22], q3 \n\t"
"vadd.f32 %q[vA11], q4 \n\t"
"vadd.f32 %q[vA12], q5 \n\t"
"vst2.16 {d12-d13}, [%[out]] \n\t"
: [vA22] "=w" (vA22),
[vA11] "=w" (vA11),
[vA12] "=w" (vA12)
: "0" (vA22),
"1" (vA11),
"2" (vA12),
[out] "r" (dIptr),
[dsrc00] "r" (dsrc),
[dsrc10] "r" (dsrc + dstep),
[dsrc01] "r" (dsrc + cn2),
[dsrc11] "r" (dsrc + dstep + cn2),
[viw00] "w" (viw00),
[viw10] "w" (viw10),
[viw01] "w" (viw01),
[viw11] "w" (viw11),
[W_BITS1] "I" (W_BITS1)
: "d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","d10","d11","d12","d13"
);
#else
int16x4x2_t vdsrc00 = vld2_s16(dsrc);
int16x4x2_t vdsrc10 = vld2_s16(dsrc + dstep);
int16x4x2_t vdsrc01 = vld2_s16(dsrc + cn2);
int16x4x2_t vdsrc11 = vld2_s16(dsrc + dstep + cn2);
int32x4_t vsumy = vmull_s16(vdsrc10.val[1], viw10);
int32x4_t vsumx = vmull_s16(vdsrc00.val[0], viw00);
vsumy = vmlal_s16(vsumy, vdsrc11.val[1], viw11);
vsumx = vmlal_s16(vsumx, vdsrc01.val[0], viw01);
vsumy = vmlal_s16(vsumy, vdsrc00.val[1], viw00);
vsumx = vmlal_s16(vsumx, vdsrc10.val[0], viw10);
vsumy = vmlal_s16(vsumy, vdsrc01.val[1], viw01);
vsumx = vmlal_s16(vsumx, vdsrc11.val[0], viw11);
int16x4_t vsumny = vrshrn_n_s32(vsumy, W_BITS1);
int16x4_t vsumnx = vrshrn_n_s32(vsumx, W_BITS1);
int32x4_t va22i = vmull_s16(vsumny, vsumny);
int32x4_t va11i = vmull_s16(vsumnx, vsumnx);
int32x4_t va12i = vmull_s16(vsumnx, vsumny);
float32x4_t va22f = vcvtq_f32_s32(va22i);
float32x4_t va11f = vcvtq_f32_s32(va11i);
float32x4_t va12f = vcvtq_f32_s32(va12i);
vA22 = vaddq_f32(vA22, va22f);
vA11 = vaddq_f32(vA11, va11f);
vA12 = vaddq_f32(vA12, va12f);
int16x4x2_t vsum;
vsum.val[0] = vsumnx;
vsum.val[1] = vsumny;
vst2_s16(dIptr, vsum);
#endif
}
for( ; x < wwcn; x++, dsrc += 2, dIptr += 2 )
{
s32 ival = CV_DESCALE(src[x]*iw00 + src[x+cn]*iw01 +
src[x+prevStride]*iw10 + src[x+prevStride+cn]*iw11, W_BITS1-5);
s32 ixval = CV_DESCALE(dsrc[0]*iw00 + dsrc[cn2]*iw01 +
dsrc[dstep]*iw10 + dsrc[dstep+cn2]*iw11, W_BITS1);
s32 iyval = CV_DESCALE(dsrc[1]*iw00 + dsrc[cn2+1]*iw01 + dsrc[dstep+1]*iw10 +
dsrc[dstep+cn2+1]*iw11, W_BITS1);
Iptr[x] = (s16)ival;
dIptr[0] = (s16)ixval;
dIptr[1] = (s16)iyval;
A11 += (f32)(ixval*ixval);
A12 += (f32)(ixval*iyval);
A22 += (f32)(iyval*iyval);
}
}
f32 A11buf[2], A12buf[2], A22buf[2];
vst1_f32(A11buf, vadd_f32(vget_low_f32(vA11), vget_high_f32(vA11)));
vst1_f32(A12buf, vadd_f32(vget_low_f32(vA12), vget_high_f32(vA12)));
vst1_f32(A22buf, vadd_f32(vget_low_f32(vA22), vget_high_f32(vA22)));
A11 += A11buf[0] + A11buf[1];
A12 += A12buf[0] + A12buf[1];
A22 += A22buf[0] + A22buf[1];
A11 *= FLT_SCALE;
A12 *= FLT_SCALE;
A22 *= FLT_SCALE;
f32 D = A11*A22 - A12*A12;
f32 minEig = (A22 + A11 - std::sqrt((A11-A22)*(A11-A22) +
4.f*A12*A12))/(2*winSize.width*winSize.height);
if( err && getMinEigenVals )
err[ptidx] = (f32)minEig;
if( minEig < minEigThreshold || D < FLT_EPSILON )
{
if( level == 0 && status )
status[ptidx] = false;
continue;
}
D = 1.f/D;
nextPtX -= halfWinX;
nextPtY -= halfWinY;
f32 prevDeltaX = 0;
f32 prevDeltaY = 0;
for(u32 j = 0; j < terminationCount; j++ )
{
inextPtX = floor(nextPtX);
inextPtY = floor(nextPtY);
if( inextPtX < -(s32)winSize.width || inextPtX >= (s32)size.width ||
inextPtY < -(s32)winSize.height || inextPtY >= (s32)size.height )
{
if( level == 0 && status )
status[ptidx] = false;
break;
}
a = nextPtX - inextPtX;
b = nextPtY - inextPtY;
iw00 = round((1.f - a)*(1.f - b)*(1 << W_BITS));
iw01 = round(a*(1.f - b)*(1 << W_BITS));
iw10 = round((1.f - a)*b*(1 << W_BITS));
iw11 = (1 << W_BITS) - iw00 - iw01 - iw10;
f32 b1 = 0, b2 = 0;
viw00 = vmov_n_s16((s16)iw00);
viw01 = vmov_n_s16((s16)iw01);
viw10 = vmov_n_s16((s16)iw10);
viw11 = vmov_n_s16((s16)iw11);
float32x4_t vb1 = vmovq_n_f32(0);
float32x4_t vb2 = vmovq_n_f32(0);
for(s32 y = 0; y < (s32)winSize.height; y++ )
{
const u8* Jptr = nextData + nextStride*(y + inextPtY) + inextPtX*cn;
const s16* Iptr = IWinBuf + y*IWinBufStride;
const s16* dIptr = derivIWinBuf + y*derivIWinBufStride;
x = 0;
internal::prefetch(Jptr, nextStride * 2);
internal::prefetch(Iptr, IWinBufStride/2);
internal::prefetch(dIptr, derivIWinBufStride/2);
for( ; x <= wwcn - 8; x += 8, dIptr += 8*2 )
{
uint8x8_t vj00 = vld1_u8(Jptr + x);
uint8x8_t vj10 = vld1_u8(Jptr + x + nextStride);
uint8x8_t vj01 = vld1_u8(Jptr + x + cn);
uint8x8_t vj11 = vld1_u8(Jptr + x + nextStride + cn);
int16x8_t vI = vld1q_s16(Iptr + x);
int16x8x2_t vDerivI = vld2q_s16(dIptr);
int16x8_t vs00 = vreinterpretq_s16_u16(vmovl_u8(vj00));
int16x8_t vs10 = vreinterpretq_s16_u16(vmovl_u8(vj10));
int16x8_t vs01 = vreinterpretq_s16_u16(vmovl_u8(vj01));
int16x8_t vs11 = vreinterpretq_s16_u16(vmovl_u8(vj11));
int32x4_t vsuml = vmull_s16(vget_low_s16(vs00), viw00);
int32x4_t vsumh = vmull_s16(vget_high_s16(vs10), viw10);
vsuml = vmlal_s16(vsuml, vget_low_s16(vs01), viw01);
vsumh = vmlal_s16(vsumh, vget_high_s16(vs11), viw11);
vsuml = vmlal_s16(vsuml, vget_low_s16(vs10), viw10);
vsumh = vmlal_s16(vsumh, vget_high_s16(vs00), viw00);
vsuml = vmlal_s16(vsuml, vget_low_s16(vs11), viw11);
vsumh = vmlal_s16(vsumh, vget_high_s16(vs01), viw01);
int16x4_t vsumnl = vrshrn_n_s32(vsuml, W_BITS1-5);
int16x4_t vsumnh = vrshrn_n_s32(vsumh, W_BITS1-5);
int16x8_t diff = vqsubq_s16(vcombine_s16(vsumnl, vsumnh), vI);
int32x4_t vb1l = vmull_s16(vget_low_s16(diff), vget_low_s16(vDerivI.val[0]));
int32x4_t vb2h = vmull_s16(vget_high_s16(diff), vget_high_s16(vDerivI.val[1]));
int32x4_t vb1i = vmlal_s16(vb1l, vget_high_s16(diff), vget_high_s16(vDerivI.val[0]));
int32x4_t vb2i = vmlal_s16(vb2h, vget_low_s16(diff), vget_low_s16(vDerivI.val[1]));
float32x4_t vb1f = vcvtq_f32_s32(vb1i);
float32x4_t vb2f = vcvtq_f32_s32(vb2i);
vb1 = vaddq_f32(vb1, vb1f);
vb2 = vaddq_f32(vb2, vb2f);
}
for( ; x < wwcn; x++, dIptr += 2 )
{
s32 diff = CV_DESCALE(Jptr[x]*iw00 + Jptr[x+cn]*iw01 +
Jptr[x+nextStride]*iw10 + Jptr[x+nextStride+cn]*iw11,
W_BITS1-5) - Iptr[x];
b1 += (f32)(diff*dIptr[0]);
b2 += (f32)(diff*dIptr[1]);
}
}
f32 bbuf[2];
float32x2_t vb = vpadd_f32(vadd_f32(vget_low_f32(vb1), vget_high_f32(vb1)), vadd_f32(vget_low_f32(vb2), vget_high_f32(vb2)));
vst1_f32(bbuf, vb);
b1 += bbuf[0];
b2 += bbuf[1];
b1 *= FLT_SCALE;
b2 *= FLT_SCALE;
f32 deltaX = (f32)((A12*b2 - A22*b1) * D);
f32 deltaY = (f32)((A12*b1 - A11*b2) * D);
nextPtX += deltaX;
nextPtY += deltaY;
nextPts[ptref+0] = nextPtX + halfWinX;
nextPts[ptref+1] = nextPtY + halfWinY;
if( ((double)deltaX*deltaX + (double)deltaY*deltaY) <= terminationEpsilon )
break;
if( j > 0 && std::abs(deltaX + prevDeltaX) < 0.01 &&
std::abs(deltaY + prevDeltaY) < 0.01 )
{
nextPts[ptref+0] -= deltaX*0.5f;
nextPts[ptref+1] -= deltaY*0.5f;
break;
}
prevDeltaX = deltaX;
prevDeltaY = deltaY;
}
if( status && status[ptidx] && err && level == 0 && !getMinEigenVals )
{
f32 nextPointX = nextPts[ptref+0] - halfWinX;
f32 nextPointY = nextPts[ptref+1] - halfWinY;
s32 inextPointX = floor(nextPointX);
s32 inextPointY = floor(nextPointY);
if( inextPointX < -(s32)winSize.width || inextPointX >= (s32)size.width ||
inextPointY < -(s32)winSize.height || inextPointY >= (s32)size.height )
{
if( status )
status[ptidx] = false;
continue;
}
f32 aa = nextPointX - inextPointX;
f32 bb = nextPointY - inextPointY;
iw00 = round((1.f - aa)*(1.f - bb)*(1 << W_BITS));
iw01 = round(aa*(1.f - bb)*(1 << W_BITS));
iw10 = round((1.f - aa)*bb*(1 << W_BITS));
iw11 = (1 << W_BITS) - iw00 - iw01 - iw10;
f32 errval = 0.f;
for(s32 y = 0; y < (s32)winSize.height; y++ )
{
const u8* Jptr = nextData + nextStride*(y + inextPointY) + inextPointX*cn;
const s16* Iptr = IWinBuf + y*IWinBufStride;
for( x = 0; x < wwcn; x++ )
{
s32 diff = CV_DESCALE(Jptr[x]*iw00 + Jptr[x+cn]*iw01 +
Jptr[x+nextStride]*iw10 + Jptr[x+nextStride+cn]*iw11,
W_BITS1-5) - Iptr[x];
errval += std::abs((f32)diff);
}
}
err[ptidx] = errval / (32*wwcn*winSize.height);
}
}
#else
(void)size;
(void)cn;
(void)prevData;
(void)prevStride;
(void)prevDerivData;
(void)prevDerivStride;
(void)nextData;
(void)nextStride;
(void)prevPts;
(void)nextPts;
(void)status;
(void)err;
(void)winSize;
(void)terminationCount;
(void)terminationEpsilon;
(void)level;
(void)maxLevel;
(void)useInitialFlow;
(void)getMinEigenVals;
(void)minEigThreshold;
(void)ptCount;
#endif
}
}//CAROTENE_NS

274
3rdparty/carotene/src/phase.cpp vendored Normal file
View File

@ -0,0 +1,274 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2012-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include <cfloat>
#include <cmath>
#include "common.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
#define FASTATAN2CONST(scale) \
f32 P1((f32)( 0.9997878412794807 * (180.0 / M_PI) * scale)), \
P3((f32)(-0.3258083974640975 * (180.0 / M_PI) * scale)), \
P5((f32)( 0.1555786518463281 * (180.0 / M_PI) * scale)), \
P7((f32)(-0.04432655554792128 * (180.0 / M_PI) * scale)), \
A_90((f32)(90.f * scale)), \
A_180((f32)(180.f * scale)), \
A_360((f32)(360.f * scale)); \
float32x4_t eps(vdupq_n_f32((float)DBL_EPSILON)), \
_90(vdupq_n_f32(A_90)), \
_180(vdupq_n_f32(A_180)), \
_360(vdupq_n_f32(A_360)), \
z(vdupq_n_f32(0.0f)), \
p1(vdupq_n_f32(P1)), \
p3(vdupq_n_f32(P3)), \
p5(vdupq_n_f32(P5)), \
p7(vdupq_n_f32(P7));
#define FASTATAN2SCALAR(y, x, a) \
{ \
f32 ax = std::abs(x), ay = std::abs(y); \
f32 c, c2; \
if (ax >= ay) \
{ \
c = ay / (ax + (float)DBL_EPSILON); \
c2 = c * c; \
a = (((P7 * c2 + P5) * c2 + P3) * c2 + P1) * c; \
} \
else \
{ \
c = ax / (ay + (float)DBL_EPSILON); \
c2 = c * c; \
a = A_90 - (((P7 * c2 + P5) * c2 + P3) * c2 + P1) * c; \
} \
if (x < 0) \
a = A_180 - a; \
if (y < 0) \
a = A_360 - a; \
}
#define FASTATAN2VECTOR(v_y, v_x, a) \
{ \
float32x4_t ax = vabsq_f32(v_x), ay = vabsq_f32(v_y); \
float32x4_t tmin = vminq_f32(ax, ay), tmax = vmaxq_f32(ax, ay); \
float32x4_t c = vmulq_f32(tmin, internal::vrecpq_f32(vaddq_f32(tmax, eps))); \
float32x4_t c2 = vmulq_f32(c, c); \
a = vmulq_f32(c2, p7); \
\
a = vmulq_f32(vaddq_f32(a, p5), c2); \
a = vmulq_f32(vaddq_f32(a, p3), c2); \
a = vmulq_f32(vaddq_f32(a, p1), c); \
\
a = vbslq_f32(vcgeq_f32(ax, ay), a, vsubq_f32(_90, a)); \
a = vbslq_f32(vcltq_f32(v_x, z), vsubq_f32(_180, a), a); \
a = vbslq_f32(vcltq_f32(v_y, z), vsubq_f32(_360, a), a); \
\
}
} // namespace
#endif
void phase(const Size2D &size,
const s16 * src0Base, ptrdiff_t src0Stride,
const s16 * src1Base, ptrdiff_t src1Stride,
u8 * dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
FASTATAN2CONST(256.0f / 360.0f)
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
float32x4_t v_05 = vdupq_n_f32(0.5f);
for (size_t i = 0; i < size.height; ++i)
{
const s16 * src0 = internal::getRowPtr(src0Base, src0Stride, i);
const s16 * src1 = internal::getRowPtr(src1Base, src1Stride, i);
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
for (; j < roiw16; j += 16)
{
internal::prefetch(src0 + j);
internal::prefetch(src1 + j);
int16x8_t v_src00 = vld1q_s16(src0 + j), v_src01 = vld1q_s16(src0 + j + 8);
int16x8_t v_src10 = vld1q_s16(src1 + j), v_src11 = vld1q_s16(src1 + j + 8);
// 0
float32x4_t v_src0_p = vcvtq_f32_s32(vmovl_s16(vget_low_s16(v_src00)));
float32x4_t v_src1_p = vcvtq_f32_s32(vmovl_s16(vget_low_s16(v_src10)));
float32x4_t v_dst32f0;
FASTATAN2VECTOR(v_src1_p, v_src0_p, v_dst32f0)
v_src0_p = vcvtq_f32_s32(vmovl_s16(vget_high_s16(v_src00)));
v_src1_p = vcvtq_f32_s32(vmovl_s16(vget_high_s16(v_src10)));
float32x4_t v_dst32f1;
FASTATAN2VECTOR(v_src1_p, v_src0_p, v_dst32f1)
uint16x8_t v_dst16s0 = vcombine_u16(vmovn_u32(vcvtq_u32_f32(vaddq_f32(v_dst32f0, v_05))),
vmovn_u32(vcvtq_u32_f32(vaddq_f32(v_dst32f1, v_05))));
// 1
v_src0_p = vcvtq_f32_s32(vmovl_s16(vget_low_s16(v_src01)));
v_src1_p = vcvtq_f32_s32(vmovl_s16(vget_low_s16(v_src11)));
FASTATAN2VECTOR(v_src1_p, v_src0_p, v_dst32f0)
v_src0_p = vcvtq_f32_s32(vmovl_s16(vget_high_s16(v_src01)));
v_src1_p = vcvtq_f32_s32(vmovl_s16(vget_high_s16(v_src11)));
FASTATAN2VECTOR(v_src1_p, v_src0_p, v_dst32f1)
uint16x8_t v_dst16s1 = vcombine_u16(vmovn_u32(vcvtq_u32_f32(vaddq_f32(v_dst32f0, v_05))),
vmovn_u32(vcvtq_u32_f32(vaddq_f32(v_dst32f1, v_05))));
vst1q_u8(dst + j, vcombine_u8(vmovn_u16(v_dst16s0),
vmovn_u16(v_dst16s1)));
}
for (; j < roiw8; j += 8)
{
int16x8_t v_src0 = vld1q_s16(src0 + j);
int16x8_t v_src1 = vld1q_s16(src1 + j);
float32x4_t v_src0_p = vcvtq_f32_s32(vmovl_s16(vget_low_s16(v_src0)));
float32x4_t v_src1_p = vcvtq_f32_s32(vmovl_s16(vget_low_s16(v_src1)));
float32x4_t v_dst32f0;
FASTATAN2VECTOR(v_src1_p, v_src0_p, v_dst32f0)
v_src0_p = vcvtq_f32_s32(vmovl_s16(vget_high_s16(v_src0)));
v_src1_p = vcvtq_f32_s32(vmovl_s16(vget_high_s16(v_src1)));
float32x4_t v_dst32f1;
FASTATAN2VECTOR(v_src1_p, v_src0_p, v_dst32f1)
uint16x8_t v_dst = vcombine_u16(vmovn_u32(vcvtq_u32_f32(vaddq_f32(v_dst32f0, v_05))),
vmovn_u32(vcvtq_u32_f32(vaddq_f32(v_dst32f1, v_05))));
vst1_u8(dst + j, vmovn_u16(v_dst));
}
for (; j < size.width; j++)
{
f32 x = src0[j], y = src1[j];
f32 a;
FASTATAN2SCALAR(y, x, a)
dst[j] = (u8)(s32)floor(a + 0.5f);
}
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
#endif
}
void phase(const Size2D &size,
const f32 * src0Base, ptrdiff_t src0Stride,
const f32 * src1Base, ptrdiff_t src1Stride,
f32 * dstBase, ptrdiff_t dstStride,
f32 scale)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
FASTATAN2CONST(scale)
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0; i < size.height; ++i)
{
const f32 * src0 = internal::getRowPtr(src0Base, src0Stride, i);
const f32 * src1 = internal::getRowPtr(src1Base, src1Stride, i);
f32 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
for (; j < roiw8; j += 8)
{
internal::prefetch(src0 + j);
internal::prefetch(src1 + j);
float32x4_t v_src00 = vld1q_f32(src0 + j), v_src01 = vld1q_f32(src0 + j + 4);
float32x4_t v_src10 = vld1q_f32(src1 + j), v_src11 = vld1q_f32(src1 + j + 4);
float32x4_t v_dst32f;
// 0
FASTATAN2VECTOR(v_src10, v_src00, v_dst32f)
vst1q_f32(dst + j, v_dst32f);
// 1
FASTATAN2VECTOR(v_src11, v_src01, v_dst32f)
vst1q_f32(dst + j + 4, v_dst32f);
}
if(j + 4 <= size.width)
{
float32x4_t v_src0 = vld1q_f32(src0 + j);
float32x4_t v_src1 = vld1q_f32(src1 + j);
float32x4_t v_dst32f;
FASTATAN2VECTOR(v_src1, v_src0, v_dst32f)
vst1q_f32(dst + j, v_dst32f);
j += 4;
}
for (; j < size.width; j++)
{
f32 a;
FASTATAN2SCALAR(src1[j], src0[j], a)
dst[j] = a;
}
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
(void)scale;
#endif
}
} // namespace CAROTENE_NS

1414
3rdparty/carotene/src/pyramid.cpp vendored Normal file

File diff suppressed because it is too large Load Diff

460
3rdparty/carotene/src/reduce.cpp vendored Normal file
View File

@ -0,0 +1,460 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2012-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include <cstring>
namespace CAROTENE_NS {
void reduceColSum(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
s32 * dstBase)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
memset(dstBase, 0, size.width*sizeof(s32));
size_t i = 0;
for (; i + 16 <= size.width; i += 16)
{
const u8* src_address = srcBase + i;
int32x4_t sll = vmovq_n_s32(0);
int32x4_t slh = vmovq_n_s32(0);
int32x4_t shl = vmovq_n_s32(0);
int32x4_t shh = vmovq_n_s32(0);
for (size_t h = 0; h < size.height; h += 256)
{
size_t lim = std::min(h + 256, size.height);
uint16x8_t sl = vmovq_n_u16(0);
uint16x8_t sh = vmovq_n_u16(0);
for (size_t k = h; k < lim; ++k, src_address += srcStride)
{
internal::prefetch(src_address + srcStride, 0);
uint8x16_t v = vld1q_u8(src_address);
sl = vaddw_u8(sl, vget_low_u8(v));
sh = vaddw_u8(sh, vget_high_u8(v));
}
int32x4_t vsll = vreinterpretq_s32_u32(vmovl_u16(vget_low_u16(sl)));
int32x4_t vslh = vreinterpretq_s32_u32(vmovl_u16(vget_high_u16(sl)));
int32x4_t vshl = vreinterpretq_s32_u32(vmovl_u16(vget_low_u16(sh)));
int32x4_t vshh = vreinterpretq_s32_u32(vmovl_u16(vget_high_u16(sh)));
sll = vqaddq_s32(sll, vsll);
slh = vqaddq_s32(slh, vslh);
shl = vqaddq_s32(shl, vshl);
shh = vqaddq_s32(shh, vshh);
}
vst1q_s32(dstBase + i + 0, sll);
vst1q_s32(dstBase + i + 4, slh);
vst1q_s32(dstBase + i + 8, shl);
vst1q_s32(dstBase + i + 12, shh);
}
for(size_t h = 0; h < size.height; ++h)
{
for(size_t j = i ; j < size.width; j++ )
{
if (((u32)(dstBase[j] += srcBase[j + srcStride * h])) > 0x7fFFffFFu)
dstBase[j] = 0x7fFFffFF;
}
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
#endif
}
void reduceColMax(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
u8 * dstBase)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
memcpy(dstBase, srcBase, size.width);
size_t i = 0;
for (; i + 16*4 <= size.width; i += 16*4)
{
const u8* src_address = srcBase + i;
uint8x16_t s1 = vld1q_u8(src_address + 0);
uint8x16_t s2 = vld1q_u8(src_address + 16);
uint8x16_t s3 = vld1q_u8(src_address + 32);
uint8x16_t s4 = vld1q_u8(src_address + 48);
src_address += srcStride;
for(size_t h = 1; h < size.height; ++h, src_address += srcStride)
{
internal::prefetch(src_address + srcStride, 0);
internal::prefetch(src_address + srcStride, 32);
uint8x16_t v1 = vld1q_u8(src_address + 0);
uint8x16_t v2 = vld1q_u8(src_address + 16);
uint8x16_t v3 = vld1q_u8(src_address + 32);
uint8x16_t v4 = vld1q_u8(src_address + 48);
s1 = vmaxq_u8(s1, v1);
s2 = vmaxq_u8(s2, v2);
s3 = vmaxq_u8(s3, v3);
s4 = vmaxq_u8(s4, v4);
}
vst1q_u8(dstBase + i + 0, s1);
vst1q_u8(dstBase + i + 16, s2);
vst1q_u8(dstBase + i + 32, s3);
vst1q_u8(dstBase + i + 48, s4);
}
for (; i + 16 <= size.width; i += 16)
{
const u8* src_address = srcBase + i;
uint8x16_t s1 = vld1q_u8(src_address);
src_address += srcStride;
for(size_t h = 1; h < size.height; ++h, src_address += srcStride)
{
internal::prefetch(src_address + srcStride, 0);
uint8x16_t v1 = vld1q_u8(src_address);
s1 = vmaxq_u8(s1, v1);
}
vst1q_u8(dstBase + i, s1);
}
if (i < size.width)
for(size_t h = 1; h < size.height; ++h)
for(size_t j = i ; j < size.width; j++ )
dstBase[j] = std::max(dstBase[j], srcBase[j + srcStride * h]);
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
#endif
}
void reduceColMin(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
u8 * dstBase)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
memcpy(dstBase, srcBase, size.width);
size_t i = 0;
for (; i + 16*4 <= size.width; i += 16*4)
{
const u8* src_address = srcBase + i;
uint8x16_t s1 = vld1q_u8(src_address + 0);
uint8x16_t s2 = vld1q_u8(src_address + 16);
uint8x16_t s3 = vld1q_u8(src_address + 32);
uint8x16_t s4 = vld1q_u8(src_address + 48);
src_address += srcStride;
for(size_t h = 1; h < size.height; ++h, src_address += srcStride)
{
internal::prefetch(src_address + srcStride, 0);
internal::prefetch(src_address + srcStride, 32);
uint8x16_t v1 = vld1q_u8(src_address + 0);
uint8x16_t v2 = vld1q_u8(src_address + 16);
uint8x16_t v3 = vld1q_u8(src_address + 32);
uint8x16_t v4 = vld1q_u8(src_address + 48);
s1 = vminq_u8(s1, v1);
s2 = vminq_u8(s2, v2);
s3 = vminq_u8(s3, v3);
s4 = vminq_u8(s4, v4);
}
vst1q_u8(dstBase + i + 0, s1);
vst1q_u8(dstBase + i + 16, s2);
vst1q_u8(dstBase + i + 32, s3);
vst1q_u8(dstBase + i + 48, s4);
}
for (; i + 16 <= size.width; i += 16)
{
const u8* src_address = srcBase + i;
uint8x16_t s1 = vld1q_u8(src_address);
src_address += srcStride;
for(size_t h = 1; h < size.height; ++h, src_address += srcStride)
{
internal::prefetch(src_address + srcStride, 0);
uint8x16_t v1 = vld1q_u8(src_address);
s1 = vminq_u8(s1, v1);
}
vst1q_u8(dstBase + i, s1);
}
if (i < size.width)
for(size_t h = 1; h < size.height; ++h)
for(size_t j = i ; j < size.width; j++ )
dstBase[j] = std::min(dstBase[j], srcBase[j + srcStride * h]);
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
#endif
}
void reduceColSum(const Size2D &size,
const f32 * srcBase, ptrdiff_t srcStride,
f32 * dstBase)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
memcpy(dstBase, srcBase, size.width*sizeof(f32));
size_t srcstep = srcStride/sizeof(f32);
size_t i = 0;
for (; i + 16 <= size.width; i += 16)
{
const f32* src_address = srcBase + i;
float32x4_t s1 = vld1q_f32(src_address + 0);
float32x4_t s2 = vld1q_f32(src_address + 4);
float32x4_t s3 = vld1q_f32(src_address + 8);
float32x4_t s4 = vld1q_f32(src_address + 12);
src_address += srcstep;
for(size_t h = 1; h < size.height; ++h, src_address += srcstep)
{
internal::prefetch(src_address + srcstep, 0);
internal::prefetch(src_address + srcstep, 32);
float32x4_t v1 = vld1q_f32(src_address + 0);
float32x4_t v2 = vld1q_f32(src_address + 4);
float32x4_t v3 = vld1q_f32(src_address + 8);
float32x4_t v4 = vld1q_f32(src_address + 12);
s1 = vaddq_f32(s1, v1);
s2 = vaddq_f32(s2, v2);
s3 = vaddq_f32(s3, v3);
s4 = vaddq_f32(s4, v4);
}
vst1q_f32(dstBase + i + 0, s1);
vst1q_f32(dstBase + i + 4, s2);
vst1q_f32(dstBase + i + 8, s3);
vst1q_f32(dstBase + i + 12, s4);
}
for (; i + 4 <= size.width; i += 4)
{
const f32* src_address = srcBase + i;
float32x4_t s1 = vld1q_f32(src_address);
src_address += srcstep;
for(size_t h = 1; h < size.height; ++h, src_address += srcstep)
{
internal::prefetch(src_address + srcstep, 0);
float32x4_t v1 = vld1q_f32(src_address);
s1 = vaddq_f32(s1, v1);
}
vst1q_f32(dstBase + i, s1);
}
if (i < size.width)
for(size_t h = 1; h < size.height; ++h)
{
for(size_t j = i ; j < size.width; j++ )
{
dstBase[j] += srcBase[j + srcstep * h];
}
}
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
#endif
}
void reduceColMax(const Size2D &size,
const f32 * srcBase, ptrdiff_t srcStride,
f32 * dstBase)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
memcpy(dstBase, srcBase, size.width*sizeof(f32));
size_t srcstep = srcStride/sizeof(f32);
size_t i = 0;
for (; i + 16 <= size.width; i += 16)
{
const f32* src_address = srcBase + i;
float32x4_t s1 = vld1q_f32(src_address + 0);
float32x4_t s2 = vld1q_f32(src_address + 4);
float32x4_t s3 = vld1q_f32(src_address + 8);
float32x4_t s4 = vld1q_f32(src_address + 12);
src_address += srcstep;
for(size_t h = 1; h < size.height; ++h, src_address += srcstep)
{
internal::prefetch(src_address + srcstep, 0);
internal::prefetch(src_address + srcstep, 32);
float32x4_t v1 = vld1q_f32(src_address + 0);
float32x4_t v2 = vld1q_f32(src_address + 4);
float32x4_t v3 = vld1q_f32(src_address + 8);
float32x4_t v4 = vld1q_f32(src_address + 12);
s1 = vmaxq_f32(s1, v1);
s2 = vmaxq_f32(s2, v2);
s3 = vmaxq_f32(s3, v3);
s4 = vmaxq_f32(s4, v4);
}
vst1q_f32(dstBase + i + 0, s1);
vst1q_f32(dstBase + i + 4, s2);
vst1q_f32(dstBase + i + 8, s3);
vst1q_f32(dstBase + i + 12, s4);
}
for (; i + 4 <= size.width; i += 4)
{
const f32* src_address = srcBase + i;
float32x4_t s1 = vld1q_f32(src_address);
src_address += srcstep;
for(size_t h = 1; h < size.height; ++h, src_address += srcstep)
{
internal::prefetch(src_address + srcstep, 0);
float32x4_t v1 = vld1q_f32(src_address);
s1 = vmaxq_f32(s1, v1);
}
vst1q_f32(dstBase + i, s1);
}
if (i < size.width)
for(size_t h = 1; h < size.height; ++h)
for(size_t j = i ; j < size.width; j++ )
dstBase[j] = std::max(dstBase[j], srcBase[j + srcstep * h]);
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
#endif
}
void reduceColMin(const Size2D &size,
const f32 * srcBase, ptrdiff_t srcStride,
f32 * dstBase)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
memcpy(dstBase, srcBase, size.width*sizeof(f32));
size_t srcstep = srcStride/sizeof(f32);
size_t i = 0;
for (; i + 16 <= size.width; i += 16)
{
const f32* src_address = srcBase + i;
float32x4_t s1 = vld1q_f32(src_address + 0);
float32x4_t s2 = vld1q_f32(src_address + 4);
float32x4_t s3 = vld1q_f32(src_address + 8);
float32x4_t s4 = vld1q_f32(src_address + 12);
src_address += srcstep;
for(size_t h = 1; h < size.height; ++h, src_address += srcstep)
{
internal::prefetch(src_address + srcstep, 0);
internal::prefetch(src_address + srcstep, 32);
float32x4_t v1 = vld1q_f32(src_address + 0);
float32x4_t v2 = vld1q_f32(src_address + 4);
float32x4_t v3 = vld1q_f32(src_address + 8);
float32x4_t v4 = vld1q_f32(src_address + 12);
s1 = vminq_f32(s1, v1);
s2 = vminq_f32(s2, v2);
s3 = vminq_f32(s3, v3);
s4 = vminq_f32(s4, v4);
}
vst1q_f32(dstBase + i + 0, s1);
vst1q_f32(dstBase + i + 4, s2);
vst1q_f32(dstBase + i + 8, s3);
vst1q_f32(dstBase + i + 12, s4);
}
for (; i + 4 <= size.width; i += 4)
{
const f32* src_address = srcBase + i;
float32x4_t s1 = vld1q_f32(src_address);
src_address += srcstep;
for(size_t h = 1; h < size.height; ++h, src_address += srcstep)
{
internal::prefetch(src_address + srcstep, 0);
float32x4_t v1 = vld1q_f32(src_address);
s1 = vminq_f32(s1, v1);
}
vst1q_f32(dstBase + i, s1);
}
if (i < size.width)
for(size_t h = 1; h < size.height; ++h)
for(size_t j = i ; j < size.width; j++ )
dstBase[j] = std::min(dstBase[j], srcBase[j + srcstep * h]);
#else
(void)size;
(void)srcBase;
(void)srcStride;
(void)dstBase;
#endif
}
} // namespace CAROTENE_NS

694
3rdparty/carotene/src/remap.cpp vendored Normal file
View File

@ -0,0 +1,694 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "remap.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace internal {
void remapNearestNeighborReplicate(const Size2D size,
const u8 * srcBase,
const s32 * map,
u8 * dstBase, ptrdiff_t dstStride)
{
for (size_t y = 0; y < size.height; ++y)
{
const s32 * map_row = internal::getRowPtr(map, size.width * sizeof(s32), y);
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, y);
for (size_t x = 0; x < size.width; ++x)
{
dst_row[x] = srcBase[map_row[x]];
}
}
}
void remapNearestNeighborConst(const Size2D size,
const u8 * srcBase,
const s32 * map,
u8 * dstBase, ptrdiff_t dstStride,
u8 borderValue)
{
for (size_t y = 0; y < size.height; ++y)
{
const s32 * map_row = internal::getRowPtr(map, size.width * sizeof(s32), y);
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, y);
for (size_t x = 0; x < size.width; ++x)
{
s32 src_idx = map_row[x];
dst_row[x] = src_idx >= 0 ? srcBase[map_row[x]] : borderValue;
}
}
}
void remapLinearReplicate(const Size2D size,
const u8 * srcBase,
const s32 * map,
const f32 * coeffs,
u8 * dstBase, ptrdiff_t dstStride)
{
int16x8_t v_zero16 = vdupq_n_s16(0);
for (size_t y = 0; y < size.height; ++y)
{
const s32 * map_row = internal::getRowPtr(map, size.width * sizeof(s32) * 4, y);
const f32 * coeff_row = internal::getRowPtr(coeffs, size.width * sizeof(f32) * 2, y);
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, y);
size_t x = 0;
for ( ; x + 8 < size.width; x += 8)
{
int16x8_t v_src00 = vsetq_lane_s16(srcBase[map_row[(x << 2)]], v_zero16, 0);
v_src00 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 4]], v_src00, 1);
v_src00 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 8]], v_src00, 2);
v_src00 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 12]], v_src00, 3);
v_src00 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 16]], v_src00, 4);
v_src00 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 20]], v_src00, 5);
v_src00 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 24]], v_src00, 6);
v_src00 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 28]], v_src00, 7);
int16x8_t v_src01 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 1]], v_zero16, 0);
v_src01 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 5]], v_src01, 1);
v_src01 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 9]], v_src01, 2);
v_src01 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 13]], v_src01, 3);
v_src01 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 17]], v_src01, 4);
v_src01 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 21]], v_src01, 5);
v_src01 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 25]], v_src01, 6);
v_src01 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 29]], v_src01, 7);
int16x8_t v_src10 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 2]], v_zero16, 0);
v_src10 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 6]], v_src10, 1);
v_src10 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 10]], v_src10, 2);
v_src10 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 14]], v_src10, 3);
v_src10 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 18]], v_src10, 4);
v_src10 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 22]], v_src10, 5);
v_src10 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 26]], v_src10, 6);
v_src10 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 30]], v_src10, 7);
int16x8_t v_src11 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 3]], v_zero16, 0);
v_src11 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 7]], v_src11, 1);
v_src11 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 11]], v_src11, 2);
v_src11 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 15]], v_src11, 3);
v_src11 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 19]], v_src11, 4);
v_src11 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 23]], v_src11, 5);
v_src11 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 27]], v_src11, 6);
v_src11 = vsetq_lane_s16(srcBase[map_row[(x << 2) + 31]], v_src11, 7);
// first part
float32x4_t v_src00_f = vcvtq_f32_s32(vmovl_s16(vget_low_s16(v_src00)));
float32x4_t v_src10_f = vcvtq_f32_s32(vmovl_s16(vget_low_s16(v_src10)));
float32x4x2_t v_coeff = vld2q_f32(coeff_row + (x << 1));
float32x4_t v_dst_0 = vmlaq_f32(v_src00_f, vcvtq_f32_s32(vsubl_s16(vget_low_s16(v_src01),
vget_low_s16(v_src00))), v_coeff.val[0]);
float32x4_t v_dst_1 = vmlaq_f32(v_src10_f, vcvtq_f32_s32(vsubl_s16(vget_low_s16(v_src11),
vget_low_s16(v_src10))), v_coeff.val[0]);
float32x4_t v_dst = vmlaq_f32(v_dst_0, vsubq_f32(v_dst_1, v_dst_0), v_coeff.val[1]);
uint16x4_t v_dst0 = vmovn_u32(vcvtq_u32_f32(v_dst));
// second part
v_src00_f = vcvtq_f32_s32(vmovl_s16(vget_high_s16(v_src00)));
v_src10_f = vcvtq_f32_s32(vmovl_s16(vget_high_s16(v_src10)));
v_coeff = vld2q_f32(coeff_row + (x << 1) + 8);
v_dst_0 = vmlaq_f32(v_src00_f, vcvtq_f32_s32(vsubl_s16(vget_high_s16(v_src01),
vget_high_s16(v_src00))), v_coeff.val[0]);
v_dst_1 = vmlaq_f32(v_src10_f, vcvtq_f32_s32(vsubl_s16(vget_high_s16(v_src11),
vget_high_s16(v_src10))), v_coeff.val[0]);
v_dst = vmlaq_f32(v_dst_0, vsubq_f32(v_dst_1, v_dst_0), v_coeff.val[1]);
uint16x4_t v_dst1 = vmovn_u32(vcvtq_u32_f32(v_dst));
// store
vst1_u8(dst_row + x, vmovn_u16(vcombine_u16(v_dst0, v_dst1)));
}
for ( ; x < size.width; ++x)
{
s32 src00_index = map_row[(x << 2)];
s32 src10_index = map_row[(x << 2) + 2];
f32 dst_val_0 = (srcBase[map_row[(x << 2) + 1]] - srcBase[src00_index]) * coeff_row[x << 1] +
srcBase[src00_index];
f32 dst_val_1 = (srcBase[map_row[(x << 2) + 3]] - srcBase[src10_index]) * coeff_row[x << 1] +
srcBase[src10_index];
dst_row[x] = floorf((dst_val_1 - dst_val_0) * coeff_row[(x << 1) + 1] + dst_val_0);
}
}
}
void remapLinearConst(const Size2D size,
const u8 * srcBase,
const s32 * map,
const f32 * coeffs,
u8 * dstBase, ptrdiff_t dstStride,
u8 borderValue)
{
int16x8_t v_zero16 = vdupq_n_s16(0);
for (size_t y = 0; y < size.height; ++y)
{
const s32 * map_row = internal::getRowPtr(map, size.width * sizeof(s32) * 4, y);
const f32 * coeff_row = internal::getRowPtr(coeffs, size.width * sizeof(f32) * 2, y);
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, y);
size_t x = 0;
for ( ; x + 8 < size.width; x += 8)
{
int16x8_t v_src00 = vsetq_lane_s16(map_row[(x << 2)] >= 0 ? srcBase[map_row[(x << 2)]] : borderValue, v_zero16, 0);
v_src00 = vsetq_lane_s16(map_row[(x << 2) + 4] >= 0 ? srcBase[map_row[(x << 2) + 4]] : borderValue, v_src00, 1);
v_src00 = vsetq_lane_s16(map_row[(x << 2) + 8] >= 0 ? srcBase[map_row[(x << 2) + 8]] : borderValue, v_src00, 2);
v_src00 = vsetq_lane_s16(map_row[(x << 2) + 12] >= 0 ? srcBase[map_row[(x << 2) + 12]] : borderValue, v_src00, 3);
v_src00 = vsetq_lane_s16(map_row[(x << 2) + 16] >= 0 ? srcBase[map_row[(x << 2) + 16]] : borderValue, v_src00, 4);
v_src00 = vsetq_lane_s16(map_row[(x << 2) + 20] >= 0 ? srcBase[map_row[(x << 2) + 20]] : borderValue, v_src00, 5);
v_src00 = vsetq_lane_s16(map_row[(x << 2) + 24] >= 0 ? srcBase[map_row[(x << 2) + 24]] : borderValue, v_src00, 6);
v_src00 = vsetq_lane_s16(map_row[(x << 2) + 28] >= 0 ? srcBase[map_row[(x << 2) + 28]] : borderValue, v_src00, 7);
int16x8_t v_src01 = vsetq_lane_s16(map_row[(x << 2) + 1] >= 0 ? srcBase[map_row[(x << 2) + 1]] : borderValue, v_zero16, 0);
v_src01 = vsetq_lane_s16(map_row[(x << 2) + 5] >= 0 ? srcBase[map_row[(x << 2) + 5]] : borderValue, v_src01, 1);
v_src01 = vsetq_lane_s16(map_row[(x << 2) + 9] >= 0 ? srcBase[map_row[(x << 2) + 9]] : borderValue, v_src01, 2);
v_src01 = vsetq_lane_s16(map_row[(x << 2) + 13] >= 0 ? srcBase[map_row[(x << 2) + 13]] : borderValue, v_src01, 3);
v_src01 = vsetq_lane_s16(map_row[(x << 2) + 17] >= 0 ? srcBase[map_row[(x << 2) + 17]] : borderValue, v_src01, 4);
v_src01 = vsetq_lane_s16(map_row[(x << 2) + 21] >= 0 ? srcBase[map_row[(x << 2) + 21]] : borderValue, v_src01, 5);
v_src01 = vsetq_lane_s16(map_row[(x << 2) + 25] >= 0 ? srcBase[map_row[(x << 2) + 25]] : borderValue, v_src01, 6);
v_src01 = vsetq_lane_s16(map_row[(x << 2) + 29] >= 0 ? srcBase[map_row[(x << 2) + 29]] : borderValue, v_src01, 7);
int16x8_t v_src10 = vsetq_lane_s16(map_row[(x << 2) + 2] >= 0 ? srcBase[map_row[(x << 2) + 2]] : borderValue, v_zero16, 0);
v_src10 = vsetq_lane_s16(map_row[(x << 2) + 6] >= 0 ? srcBase[map_row[(x << 2) + 6]] : borderValue, v_src10, 1);
v_src10 = vsetq_lane_s16(map_row[(x << 2) + 10] >= 0 ? srcBase[map_row[(x << 2) + 10]] : borderValue, v_src10, 2);
v_src10 = vsetq_lane_s16(map_row[(x << 2) + 14] >= 0 ? srcBase[map_row[(x << 2) + 14]] : borderValue, v_src10, 3);
v_src10 = vsetq_lane_s16(map_row[(x << 2) + 18] >= 0 ? srcBase[map_row[(x << 2) + 18]] : borderValue, v_src10, 4);
v_src10 = vsetq_lane_s16(map_row[(x << 2) + 22] >= 0 ? srcBase[map_row[(x << 2) + 22]] : borderValue, v_src10, 5);
v_src10 = vsetq_lane_s16(map_row[(x << 2) + 26] >= 0 ? srcBase[map_row[(x << 2) + 26]] : borderValue, v_src10, 6);
v_src10 = vsetq_lane_s16(map_row[(x << 2) + 30] >= 0 ? srcBase[map_row[(x << 2) + 30]] : borderValue, v_src10, 7);
int16x8_t v_src11 = vsetq_lane_s16(map_row[(x << 2) + 3] >= 0 ? srcBase[map_row[(x << 2) + 3]] : borderValue, v_zero16, 0);
v_src11 = vsetq_lane_s16(map_row[(x << 2) + 7] >= 0 ? srcBase[map_row[(x << 2) + 7]] : borderValue, v_src11, 1);
v_src11 = vsetq_lane_s16(map_row[(x << 2) + 11] >= 0 ? srcBase[map_row[(x << 2) + 11]] : borderValue, v_src11, 2);
v_src11 = vsetq_lane_s16(map_row[(x << 2) + 15] >= 0 ? srcBase[map_row[(x << 2) + 15]] : borderValue, v_src11, 3);
v_src11 = vsetq_lane_s16(map_row[(x << 2) + 19] >= 0 ? srcBase[map_row[(x << 2) + 19]] : borderValue, v_src11, 4);
v_src11 = vsetq_lane_s16(map_row[(x << 2) + 23] >= 0 ? srcBase[map_row[(x << 2) + 23]] : borderValue, v_src11, 5);
v_src11 = vsetq_lane_s16(map_row[(x << 2) + 27] >= 0 ? srcBase[map_row[(x << 2) + 27]] : borderValue, v_src11, 6);
v_src11 = vsetq_lane_s16(map_row[(x << 2) + 31] >= 0 ? srcBase[map_row[(x << 2) + 31]] : borderValue, v_src11, 7);
// first part
float32x4_t v_src00_f = vcvtq_f32_s32(vmovl_s16(vget_low_s16(v_src00)));
float32x4_t v_src10_f = vcvtq_f32_s32(vmovl_s16(vget_low_s16(v_src10)));
float32x4x2_t v_coeff = vld2q_f32(coeff_row + (x << 1));
float32x4_t v_dst_0 = vmlaq_f32(v_src00_f, vcvtq_f32_s32(vsubl_s16(vget_low_s16(v_src01),
vget_low_s16(v_src00))), v_coeff.val[0]);
float32x4_t v_dst_1 = vmlaq_f32(v_src10_f, vcvtq_f32_s32(vsubl_s16(vget_low_s16(v_src11),
vget_low_s16(v_src10))), v_coeff.val[0]);
float32x4_t v_dst = vmlaq_f32(v_dst_0, vsubq_f32(v_dst_1, v_dst_0), v_coeff.val[1]);
uint16x4_t v_dst0 = vmovn_u32(vcvtq_u32_f32(v_dst));
// second part
v_src00_f = vcvtq_f32_s32(vmovl_s16(vget_high_s16(v_src00)));
v_src10_f = vcvtq_f32_s32(vmovl_s16(vget_high_s16(v_src10)));
v_coeff = vld2q_f32(coeff_row + (x << 1) + 8);
v_dst_0 = vmlaq_f32(v_src00_f, vcvtq_f32_s32(vsubl_s16(vget_high_s16(v_src01),
vget_high_s16(v_src00))), v_coeff.val[0]);
v_dst_1 = vmlaq_f32(v_src10_f, vcvtq_f32_s32(vsubl_s16(vget_high_s16(v_src11),
vget_high_s16(v_src10))), v_coeff.val[0]);
v_dst = vmlaq_f32(v_dst_0, vsubq_f32(v_dst_1, v_dst_0), v_coeff.val[1]);
uint16x4_t v_dst1 = vmovn_u32(vcvtq_u32_f32(v_dst));
// store
vst1_u8(dst_row + x, vmovn_u16(vcombine_u16(v_dst0, v_dst1)));
}
for ( ; x < size.width; ++x)
{
s16 src00 = map_row[(x << 2) + 0] >= 0 ? srcBase[map_row[(x << 2) + 0]] : borderValue;
s16 src01 = map_row[(x << 2) + 1] >= 0 ? srcBase[map_row[(x << 2) + 1]] : borderValue;
s16 src10 = map_row[(x << 2) + 2] >= 0 ? srcBase[map_row[(x << 2) + 2]] : borderValue;
s16 src11 = map_row[(x << 2) + 3] >= 0 ? srcBase[map_row[(x << 2) + 3]] : borderValue;
f32 dst_val_0 = (src01 - src00) * coeff_row[(x << 1)] + src00;
f32 dst_val_1 = (src11 - src10) * coeff_row[(x << 1)] + src10;
dst_row[x] = floorf((dst_val_1 - dst_val_0) * coeff_row[(x << 1) + 1] + dst_val_0);
}
}
}
} // namespace internal
#endif // CAROTENE_NEON
bool isRemapNearestNeighborSupported(const Size2D &ssize)
{
#if SIZE_MAX > UINT32_MAX
return !(ssize.width > 0xffffFFFF || ssize.height > 0xffffFFFF) && // Restrict image size since internal index evaluation
// is performed with u32
isSupportedConfiguration();
#else
(void)ssize;
return isSupportedConfiguration();
#endif
}
bool isRemapLinearSupported(const Size2D &ssize)
{
#if SIZE_MAX > UINT32_MAX
return !(ssize.width > 0xffffFFFF || ssize.height > 0xffffFFFF) && // Restrict image size since internal index evaluation
// is performed with u32
isSupportedConfiguration();
#else
(void)ssize;
return isSupportedConfiguration();
#endif
}
void remapNearestNeighbor(const Size2D &ssize, const Size2D &dsize,
const u8 * srcBase, ptrdiff_t srcStride,
const f32 * tableBase, ptrdiff_t tableStride,
u8 * dstBase, ptrdiff_t dstStride,
BORDER_MODE borderMode, u8 borderValue)
{
internal::assertSupportedConfiguration(isRemapNearestNeighborSupported(ssize));
#ifdef CAROTENE_NEON
using namespace internal;
s32 _map[BLOCK_SIZE * BLOCK_SIZE + 16];
s32 * map = alignPtr(_map, 16);
int32x4_t v_width4 = vdupq_n_s32(ssize.width - 1), v_height4 = vdupq_n_s32(ssize.height - 1);
int32x2_t v_width2 = vdup_n_s32(ssize.width - 1), v_height2 = vdup_n_s32(ssize.height - 1);
int32x4_t v_step4 = vdupq_n_s32(srcStride);
int32x2_t v_step2 = vdup_n_s32(srcStride);
if (borderMode == BORDER_MODE_REPLICATE)
{
int32x4_t v_zero4 = vdupq_n_s32(0);
int32x2_t v_zero2 = vdup_n_s32(0);
for (size_t i = 0; i < dsize.height; i += BLOCK_SIZE)
{
size_t blockHeight = std::min<size_t>(BLOCK_SIZE, dsize.height - i);
for (size_t j = 0; j < dsize.width; j += BLOCK_SIZE)
{
size_t blockWidth = std::min<size_t>(BLOCK_SIZE, dsize.width - j);
// compute table
for (size_t y = 0; y < blockHeight; ++y)
{
const f32 * table_row = getRowPtr(tableBase, tableStride, i + y) + (j << 1);
s32 * map_row = getRowPtr(&map[0], blockWidth * sizeof(s32), y);
size_t x = 0;
for ( ; x + 8 <= blockWidth; x += 8)
{
float32x4x2_t v_table0 = vld2q_f32(table_row + (x << 1)),
v_table1 = vld2q_f32(table_row + (x << 1) + 8);
int32x4_t v_dst_x = vmaxq_s32(v_zero4, vminq_s32(v_width4, vcvtq_s32_f32(v_table0.val[0])));
int32x4_t v_dst_y = vmaxq_s32(v_zero4, vminq_s32(v_height4, vcvtq_s32_f32(v_table0.val[1])));
int32x4_t v_dst_index = vmlaq_s32(v_dst_x, v_dst_y, v_step4);
vst1q_s32(map_row + x, v_dst_index);
v_dst_x = vmaxq_s32(v_zero4, vminq_s32(v_width4, vcvtq_s32_f32(v_table1.val[0])));
v_dst_y = vmaxq_s32(v_zero4, vminq_s32(v_height4, vcvtq_s32_f32(v_table1.val[1])));
v_dst_index = vmlaq_s32(v_dst_x, v_dst_y, v_step4);
vst1q_s32(map_row + x + 4, v_dst_index);
}
for ( ; x + 4 <= blockWidth; x += 4)
{
float32x4x2_t v_table0 = vld2q_f32(table_row + (x << 1));
int32x4_t v_dst_x = vmaxq_s32(v_zero4, vminq_s32(v_width4, vcvtq_s32_f32(v_table0.val[0])));
int32x4_t v_dst_y = vmaxq_s32(v_zero4, vminq_s32(v_height4, vcvtq_s32_f32(v_table0.val[1])));
int32x4_t v_dst_index = vmlaq_s32(v_dst_x, v_dst_y, v_step4);
vst1q_s32(map_row + x, v_dst_index);
}
for ( ; x + 2 <= blockWidth; x += 2)
{
float32x2x2_t v_table0 = vld2_f32(table_row + (x << 1));
int32x2_t v_dst_x = vmax_s32(v_zero2, vmin_s32(v_width2, vcvt_s32_f32(v_table0.val[0])));
int32x2_t v_dst_y = vmax_s32(v_zero2, vmin_s32(v_height2, vcvt_s32_f32(v_table0.val[1])));
int32x2_t v_dst_index = vmla_s32(v_dst_x, v_dst_y, v_step2);
vst1_s32(map_row + x, v_dst_index);
}
for ( ; x < blockWidth; ++x)
{
s32 src_x = std::max(0, std::min<s32>(ssize.width - 1, (s32)floorf(table_row[(x << 1) + 0])));
s32 src_y = std::max(0, std::min<s32>(ssize.height - 1, (s32)floorf(table_row[(x << 1) + 1])));
map_row[x] = src_y * srcStride + src_x;
}
}
// make remap
remapNearestNeighborReplicate(Size2D(blockWidth, blockHeight), srcBase, &map[0],
getRowPtr(dstBase, dstStride, i) + j, dstStride);
}
}
}
else if (borderMode == BORDER_MODE_CONSTANT)
{
int32x4_t v_m1_4 = vdupq_n_s32(-1);
int32x2_t v_m1_2 = vdup_n_s32(-1);
float32x4_t v_zero4 = vdupq_n_f32(0.0f);
float32x2_t v_zero2 = vdup_n_f32(0.0f);
for (size_t i = 0; i < dsize.height; i += BLOCK_SIZE)
{
size_t blockHeight = std::min<size_t>(BLOCK_SIZE, dsize.height - i);
for (size_t j = 0; j < dsize.width; j += BLOCK_SIZE)
{
size_t blockWidth = std::min<size_t>(BLOCK_SIZE, dsize.width - j);
// compute table
for (size_t y = 0; y < blockHeight; ++y)
{
const f32 * table_row = getRowPtr(tableBase, tableStride, i + y) + (j << 1);
s32 * map_row = getRowPtr(&map[0], blockWidth * sizeof(s32), y);
size_t x = 0;
for ( ; x + 8 <= blockWidth; x += 8)
{
float32x4x2_t v_table0 = vld2q_f32(table_row + (x << 1)),
v_table1 = vld2q_f32(table_row + (x << 1) + 8);
int32x4_t v_dst_x = vcvtq_s32_f32(v_table0.val[0]);
int32x4_t v_dst_y = vcvtq_s32_f32(v_table0.val[1]);
uint32x4_t v_mask = vandq_u32(vandq_u32(vcgeq_f32(v_table0.val[0], v_zero4), vcleq_s32(v_dst_x, v_width4)),
vandq_u32(vcgeq_f32(v_table0.val[1], v_zero4), vcleq_s32(v_dst_y, v_height4)));
int32x4_t v_dst_index = vbslq_s32(v_mask, vmlaq_s32(v_dst_x, v_dst_y, v_step4), v_m1_4);
vst1q_s32(map_row + x, v_dst_index);
v_dst_x = vcvtq_s32_f32(v_table1.val[0]);
v_dst_y = vcvtq_s32_f32(v_table1.val[1]);
v_mask = vandq_u32(vandq_u32(vcgeq_f32(v_table1.val[0], v_zero4), vcleq_s32(v_dst_x, v_width4)),
vandq_u32(vcgeq_f32(v_table1.val[1], v_zero4), vcleq_s32(v_dst_y, v_height4)));
v_dst_index = vbslq_s32(v_mask, vmlaq_s32(v_dst_x, v_dst_y, v_step4), v_m1_4);
vst1q_s32(map_row + x + 4, v_dst_index);
}
for ( ; x + 4 <= blockWidth; x += 4)
{
float32x4x2_t v_table0 = vld2q_f32(table_row + (x << 1));
int32x4_t v_dst_x = vcvtq_s32_f32(v_table0.val[0]);
int32x4_t v_dst_y = vcvtq_s32_f32(v_table0.val[1]);
uint32x4_t v_mask = vandq_u32(vandq_u32(vcgeq_f32(v_table0.val[0], v_zero4), vcleq_s32(v_dst_x, v_width4)),
vandq_u32(vcgeq_f32(v_table0.val[1], v_zero4), vcleq_s32(v_dst_y, v_height4)));
int32x4_t v_dst_index = vbslq_s32(v_mask, vmlaq_s32(v_dst_x, v_dst_y, v_step4), v_m1_4);
vst1q_s32(map_row + x, v_dst_index);
}
for ( ; x + 2 <= blockWidth; x += 2)
{
float32x2x2_t v_table0 = vld2_f32(table_row + (x << 1));
int32x2_t v_dst_x = vcvt_s32_f32(v_table0.val[0]);
int32x2_t v_dst_y = vcvt_s32_f32(v_table0.val[1]);
uint32x2_t v_mask = vand_u32(vand_u32(vcge_f32(v_table0.val[0], v_zero2), vcle_s32(v_dst_x, v_width2)),
vand_u32(vcge_f32(v_table0.val[1], v_zero2), vcle_s32(v_dst_y, v_height2)));
int32x2_t v_dst_index = vbsl_s32(v_mask, vmla_s32(v_dst_x, v_dst_y, v_step2), v_m1_2);
vst1_s32(map_row + x, v_dst_index);
}
for ( ; x < blockWidth; ++x)
{
s32 src_x = (s32)floorf(table_row[(x << 1) + 0]);
s32 src_y = (s32)floorf(table_row[(x << 1) + 1]);
map_row[x] = (src_x >= 0) && (src_x < (s32)ssize.width) &&
(src_y >= 0) && (src_y < (s32)ssize.height) ? src_y * srcStride + src_x : -1;
}
}
// make remap
remapNearestNeighborConst(Size2D(blockWidth, blockHeight), srcBase, &map[0],
getRowPtr(dstBase, dstStride, i) + j, dstStride, borderValue);
}
}
}
#else
(void)ssize;
(void)dsize;
(void)srcBase;
(void)srcStride;
(void)tableBase;
(void)tableStride;
(void)dstBase;
(void)dstStride;
(void)borderMode;
(void)borderValue;
#endif
}
void remapLinear(const Size2D &ssize, const Size2D &dsize,
const u8 * srcBase, ptrdiff_t srcStride,
const f32 * tableBase, ptrdiff_t tableStride,
u8 * dstBase, ptrdiff_t dstStride,
BORDER_MODE borderMode, u8 borderValue)
{
internal::assertSupportedConfiguration(isRemapLinearSupported(ssize));
#ifdef CAROTENE_NEON
using namespace internal;
s32 _map[((BLOCK_SIZE * BLOCK_SIZE) << 2) + 16];
f32 _coeffs[((BLOCK_SIZE * BLOCK_SIZE) << 1) + 16];
s32 * map = alignPtr(_map, 16);
f32 * coeffs = alignPtr(_coeffs, 16);
int32x4_t v_width4 = vdupq_n_s32(ssize.width - 1), v_height4 = vdupq_n_s32(ssize.height - 1);
int32x4_t v_step4 = vdupq_n_s32(srcStride), v_1 = vdupq_n_s32(1);
float32x4_t v_zero4f = vdupq_n_f32(0.0f), v_one4f = vdupq_n_f32(1.0f);
if (borderMode == BORDER_MODE_REPLICATE)
{
int32x4_t v_zero4 = vdupq_n_s32(0);
for (size_t i = 0; i < dsize.height; i += BLOCK_SIZE)
{
size_t blockHeight = std::min<size_t>(BLOCK_SIZE, dsize.height - i);
for (size_t j = 0; j < dsize.width; j += BLOCK_SIZE)
{
size_t blockWidth = std::min<size_t>(BLOCK_SIZE, dsize.width - j);
// compute table
for (size_t y = 0; y < blockHeight; ++y)
{
const f32 * table_row = getRowPtr(tableBase, tableStride, i + y) + (j << 1);
s32 * map_row = getRowPtr(map, blockWidth * sizeof(s32) * 4, y);
f32 * coeff_row = getRowPtr(coeffs, blockWidth * sizeof(f32) * 2, y);
size_t x = 0;
for ( ; x + 4 <= blockWidth; x += 4)
{
float32x4x2_t v_table = vld2q_f32(table_row + (x << 1));
int32x4_t v_src_x = vcvtq_s32_f32(v_table.val[0]);
int32x4_t v_src_y = vcvtq_s32_f32(v_table.val[1]);
float32x4x2_t v_coeff;
v_coeff.val[0] = vsubq_f32(v_table.val[0], vcvtq_f32_s32(v_src_x));
v_coeff.val[1] = vsubq_f32(v_table.val[1], vcvtq_f32_s32(v_src_y));
uint32x4_t v_maskx = vcltq_f32(v_coeff.val[0], v_zero4f);
uint32x4_t v_masky = vcltq_f32(v_coeff.val[1], v_zero4f);
v_coeff.val[0] = vbslq_f32(v_maskx, vaddq_f32(v_one4f, v_coeff.val[0]), v_coeff.val[0]);
v_coeff.val[1] = vbslq_f32(v_masky, vaddq_f32(v_one4f, v_coeff.val[1]), v_coeff.val[1]);
v_src_x = vbslq_s32(v_maskx, vsubq_s32(v_src_x, v_1), v_src_x);
v_src_y = vbslq_s32(v_masky, vsubq_s32(v_src_y, v_1), v_src_y);
int32x4_t v_dst0_x = vmaxq_s32(v_zero4, vminq_s32(v_width4, v_src_x));
int32x4_t v_dst0_y = vmaxq_s32(v_zero4, vminq_s32(v_height4, v_src_y));
int32x4_t v_dst1_x = vmaxq_s32(v_zero4, vminq_s32(v_width4, vaddq_s32(v_1, v_src_x)));
int32x4_t v_dst1_y = vmaxq_s32(v_zero4, vminq_s32(v_height4, vaddq_s32(v_1, v_src_y)));
int32x4x4_t v_dst_index;
v_dst_index.val[0] = vmlaq_s32(v_dst0_x, v_dst0_y, v_step4);
v_dst_index.val[1] = vmlaq_s32(v_dst1_x, v_dst0_y, v_step4);
v_dst_index.val[2] = vmlaq_s32(v_dst0_x, v_dst1_y, v_step4);
v_dst_index.val[3] = vmlaq_s32(v_dst1_x, v_dst1_y, v_step4);
vst2q_f32(coeff_row + (x << 1), v_coeff);
vst4q_s32(map_row + (x << 2), v_dst_index);
}
for ( ; x < blockWidth; ++x)
{
f32 src_x_f = table_row[(x << 1) + 0];
f32 src_y_f = table_row[(x << 1) + 1];
s32 src0_x = (s32)floorf(src_x_f);
s32 src0_y = (s32)floorf(src_y_f);
coeff_row[x << 1] = src_x_f - src0_x;
coeff_row[(x << 1) + 1] = src_y_f - src0_y;
s32 src1_y = std::max(0, std::min<s32>(ssize.height - 1, src0_y + 1));
src0_y = std::max(0, std::min<s32>(ssize.height - 1, src0_y));
s32 src1_x = std::max(0, std::min<s32>(ssize.width - 1, src0_x + 1));
src0_x = std::max(0, std::min<s32>(ssize.width - 1, src0_x));
map_row[(x << 2) + 0] = src0_y * srcStride + src0_x;
map_row[(x << 2) + 1] = src0_y * srcStride + src1_x;
map_row[(x << 2) + 2] = src1_y * srcStride + src0_x;
map_row[(x << 2) + 3] = src1_y * srcStride + src1_x;
}
}
remapLinearReplicate(Size2D(blockWidth, blockHeight),
srcBase, &map[0], &coeffs[0],
getRowPtr(dstBase, dstStride, i) + j, dstStride);
}
}
}
else if (borderMode == BORDER_MODE_CONSTANT)
{
float32x4_t v_zero4 = vdupq_n_f32(0.0f);
int32x4_t v_m1_4 = vdupq_n_s32(-1);
for (size_t i = 0; i < dsize.height; i += BLOCK_SIZE)
{
size_t blockHeight = std::min<size_t>(BLOCK_SIZE, dsize.height - i);
for (size_t j = 0; j < dsize.width; j += BLOCK_SIZE)
{
size_t blockWidth = std::min<size_t>(BLOCK_SIZE, dsize.width - j);
// compute table
for (size_t y = 0; y < blockHeight; ++y)
{
const f32 * table_row = getRowPtr(tableBase, tableStride, i + y) + (j << 1);
s32 * map_row = getRowPtr(map, blockWidth * sizeof(s32) * 4, y);
f32 * coeff_row = getRowPtr(coeffs, blockWidth * sizeof(f32) * 2, y);
size_t x = 0;
for ( ; x + 4 <= blockWidth; x += 4)
{
float32x4x2_t v_table = vld2q_f32(table_row + (x << 1));
int32x4_t v_src_x0 = vcvtq_s32_f32(v_table.val[0]);
int32x4_t v_src_y0 = vcvtq_s32_f32(v_table.val[1]);
float32x4x2_t v_coeff;
v_coeff.val[0] = vsubq_f32(v_table.val[0], vcvtq_f32_s32(v_src_x0));
v_coeff.val[1] = vsubq_f32(v_table.val[1], vcvtq_f32_s32(v_src_y0));
uint32x4_t v_maskx = vcltq_f32(v_coeff.val[0], v_zero4f);
uint32x4_t v_masky = vcltq_f32(v_coeff.val[1], v_zero4f);
v_coeff.val[0] = vbslq_f32(v_maskx, vaddq_f32(v_one4f, v_coeff.val[0]), v_coeff.val[0]);
v_coeff.val[1] = vbslq_f32(v_masky, vaddq_f32(v_one4f, v_coeff.val[1]), v_coeff.val[1]);
v_src_x0 = vbslq_s32(v_maskx, vsubq_s32(v_src_x0, v_1), v_src_x0);
v_src_y0 = vbslq_s32(v_masky, vsubq_s32(v_src_y0, v_1), v_src_y0);
int32x4_t v_src_x1 = vaddq_s32(v_src_x0, v_1);
int32x4_t v_src_y1 = vaddq_s32(v_src_y0, v_1);
int32x4x4_t v_dst_index;
v_dst_index.val[0] = vmlaq_s32(v_src_x0, v_src_y0, v_step4);
v_dst_index.val[1] = vmlaq_s32(v_src_x1, v_src_y0, v_step4);
v_dst_index.val[2] = vmlaq_s32(v_src_x0, v_src_y1, v_step4);
v_dst_index.val[3] = vmlaq_s32(v_src_x1, v_src_y1, v_step4);
uint32x4_t v_mask_x0 = vandq_u32(vcgeq_f32(v_table.val[0], v_zero4), vcleq_s32(v_src_x0, v_width4));
uint32x4_t v_mask_x1 = vandq_u32(vcgeq_f32(vaddq_f32(v_table.val[0], v_one4f), v_zero4), vcleq_s32(v_src_x1, v_width4));
uint32x4_t v_mask_y0 = vandq_u32(vcgeq_f32(v_table.val[1], v_zero4), vcleq_s32(v_src_y0, v_height4));
uint32x4_t v_mask_y1 = vandq_u32(vcgeq_f32(vaddq_f32(v_table.val[1], v_one4f), v_zero4), vcleq_s32(v_src_y1, v_height4));
v_dst_index.val[0] = vbslq_s32(vandq_u32(v_mask_x0, v_mask_y0), v_dst_index.val[0], v_m1_4);
v_dst_index.val[1] = vbslq_s32(vandq_u32(v_mask_x1, v_mask_y0), v_dst_index.val[1], v_m1_4);
v_dst_index.val[2] = vbslq_s32(vandq_u32(v_mask_x0, v_mask_y1), v_dst_index.val[2], v_m1_4);
v_dst_index.val[3] = vbslq_s32(vandq_u32(v_mask_x1, v_mask_y1), v_dst_index.val[3], v_m1_4);
vst2q_f32(coeff_row + (x << 1), v_coeff);
vst4q_s32(map_row + (x << 2), v_dst_index);
}
for ( ; x < blockWidth; ++x)
{
f32 src_x_f = table_row[(x << 1) + 0];
f32 src_y_f = table_row[(x << 1) + 1];
s32 src0_x = (s32)floorf(src_x_f), src1_x = src0_x + 1;
s32 src0_y = (s32)floorf(src_y_f), src1_y = src0_y + 1;
coeff_row[(x << 1)] = src_x_f - src0_x;
coeff_row[(x << 1) + 1] = src_y_f - src0_y;
map_row[(x << 2) + 0] = (src0_x >= 0) && (src0_x < (s32)ssize.width) &&
(src0_y >= 0) && (src0_y < (s32)ssize.height) ? src0_y * srcStride + src0_x : -1;
map_row[(x << 2) + 1] = (src1_x >= 0) && (src1_x < (s32)ssize.width) &&
(src0_y >= 0) && (src0_y < (s32)ssize.height) ? src0_y * srcStride + src1_x : -1;
map_row[(x << 2) + 2] = (src0_x >= 0) && (src0_x < (s32)ssize.width) &&
(src1_y >= 0) && (src1_y < (s32)ssize.height) ? src1_y * srcStride + src0_x : -1;
map_row[(x << 2) + 3] = (src1_x >= 0) && (src1_x < (s32)ssize.width) &&
(src1_y >= 0) && (src1_y < (s32)ssize.height) ? src1_y * srcStride + src1_x : -1;
}
}
remapLinearConst(Size2D(blockWidth, blockHeight),
srcBase, &map[0], &coeffs[0],
getRowPtr(dstBase, dstStride, i) + j, dstStride, borderValue);
}
}
}
#else
(void)ssize;
(void)dsize;
(void)srcBase;
(void)srcStride;
(void)tableBase;
(void)tableStride;
(void)dstBase;
(void)dstStride;
(void)borderMode;
(void)borderValue;
#endif
}
} // namespace CAROTENE_NS

85
3rdparty/carotene/src/remap.hpp vendored Normal file
View File

@ -0,0 +1,85 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#ifndef CAROTENE_SRC_REMAP_HPP
#define CAROTENE_SRC_REMAP_HPP
#include "common.hpp"
#include <cmath>
#ifdef CAROTENE_NEON
namespace CAROTENE_NS { namespace internal {
enum
{
BLOCK_SIZE = 32
};
void remapNearestNeighborReplicate(const Size2D size,
const u8 * srcBase,
const s32 * map,
u8 * dstBase, ptrdiff_t dstStride);
void remapNearestNeighborConst(const Size2D size,
const u8 * srcBase,
const s32 * map,
u8 * dstBase, ptrdiff_t dstStride,
u8 borderValue);
void remapLinearReplicate(const Size2D size,
const u8 * srcBase,
const s32 * map,
const f32 * coeffs,
u8 * dstBase, ptrdiff_t dstStride);
void remapLinearConst(const Size2D size,
const u8 * srcBase,
const s32 * map,
const f32 * coeffs,
u8 * dstBase, ptrdiff_t dstStride,
u8 borderValue);
} }
#endif // CAROTENE_NEON
#endif // CAROTENE_SRC_REMAP_HPP

2191
3rdparty/carotene/src/resize.cpp vendored Normal file

File diff suppressed because it is too large Load Diff

199
3rdparty/carotene/src/saturate_cast.hpp vendored Normal file
View File

@ -0,0 +1,199 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2012-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#ifndef CAROTENE_SATURATE_CAST_HPP
#define CAROTENE_SATURATE_CAST_HPP
#include <algorithm>
#include <climits>
#include <cmath>
#if defined _MSC_VER && defined _M_ARM
# include <intrin.h>
#endif
#include <carotene/definitions.hpp>
#include <carotene/types.hpp>
namespace CAROTENE_NS { namespace internal {
#if defined _MSC_VER && defined _M_ARM
__declspec(naked) static void vcvtr_s32_f64_imp(f64 d)
{
(void)d;
__emit(0xEEBD); // vcvtr.s32.f64 s0, d0
__emit(0x0B40);
__emit(0xEE10); // vmov r0, s0
__emit(0x0A10);
__emit(0x4770); // bx lr
}
# define CAROTENE_ROUND_FLT(x) return ((s32 (*)(f64))vcvtr_s32_f64_imp)((f64)x);
# define CAROTENE_ROUND_DBL(x) return ((s32 (*)(f64))vcvtr_s32_f64_imp)(x);
#elif defined CV_ICC || defined __GNUC__
# if defined(__VFP_FP__) && !defined(__SOFTFP__) && !(defined _DEBUG || defined DEBUG) && !defined(__CUDACC__)
# define CAROTENE_ROUND_FLT(value) { \
register union { f32 f; s32 i; } result; \
asm ("ftosis %0, %1 \n" : "=w" (result.f) : "w" (value) ); \
return result.i; }
# define CAROTENE_ROUND_DBL(value) { \
register union {f32 f; s32 i;} __tegra_result; \
asm ( \
"ftosid %0, %P1\n" \
: "=w" (__tegra_result.f) \
: "w" (value) \
); \
return __tegra_result.i; \
}
# else
# define CAROTENE_ROUND_FLT(x) return (s32)lrintf(value);
# define CAROTENE_ROUND_DBL(value) return (s32)lrint(value);
# endif
#endif
inline s32 round(f32 value)
{
#ifdef CAROTENE_ROUND_FLT
CAROTENE_ROUND_FLT(value)
#else
s32 intpart = (s32)(value);
f32 fractpart = value - intpart;
if ((fractpart != 0.5 && fractpart != -0.5) || ((intpart % 2) != 0))
return (s32)(value + (value >= 0 ? 0.5 : -0.5));
else
return intpart;
#endif
}
inline s32 round(f64 value)
{
#ifdef CAROTENE_ROUND_DBL
CAROTENE_ROUND_DBL(value)
#else
s32 intpart = (s32)(value);
f64 fractpart = value - intpart;
if ((fractpart != 0.5 && fractpart != -0.5) || ((intpart % 2) != 0))
return (s32)(value + (value >= 0 ? 0.5 : -0.5));
else
return intpart;
#endif
}
/////////////// saturate_cast (used in image & signal processing) ///////////////////
template<typename _Tp> inline _Tp saturate_cast(u8 v) { return _Tp(v); }
template<typename _Tp> inline _Tp saturate_cast(s8 v) { return _Tp(v); }
template<typename _Tp> inline _Tp saturate_cast(u16 v) { return _Tp(v); }
template<typename _Tp> inline _Tp saturate_cast(s16 v) { return _Tp(v); }
template<typename _Tp> inline _Tp saturate_cast(u32 v) { return _Tp(v); }
template<typename _Tp> inline _Tp saturate_cast(s32 v) { return _Tp(v); }
template<typename _Tp> inline _Tp saturate_cast(s64 v) { return _Tp(v); }
template<typename _Tp> inline _Tp saturate_cast(u64 v) { return _Tp(v); }
template<typename _Tp> inline _Tp saturate_cast(f32 v) { return _Tp(v); }
template<typename _Tp> inline _Tp saturate_cast(f64 v) { return _Tp(v); }
template<> inline u8 saturate_cast<u8>(s8 v) { return (u8)std::max((s32)v, 0); }
template<> inline u8 saturate_cast<u8>(u16 v) { return (u8)std::min((u32)v, (u32)UCHAR_MAX); }
template<> inline u8 saturate_cast<u8>(s32 v) { return (u8)((u32)v <= UCHAR_MAX ? v : v > 0 ? UCHAR_MAX : 0); }
template<> inline u8 saturate_cast<u8>(s16 v) { return saturate_cast<u8>((s32)v); }
template<> inline u8 saturate_cast<u8>(u32 v) { return (u8)std::min(v, (u32)UCHAR_MAX); }
template<> inline u8 saturate_cast<u8>(s64 v) { return (u8)((u64)v <= UCHAR_MAX ? v : v > 0 ? UCHAR_MAX : 0); }
template<> inline u8 saturate_cast<u8>(u64 v) { return (u8)std::min(v, (u64)UCHAR_MAX); }
template<> inline u8 saturate_cast<u8>(f32 v) { return saturate_cast<u8>(round(v)); }
template<> inline u8 saturate_cast<u8>(f64 v) { return saturate_cast<u8>(round(v)); }
template<> inline s8 saturate_cast<s8>(u8 v) { return (s8)std::min((s32)v, SCHAR_MAX); }
template<> inline s8 saturate_cast<s8>(u16 v) { return (s8)std::min((u32)v, (u32)SCHAR_MAX); }
template<> inline s8 saturate_cast<s8>(s32 v) { return (s8)((u32)(v-SCHAR_MIN) <= (u32)UCHAR_MAX ? v : v > 0 ? SCHAR_MAX : SCHAR_MIN); }
template<> inline s8 saturate_cast<s8>(s16 v) { return saturate_cast<s8>((s32)v); }
template<> inline s8 saturate_cast<s8>(u32 v) { return (s8)std::min(v, (u32)SCHAR_MAX); }
template<> inline s8 saturate_cast<s8>(s64 v) { return (s8)((u64)(v-SCHAR_MIN) <= (u64)UCHAR_MAX ? v : v > 0 ? SCHAR_MAX : SCHAR_MIN); }
template<> inline s8 saturate_cast<s8>(u64 v) { return (s8)std::min(v, (u64)SCHAR_MAX); }
template<> inline s8 saturate_cast<s8>(f32 v) { return saturate_cast<s8>(round(v)); }
template<> inline s8 saturate_cast<s8>(f64 v) { return saturate_cast<s8>(round(v)); }
template<> inline u16 saturate_cast<u16>(s8 v) { return (u16)std::max((s32)v, 0); }
template<> inline u16 saturate_cast<u16>(s16 v) { return (u16)std::max((s32)v, 0); }
template<> inline u16 saturate_cast<u16>(s32 v) { return (u16)((u32)v <= (u32)USHRT_MAX ? v : v > 0 ? USHRT_MAX : 0); }
template<> inline u16 saturate_cast<u16>(u32 v) { return (u16)std::min(v, (u32)USHRT_MAX); }
template<> inline u16 saturate_cast<u16>(s64 v) { return (u16)((u64)v <= (u64)USHRT_MAX ? v : v > 0 ? USHRT_MAX : 0); }
template<> inline u16 saturate_cast<u16>(u64 v) { return (u16)std::min(v, (u64)USHRT_MAX); }
template<> inline u16 saturate_cast<u16>(f32 v) { return saturate_cast<u16>(round(v)); }
template<> inline u16 saturate_cast<u16>(f64 v) { return saturate_cast<u16>(round(v)); }
template<> inline s16 saturate_cast<s16>(u16 v) { return (s16)std::min((s32)v, SHRT_MAX); }
template<> inline s16 saturate_cast<s16>(s32 v) { return (s16)((u32)(v - SHRT_MIN) <= (u32)USHRT_MAX ? v : v > 0 ? SHRT_MAX : SHRT_MIN); }
template<> inline s16 saturate_cast<s16>(u32 v) { return (s16)std::min(v, (u32)SHRT_MAX); }
template<> inline s16 saturate_cast<s16>(s64 v) { return (s16)((u64)(v - SHRT_MIN) <= (u64)USHRT_MAX ? v : v > 0 ? SHRT_MAX : SHRT_MIN); }
template<> inline s16 saturate_cast<s16>(u64 v) { return (s16)std::min(v, (u64)SHRT_MAX); }
template<> inline s16 saturate_cast<s16>(f32 v) { return saturate_cast<s16>(round(v)); }
template<> inline s16 saturate_cast<s16>(f64 v) { return saturate_cast<s16>(round(v)); }
template<> inline u32 saturate_cast<u32>(s8 v) { return (u32)std::max(v, (s8)0); }
template<> inline u32 saturate_cast<u32>(s16 v) { return (u32)std::max(v, (s16)0); }
template<> inline u32 saturate_cast<u32>(s32 v) { return (u32)std::max(v, (s32)0); }
template<> inline u32 saturate_cast<u32>(s64 v) { return (u32)((u64)v <= (u64)UINT_MAX ? v : v > 0 ? UINT_MAX : 0); }
template<> inline u32 saturate_cast<u32>(u64 v) { return (u32)std::min(v, (u64)UINT_MAX); }
//OpenCV like f32/f64 -> u32 conversion
//we intentionally do not clip negative numbers, to make -1 become 0xffffffff etc.
template<> inline u32 saturate_cast<u32>(f32 v) { return round(v); }
template<> inline u32 saturate_cast<u32>(f64 v) { return round(v); }
//Negative clipping implementation
//template<> inline u32 saturate_cast<u32>(f32 v) { return saturate_cast<u32>(round(v)); }
//template<> inline u32 saturate_cast<u32>(f64 v) { return saturate_cast<u32>(round(v)); }
template<> inline s32 saturate_cast<s32>(u32 v) { return (s32)std::min(v, (u32)INT_MAX); }
template<> inline s32 saturate_cast<s32>(s64 v) { return (s32)((u64)(v - INT_MIN) <= (u64)UINT_MAX ? v : v > 0 ? INT_MAX : INT_MIN); }
template<> inline s32 saturate_cast<s32>(u64 v) { return (s32)std::min(v, (u64)INT_MAX); }
template<> inline s32 saturate_cast<s32>(f32 v) { return round(v); }
template<> inline s32 saturate_cast<s32>(f64 v) { return round(v); }
template<> inline u64 saturate_cast<u64>(s8 v) { return (u64)std::max(v, (s8)0); }
template<> inline u64 saturate_cast<u64>(s16 v) { return (u64)std::max(v, (s16)0); }
template<> inline u64 saturate_cast<u64>(s32 v) { return (u64)std::max(v, (s32)0); }
template<> inline u64 saturate_cast<u64>(s64 v) { return (u64)std::max(v, (s64)0); }
template<> inline s64 saturate_cast<s64>(u64 v) { return (s64)std::min(v, (u64)LLONG_MAX); }
} }
#endif

219
3rdparty/carotene/src/scharr.cpp vendored Normal file
View File

@ -0,0 +1,219 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2012-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include <vector>
#include "common.hpp"
namespace CAROTENE_NS {
bool isScharr3x3Supported(const Size2D &size, BORDER_MODE border, s32 dx, s32 dy, Margin borderMargin)
{
return (dx == 0 && dy == 1 &&
isSeparableFilter3x3Supported(size, border, 3, 1, borderMargin)) ||
(dx == 1 && dy == 0 &&
isSeparableFilter3x3Supported(size, border, 1, 3, borderMargin));
}
void Scharr3x3(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
s16 * dstBase, ptrdiff_t dstStride,
s32 dx, s32 dy,
BORDER_MODE border, u8 borderValue, Margin borderMargin)
{
internal::assertSupportedConfiguration(isScharr3x3Supported(size, border, dx, dy, borderMargin));
#ifdef CAROTENE_NEON
static s16 dw[] = {3, 10, 3};
if (dy == 1)
SeparableFilter3x3(size, srcBase, srcStride, dstBase, dstStride,
3, 1, dw, 0,
border, borderValue, borderMargin);
else
SeparableFilter3x3(size, srcBase, srcStride, dstBase, dstStride,
1, 3, 0, dw,
border, borderValue, borderMargin);
#else
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)borderValue;
#endif
}
void ScharrDeriv(const Size2D &size, s32 cn,
const u8 * srcBase, ptrdiff_t srcStride,
s16 * dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
size_t colsn = size.width*cn;
size_t roiw8 = colsn > 7 ? colsn - 7 : 0;
ptrdiff_t delta = (ptrdiff_t)(((size.width + 2)*cn + 15) & -16);//align size
std::vector<s16> _tempBuf((delta << 1) + 64);
s16 *trow0 = internal::alignPtr(&_tempBuf[cn], 16), *trow1 = internal::alignPtr(trow0 + delta, 16);
int16x8_t vc3 = vmovq_n_s16(3);
int16x8_t vc10 = vmovq_n_s16(10);
uint8x8_t v8c10 = vmov_n_u8(10);
for(size_t y = 0; y < size.height; y++ )
{
const u8* srow0 = internal::getRowPtr(srcBase, srcStride, y > 0 ? y-1 : size.height > 1 ? 1 : 0);
const u8* srow1 = internal::getRowPtr(srcBase, srcStride, y);
const u8* srow2 = internal::getRowPtr(srcBase, srcStride, y < size.height-1 ? y+1 : size.height > 1 ? size.height-2 : 0);
s16* drow = internal::getRowPtr(dstBase, dstStride, y);
// do vertical convolution
size_t x = 0;
for( ; x < roiw8; x += 8 )
{
internal::prefetch(srow0 + x);
internal::prefetch(srow1 + x);
internal::prefetch(srow2 + x);
#if __GNUC_MINOR__ < 7
__asm__ (
"vld1.8 {d0}, [%[src0]] \n\t"
"vld1.8 {d2}, [%[src2]] \n\t"
"vld1.8 {d1}, [%[src1]] \n\t"
"vaddl.u8 q2, d2, d0 \n\t"
"vmull.u8 q3, d1, %[vc10] \n\t"
"vsubl.u8 q4, d2, d0 \n\t"
"vmla.s16 q3, q2, %q[vc3] \n\t"
"vst1.16 {d8-d9}, [%[out1],:128] \n\t"
"vst1.16 {d6-d7}, [%[out0],:128] \n\t"
:
: [out0] "r" (trow0 + x),
[out1] "r" (trow1 + x),
[src0] "r" (srow0 + x),
[src1] "r" (srow1 + x),
[src2] "r" (srow2 + x),
[vc10] "w" (v8c10), [vc3] "w" (vc3)
: "d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","d10","d11","d12","d13","d14","d15"
);
#else
uint8x8_t s0 = vld1_u8(srow0 + x);
uint8x8_t s1 = vld1_u8(srow1 + x);
uint8x8_t s2 = vld1_u8(srow2 + x);
int16x8_t s1x10 = vreinterpretq_s16_u16(vmull_u8(s1, v8c10));
int16x8_t s02 = vreinterpretq_s16_u16(vaddl_u8(s2, s0));
int16x8_t t1 = vreinterpretq_s16_u16(vsubl_u8(s2, s0));
int16x8_t t0 = vmlaq_s16(s1x10, s02, vc3);
vst1q_s16(trow1 + x, t1);
vst1q_s16(trow0 + x, t0);
#endif
}
for( ; x < colsn; x++ )
{
trow0[x] = (s16)((srow0[x] + srow2[x])*3 + srow1[x]*10);
trow1[x] = (s16)(srow2[x] - srow0[x]);
}
// make border
size_t x0 = (size.width > 1 ? cn : 0), x1 = (size.width > 1 ? (size.width-2)*cn : 0);
for( s32 k = 0; k < cn; k++ )
{
trow0[-cn + k] = trow0[x0 + k]; trow0[colsn + k] = trow0[x1 + k];
trow1[-cn + k] = trow1[x0 + k]; trow1[colsn + k] = trow1[x1 + k];
}
// do horizontal convolution, interleave the results and store them to dst
x = 0;
for( ; x < roiw8; x += 8 )
{
#if __GNUC_MINOR__ < 6
__asm__ (
"vld1.16 {d4-d5}, [%[s2ptr]] \n\t"
"vld1.16 {d8-d9}, [%[s4ptr]] \n\t"
"vld1.16 {d6-d7}, [%[s3ptr],:128] \n\t"
"vld1.16 {d0-d1}, [%[s0ptr]] \n\t"
"vld1.16 {d2-d3}, [%[s1ptr]] \n\t"
"vadd.i16 q7, q2, q4 \n\t"
"vmul.s16 q6, q3, %q[vc10] \n\t"
"vsub.s16 q5, q1, q0 \n\t"
"vmla.s16 q6, q7, %q[vc3] \n\t"
"vst2.16 {d10-d13}, [%[out]] \n\t"
:
: [out] "r" (drow + x * 2),
[s0ptr] "r" (trow0 + x - cn),
[s1ptr] "r" (trow0 + x + cn),
[s2ptr] "r" (trow1 + x - cn),
[s3ptr] "r" (trow1 + x),
[s4ptr] "r" (trow1 + x + cn),
[vc10] "w" (vc10), [vc3] "w" (vc3)
: "d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","d10","d11","d12","d13","d14","d15"
);
#else
int16x8_t s0 = vld1q_s16(trow0 + x - cn);
int16x8_t s1 = vld1q_s16(trow0 + x + cn);
int16x8_t s2 = vld1q_s16(trow1 + x - cn);
int16x8_t s3 = vld1q_s16(trow1 + x);
int16x8_t s4 = vld1q_s16(trow1 + x + cn);
int16x8_t s3x10 = vmulq_s16(s3, vc10);
int16x8_t s24 = vaddq_s16(s2, s4);
int16x8x2_t vr;
vr.val[0] = vsubq_s16(s1, s0);
vr.val[1] = vmlaq_s16(s3x10, s24, vc3);
vst2q_s16(drow + x*2, vr);
#endif //__GNUC_MINOR__ < 6
}
for( ; x < colsn; x++ )
{
drow[x*2] = (s16)(trow0[x+cn] - trow0[x-cn]);
drow[x*2+1] = (s16)((trow1[x+cn] + trow1[x-cn])*3 + trow1[x]*10);
}
}
#else
(void)size;
(void)cn;
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
#endif
}
} // namespace CAROTENE_NS

View File

@ -0,0 +1,109 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include "separable_filter.hpp"
namespace CAROTENE_NS {
bool isSeparableFilter3x3Supported(const Size2D &size, BORDER_MODE border, s32 dx, s32 dy, Margin borderMargin)
{
return isSupportedConfiguration() &&
size.width >= 9 && size.height >= 1 &&
(size.height + borderMargin.top + borderMargin.bottom) >= 2 &&
(dx >= 0) && (dx < 4) && (dy >= 0) && (dy < 4) &&
(border == BORDER_MODE_CONSTANT ||
border == BORDER_MODE_REFLECT ||
border == BORDER_MODE_REFLECT101 ||
border == BORDER_MODE_REPLICATE );
}
void SeparableFilter3x3(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
s16 * dstBase, ptrdiff_t dstStride,
const u8 rowFilter, const u8 colFilter, const s16 *xw, const s16 *yw,
BORDER_MODE border, u8 borderValue, Margin borderMargin)
{
internal::assertSupportedConfiguration(isSeparableFilter3x3Supported(size, border, rowFilter, colFilter, borderMargin));
#ifdef CAROTENE_NEON
if(!((xw || rowFilter < 3) && (yw || colFilter < 3)))
std::abort();//Couldn't call generic filter without provided weights
typedef void (*sepFilter3x3_8u16s_func)(const Size2D&, const u8*, ptrdiff_t, s16*, ptrdiff_t,
const s16*, const s16*, BORDER_MODE, u8, Margin);
static sepFilter3x3_8u16s_func quickFilters[4][4]=
{
/*d0y*/{ /*d0x*/ internal::sepFilter3x3<internal::RowFilter3x3S16_121, internal::ColFilter3x3S16_121>::process,
/*dx*/ internal::sepFilter3x3<internal::RowFilter3x3S16_m101, internal::ColFilter3x3S16_121>::process,
/*d2x*/ internal::sepFilter3x3<internal::RowFilter3x3S16_1m21, internal::ColFilter3x3S16_121>::process,
/*dNx*/ internal::sepFilter3x3<internal::RowFilter3x3S16Generic, internal::ColFilter3x3S16_121>::process},
/*dy */{ /*d0x*/ internal::sepFilter3x3<internal::RowFilter3x3S16_121, internal::ColFilter3x3S16_m101>::process,
/*dx*/ internal::sepFilter3x3<internal::RowFilter3x3S16_m101, internal::ColFilter3x3S16_m101>::process,
/*d2x*/ internal::sepFilter3x3<internal::RowFilter3x3S16_1m21, internal::ColFilter3x3S16_m101>::process,
/*dNx*/ internal::sepFilter3x3<internal::RowFilter3x3S16Generic, internal::ColFilter3x3S16_m101>::process},
/*d2y*/{ /*d0x*/ internal::sepFilter3x3<internal::RowFilter3x3S16_121, internal::ColFilter3x3S16_1m21>::process,
/*dx*/ internal::sepFilter3x3<internal::RowFilter3x3S16_m101, internal::ColFilter3x3S16_1m21>::process,
/*d2x*/ internal::sepFilter3x3<internal::RowFilter3x3S16_1m21, internal::ColFilter3x3S16_1m21>::process,
/*dNx*/ internal::sepFilter3x3<internal::RowFilter3x3S16Generic, internal::ColFilter3x3S16_1m21>::process},
/*dNy*/{ /*d0x*/ internal::sepFilter3x3<internal::RowFilter3x3S16_121, internal::ColFilter3x3S16Generic>::process,
/*dx*/ internal::sepFilter3x3<internal::RowFilter3x3S16_m101, internal::ColFilter3x3S16Generic>::process,
/*d2x*/ internal::sepFilter3x3<internal::RowFilter3x3S16_1m21, internal::ColFilter3x3S16Generic>::process,
/*dNx*/ internal::sepFilter3x3<internal::RowFilter3x3S16Generic, internal::ColFilter3x3S16Generic>::process}
};
quickFilters[colFilter][rowFilter](size, srcBase, srcStride, dstBase, dstStride,
xw, yw, border, borderValue, borderMargin);
#else
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)xw;
(void)yw;
(void)borderValue;
#endif
}
} // namespace CAROTENE_NS

1161
3rdparty/carotene/src/separable_filter.hpp vendored Normal file

File diff suppressed because it is too large Load Diff

317
3rdparty/carotene/src/sobel.cpp vendored Normal file
View File

@ -0,0 +1,317 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2012-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include <vector>
#include "common.hpp"
namespace CAROTENE_NS {
bool isSobel3x3Supported(const Size2D &size, BORDER_MODE border,
s32 dx, s32 dy, Margin borderMargin)
{
return dx < 3 && dx >= 0 &&
dy < 3 && dy >= 0 &&
(dx + dy) > 0 &&
isSeparableFilter3x3Supported(size, border, dx, dy, borderMargin);
}
void Sobel3x3(const Size2D &size,
const u8 * srcBase, ptrdiff_t srcStride,
s16 * dstBase, ptrdiff_t dstStride,
s32 dx, s32 dy,
BORDER_MODE borderType, u8 borderValue, Margin borderMargin)
{
internal::assertSupportedConfiguration(isSobel3x3Supported(size, borderType, dx, dy, borderMargin));
#ifdef CAROTENE_NEON
SeparableFilter3x3(size, srcBase, srcStride, dstBase, dstStride,
dx, dy, 0, 0,
borderType, borderValue, borderMargin);
#else
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)borderValue;
#endif
}
bool isSobel3x3f32Supported(const Size2D &size, BORDER_MODE border,
s32 dx, s32 dy)
{
return isSupportedConfiguration() &&
dx < 3 && dx >= 0 &&
dy < 3 && dy >= 0 &&
(dx + dy) > 0 &&
size.width >= 4 && size.height >= 2 &&
(border == BORDER_MODE_CONSTANT ||
border == BORDER_MODE_REFLECT ||
border == BORDER_MODE_REFLECT101 ||
border == BORDER_MODE_REPLICATE );
}
void Sobel3x3(const Size2D &size,
const f32 * srcBase, ptrdiff_t srcStride,
f32 * dstBase, ptrdiff_t dstStride,
s32 dx, s32 dy,
BORDER_MODE borderType, f32 borderValue)
{
internal::assertSupportedConfiguration(isSobel3x3f32Supported(size, borderType, dx, dy));
#ifdef CAROTENE_NEON
std::vector<f32> _tmp;
f32 *tmp = 0;
if (borderType == BORDER_MODE_CONSTANT)
{
_tmp.assign(size.width + 2, borderValue);
tmp = &_tmp[1];
}
ptrdiff_t delta = (ptrdiff_t)((size.width + 2 + 31) & -32);//align size
std::vector<f32> _tempBuf((delta << 1) + 64);
f32 *trow0 = internal::alignPtr(&_tempBuf[1], 32), *trow1 = internal::alignPtr(trow0 + delta, 32);
for( size_t y = 0; y < size.height; y++ )
{
const f32* srow0;
const f32* srow1 = internal::getRowPtr(srcBase, srcStride, y);
const f32* srow2;
f32* drow = internal::getRowPtr(dstBase, dstStride, y > 0 ? y-1 : 0);
f32* drow1 = internal::getRowPtr(dstBase, dstStride, y);
if (borderType == BORDER_MODE_REFLECT101) {
srow0 = internal::getRowPtr(srcBase, srcStride, y > 0 ? y-1 : 1);
srow2 = internal::getRowPtr(srcBase, srcStride, y < size.height-1 ? y+1 : size.height-2);
} else if (borderType == BORDER_MODE_CONSTANT) {
srow0 = y > 0 ? internal::getRowPtr(srcBase, srcStride, y-1) : tmp;
srow2 = y < size.height-1 ? internal::getRowPtr(srcBase, srcStride, y+1) : tmp;
} else { // BORDER_MODE_REFLECT || BORDER_MODE_REPLICATE
srow0 = internal::getRowPtr(srcBase, srcStride, y > 0 ? y-1 : 0);
srow2 = internal::getRowPtr(srcBase, srcStride, y < size.height-1 ? y+1 : size.height-1);
}
float32x4_t tprev = vmovq_n_f32(0.f);
float32x4_t tcurr = vmovq_n_f32(0.f);
float32x4_t tnext = vmovq_n_f32(0.f);
float32x4_t t0, t1, t2;
// do vertical convolution
size_t x = 0, bcolsn = y + 2 < size.height ? size.width : (size.width - 4);
for( ; x <= bcolsn; x += 4 )
{
internal::prefetch(srow0 + x);
internal::prefetch(srow1 + x);
internal::prefetch(srow2 + x);
float32x4_t x0 = vld1q_f32(srow0 + x);
float32x4_t x1 = vld1q_f32(srow1 + x);
float32x4_t x2 = vld1q_f32(srow2 + x);
tprev = tcurr;
tcurr = tnext;
if(!dy)
{
tnext = vaddq_f32(vaddq_f32(vaddq_f32(x1, x1), x2), x0);
}
else if(dy == 2)
{
tnext = vsubq_f32(vsubq_f32(x2, x1), vsubq_f32(x1, x0));
}
else
{
tnext = vsubq_f32(x2, x0);
}
if(!x) {
tcurr = tnext;
// make border
if (borderType == BORDER_MODE_CONSTANT)
{
tcurr = vsetq_lane_f32(borderValue,tcurr, 3);
}
else if (borderType == BORDER_MODE_REFLECT101)
{
tcurr = vsetq_lane_f32(vgetq_lane_f32(tcurr, 1),tcurr, 3);
}
else // BORDER_MODE_REFLECT || BORDER_MODE_REPLICATE
{
tcurr = vsetq_lane_f32(vgetq_lane_f32(tcurr, 0),tcurr, 3);
}
continue;
}
internal::prefetch(trow0 + x);
internal::prefetch(trow1 + x);
t0 = vextq_f32(tprev, tcurr, 3);
t1 = tcurr;
t2 = vextq_f32(tcurr, tnext, 1);
if(!dx)
{
t0 = vaddq_f32(t0, vaddq_f32(vaddq_f32(t1, t1), t2));
}
else if(dx == 2)
{
t0 = vsubq_f32(vsubq_f32(t2, t1), vsubq_f32(t1, t0));
}
else
{
t0 = vsubq_f32(t2, t0);
}
if(!(y%2))
{
vst1q_f32(trow0 + x - 4, t0);
}
else
{
vst1q_f32(trow1 + x - 4, t0);
}
}
x -= 4;
if(x == size.width){
x--;
}
f32 prevx = 0, rowx = 0, nextx = 0;
if(!dy)
{
prevx = x > 0 ? srow2[x-1] + 2*srow1[x-1] + srow0[x-1] :
(borderType == BORDER_MODE_REFLECT101 ? srow2[1] + 2*srow1[1] + srow0[1] :
(borderType == BORDER_MODE_CONSTANT ? 4*borderValue :
srow2[0] + 2*srow1[0] + srow0[0]) );
rowx = srow2[x] + 2*srow1[x] + srow0[x];
}
else if(dy == 2)
{
prevx = x > 0 ? srow2[x-1] - 2*srow1[x-1] + srow0[x-1] :
(borderType == BORDER_MODE_REFLECT101 ? srow2[1] - 2*srow1[1] + srow0[1] :
(borderType == BORDER_MODE_CONSTANT ? 0.f :
srow2[0] - 2*srow1[0] + srow0[0]) );
rowx = srow2[x] - 2*srow1[x] + srow0[x];
}
else
{
prevx = x > 0 ? srow2[x-1] - srow0[x-1] :
(borderType == BORDER_MODE_REFLECT101 ? srow2[1] - srow0[1] :
(borderType == BORDER_MODE_CONSTANT ? 0.f :
srow2[0] - srow0[0]) );
rowx = srow2[x] - srow0[x];
}
for( ; x < size.width; x++ )
{
if(x+1 == size.width) {
// make border
if (borderType == BORDER_MODE_CONSTANT)
{
if(!dy) {
nextx = 4*borderValue;
} else {
nextx = 0.f;
}
} else if (borderType == BORDER_MODE_REFLECT101)
{
if(!dy) {
nextx = srow2[x-1] + 2*srow1[x-1] + srow0[x-1];
} else if(dy == 2) {
nextx = srow2[x-1] - 2*srow1[x-1] + srow0[x-1];
} else {
nextx = srow2[x-1] - srow0[x-1];
}
} else {
if(!dy) {
nextx = srow2[x] + 2*srow1[x] + srow0[x];
} else if(dy == 2) {
nextx = srow2[x] - 2*srow1[x] + srow0[x];
} else {
nextx = srow2[x] - srow0[x];
}
}
} else {
if(!dy) {
nextx = srow2[x+1] + 2*srow1[x+1] + srow0[x+1];
} else if(dy == 2) {
nextx = srow2[x+1] - 2*srow1[x+1] + srow0[x+1];
} else {
nextx = srow2[x+1] - srow0[x+1];
}
}
f32 res;
if(dx==1) {
res = nextx - prevx;
} else if(!dx) {
res = prevx + 2*rowx + nextx;
} else {
res = prevx - 2*rowx + nextx;
}
if(!(y%2)) {
*(trow0+x) = res;
} else {
*(trow1+x) = res;
}
prevx = rowx;
rowx = nextx;
}
if(y>0) {
for(size_t x1 = 0; x1 < size.width; x1++ )
{
if(y%2)
*(drow + x1) = trow0[x1];
else
*(drow + x1) = trow1[x1];
}
}
if(y == size.height-1) {
for(size_t x1 = 0; x1 < size.width; x1++ )
{
if(!(y%2))
*(drow1 + x1) = trow0[x1];
else
*(drow1 + x1) = trow1[x1];
}
}
}
#else
(void)srcBase;
(void)srcStride;
(void)dstBase;
(void)dstStride;
(void)borderValue;
#endif
}
} // namespace CAROTENE_NS

621
3rdparty/carotene/src/sub.cpp vendored Normal file
View File

@ -0,0 +1,621 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
template <typename T, typename WT>
struct SubWrap
{
typedef T type;
void operator() (const typename internal::VecTraits<T>::vec128 & v_src0,
const typename internal::VecTraits<T>::vec128 & v_src1,
typename internal::VecTraits<T>::vec128 & v_dst) const
{
v_dst = internal::vsubq(v_src0, v_src1);
}
void operator() (const typename internal::VecTraits<T>::vec64 & v_src0,
const typename internal::VecTraits<T>::vec64 & v_src1,
typename internal::VecTraits<T>::vec64 & v_dst) const
{
v_dst = internal::vsub(v_src0, v_src1);
}
void operator() (const T * src0, const T * src1, T * dst) const
{
dst[0] = (T)((WT)src0[0] - (WT)src1[0]);
}
};
template <typename T, typename WT>
struct SubSaturate
{
typedef T type;
void operator() (const typename internal::VecTraits<T>::vec128 & v_src0,
const typename internal::VecTraits<T>::vec128 & v_src1,
typename internal::VecTraits<T>::vec128 & v_dst) const
{
v_dst = internal::vqsubq(v_src0, v_src1);
}
void operator() (const typename internal::VecTraits<T>::vec64 & v_src0,
const typename internal::VecTraits<T>::vec64 & v_src1,
typename internal::VecTraits<T>::vec64 & v_dst) const
{
v_dst = internal::vqsub(v_src0, v_src1);
}
void operator() (const T * src0, const T * src1, T * dst) const
{
dst[0] = internal::saturate_cast<T>((WT)src0[0] - (WT)src1[0]);
}
};
} // namespace
#endif
void sub(const Size2D &size,
const u8 * src0Base, ptrdiff_t src0Stride,
const u8 * src1Base, ptrdiff_t src1Stride,
u8 *dstBase, ptrdiff_t dstStride,
CONVERT_POLICY policy)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
if (policy == CONVERT_POLICY_SATURATE)
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
SubSaturate<u8, s16>());
}
else
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
SubWrap<u8, s16>());
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
(void)policy;
#endif
}
void sub(const Size2D &size,
const u8 * src0Base, ptrdiff_t src0Stride,
const u8 * src1Base, ptrdiff_t src1Stride,
s16 *dstBase, ptrdiff_t dstStride,
CONVERT_POLICY)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0; i < size.height; ++i)
{
const u8 * src0 = internal::getRowPtr(src0Base, src0Stride, i);
const u8 * src1 = internal::getRowPtr(src1Base, src1Stride, i);
u16 * dstu16 = internal::getRowPtr((u16 *)dstBase, dstStride, i);
s16 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
for (; j < roiw32; j += 32)
{
internal::prefetch(src0 + j);
internal::prefetch(src1 + j);
uint8x16_t v_src00 = vld1q_u8(src0 + j), v_src01 = vld1q_u8(src0 + j + 16);
uint8x16_t v_src10 = vld1q_u8(src1 + j), v_src11 = vld1q_u8(src1 + j + 16);
vst1q_u16(dstu16 + j, vsubl_u8(vget_low_u8(v_src00), vget_low_u8(v_src10)));
vst1q_u16(dstu16 + j + 8, vsubl_u8(vget_high_u8(v_src00), vget_high_u8(v_src10)));
vst1q_u16(dstu16 + j + 16, vsubl_u8(vget_low_u8(v_src01), vget_low_u8(v_src11)));
vst1q_u16(dstu16 + j + 24, vsubl_u8(vget_high_u8(v_src01), vget_high_u8(v_src11)));
}
for (; j < roiw8; j += 8)
{
uint8x8_t v_src0 = vld1_u8(src0 + j);
uint8x8_t v_src1 = vld1_u8(src1 + j);
vst1q_u16(dstu16 + j, vsubl_u8(v_src0, v_src1));
}
for (; j < size.width; j++)
dst[j] = (s16)src0[j] - (s16)src1[j];
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
#endif
}
void sub(const Size2D &size,
const u8 * src0Base, ptrdiff_t src0Stride,
const u8 * src1Base, ptrdiff_t src1Stride,
f32 *dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0; i < size.height; ++i)
{
const u8 * src0 = internal::getRowPtr(src0Base, src0Stride, i);
const u8 * src1 = internal::getRowPtr(src1Base, src1Stride, i);
f32 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
for (; j < roiw32; j += 32)
{
internal::prefetch(src0 + j);
internal::prefetch(src1 + j);
uint8x16_t v_src00 = vld1q_u8(src0 + j), v_src01 = vld1q_u8(src0 + j + 16);
uint8x16_t v_src10 = vld1q_u8(src1 + j), v_src11 = vld1q_u8(src1 + j + 16);
int16x8_t vsl = vreinterpretq_s16_u16(vsubl_u8( vget_low_u8(v_src00), vget_low_u8(v_src10)));
int16x8_t vsh = vreinterpretq_s16_u16(vsubl_u8(vget_high_u8(v_src00), vget_high_u8(v_src10)));
vst1q_f32(dst + j + 0, vcvtq_f32_s32(vmovl_s16( vget_low_s16(vsl) )));
vst1q_f32(dst + j + 4, vcvtq_f32_s32(vmovl_s16( vget_high_s16(vsl) )));
vst1q_f32(dst + j + 8, vcvtq_f32_s32(vmovl_s16( vget_low_s16(vsh) )));
vst1q_f32(dst + j + 12, vcvtq_f32_s32(vmovl_s16( vget_high_s16(vsh) )));
vsl = vreinterpretq_s16_u16(vsubl_u8( vget_low_u8(v_src01), vget_low_u8(v_src11)));
vsh = vreinterpretq_s16_u16(vsubl_u8(vget_high_u8(v_src01), vget_high_u8(v_src11)));
vst1q_f32(dst + j + 16, vcvtq_f32_s32(vmovl_s16( vget_low_s16(vsl) )));
vst1q_f32(dst + j + 20, vcvtq_f32_s32(vmovl_s16( vget_high_s16(vsl) )));
vst1q_f32(dst + j + 24, vcvtq_f32_s32(vmovl_s16( vget_low_s16(vsh) )));
vst1q_f32(dst + j + 28, vcvtq_f32_s32(vmovl_s16( vget_high_s16(vsh) )));
}
for (; j < roiw8; j += 8)
{
uint8x8_t v_src0 = vld1_u8(src0 + j);
uint8x8_t v_src1 = vld1_u8(src1 + j);
int16x8_t vs = vreinterpretq_s16_u16(vsubl_u8(v_src0, v_src1));
vst1q_f32(dst + j + 0, vcvtq_f32_s32(vmovl_s16( vget_low_s16(vs) )));
vst1q_f32(dst + j + 4, vcvtq_f32_s32(vmovl_s16( vget_high_s16(vs) )));
}
for(; j < size.width; j++)
dst[j] = (f32)src0[j] - (f32)src1[j];
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
#endif
}
void sub(const Size2D &size,
const u8 * src0Base, ptrdiff_t src0Stride,
const s16 * src1Base, ptrdiff_t src1Stride,
s16 *dstBase, ptrdiff_t dstStride,
CONVERT_POLICY policy)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0; i < size.height; ++i)
{
const u8 * src0 = internal::getRowPtr(src0Base, src0Stride, i);
const s16 * src1 = internal::getRowPtr(src1Base, src1Stride, i);
s16 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
if (policy == CONVERT_POLICY_SATURATE)
{
for (; j < roiw16; j += 16)
{
internal::prefetch(src0 + j);
internal::prefetch(src1 + j);
uint8x16_t v_src0 = vld1q_u8(src0 + j);
int16x8_t v_src00 = vreinterpretq_s16_u16(vmovl_u8(vget_low_u8(v_src0)));
int16x8_t v_src01 = vreinterpretq_s16_u16(vmovl_u8(vget_high_u8(v_src0)));
int16x8_t v_src10 = vld1q_s16(src1 + j), v_src11 = vld1q_s16(src1 + j + 8);
int16x8_t v_dst0 = vqsubq_s16(v_src00, v_src10);
int16x8_t v_dst1 = vqsubq_s16(v_src01, v_src11);
vst1q_s16(dst + j, v_dst0);
vst1q_s16(dst + j + 8, v_dst1);
}
for (; j < roiw8; j += 8)
{
int16x8_t v_src0 = vreinterpretq_s16_u16(vmovl_u8(vld1_u8(src0 + j)));
int16x8_t v_src1 = vld1q_s16(src1 + j);
int16x8_t v_dst = vqsubq_s16(v_src0, v_src1);
vst1q_s16(dst + j, v_dst);
}
for (; j < size.width; j++)
dst[j] = internal::saturate_cast<s16>((s32)src0[j] - (s32)src1[j]);
}
else
{
for (; j < roiw16; j += 16)
{
internal::prefetch(src0 + j);
internal::prefetch(src1 + j);
uint8x16_t v_src0 = vld1q_u8(src0 + j);
int16x8_t v_src00 = vreinterpretq_s16_u16(vmovl_u8(vget_low_u8(v_src0)));
int16x8_t v_src01 = vreinterpretq_s16_u16(vmovl_u8(vget_high_u8(v_src0)));
int16x8_t v_src10 = vld1q_s16(src1 + j), v_src11 = vld1q_s16(src1 + j + 8);
int16x8_t v_dst0 = vsubq_s16(v_src00, v_src10);
int16x8_t v_dst1 = vsubq_s16(v_src01, v_src11);
vst1q_s16(dst + j, v_dst0);
vst1q_s16(dst + j + 8, v_dst1);
}
for (; j < roiw8; j += 8)
{
int16x8_t v_src0 = vreinterpretq_s16_u16(vmovl_u8(vld1_u8(src0 + j)));
int16x8_t v_src1 = vld1q_s16(src1 + j);
int16x8_t v_dst = vsubq_s16(v_src0, v_src1);
vst1q_s16(dst + j, v_dst);
}
for (; j < size.width; j++)
dst[j] = (s16)((s32)src0[j] - (s32)src1[j]);
}
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
(void)policy;
#endif
}
void sub(const Size2D &size,
const s16 * src0Base, ptrdiff_t src0Stride,
const u8 * src1Base, ptrdiff_t src1Stride,
s16 *dstBase, ptrdiff_t dstStride,
CONVERT_POLICY policy)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
for (size_t i = 0; i < size.height; ++i)
{
const s16 * src0 = internal::getRowPtr(src0Base, src0Stride, i);
const u8 * src1 = internal::getRowPtr(src1Base, src1Stride, i);
s16 * dst = internal::getRowPtr(dstBase, dstStride, i);
size_t j = 0;
if (policy == CONVERT_POLICY_SATURATE)
{
for (; j < roiw16; j += 16)
{
internal::prefetch(src0 + j);
internal::prefetch(src1 + j);
int16x8_t v_src00 = vld1q_s16(src0 + j), v_src01 = vld1q_s16(src0 + j + 8);
uint8x16_t v_src1 = vld1q_u8(src1 + j);
int16x8_t v_src10 = vreinterpretq_s16_u16(vmovl_u8(vget_low_u8(v_src1)));
int16x8_t v_src11 = vreinterpretq_s16_u16(vmovl_u8(vget_high_u8(v_src1)));
int16x8_t v_dst0 = vqsubq_s16(v_src00, v_src10);
int16x8_t v_dst1 = vqsubq_s16(v_src01, v_src11);
vst1q_s16(dst + j, v_dst0);
vst1q_s16(dst + j + 8, v_dst1);
}
for (; j < roiw8; j += 8)
{
int16x8_t v_src0 = vld1q_s16(src0 + j);
int16x8_t v_src1 = vreinterpretq_s16_u16(vmovl_u8(vld1_u8(src1 + j)));
int16x8_t v_dst = vqsubq_s16(v_src0, v_src1);
vst1q_s16(dst + j, v_dst);
}
for (; j < size.width; j++)
dst[j] = internal::saturate_cast<s16>((s32)src0[j] - (s32)src1[j]);
}
else
{
for (; j < roiw16; j += 16)
{
internal::prefetch(src0 + j);
internal::prefetch(src1 + j);
int16x8_t v_src00 = vld1q_s16(src0 + j), v_src01 = vld1q_s16(src0 + j + 8);
uint8x16_t v_src1 = vld1q_u8(src1 + j);
int16x8_t v_src10 = vreinterpretq_s16_u16(vmovl_u8(vget_low_u8(v_src1)));
int16x8_t v_src11 = vreinterpretq_s16_u16(vmovl_u8(vget_high_u8(v_src1)));
int16x8_t v_dst0 = vsubq_s16(v_src00, v_src10);
int16x8_t v_dst1 = vsubq_s16(v_src01, v_src11);
vst1q_s16(dst + j, v_dst0);
vst1q_s16(dst + j + 8, v_dst1);
}
for (; j < roiw8; j += 8)
{
int16x8_t v_src0 = vld1q_s16(src0 + j);
int16x8_t v_src1 = vreinterpretq_s16_u16(vmovl_u8(vld1_u8(src1 + j)));
int16x8_t v_dst = vsubq_s16(v_src0, v_src1);
vst1q_s16(dst + j, v_dst);
}
for (; j < size.width; j++)
dst[j] = (s16)((s32)src0[j] - (s32)src1[j]);
}
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
(void)policy;
#endif
}
void sub(const Size2D &size,
const s8 * src0Base, ptrdiff_t src0Stride,
const s8 * src1Base, ptrdiff_t src1Stride,
s8 *dstBase, ptrdiff_t dstStride,
CONVERT_POLICY policy)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
if (policy == CONVERT_POLICY_SATURATE)
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
SubSaturate<s8, s16>());
}
else
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
SubWrap<s8, s16>());
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
(void)policy;
#endif
}
void sub(const Size2D &size,
const s16 * src0Base, ptrdiff_t src0Stride,
const s16 * src1Base, ptrdiff_t src1Stride,
s16 *dstBase, ptrdiff_t dstStride,
CONVERT_POLICY policy)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
if (policy == CONVERT_POLICY_SATURATE)
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
SubSaturate<s16, s32>());
}
else
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
SubWrap<s16, s32>());
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
(void)policy;
#endif
}
void sub(const Size2D &size,
const u16 * src0Base, ptrdiff_t src0Stride,
const u16 * src1Base, ptrdiff_t src1Stride,
u16 *dstBase, ptrdiff_t dstStride,
CONVERT_POLICY policy)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
if (policy == CONVERT_POLICY_SATURATE)
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
SubSaturate<u16, s32>());
}
else
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
SubWrap<u16, s32>());
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
(void)policy;
#endif
}
void sub(const Size2D &size,
const s32 * src0Base, ptrdiff_t src0Stride,
const s32 * src1Base, ptrdiff_t src1Stride,
s32 *dstBase, ptrdiff_t dstStride,
CONVERT_POLICY policy)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
if (policy == CONVERT_POLICY_SATURATE)
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
SubSaturate<s32, s64>());
}
else
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
SubWrap<s32, s64>());
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
(void)policy;
#endif
}
void sub(const Size2D &size,
const u32 * src0Base, ptrdiff_t src0Stride,
const u32 * src1Base, ptrdiff_t src1Stride,
u32 *dstBase, ptrdiff_t dstStride,
CONVERT_POLICY policy)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
if (policy == CONVERT_POLICY_SATURATE)
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
SubSaturate<u32, s64>());
}
else
{
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
SubWrap<u32, s64>());
}
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
(void)policy;
#endif
}
void sub(const Size2D &size,
const f32 * src0Base, ptrdiff_t src0Stride,
const f32 * src1Base, ptrdiff_t src1Stride,
f32 *dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
internal::vtransform(size,
src0Base, src0Stride,
src1Base, src1Stride,
dstBase, dstStride,
SubWrap<f32, f32>());
#else
(void)size;
(void)src0Base;
(void)src0Stride;
(void)src1Base;
(void)src1Stride;
(void)dstBase;
(void)dstStride;
#endif
}
} // namespace CAROTENE_NS

385
3rdparty/carotene/src/sum.cpp vendored Normal file
View File

@ -0,0 +1,385 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2012-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
bool isSumSupported(u32 channels)
{
return (channels && channels < 5);
}
void sum(const Size2D &_size,
const u8 * srcBase, ptrdiff_t srcStride,
u32 * sumdst, u32 channels)
{
internal::assertSupportedConfiguration(isSumSupported(channels));
#ifdef CAROTENE_NEON
Size2D size(_size);
if (srcStride == (ptrdiff_t)(size.width))
{
size.width *= size.height;
size.height = 1;
}
const ptrdiff_t width = size.width * channels;
for(size_t k = 0; k < size.height; ++k)
{
const u8* src = internal::getRowPtr( srcBase, srcStride, k);
ptrdiff_t i = 0;
if (channels == 3)
{
uint32x4_t vs1231 = vdupq_n_u32(0);
uint32x4_t vs3123 = vdupq_n_u32(0);
uint32x4_t vs2312 = vdupq_n_u32(0);
for (; i <= width - 257*8*3; i += 257*8*3, src += 257*8*3)
{
uint16x8_t s1 = vmovl_u8(vld1_u8(src + 0));
uint16x8_t s2 = vmovl_u8(vld1_u8(src + 8));
uint16x8_t s3 = vmovl_u8(vld1_u8(src + 16));
for (ptrdiff_t j = 8*3; j < 257*8*3; j+= 8*3)
{
internal::prefetch(src + j + 24);
s1 = vaddw_u8(s1, vld1_u8(src + j + 0));
s2 = vaddw_u8(s2, vld1_u8(src + j + 8));
s3 = vaddw_u8(s3, vld1_u8(src + j + 16));
}
vs1231 = vqaddq_u32(vs1231, vaddl_u16(vget_low_u16(s1), vget_high_u16(s2)));
vs3123 = vqaddq_u32(vs3123, vaddl_u16(vget_low_u16(s2), vget_high_u16(s3)));
vs2312 = vqaddq_u32(vs2312, vaddl_u16(vget_low_u16(s3), vget_high_u16(s1)));
}
if (i <= width - 8*3)
{
uint16x8_t s1 = vmovl_u8(vld1_u8(src + 0));
uint16x8_t s2 = vmovl_u8(vld1_u8(src + 8));
uint16x8_t s3 = vmovl_u8(vld1_u8(src + 16));
for (i += 8*3, src += 8*3; i <= width - 8*3; i += 8*3, src += 8*3)
{
internal::prefetch(src + 24);
s1 = vaddw_u8(s1, vld1_u8(src + 0));
s2 = vaddw_u8(s2, vld1_u8(src + 8));
s3 = vaddw_u8(s3, vld1_u8(src + 16));
}
vs1231 = vqaddq_u32(vs1231, vaddl_u16(vget_low_u16(s1), vget_high_u16(s2)));
vs3123 = vqaddq_u32(vs3123, vaddl_u16(vget_low_u16(s2), vget_high_u16(s3)));
vs2312 = vqaddq_u32(vs2312, vaddl_u16(vget_low_u16(s3), vget_high_u16(s1)));
}
u32 sum[12];
vst1q_u32(sum+0, vs1231);
vst1q_u32(sum+4, vs2312);
vst1q_u32(sum+8, vs3123);
for (; i < width; i += 3, src += 3)
{
sumdst[0] += src[0];
sumdst[1] += src[1];
sumdst[2] += src[2];
}
sumdst[0] += sum[0] + sum[3] + sum[6] + sum[9];
sumdst[1] += sum[1] + sum[4] + sum[7] + sum[10];
sumdst[2] += sum[2] + sum[5] + sum[8] + sum[11];
}
else
{
uint32x4_t vs = vdupq_n_u32(0);
for (; i <= width - 257*8; i += 257*8, src += 257 * 8)
{
uint16x8_t s1 = vmovl_u8(vld1_u8(src));
for (int j = 8; j < 257 * 8; j += 8)
{
internal::prefetch(src + j);
s1 = vaddw_u8(s1, vld1_u8(src + j));
}
vs = vqaddq_u32(vs, vaddl_u16(vget_low_u16(s1), vget_high_u16(s1)));
}
if (i < width - 7)
{
uint16x8_t s1 = vmovl_u8(vld1_u8(src));
for(i+=8,src+=8; i < width-7; i+=8,src+=8)
{
internal::prefetch(src);
s1 = vaddw_u8(s1, vld1_u8(src));
}
vs = vqaddq_u32(vs, vaddl_u16(vget_low_u16(s1), vget_high_u16(s1)));
}
if (channels == 1)
{
uint32x2_t vs2 = vqadd_u32(vget_low_u32(vs), vget_high_u32(vs));
uint32x2_t vs1 = vreinterpret_u32_u64(vpaddl_u32(vs2));
u32 s0 = vget_lane_u32(vs1, 0);
for(; i < width; ++i,++src)
s0 += src[0];
sumdst[0] += s0;
}
else if (channels == 4)
{
vst1q_u32(sumdst, vqaddq_u32(vs, vld1q_u32(sumdst)));
for(; i < width; i+=4,src+=4)
{
sumdst[0] += src[0];
sumdst[1] += src[1];
sumdst[2] += src[2];
sumdst[3] += src[3];
}
}
else//if (channels == 2)
{
uint32x2_t vs2 = vqadd_u32(vget_low_u32(vs), vget_high_u32(vs));
vst1_u32(sumdst, vqadd_u32(vs2, vld1_u32(sumdst)));
for(; i < width; i+=2,src+=2)
{
sumdst[0] += src[0];
sumdst[1] += src[1];
}
}
}//channels != 3
}
#else
(void)_size;
(void)srcBase;
(void)srcStride;
(void)sumdst;
(void)channels;
#endif
}
void sum(const Size2D &_size,
const f32 * srcBase, ptrdiff_t srcStride,
f64 * sumdst, u32 channels)
{
internal::assertSupportedConfiguration(isSumSupported(channels));
#ifdef CAROTENE_NEON
Size2D size(_size);
if (srcStride == (ptrdiff_t)(size.width))
{
size.width *= size.height;
size.height = 1;
}
const ptrdiff_t width = size.width * channels;
for(size_t k = 0; k < size.height; ++k)
{
const f32* src = internal::getRowPtr( srcBase, srcStride, k);
ptrdiff_t i = 0;
if (channels == 3)
{
float32x4_t vs1231 = vdupq_n_f32(0);
float32x4_t vs2312 = vdupq_n_f32(0);
float32x4_t vs3123 = vdupq_n_f32(0);
for(; i <= width-12; i += 12)
{
internal::prefetch(src + i + 12);
vs1231 = vaddq_f32(vs1231, vld1q_f32(src + i + 0));
vs2312 = vaddq_f32(vs2312, vld1q_f32(src + i + 4));
vs3123 = vaddq_f32(vs3123, vld1q_f32(src + i + 8));
}
f32 s[12];
vst1q_f32(s + 0, vs1231);
vst1q_f32(s + 4, vs2312);
vst1q_f32(s + 8, vs3123);
sumdst[0] += s[0] + s[3] + s[6] + s[9];
sumdst[1] += s[1] + s[4] + s[7] + s[10];
sumdst[2] += s[2] + s[5] + s[8] + s[11];
for( ; i < width; i+=3)
{
sumdst[0] += src[i];
sumdst[1] += src[i+1];
sumdst[2] += src[i+2];
}
}
else
{
float32x4_t vs = vdupq_n_f32(0);
for(; i <= width-4; i += 4)
{
internal::prefetch(src + i);
vs = vaddq_f32(vs, vld1q_f32(src+i));
}
if (channels == 1)
{
float32x2_t vs2 = vpadd_f32(vget_low_f32(vs), vget_high_f32(vs));
f32 s[2];
vst1_f32(s, vs2);
sumdst[0] += s[0] + s[1];
for( ; i < width; i++)
sumdst[0] += src[i];
}
else if (channels == 4)
{
f32 s[4];
vst1q_f32(s, vs);
sumdst[0] += s[0];
sumdst[1] += s[1];
sumdst[2] += s[2];
sumdst[3] += s[3];
}
else//if (channels == 2)
{
float32x2_t vs2 = vadd_f32(vget_low_f32(vs), vget_high_f32(vs));
f32 s[2];
vst1_f32(s, vs2);
sumdst[0] += s[0];
sumdst[1] += s[1];
if(i < width)
{
sumdst[0] += src[i];
sumdst[1] += src[i+1];
}
}
}//channels != 3
}
#else
(void)_size;
(void)srcBase;
(void)srcStride;
(void)sumdst;
(void)channels;
#endif
}
bool isSqsumSupported(u32 channels)
{
return (channels && ((4/channels)*channels == 4));
}
void sqsum(const Size2D &_size,
const u8 * srcBase, ptrdiff_t srcStride,
f64 * sumdst, f64 * sqsumdst, u32 channels)
{
internal::assertSupportedConfiguration(isSqsumSupported(channels));
#ifdef CAROTENE_NEON
Size2D size(_size);
if (srcStride == (ptrdiff_t)(size.width*channels))
{
size.width *= size.height;
size.height = 1;
}
const size_t width = size.width * channels;
size_t blockSize0 = 1 << 23;
size_t roiw8 = width & ~7;
uint32x4_t v_zero = vdupq_n_u32(0u);
for (size_t i = 0; i < size.height; ++i)
{
const u8 * src = internal::getRowPtr(srcBase, srcStride, i);
size_t j = 0u;
while (j < roiw8)
{
size_t blockSize = std::min(roiw8 - j, blockSize0) + j;
uint32x4_t v_sum = v_zero;
uint32x4_t v_sqsum = v_zero;
for ( ; j < blockSize ; j += 8, src += 8)
{
internal::prefetch(src);
uint8x8_t v_src0 = vld1_u8(src);
uint16x8_t v_src = vmovl_u8(v_src0);
uint16x4_t v_srclo = vget_low_u16(v_src), v_srchi = vget_high_u16(v_src);
v_sum = vaddq_u32(v_sum, vaddl_u16(v_srclo, v_srchi));
v_sqsum = vmlal_u16(v_sqsum, v_srclo, v_srclo);
v_sqsum = vmlal_u16(v_sqsum, v_srchi, v_srchi);
}
u32 arsum[8];
vst1q_u32(arsum, v_sum);
vst1q_u32(arsum + 4, v_sqsum);
sumdst[0] += (f64)arsum[0];
sumdst[1 % channels] += (f64)arsum[1];
sumdst[2 % channels] += (f64)arsum[2];
sumdst[3 % channels] += (f64)arsum[3];
sqsumdst[0] += (f64)arsum[4];
sqsumdst[1 % channels] += (f64)arsum[5];
sqsumdst[2 % channels] += (f64)arsum[6];
sqsumdst[3 % channels] += (f64)arsum[7];
}
// collect a few last elements in the current row
// it's ok to process channels elements per step
// since we could handle 1,2 or 4 channels
// we always have channels-fold amount of elements remaining
for ( ; j < width; j+=channels, src+=channels)
{
for (u32 kk = 0; kk < channels; kk++)
{
u32 srcval = src[kk];
sumdst[kk] += srcval;
sqsumdst[kk] += srcval * srcval;
}
}
}
#else
(void)_size;
(void)srcBase;
(void)srcStride;
(void)sumdst;
(void)sqsumdst;
(void)channels;
#endif
}
} // namespace CAROTENE_NS

View File

@ -0,0 +1,241 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2013-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "common.hpp"
#include <vector>
#include <cstring>
namespace CAROTENE_NS {
#define ENABLE4LINESMATCHING false //Disabled since overall time for simultaneous 4 lines matching is greater than
//time for simultaneous 2 lines matching for the same amount of data
bool isMatchTemplateSupported(const Size2D &tmplSize)
{
return isSupportedConfiguration() &&
tmplSize.width >= 8 && // Actually the function could process even shorter templates
// but there will be no NEON optimization in this case
(tmplSize.width * tmplSize.height) <= 256;
}
void matchTemplate(const Size2D &srcSize,
const u8 * srcBase, ptrdiff_t srcStride,
const Size2D &tmplSize,
const u8 * tmplBase, ptrdiff_t tmplStride,
f32 * dstBase, ptrdiff_t dstStride,
bool normalize)
{
internal::assertSupportedConfiguration(isMatchTemplateSupported(tmplSize));
#ifdef CAROTENE_NEON
const size_t tmplW = tmplSize.width;
const size_t tmplH = tmplSize.height;
const size_t dstW = srcSize.width - tmplSize.width + 1;
const size_t dstH = srcSize.height - tmplSize.height + 1;
//template correlation part
{
#if ENABLE4LINESMATCHING
const size_t dstroiw4 = dstW & ~3u;
#endif
const size_t dstroiw2 = dstW & ~1u;
const size_t tmplroiw = tmplW & ~7u;
const size_t dstride = dstStride >> 2;
f32 *corr = dstBase;
const u8 *imgrrow = srcBase;
for(size_t r = 0; r < dstH; ++r, corr+=dstride, imgrrow+=srcStride)
{
size_t c = 0;
#if ENABLE4LINESMATCHING
for(; c < dstroiw4; c+=4)
{
u32 dot[4] = {0, 0, 0, 0};
uint32x4_t vdot0 = vmovq_n_u32(0);
uint32x4_t vdot1 = vmovq_n_u32(0);
uint32x4_t vdot2 = vmovq_n_u32(0);
uint32x4_t vdot3 = vmovq_n_u32(0);
const u8 *img = imgrrow;
const u8 *tmpl = tmplBase;
for(size_t i = 0; i < tmplH; ++i, tmpl+=tmplStride, img+=srcStride)
{
size_t j = 0;
for(; j < tmplroiw; j+=8)
{
uint8x8_t vtmpl = vld1_u8(tmpl + j);
uint8x8_t vimg0 = vld1_u8(img + j + c + 0);
uint8x8_t vimg1 = vld1_u8(img + j + c + 1);
uint8x8_t vimg2 = vld1_u8(img + j + c + 2);
uint8x8_t vimg3 = vld1_u8(img + j + c + 3);
uint16x8_t vd0 = vmull_u8(vtmpl, vimg0);
uint16x8_t vd1 = vmull_u8(vtmpl, vimg1);
uint16x8_t vd2 = vmull_u8(vtmpl, vimg2);
uint16x8_t vd3 = vmull_u8(vtmpl, vimg3);
vdot0 = vpadalq_u16(vdot0, vd0);
vdot1 = vpadalq_u16(vdot1, vd1);
vdot2 = vpadalq_u16(vdot2, vd2);
vdot3 = vpadalq_u16(vdot3, vd3);
}
for(; j < tmplW; ++j)
{
dot[0] += tmpl[j] * img[j + c + 0];
dot[1] += tmpl[j] * img[j + c + 1];
dot[2] += tmpl[j] * img[j + c + 2];
dot[3] += tmpl[j] * img[j + c + 3];
}
}
uint32x4_t vdotx = vld1q_u32(dot);
uint32x2_t vdot_0 = vpadd_u32(vget_low_u32(vdot0), vget_high_u32(vdot0));
uint32x2_t vdot_1 = vpadd_u32(vget_low_u32(vdot1), vget_high_u32(vdot1));
uint32x2_t vdot_2 = vpadd_u32(vget_low_u32(vdot2), vget_high_u32(vdot2));
uint32x2_t vdot_3 = vpadd_u32(vget_low_u32(vdot3), vget_high_u32(vdot3));
uint32x2_t vdot_01 = vpadd_u32(vdot_0, vdot_1);
uint32x2_t vdot_23 = vpadd_u32(vdot_2, vdot_3);
vst1q_f32(corr + c, vcvtq_f32_u32(vaddq_u32(vdotx, vcombine_u32(vdot_01, vdot_23))));
}
#endif
for(; c < dstroiw2; c+=2)
{
u32 dot[2] = {0, 0};
uint32x4_t vdot0 = vmovq_n_u32(0);
uint32x4_t vdot1 = vmovq_n_u32(0);
const u8 *img = imgrrow;
const u8 *tmpl = tmplBase;
for(size_t i = 0; i < tmplH; ++i, tmpl+=tmplStride, img+=srcStride)
{
size_t j = 0;
for(; j < tmplroiw; j+=8)
{
uint8x8_t vtmpl = vld1_u8(tmpl + j);
uint8x8_t vimg0 = vld1_u8(img + j + c + 0);
uint8x8_t vimg1 = vld1_u8(img + j + c + 1);
uint16x8_t vd0 = vmull_u8(vtmpl, vimg0);
uint16x8_t vd1 = vmull_u8(vtmpl, vimg1);
vdot0 = vpadalq_u16(vdot0, vd0);
vdot1 = vpadalq_u16(vdot1, vd1);
}
for(; j < tmplW; ++j)
{
dot[0] += tmpl[j] * img[j + c + 0];
dot[1] += tmpl[j] * img[j + c + 1];
}
}
uint32x2_t vdotx = vld1_u32(dot);
uint32x2_t vdot_0 = vpadd_u32(vget_low_u32(vdot0), vget_high_u32(vdot0));
uint32x2_t vdot_1 = vpadd_u32(vget_low_u32(vdot1), vget_high_u32(vdot1));
uint32x2_t vdot_ = vpadd_u32(vdot_0, vdot_1);
vst1_f32(corr + c, vcvt_f32_u32(vadd_u32(vdotx, vdot_)));
}
for(; c < dstW; ++c)
{
u32 dot = 0;
uint32x4_t vdot = vmovq_n_u32(0);
const u8 *img = imgrrow;
const u8 *tmpl = tmplBase;
for(size_t i = 0; i < tmplH; ++i, tmpl+=tmplStride, img+=srcStride)
{
size_t j = 0;
for(; j < tmplroiw; j+=8)
{
uint8x8_t vtmpl = vld1_u8(tmpl + j);
uint8x8_t vimg = vld1_u8(img + j + c);
uint16x8_t vd = vmull_u8(vtmpl, vimg);
vdot = vpadalq_u16(vdot, vd);
}
for(; j < tmplW; ++j)
dot += tmpl[j] * img[j + c];
}
u32 wdot[2];
vst1_u32(wdot, vpadd_u32(vget_low_u32(vdot), vget_high_u32(vdot)));
dot += wdot[0] + wdot[1];
corr[c] = (f32)dot;
}
}
}
if(normalize)
{
f32 tn = std::sqrt((f32)normL2(tmplSize, tmplBase, tmplStride));
size_t iw = srcSize.width+1;
size_t ih = srcSize.height+1;
std::vector<f64> _sqsum(iw*ih);
f64 *sqsum = &_sqsum[0];
memset(sqsum, 0, iw*sizeof(f64));
for(size_t i = 1; i < ih; ++i)
sqsum[iw*i] = 0.;
sqrIntegral(srcSize, srcBase, srcStride, sqsum + iw + 1, iw*sizeof(f64));
for(size_t i = 0; i < dstH; ++i)
{
f32 *result = internal::getRowPtr(dstBase, dstStride, i);
for(size_t j = 0; j < dstW; ++j)
{
double s2 = sqsum[iw*i + j] +
sqsum[iw*(i + tmplSize.height) + j + tmplSize.width] -
sqsum[iw*(i + tmplSize.height) + j] -
sqsum[iw*i + j + tmplSize.width];
result[j] /= tn * std::sqrt(s2);
}
}
}
#else
(void)srcSize;
(void)srcBase;
(void)srcStride;
(void)tmplBase;
(void)tmplStride;
(void)dstBase;
(void)dstStride;
(void)normalize;
#endif
}
} // namespace CAROTENE_NS

1627
3rdparty/carotene/src/threshold.cpp vendored Normal file

File diff suppressed because it is too large Load Diff

689
3rdparty/carotene/src/vtransform.hpp vendored Normal file
View File

@ -0,0 +1,689 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2014-2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#ifndef CAROTENE_SRC_VTRANSFORM_HPP
#define CAROTENE_SRC_VTRANSFORM_HPP
#include "common.hpp"
#include <carotene/types.hpp>
#ifdef CAROTENE_NEON
namespace CAROTENE_NS { namespace internal {
////////////////////////////// Type Traits ///////////////////////
template <typename T, int cn = 1>
struct VecTraits;
template <> struct VecTraits< u8, 1> { typedef uint8x16_t vec128; typedef uint8x8_t vec64; typedef VecTraits< u8, 1> unsign; };
template <> struct VecTraits< s8, 1> { typedef int8x16_t vec128; typedef int8x8_t vec64; typedef VecTraits< u8, 1> unsign; };
template <> struct VecTraits<u16, 1> { typedef uint16x8_t vec128; typedef uint16x4_t vec64; typedef VecTraits< u16, 1> unsign; };
template <> struct VecTraits<s16, 1> { typedef int16x8_t vec128; typedef int16x4_t vec64; typedef VecTraits< u16, 1> unsign; };
template <> struct VecTraits<s32, 1> { typedef int32x4_t vec128; typedef int32x2_t vec64; typedef VecTraits< u32, 1> unsign; };
template <> struct VecTraits<u32, 1> { typedef uint32x4_t vec128; typedef uint32x2_t vec64; typedef VecTraits< u32, 1> unsign; };
template <> struct VecTraits<s64, 1> { typedef int64x2_t vec128; typedef int64x1_t vec64; typedef VecTraits< u64, 1> unsign; };
template <> struct VecTraits<u64, 1> { typedef uint64x2_t vec128; typedef uint64x1_t vec64; typedef VecTraits< u64, 1> unsign; };
template <> struct VecTraits<f32, 1> { typedef float32x4_t vec128; typedef float32x2_t vec64; typedef VecTraits< u32, 1> unsign; };
template <> struct VecTraits< u8, 2> { typedef uint8x16x2_t vec128; typedef uint8x8x2_t vec64; typedef VecTraits< u8, 2> unsign; };
template <> struct VecTraits< s8, 2> { typedef int8x16x2_t vec128; typedef int8x8x2_t vec64; typedef VecTraits< u8, 2> unsign; };
template <> struct VecTraits<u16, 2> { typedef uint16x8x2_t vec128; typedef uint16x4x2_t vec64; typedef VecTraits< u16, 2> unsign; };
template <> struct VecTraits<s16, 2> { typedef int16x8x2_t vec128; typedef int16x4x2_t vec64; typedef VecTraits< u16, 2> unsign; };
template <> struct VecTraits<s32, 2> { typedef int32x4x2_t vec128; typedef int32x2x2_t vec64; typedef VecTraits< u32, 2> unsign; };
template <> struct VecTraits<u32, 2> { typedef uint32x4x2_t vec128; typedef uint32x2x2_t vec64; typedef VecTraits< u32, 2> unsign; };
template <> struct VecTraits<s64, 2> { typedef int64x2x2_t vec128; typedef int64x1x2_t vec64; typedef VecTraits< u64, 2> unsign; };
template <> struct VecTraits<u64, 2> { typedef uint64x2x2_t vec128; typedef uint64x1x2_t vec64; typedef VecTraits< u64, 2> unsign; };
template <> struct VecTraits<f32, 2> { typedef float32x4x2_t vec128; typedef float32x2x2_t vec64; typedef VecTraits< u32, 2> unsign; };
template <> struct VecTraits< u8, 3> { typedef uint8x16x3_t vec128; typedef uint8x8x3_t vec64; typedef VecTraits< u8, 3> unsign; };
template <> struct VecTraits< s8, 3> { typedef int8x16x3_t vec128; typedef int8x8x3_t vec64; typedef VecTraits< u8, 3> unsign; };
template <> struct VecTraits<u16, 3> { typedef uint16x8x3_t vec128; typedef uint16x4x3_t vec64; typedef VecTraits< u16, 3> unsign; };
template <> struct VecTraits<s16, 3> { typedef int16x8x3_t vec128; typedef int16x4x3_t vec64; typedef VecTraits< u16, 3> unsign; };
template <> struct VecTraits<s32, 3> { typedef int32x4x3_t vec128; typedef int32x2x3_t vec64; typedef VecTraits< u32, 3> unsign; };
template <> struct VecTraits<u32, 3> { typedef uint32x4x3_t vec128; typedef uint32x2x3_t vec64; typedef VecTraits< u32, 3> unsign; };
template <> struct VecTraits<s64, 3> { typedef int64x2x3_t vec128; typedef int64x1x3_t vec64; typedef VecTraits< u64, 2> unsign; };
template <> struct VecTraits<u64, 3> { typedef uint64x2x3_t vec128; typedef uint64x1x3_t vec64; typedef VecTraits< u64, 2> unsign; };
template <> struct VecTraits<f32, 3> { typedef float32x4x3_t vec128; typedef float32x2x3_t vec64; typedef VecTraits< u32, 3> unsign; };
template <> struct VecTraits< u8, 4> { typedef uint8x16x4_t vec128; typedef uint8x8x4_t vec64; typedef VecTraits< u8, 3> unsign; };
template <> struct VecTraits< s8, 4> { typedef int8x16x4_t vec128; typedef int8x8x4_t vec64; typedef VecTraits< u8, 3> unsign; };
template <> struct VecTraits<u16, 4> { typedef uint16x8x4_t vec128; typedef uint16x4x4_t vec64; typedef VecTraits< u16, 3> unsign; };
template <> struct VecTraits<s16, 4> { typedef int16x8x4_t vec128; typedef int16x4x4_t vec64; typedef VecTraits< u16, 3> unsign; };
template <> struct VecTraits<s32, 4> { typedef int32x4x4_t vec128; typedef int32x2x4_t vec64; typedef VecTraits< u32, 3> unsign; };
template <> struct VecTraits<u32, 4> { typedef uint32x4x4_t vec128; typedef uint32x2x4_t vec64; typedef VecTraits< u32, 3> unsign; };
template <> struct VecTraits<s64, 4> { typedef int64x2x4_t vec128; typedef int64x1x4_t vec64; typedef VecTraits< u64, 2> unsign; };
template <> struct VecTraits<u64, 4> { typedef uint64x2x4_t vec128; typedef uint64x1x4_t vec64; typedef VecTraits< u64, 2> unsign; };
template <> struct VecTraits<f32, 4> { typedef float32x4x4_t vec128; typedef float32x2x4_t vec64; typedef VecTraits< u32, 3> unsign; };
////////////////////////////// vld1q ///////////////////////
inline uint8x16_t vld1q(const u8 * ptr) { return vld1q_u8(ptr); }
inline int8x16_t vld1q(const s8 * ptr) { return vld1q_s8(ptr); }
inline uint16x8_t vld1q(const u16 * ptr) { return vld1q_u16(ptr); }
inline int16x8_t vld1q(const s16 * ptr) { return vld1q_s16(ptr); }
inline uint32x4_t vld1q(const u32 * ptr) { return vld1q_u32(ptr); }
inline int32x4_t vld1q(const s32 * ptr) { return vld1q_s32(ptr); }
inline float32x4_t vld1q(const f32 * ptr) { return vld1q_f32(ptr); }
////////////////////////////// vld1 ///////////////////////
inline uint8x8_t vld1(const u8 * ptr) { return vld1_u8(ptr); }
inline int8x8_t vld1(const s8 * ptr) { return vld1_s8(ptr); }
inline uint16x4_t vld1(const u16 * ptr) { return vld1_u16(ptr); }
inline int16x4_t vld1(const s16 * ptr) { return vld1_s16(ptr); }
inline uint32x2_t vld1(const u32 * ptr) { return vld1_u32(ptr); }
inline int32x2_t vld1(const s32 * ptr) { return vld1_s32(ptr); }
inline float32x2_t vld1(const f32 * ptr) { return vld1_f32(ptr); }
////////////////////////////// vld2q ///////////////////////
inline uint8x16x2_t vld2q(const u8 * ptr) { return vld2q_u8(ptr); }
inline int8x16x2_t vld2q(const s8 * ptr) { return vld2q_s8(ptr); }
inline uint16x8x2_t vld2q(const u16 * ptr) { return vld2q_u16(ptr); }
inline int16x8x2_t vld2q(const s16 * ptr) { return vld2q_s16(ptr); }
inline uint32x4x2_t vld2q(const u32 * ptr) { return vld2q_u32(ptr); }
inline int32x4x2_t vld2q(const s32 * ptr) { return vld2q_s32(ptr); }
inline float32x4x2_t vld2q(const f32 * ptr) { return vld2q_f32(ptr); }
////////////////////////////// vld2 ///////////////////////
inline uint8x8x2_t vld2(const u8 * ptr) { return vld2_u8(ptr); }
inline int8x8x2_t vld2(const s8 * ptr) { return vld2_s8(ptr); }
inline uint16x4x2_t vld2(const u16 * ptr) { return vld2_u16(ptr); }
inline int16x4x2_t vld2(const s16 * ptr) { return vld2_s16(ptr); }
inline uint32x2x2_t vld2(const u32 * ptr) { return vld2_u32(ptr); }
inline int32x2x2_t vld2(const s32 * ptr) { return vld2_s32(ptr); }
inline float32x2x2_t vld2(const f32 * ptr) { return vld2_f32(ptr); }
////////////////////////////// vld3q ///////////////////////
inline uint8x16x3_t vld3q(const u8 * ptr) { return vld3q_u8(ptr); }
inline int8x16x3_t vld3q(const s8 * ptr) { return vld3q_s8(ptr); }
inline uint16x8x3_t vld3q(const u16 * ptr) { return vld3q_u16(ptr); }
inline int16x8x3_t vld3q(const s16 * ptr) { return vld3q_s16(ptr); }
inline uint32x4x3_t vld3q(const u32 * ptr) { return vld3q_u32(ptr); }
inline int32x4x3_t vld3q(const s32 * ptr) { return vld3q_s32(ptr); }
inline float32x4x3_t vld3q(const f32 * ptr) { return vld3q_f32(ptr); }
////////////////////////////// vld3 ///////////////////////
inline uint8x8x3_t vld3(const u8 * ptr) { return vld3_u8(ptr); }
inline int8x8x3_t vld3(const s8 * ptr) { return vld3_s8(ptr); }
inline uint16x4x3_t vld3(const u16 * ptr) { return vld3_u16(ptr); }
inline int16x4x3_t vld3(const s16 * ptr) { return vld3_s16(ptr); }
inline uint32x2x3_t vld3(const u32 * ptr) { return vld3_u32(ptr); }
inline int32x2x3_t vld3(const s32 * ptr) { return vld3_s32(ptr); }
inline float32x2x3_t vld3(const f32 * ptr) { return vld3_f32(ptr); }
////////////////////////////// vld4q ///////////////////////
inline uint8x16x4_t vld4q(const u8 * ptr) { return vld4q_u8(ptr); }
inline int8x16x4_t vld4q(const s8 * ptr) { return vld4q_s8(ptr); }
inline uint16x8x4_t vld4q(const u16 * ptr) { return vld4q_u16(ptr); }
inline int16x8x4_t vld4q(const s16 * ptr) { return vld4q_s16(ptr); }
inline uint32x4x4_t vld4q(const u32 * ptr) { return vld4q_u32(ptr); }
inline int32x4x4_t vld4q(const s32 * ptr) { return vld4q_s32(ptr); }
inline float32x4x4_t vld4q(const f32 * ptr) { return vld4q_f32(ptr); }
////////////////////////////// vld4 ///////////////////////
inline uint8x8x4_t vld4(const u8 * ptr) { return vld4_u8(ptr); }
inline int8x8x4_t vld4(const s8 * ptr) { return vld4_s8(ptr); }
inline uint16x4x4_t vld4(const u16 * ptr) { return vld4_u16(ptr); }
inline int16x4x4_t vld4(const s16 * ptr) { return vld4_s16(ptr); }
inline uint32x2x4_t vld4(const u32 * ptr) { return vld4_u32(ptr); }
inline int32x2x4_t vld4(const s32 * ptr) { return vld4_s32(ptr); }
inline float32x2x4_t vld4(const f32 * ptr) { return vld4_f32(ptr); }
////////////////////////////// vst1q ///////////////////////
inline void vst1q(u8 * ptr, const uint8x16_t & v) { return vst1q_u8(ptr, v); }
inline void vst1q(s8 * ptr, const int8x16_t & v) { return vst1q_s8(ptr, v); }
inline void vst1q(u16 * ptr, const uint16x8_t & v) { return vst1q_u16(ptr, v); }
inline void vst1q(s16 * ptr, const int16x8_t & v) { return vst1q_s16(ptr, v); }
inline void vst1q(u32 * ptr, const uint32x4_t & v) { return vst1q_u32(ptr, v); }
inline void vst1q(s32 * ptr, const int32x4_t & v) { return vst1q_s32(ptr, v); }
inline void vst1q(f32 * ptr, const float32x4_t & v) { return vst1q_f32(ptr, v); }
////////////////////////////// vst1 ///////////////////////
inline void vst1(u8 * ptr, const uint8x8_t & v) { return vst1_u8(ptr, v); }
inline void vst1(s8 * ptr, const int8x8_t & v) { return vst1_s8(ptr, v); }
inline void vst1(u16 * ptr, const uint16x4_t & v) { return vst1_u16(ptr, v); }
inline void vst1(s16 * ptr, const int16x4_t & v) { return vst1_s16(ptr, v); }
inline void vst1(u32 * ptr, const uint32x2_t & v) { return vst1_u32(ptr, v); }
inline void vst1(s32 * ptr, const int32x2_t & v) { return vst1_s32(ptr, v); }
inline void vst1(f32 * ptr, const float32x2_t & v) { return vst1_f32(ptr, v); }
////////////////////////////// vst2q ///////////////////////
inline void vst2q(u8 * ptr, const uint8x16x2_t & v) { return vst2q_u8(ptr, v); }
inline void vst2q(s8 * ptr, const int8x16x2_t & v) { return vst2q_s8(ptr, v); }
inline void vst2q(u16 * ptr, const uint16x8x2_t & v) { return vst2q_u16(ptr, v); }
inline void vst2q(s16 * ptr, const int16x8x2_t & v) { return vst2q_s16(ptr, v); }
inline void vst2q(u32 * ptr, const uint32x4x2_t & v) { return vst2q_u32(ptr, v); }
inline void vst2q(s32 * ptr, const int32x4x2_t & v) { return vst2q_s32(ptr, v); }
inline void vst2q(f32 * ptr, const float32x4x2_t & v) { return vst2q_f32(ptr, v); }
////////////////////////////// vst2 ///////////////////////
inline void vst2(u8 * ptr, const uint8x8x2_t & v) { return vst2_u8(ptr, v); }
inline void vst2(s8 * ptr, const int8x8x2_t & v) { return vst2_s8(ptr, v); }
inline void vst2(u16 * ptr, const uint16x4x2_t & v) { return vst2_u16(ptr, v); }
inline void vst2(s16 * ptr, const int16x4x2_t & v) { return vst2_s16(ptr, v); }
inline void vst2(u32 * ptr, const uint32x2x2_t & v) { return vst2_u32(ptr, v); }
inline void vst2(s32 * ptr, const int32x2x2_t & v) { return vst2_s32(ptr, v); }
inline void vst2(f32 * ptr, const float32x2x2_t & v) { return vst2_f32(ptr, v); }
////////////////////////////// vst3q ///////////////////////
inline void vst3q(u8 * ptr, const uint8x16x3_t & v) { return vst3q_u8(ptr, v); }
inline void vst3q(s8 * ptr, const int8x16x3_t & v) { return vst3q_s8(ptr, v); }
inline void vst3q(u16 * ptr, const uint16x8x3_t & v) { return vst3q_u16(ptr, v); }
inline void vst3q(s16 * ptr, const int16x8x3_t & v) { return vst3q_s16(ptr, v); }
inline void vst3q(u32 * ptr, const uint32x4x3_t & v) { return vst3q_u32(ptr, v); }
inline void vst3q(s32 * ptr, const int32x4x3_t & v) { return vst3q_s32(ptr, v); }
inline void vst3q(f32 * ptr, const float32x4x3_t & v) { return vst3q_f32(ptr, v); }
////////////////////////////// vst3 ///////////////////////
inline void vst3(u8 * ptr, const uint8x8x3_t & v) { return vst3_u8(ptr, v); }
inline void vst3(s8 * ptr, const int8x8x3_t & v) { return vst3_s8(ptr, v); }
inline void vst3(u16 * ptr, const uint16x4x3_t & v) { return vst3_u16(ptr, v); }
inline void vst3(s16 * ptr, const int16x4x3_t & v) { return vst3_s16(ptr, v); }
inline void vst3(u32 * ptr, const uint32x2x3_t & v) { return vst3_u32(ptr, v); }
inline void vst3(s32 * ptr, const int32x2x3_t & v) { return vst3_s32(ptr, v); }
inline void vst3(f32 * ptr, const float32x2x3_t & v) { return vst3_f32(ptr, v); }
////////////////////////////// vst4q ///////////////////////
inline void vst4q(u8 * ptr, const uint8x16x4_t & v) { return vst4q_u8(ptr, v); }
inline void vst4q(s8 * ptr, const int8x16x4_t & v) { return vst4q_s8(ptr, v); }
inline void vst4q(u16 * ptr, const uint16x8x4_t & v) { return vst4q_u16(ptr, v); }
inline void vst4q(s16 * ptr, const int16x8x4_t & v) { return vst4q_s16(ptr, v); }
inline void vst4q(u32 * ptr, const uint32x4x4_t & v) { return vst4q_u32(ptr, v); }
inline void vst4q(s32 * ptr, const int32x4x4_t & v) { return vst4q_s32(ptr, v); }
inline void vst4q(f32 * ptr, const float32x4x4_t & v) { return vst4q_f32(ptr, v); }
////////////////////////////// vst4 ///////////////////////
inline void vst4(u8 * ptr, const uint8x8x4_t & v) { return vst4_u8(ptr, v); }
inline void vst4(s8 * ptr, const int8x8x4_t & v) { return vst4_s8(ptr, v); }
inline void vst4(u16 * ptr, const uint16x4x4_t & v) { return vst4_u16(ptr, v); }
inline void vst4(s16 * ptr, const int16x4x4_t & v) { return vst4_s16(ptr, v); }
inline void vst4(u32 * ptr, const uint32x2x4_t & v) { return vst4_u32(ptr, v); }
inline void vst4(s32 * ptr, const int32x2x4_t & v) { return vst4_s32(ptr, v); }
inline void vst4(f32 * ptr, const float32x2x4_t & v) { return vst4_f32(ptr, v); }
////////////////////////////// vabdq ///////////////////////
inline uint8x16_t vabdq(const uint8x16_t & v0, const uint8x16_t & v1) { return vabdq_u8 (v0, v1); }
inline int8x16_t vabdq(const int8x16_t & v0, const int8x16_t & v1) { return vabdq_s8 (v0, v1); }
inline uint16x8_t vabdq(const uint16x8_t & v0, const uint16x8_t & v1) { return vabdq_u16(v0, v1); }
inline int16x8_t vabdq(const int16x8_t & v0, const int16x8_t & v1) { return vabdq_s16(v0, v1); }
inline uint32x4_t vabdq(const uint32x4_t & v0, const uint32x4_t & v1) { return vabdq_u32(v0, v1); }
inline int32x4_t vabdq(const int32x4_t & v0, const int32x4_t & v1) { return vabdq_s32(v0, v1); }
inline float32x4_t vabdq(const float32x4_t & v0, const float32x4_t & v1) { return vabdq_f32(v0, v1); }
////////////////////////////// vabd ///////////////////////
inline uint8x8_t vabd(const uint8x8_t & v0, const uint8x8_t & v1) { return vabd_u8 (v0, v1); }
inline int8x8_t vabd(const int8x8_t & v0, const int8x8_t & v1) { return vabd_s8 (v0, v1); }
inline uint16x4_t vabd(const uint16x4_t & v0, const uint16x4_t & v1) { return vabd_u16(v0, v1); }
inline int16x4_t vabd(const int16x4_t & v0, const int16x4_t & v1) { return vabd_s16(v0, v1); }
inline uint32x2_t vabd(const uint32x2_t & v0, const uint32x2_t & v1) { return vabd_u32(v0, v1); }
inline int32x2_t vabd(const int32x2_t & v0, const int32x2_t & v1) { return vabd_s32(v0, v1); }
inline float32x2_t vabd(const float32x2_t & v0, const float32x2_t & v1) { return vabd_f32(v0, v1); }
////////////////////////////// vminq ///////////////////////
inline uint8x16_t vminq(const uint8x16_t & v0, const uint8x16_t & v1) { return vminq_u8 (v0, v1); }
inline int8x16_t vminq(const int8x16_t & v0, const int8x16_t & v1) { return vminq_s8 (v0, v1); }
inline uint16x8_t vminq(const uint16x8_t & v0, const uint16x8_t & v1) { return vminq_u16(v0, v1); }
inline int16x8_t vminq(const int16x8_t & v0, const int16x8_t & v1) { return vminq_s16(v0, v1); }
inline uint32x4_t vminq(const uint32x4_t & v0, const uint32x4_t & v1) { return vminq_u32(v0, v1); }
inline int32x4_t vminq(const int32x4_t & v0, const int32x4_t & v1) { return vminq_s32(v0, v1); }
inline float32x4_t vminq(const float32x4_t & v0, const float32x4_t & v1) { return vminq_f32(v0, v1); }
////////////////////////////// vmin ///////////////////////
inline uint8x8_t vmin(const uint8x8_t & v0, const uint8x8_t & v1) { return vmin_u8 (v0, v1); }
inline int8x8_t vmin(const int8x8_t & v0, const int8x8_t & v1) { return vmin_s8 (v0, v1); }
inline uint16x4_t vmin(const uint16x4_t & v0, const uint16x4_t & v1) { return vmin_u16(v0, v1); }
inline int16x4_t vmin(const int16x4_t & v0, const int16x4_t & v1) { return vmin_s16(v0, v1); }
inline uint32x2_t vmin(const uint32x2_t & v0, const uint32x2_t & v1) { return vmin_u32(v0, v1); }
inline int32x2_t vmin(const int32x2_t & v0, const int32x2_t & v1) { return vmin_s32(v0, v1); }
inline float32x2_t vmin(const float32x2_t & v0, const float32x2_t & v1) { return vmin_f32(v0, v1); }
////////////////////////////// vmaxq ///////////////////////
inline uint8x16_t vmaxq(const uint8x16_t & v0, const uint8x16_t & v1) { return vmaxq_u8 (v0, v1); }
inline int8x16_t vmaxq(const int8x16_t & v0, const int8x16_t & v1) { return vmaxq_s8 (v0, v1); }
inline uint16x8_t vmaxq(const uint16x8_t & v0, const uint16x8_t & v1) { return vmaxq_u16(v0, v1); }
inline int16x8_t vmaxq(const int16x8_t & v0, const int16x8_t & v1) { return vmaxq_s16(v0, v1); }
inline uint32x4_t vmaxq(const uint32x4_t & v0, const uint32x4_t & v1) { return vmaxq_u32(v0, v1); }
inline int32x4_t vmaxq(const int32x4_t & v0, const int32x4_t & v1) { return vmaxq_s32(v0, v1); }
inline float32x4_t vmaxq(const float32x4_t & v0, const float32x4_t & v1) { return vmaxq_f32(v0, v1); }
////////////////////////////// vmax ///////////////////////
inline uint8x8_t vmax(const uint8x8_t & v0, const uint8x8_t & v1) { return vmax_u8 (v0, v1); }
inline int8x8_t vmax(const int8x8_t & v0, const int8x8_t & v1) { return vmax_s8 (v0, v1); }
inline uint16x4_t vmax(const uint16x4_t & v0, const uint16x4_t & v1) { return vmax_u16(v0, v1); }
inline int16x4_t vmax(const int16x4_t & v0, const int16x4_t & v1) { return vmax_s16(v0, v1); }
inline uint32x2_t vmax(const uint32x2_t & v0, const uint32x2_t & v1) { return vmax_u32(v0, v1); }
inline int32x2_t vmax(const int32x2_t & v0, const int32x2_t & v1) { return vmax_s32(v0, v1); }
inline float32x2_t vmax(const float32x2_t & v0, const float32x2_t & v1) { return vmax_f32(v0, v1); }
////////////////////////////// vdupq_n ///////////////////////
inline uint8x16_t vdupq_n(const u8 & val) { return vdupq_n_u8(val); }
inline int8x16_t vdupq_n(const s8 & val) { return vdupq_n_s8(val); }
inline uint16x8_t vdupq_n(const u16 & val) { return vdupq_n_u16(val); }
inline int16x8_t vdupq_n(const s16 & val) { return vdupq_n_s16(val); }
inline uint32x4_t vdupq_n(const u32 & val) { return vdupq_n_u32(val); }
inline int32x4_t vdupq_n(const s32 & val) { return vdupq_n_s32(val); }
inline uint64x2_t vdupq_n(const u64 & val) { return vdupq_n_u64(val); }
inline int64x2_t vdupq_n(const s64 & val) { return vdupq_n_s64(val); }
inline float32x4_t vdupq_n(const f32 & val) { return vdupq_n_f32(val); }
////////////////////////////// vdup_n ///////////////////////
inline uint8x8_t vdup_n(const u8 & val) { return vdup_n_u8(val); }
inline int8x8_t vdup_n(const s8 & val) { return vdup_n_s8(val); }
inline uint16x4_t vdup_n(const u16 & val) { return vdup_n_u16(val); }
inline int16x4_t vdup_n(const s16 & val) { return vdup_n_s16(val); }
inline uint32x2_t vdup_n(const u32 & val) { return vdup_n_u32(val); }
inline int32x2_t vdup_n(const s32 & val) { return vdup_n_s32(val); }
inline uint64x1_t vdup_n(const u64 & val) { return vdup_n_u64(val); }
inline int64x1_t vdup_n(const s64 & val) { return vdup_n_s64(val); }
inline float32x2_t vdup_n(const f32 & val) { return vdup_n_f32(val); }
////////////////////////////// vget_low ///////////////////////
inline uint8x8_t vget_low(const uint8x16_t & v) { return vget_low_u8 (v); }
inline int8x8_t vget_low(const int8x16_t & v) { return vget_low_s8 (v); }
inline uint16x4_t vget_low(const uint16x8_t & v) { return vget_low_u16(v); }
inline int16x4_t vget_low(const int16x8_t & v) { return vget_low_s16(v); }
inline uint32x2_t vget_low(const uint32x4_t & v) { return vget_low_u32(v); }
inline int32x2_t vget_low(const int32x4_t & v) { return vget_low_s32(v); }
inline float32x2_t vget_low(const float32x4_t & v) { return vget_low_f32(v); }
////////////////////////////// vget_high ///////////////////////
inline uint8x8_t vget_high(const uint8x16_t & v) { return vget_high_u8 (v); }
inline int8x8_t vget_high(const int8x16_t & v) { return vget_high_s8 (v); }
inline uint16x4_t vget_high(const uint16x8_t & v) { return vget_high_u16(v); }
inline int16x4_t vget_high(const int16x8_t & v) { return vget_high_s16(v); }
inline uint32x2_t vget_high(const uint32x4_t & v) { return vget_high_u32(v); }
inline int32x2_t vget_high(const int32x4_t & v) { return vget_high_s32(v); }
inline float32x2_t vget_high(const float32x4_t & v) { return vget_high_f32(v); }
////////////////////////////// vcombine ///////////////////////
inline uint8x16_t vcombine(const uint8x8_t & v0, const uint8x8_t & v1) { return vcombine_u8 (v0, v1); }
inline int8x16_t vcombine(const int8x8_t & v0, const int8x8_t & v1) { return vcombine_s8 (v0, v1); }
inline uint16x8_t vcombine(const uint16x4_t & v0, const uint16x4_t & v1) { return vcombine_u16(v0, v1); }
inline int16x8_t vcombine(const int16x4_t & v0, const int16x4_t & v1) { return vcombine_s16(v0, v1); }
inline uint32x4_t vcombine(const uint32x2_t & v0, const uint32x2_t & v1) { return vcombine_u32(v0, v1); }
inline int32x4_t vcombine(const int32x2_t & v0, const int32x2_t & v1) { return vcombine_s32(v0, v1); }
inline float32x4_t vcombine(const float32x2_t & v0, const float32x2_t & v1) { return vcombine_f32(v0, v1); }
////////////////////////////// vaddq ///////////////////////
inline uint8x16_t vaddq(const uint8x16_t & v0, const uint8x16_t & v1) { return vaddq_u8 (v0, v1); }
inline int8x16_t vaddq(const int8x16_t & v0, const int8x16_t & v1) { return vaddq_s8 (v0, v1); }
inline uint16x8_t vaddq(const uint16x8_t & v0, const uint16x8_t & v1) { return vaddq_u16(v0, v1); }
inline int16x8_t vaddq(const int16x8_t & v0, const int16x8_t & v1) { return vaddq_s16(v0, v1); }
inline uint32x4_t vaddq(const uint32x4_t & v0, const uint32x4_t & v1) { return vaddq_u32(v0, v1); }
inline int32x4_t vaddq(const int32x4_t & v0, const int32x4_t & v1) { return vaddq_s32(v0, v1); }
inline float32x4_t vaddq(const float32x4_t & v0, const float32x4_t & v1) { return vaddq_f32(v0, v1); }
////////////////////////////// vadd ///////////////////////
inline uint8x8_t vadd(const uint8x8_t & v0, const uint8x8_t & v1) { return vadd_u8 (v0, v1); }
inline int8x8_t vadd(const int8x8_t & v0, const int8x8_t & v1) { return vadd_s8 (v0, v1); }
inline uint16x4_t vadd(const uint16x4_t & v0, const uint16x4_t & v1) { return vadd_u16(v0, v1); }
inline int16x4_t vadd(const int16x4_t & v0, const int16x4_t & v1) { return vadd_s16(v0, v1); }
inline uint32x2_t vadd(const uint32x2_t & v0, const uint32x2_t & v1) { return vadd_u32(v0, v1); }
inline int32x2_t vadd(const int32x2_t & v0, const int32x2_t & v1) { return vadd_s32(v0, v1); }
inline float32x2_t vadd(const float32x2_t & v0, const float32x2_t & v1) { return vadd_f32(v0, v1); }
////////////////////////////// vqaddq ///////////////////////
inline uint8x16_t vqaddq(const uint8x16_t & v0, const uint8x16_t & v1) { return vqaddq_u8 (v0, v1); }
inline int8x16_t vqaddq(const int8x16_t & v0, const int8x16_t & v1) { return vqaddq_s8 (v0, v1); }
inline uint16x8_t vqaddq(const uint16x8_t & v0, const uint16x8_t & v1) { return vqaddq_u16(v0, v1); }
inline int16x8_t vqaddq(const int16x8_t & v0, const int16x8_t & v1) { return vqaddq_s16(v0, v1); }
inline uint32x4_t vqaddq(const uint32x4_t & v0, const uint32x4_t & v1) { return vqaddq_u32(v0, v1); }
inline int32x4_t vqaddq(const int32x4_t & v0, const int32x4_t & v1) { return vqaddq_s32(v0, v1); }
////////////////////////////// vqadd ///////////////////////
inline uint8x8_t vqadd(const uint8x8_t & v0, const uint8x8_t & v1) { return vqadd_u8 (v0, v1); }
inline int8x8_t vqadd(const int8x8_t & v0, const int8x8_t & v1) { return vqadd_s8 (v0, v1); }
inline uint16x4_t vqadd(const uint16x4_t & v0, const uint16x4_t & v1) { return vqadd_u16(v0, v1); }
inline int16x4_t vqadd(const int16x4_t & v0, const int16x4_t & v1) { return vqadd_s16(v0, v1); }
inline uint32x2_t vqadd(const uint32x2_t & v0, const uint32x2_t & v1) { return vqadd_u32(v0, v1); }
inline int32x2_t vqadd(const int32x2_t & v0, const int32x2_t & v1) { return vqadd_s32(v0, v1); }
////////////////////////////// vsubq ///////////////////////
inline uint8x16_t vsubq(const uint8x16_t & v0, const uint8x16_t & v1) { return vsubq_u8 (v0, v1); }
inline int8x16_t vsubq(const int8x16_t & v0, const int8x16_t & v1) { return vsubq_s8 (v0, v1); }
inline uint16x8_t vsubq(const uint16x8_t & v0, const uint16x8_t & v1) { return vsubq_u16(v0, v1); }
inline int16x8_t vsubq(const int16x8_t & v0, const int16x8_t & v1) { return vsubq_s16(v0, v1); }
inline uint32x4_t vsubq(const uint32x4_t & v0, const uint32x4_t & v1) { return vsubq_u32(v0, v1); }
inline int32x4_t vsubq(const int32x4_t & v0, const int32x4_t & v1) { return vsubq_s32(v0, v1); }
inline float32x4_t vsubq(const float32x4_t & v0, const float32x4_t & v1) { return vsubq_f32(v0, v1); }
////////////////////////////// vsub ///////////////////////
inline uint8x8_t vsub(const uint8x8_t & v0, const uint8x8_t & v1) { return vsub_u8 (v0, v1); }
inline int8x8_t vsub(const int8x8_t & v0, const int8x8_t & v1) { return vsub_s8 (v0, v1); }
inline uint16x4_t vsub(const uint16x4_t & v0, const uint16x4_t & v1) { return vsub_u16(v0, v1); }
inline int16x4_t vsub(const int16x4_t & v0, const int16x4_t & v1) { return vsub_s16(v0, v1); }
inline uint32x2_t vsub(const uint32x2_t & v0, const uint32x2_t & v1) { return vsub_u32(v0, v1); }
inline int32x2_t vsub(const int32x2_t & v0, const int32x2_t & v1) { return vsub_s32(v0, v1); }
inline float32x2_t vsub(const float32x2_t & v0, const float32x2_t & v1) { return vsub_f32(v0, v1); }
////////////////////////////// vqsubq ///////////////////////
inline uint8x16_t vqsubq(const uint8x16_t & v0, const uint8x16_t & v1) { return vqsubq_u8 (v0, v1); }
inline int8x16_t vqsubq(const int8x16_t & v0, const int8x16_t & v1) { return vqsubq_s8 (v0, v1); }
inline uint16x8_t vqsubq(const uint16x8_t & v0, const uint16x8_t & v1) { return vqsubq_u16(v0, v1); }
inline int16x8_t vqsubq(const int16x8_t & v0, const int16x8_t & v1) { return vqsubq_s16(v0, v1); }
inline uint32x4_t vqsubq(const uint32x4_t & v0, const uint32x4_t & v1) { return vqsubq_u32(v0, v1); }
inline int32x4_t vqsubq(const int32x4_t & v0, const int32x4_t & v1) { return vqsubq_s32(v0, v1); }
inline uint64x2_t vqsubq(const uint64x2_t & v0, const uint64x2_t & v1) { return vqsubq_u64(v0, v1); }
inline int64x2_t vqsubq(const int64x2_t & v0, const int64x2_t & v1) { return vqsubq_s64(v0, v1); }
////////////////////////////// vqsub ///////////////////////
inline uint8x8_t vqsub(const uint8x8_t & v0, const uint8x8_t & v1) { return vqsub_u8 (v0, v1); }
inline int8x8_t vqsub(const int8x8_t & v0, const int8x8_t & v1) { return vqsub_s8 (v0, v1); }
inline uint16x4_t vqsub(const uint16x4_t & v0, const uint16x4_t & v1) { return vqsub_u16(v0, v1); }
inline int16x4_t vqsub(const int16x4_t & v0, const int16x4_t & v1) { return vqsub_s16(v0, v1); }
inline uint32x2_t vqsub(const uint32x2_t & v0, const uint32x2_t & v1) { return vqsub_u32(v0, v1); }
inline int32x2_t vqsub(const int32x2_t & v0, const int32x2_t & v1) { return vqsub_s32(v0, v1); }
inline uint64x1_t vqsub(const uint64x1_t & v0, const uint64x1_t & v1) { return vqsub_u64(v0, v1); }
inline int64x1_t vqsub(const int64x1_t & v0, const int64x1_t & v1) { return vqsub_s64(v0, v1); }
////////////////////////////// vmull ///////////////////////
inline uint16x8_t vmull(const uint8x8_t & v0, const uint8x8_t & v1) { return vmull_u8 (v0, v1); }
inline int16x8_t vmull(const int8x8_t & v0, const int8x8_t & v1) { return vmull_s8 (v0, v1); }
inline uint32x4_t vmull(const uint16x4_t & v0, const uint16x4_t & v1) { return vmull_u16(v0, v1); }
inline int32x4_t vmull(const int16x4_t & v0, const int16x4_t & v1) { return vmull_s16(v0, v1); }
inline uint64x2_t vmull(const uint32x2_t & v0, const uint32x2_t & v1) { return vmull_u32(v0, v1); }
inline int64x2_t vmull(const int32x2_t & v0, const int32x2_t & v1) { return vmull_s32(v0, v1); }
////////////////////////////// vrev64q ///////////////////////
inline uint8x16_t vrev64q(const uint8x16_t & v) { return vrev64q_u8 (v); }
inline int8x16_t vrev64q(const int8x16_t & v) { return vrev64q_s8 (v); }
inline uint16x8_t vrev64q(const uint16x8_t & v) { return vrev64q_u16(v); }
inline int16x8_t vrev64q(const int16x8_t & v) { return vrev64q_s16(v); }
inline uint32x4_t vrev64q(const uint32x4_t & v) { return vrev64q_u32(v); }
inline int32x4_t vrev64q(const int32x4_t & v) { return vrev64q_s32(v); }
inline float32x4_t vrev64q(const float32x4_t & v) { return vrev64q_f32(v); }
////////////////////////////// vrev64 ///////////////////////
inline uint8x8_t vrev64(const uint8x8_t & v) { return vrev64_u8 (v); }
inline int8x8_t vrev64(const int8x8_t & v) { return vrev64_s8 (v); }
inline uint16x4_t vrev64(const uint16x4_t & v) { return vrev64_u16(v); }
inline int16x4_t vrev64(const int16x4_t & v) { return vrev64_s16(v); }
inline uint32x2_t vrev64(const uint32x2_t & v) { return vrev64_u32(v); }
inline int32x2_t vrev64(const int32x2_t & v) { return vrev64_s32(v); }
inline float32x2_t vrev64(const float32x2_t & v) { return vrev64_f32(v); }
////////////////////////////// vceqq ///////////////////////
inline uint8x16_t vceqq(const uint8x16_t & v0, const uint8x16_t & v1) { return vceqq_u8 (v0, v1); }
inline uint8x16_t vceqq(const int8x16_t & v0, const int8x16_t & v1) { return vceqq_s8 (v0, v1); }
inline uint16x8_t vceqq(const uint16x8_t & v0, const uint16x8_t & v1) { return vceqq_u16(v0, v1); }
inline uint16x8_t vceqq(const int16x8_t & v0, const int16x8_t & v1) { return vceqq_s16(v0, v1); }
inline uint32x4_t vceqq(const uint32x4_t & v0, const uint32x4_t & v1) { return vceqq_u32(v0, v1); }
inline uint32x4_t vceqq(const int32x4_t & v0, const int32x4_t & v1) { return vceqq_s32(v0, v1); }
inline uint32x4_t vceqq(const float32x4_t & v0, const float32x4_t & v1) { return vceqq_f32(v0, v1); }
////////////////////////////// vceq ///////////////////////
inline uint8x8_t vceq(const uint8x8_t & v0, const uint8x8_t & v1) { return vceq_u8 (v0, v1); }
inline uint8x8_t vceq(const int8x8_t & v0, const int8x8_t & v1) { return vceq_s8 (v0, v1); }
inline uint16x4_t vceq(const uint16x4_t & v0, const uint16x4_t & v1) { return vceq_u16(v0, v1); }
inline uint16x4_t vceq(const int16x4_t & v0, const int16x4_t & v1) { return vceq_s16(v0, v1); }
inline uint32x2_t vceq(const uint32x2_t & v0, const uint32x2_t & v1) { return vceq_u32(v0, v1); }
inline uint32x2_t vceq(const int32x2_t & v0, const int32x2_t & v1) { return vceq_s32(v0, v1); }
inline uint32x2_t vceq(const float32x2_t & v0, const float32x2_t & v1) { return vceq_f32(v0, v1); }
////////////////////////////// vcgtq ///////////////////////
inline uint8x16_t vcgtq(const uint8x16_t & v0, const uint8x16_t & v1) { return vcgtq_u8 (v0, v1); }
inline uint8x16_t vcgtq(const int8x16_t & v0, const int8x16_t & v1) { return vcgtq_s8 (v0, v1); }
inline uint16x8_t vcgtq(const uint16x8_t & v0, const uint16x8_t & v1) { return vcgtq_u16(v0, v1); }
inline uint16x8_t vcgtq(const int16x8_t & v0, const int16x8_t & v1) { return vcgtq_s16(v0, v1); }
inline uint32x4_t vcgtq(const uint32x4_t & v0, const uint32x4_t & v1) { return vcgtq_u32(v0, v1); }
inline uint32x4_t vcgtq(const int32x4_t & v0, const int32x4_t & v1) { return vcgtq_s32(v0, v1); }
inline uint32x4_t vcgtq(const float32x4_t & v0, const float32x4_t & v1) { return vcgtq_f32(v0, v1); }
////////////////////////////// vcgt ///////////////////////
inline uint8x8_t vcgt(const uint8x8_t & v0, const uint8x8_t & v1) { return vcgt_u8 (v0, v1); }
inline uint8x8_t vcgt(const int8x8_t & v0, const int8x8_t & v1) { return vcgt_s8 (v0, v1); }
inline uint16x4_t vcgt(const uint16x4_t & v0, const uint16x4_t & v1) { return vcgt_u16(v0, v1); }
inline uint16x4_t vcgt(const int16x4_t & v0, const int16x4_t & v1) { return vcgt_s16(v0, v1); }
inline uint32x2_t vcgt(const uint32x2_t & v0, const uint32x2_t & v1) { return vcgt_u32(v0, v1); }
inline uint32x2_t vcgt(const int32x2_t & v0, const int32x2_t & v1) { return vcgt_s32(v0, v1); }
inline uint32x2_t vcgt(const float32x2_t & v0, const float32x2_t & v1) { return vcgt_f32(v0, v1); }
////////////////////////////// vcgeq ///////////////////////
inline uint8x16_t vcgeq(const uint8x16_t & v0, const uint8x16_t & v1) { return vcgeq_u8 (v0, v1); }
inline uint8x16_t vcgeq(const int8x16_t & v0, const int8x16_t & v1) { return vcgeq_s8 (v0, v1); }
inline uint16x8_t vcgeq(const uint16x8_t & v0, const uint16x8_t & v1) { return vcgeq_u16(v0, v1); }
inline uint16x8_t vcgeq(const int16x8_t & v0, const int16x8_t & v1) { return vcgeq_s16(v0, v1); }
inline uint32x4_t vcgeq(const uint32x4_t & v0, const uint32x4_t & v1) { return vcgeq_u32(v0, v1); }
inline uint32x4_t vcgeq(const int32x4_t & v0, const int32x4_t & v1) { return vcgeq_s32(v0, v1); }
inline uint32x4_t vcgeq(const float32x4_t & v0, const float32x4_t & v1) { return vcgeq_f32(v0, v1); }
////////////////////////////// vcge ///////////////////////
inline uint8x8_t vcge(const uint8x8_t & v0, const uint8x8_t & v1) { return vcge_u8 (v0, v1); }
inline uint8x8_t vcge(const int8x8_t & v0, const int8x8_t & v1) { return vcge_s8 (v0, v1); }
inline uint16x4_t vcge(const uint16x4_t & v0, const uint16x4_t & v1) { return vcge_u16(v0, v1); }
inline uint16x4_t vcge(const int16x4_t & v0, const int16x4_t & v1) { return vcge_s16(v0, v1); }
inline uint32x2_t vcge(const uint32x2_t & v0, const uint32x2_t & v1) { return vcge_u32(v0, v1); }
inline uint32x2_t vcge(const int32x2_t & v0, const int32x2_t & v1) { return vcge_s32(v0, v1); }
inline uint32x2_t vcge(const float32x2_t & v0, const float32x2_t & v1) { return vcge_f32(v0, v1); }
////////////////////////////// vandq ///////////////////////
inline uint8x16_t vandq(const uint8x16_t & v0, const uint8x16_t & v1) { return vandq_u8 (v0, v1); }
inline int8x16_t vandq(const int8x16_t & v0, const int8x16_t & v1) { return vandq_s8 (v0, v1); }
inline uint16x8_t vandq(const uint16x8_t & v0, const uint16x8_t & v1) { return vandq_u16(v0, v1); }
inline int16x8_t vandq(const int16x8_t & v0, const int16x8_t & v1) { return vandq_s16(v0, v1); }
inline uint32x4_t vandq(const uint32x4_t & v0, const uint32x4_t & v1) { return vandq_u32(v0, v1); }
inline int32x4_t vandq(const int32x4_t & v0, const int32x4_t & v1) { return vandq_s32(v0, v1); }
////////////////////////////// vand ///////////////////////
inline uint8x8_t vand(const uint8x8_t & v0, const uint8x8_t & v1) { return vand_u8 (v0, v1); }
inline int8x8_t vand(const int8x8_t & v0, const int8x8_t & v1) { return vand_s8 (v0, v1); }
inline uint16x4_t vand(const uint16x4_t & v0, const uint16x4_t & v1) { return vand_u16(v0, v1); }
inline int16x4_t vand(const int16x4_t & v0, const int16x4_t & v1) { return vand_s16(v0, v1); }
inline uint32x2_t vand(const uint32x2_t & v0, const uint32x2_t & v1) { return vand_u32(v0, v1); }
inline int32x2_t vand(const int32x2_t & v0, const int32x2_t & v1) { return vand_s32(v0, v1); }
////////////////////////////// vmovn ///////////////////////
inline uint8x8_t vmovn(const uint16x8_t & v) { return vmovn_u16(v); }
inline int8x8_t vmovn(const int16x8_t & v) { return vmovn_s16(v); }
inline uint16x4_t vmovn(const uint32x4_t & v) { return vmovn_u32(v); }
inline int16x4_t vmovn(const int32x4_t & v) { return vmovn_s32(v); }
inline uint32x2_t vmovn(const uint64x2_t & v) { return vmovn_u64(v); }
inline int32x2_t vmovn(const int64x2_t & v) { return vmovn_s64(v); }
////////////////////////////// vqmovn ///////////////////////
inline uint8x8_t vqmovn(const uint16x8_t & v) { return vqmovn_u16(v); }
inline int8x8_t vqmovn(const int16x8_t & v) { return vqmovn_s16(v); }
inline uint16x4_t vqmovn(const uint32x4_t & v) { return vqmovn_u32(v); }
inline int16x4_t vqmovn(const int32x4_t & v) { return vqmovn_s32(v); }
inline uint32x2_t vqmovn(const uint64x2_t & v) { return vqmovn_u64(v); }
inline int32x2_t vqmovn(const int64x2_t & v) { return vqmovn_s64(v); }
////////////////////////////// vmovl ///////////////////////
inline uint16x8_t vmovl(const uint8x8_t & v) { return vmovl_u8(v); }
inline int16x8_t vmovl(const int8x8_t & v) { return vmovl_s8(v); }
inline uint32x4_t vmovl(const uint16x4_t & v) { return vmovl_u16(v); }
inline int32x4_t vmovl(const int16x4_t & v) { return vmovl_s16(v); }
////////////////////////////// vmvnq ///////////////////////
inline uint8x16_t vmvnq(const uint8x16_t & v) { return vmvnq_u8 (v); }
inline int8x16_t vmvnq(const int8x16_t & v) { return vmvnq_s8 (v); }
inline uint16x8_t vmvnq(const uint16x8_t & v) { return vmvnq_u16(v); }
inline int16x8_t vmvnq(const int16x8_t & v) { return vmvnq_s16(v); }
inline uint32x4_t vmvnq(const uint32x4_t & v) { return vmvnq_u32(v); }
inline int32x4_t vmvnq(const int32x4_t & v) { return vmvnq_s32(v); }
////////////////////////////// vmvn ///////////////////////
inline uint8x8_t vmvn(const uint8x8_t & v) { return vmvn_u8 (v); }
inline int8x8_t vmvn(const int8x8_t & v) { return vmvn_s8 (v); }
inline uint16x4_t vmvn(const uint16x4_t & v) { return vmvn_u16(v); }
inline int16x4_t vmvn(const int16x4_t & v) { return vmvn_s16(v); }
inline uint32x2_t vmvn(const uint32x2_t & v) { return vmvn_u32(v); }
inline int32x2_t vmvn(const int32x2_t & v) { return vmvn_s32(v); }
////////////////////////////// vbicq ///////////////////////
inline uint8x16_t vbicq(const uint8x16_t & v0, const uint8x16_t & v1) { return vbicq_u8 (v0, v1); }
inline int8x16_t vbicq(const int8x16_t & v0, const int8x16_t & v1) { return vbicq_s8 (v0, v1); }
inline uint16x8_t vbicq(const uint16x8_t & v0, const uint16x8_t & v1) { return vbicq_u16(v0, v1); }
inline int16x8_t vbicq(const int16x8_t & v0, const int16x8_t & v1) { return vbicq_s16(v0, v1); }
inline uint32x4_t vbicq(const uint32x4_t & v0, const uint32x4_t & v1) { return vbicq_u32(v0, v1); }
inline int32x4_t vbicq(const int32x4_t & v0, const int32x4_t & v1) { return vbicq_s32(v0, v1); }
inline uint64x2_t vbicq(const uint64x2_t & v0, const uint64x2_t & v1) { return vbicq_u64(v0, v1); }
inline int64x2_t vbicq(const int64x2_t & v0, const int64x2_t & v1) { return vbicq_s64(v0, v1); }
////////////////////////////// vbic ///////////////////////
inline uint8x8_t vbic(const uint8x8_t & v0, const uint8x8_t & v1) { return vbic_u8 (v0, v1); }
inline int8x8_t vbic(const int8x8_t & v0, const int8x8_t & v1) { return vbic_s8 (v0, v1); }
inline uint16x4_t vbic(const uint16x4_t & v0, const uint16x4_t & v1) { return vbic_u16(v0, v1); }
inline int16x4_t vbic(const int16x4_t & v0, const int16x4_t & v1) { return vbic_s16(v0, v1); }
inline uint32x2_t vbic(const uint32x2_t & v0, const uint32x2_t & v1) { return vbic_u32(v0, v1); }
inline int32x2_t vbic(const int32x2_t & v0, const int32x2_t & v1) { return vbic_s32(v0, v1); }
inline uint64x1_t vbic(const uint64x1_t & v0, const uint64x1_t & v1) { return vbic_u64(v0, v1); }
inline int64x1_t vbic(const int64x1_t & v0, const int64x1_t & v1) { return vbic_s64(v0, v1); }
////////////////////////////// vtransform ///////////////////////
template <typename Op>
void vtransform(Size2D size,
const typename Op::type * src0Base, ptrdiff_t src0Stride,
const typename Op::type * src1Base, ptrdiff_t src1Stride,
typename Op::type * dstBase, ptrdiff_t dstStride, const Op & op)
{
typedef typename Op::type type;
typedef typename VecTraits<type>::vec128 vec128;
typedef typename VecTraits<type>::vec64 vec64;
if (src0Stride == src1Stride && src0Stride == dstStride &&
src0Stride == (ptrdiff_t)(size.width * sizeof(type)))
{
size.width *= size.height;
size.height = 1;
}
const size_t step_base = 32 / sizeof(type);
size_t roiw_base = size.width >= (step_base - 1) ? size.width - step_base + 1 : 0;
const size_t step_tail = 8 / sizeof(type);
size_t roiw_tail = size.width >= (step_tail - 1) ? size.width - step_tail + 1 : 0;
for (size_t y = 0; y < size.height; ++y)
{
const type * src0 = internal::getRowPtr(src0Base, src0Stride, y);
const type * src1 = internal::getRowPtr(src1Base, src1Stride, y);
typename Op::type * dst = internal::getRowPtr(dstBase, dstStride, y);
size_t x = 0;
for( ; x < roiw_base; x += step_base )
{
internal::prefetch(src0 + x);
internal::prefetch(src1 + x);
vec128 v_src00 = vld1q(src0 + x), v_src01 = vld1q(src0 + x + 16 / sizeof(type));
vec128 v_src10 = vld1q(src1 + x), v_src11 = vld1q(src1 + x + 16 / sizeof(type));
vec128 v_dst;
op(v_src00, v_src10, v_dst);
vst1q(dst + x, v_dst);
op(v_src01, v_src11, v_dst);
vst1q(dst + x + 16 / sizeof(type), v_dst);
}
for( ; x < roiw_tail; x += step_tail )
{
vec64 v_src0 = vld1(src0 + x);
vec64 v_src1 = vld1(src1 + x);
vec64 v_dst;
op(v_src0, v_src1, v_dst);
vst1(dst + x, v_dst);
}
for (; x < size.width; ++x)
{
op(src0 + x, src1 + x, dst + x);
}
}
}
} }
#endif // CAROTENE_NEON
#endif

434
3rdparty/carotene/src/warp_affine.cpp vendored Normal file
View File

@ -0,0 +1,434 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "remap.hpp"
namespace CAROTENE_NS {
bool isWarpAffineNearestNeighborSupported(const Size2D &ssize)
{
#if SIZE_MAX > UINT32_MAX
return !(ssize.width > 0xffffFFFF || ssize.height > 0xffffFFFF) && // Restrict image size since internal index evaluation
// is performed with u32
isSupportedConfiguration();
#else
(void)ssize;
return isSupportedConfiguration();
#endif
}
bool isWarpAffineLinearSupported(const Size2D &ssize)
{
#if SIZE_MAX > UINT32_MAX
return !(ssize.width > 0xffffFFFF || ssize.height > 0xffffFFFF) && // Restrict image size since internal index evaluation
// is performed with u32
isSupportedConfiguration();
#else
(void)ssize;
return isSupportedConfiguration();
#endif
}
void warpAffineNearestNeighbor(const Size2D &ssize, const Size2D &dsize,
const u8 * srcBase, ptrdiff_t srcStride,
const f32 * m,
u8 * dstBase, ptrdiff_t dstStride,
BORDER_MODE borderMode, u8 borderValue)
{
internal::assertSupportedConfiguration(isWarpAffineNearestNeighborSupported(ssize));
#ifdef CAROTENE_NEON
using namespace internal;
s32 _map[BLOCK_SIZE * BLOCK_SIZE + 16];
s32 * map = alignPtr(_map, 16);
int32x4_t v_width4 = vdupq_n_s32(ssize.width - 1), v_height4 = vdupq_n_s32(ssize.height - 1);
int32x4_t v_step4 = vdupq_n_s32(srcStride);
float32x4_t v_4 = vdupq_n_f32(4.0f);
float32x4_t v_m0 = vdupq_n_f32(m[0]);
float32x4_t v_m1 = vdupq_n_f32(m[1]);
float32x4_t v_m2 = vdupq_n_f32(m[2]);
float32x4_t v_m3 = vdupq_n_f32(m[3]);
float32x4_t v_m4 = vdupq_n_f32(m[4]);
float32x4_t v_m5 = vdupq_n_f32(m[5]);
if (borderMode == BORDER_MODE_REPLICATE)
{
int32x4_t v_zero4 = vdupq_n_s32(0);
for (size_t i = 0; i < dsize.height; i += BLOCK_SIZE)
{
size_t blockHeight = std::min<size_t>(BLOCK_SIZE, dsize.height - i);
for (size_t j = 0; j < dsize.width; j += BLOCK_SIZE)
{
size_t blockWidth = std::min<size_t>(BLOCK_SIZE, dsize.width - j);
// compute table
for (size_t y = 0; y < blockHeight; ++y)
{
s32 * map_row = getRowPtr(&map[0], blockWidth * sizeof(s32), y);
size_t x = 0, y_ = y + i;
f32 indeces[4] = { j + 0.0f, j + 1.0f, j + 2.0f, j + 3.0f };
float32x4_t v_x = vld1q_f32(indeces), v_y = vdupq_n_f32(y_);
float32x4_t v_yx = vmlaq_f32(v_m4, v_m2, v_y), v_yy = vmlaq_f32(v_m5, v_m3, v_y);
for ( ; x + 4 <= blockWidth; x += 4)
{
float32x4_t v_src_xf = vmlaq_f32(v_yx, v_m0, v_x);
float32x4_t v_src_yf = vmlaq_f32(v_yy, v_m1, v_x);
int32x4_t v_src_x = vmaxq_s32(v_zero4, vminq_s32(v_width4, vcvtq_s32_f32(v_src_xf)));
int32x4_t v_src_y = vmaxq_s32(v_zero4, vminq_s32(v_height4, vcvtq_s32_f32(v_src_yf)));
int32x4_t v_src_index = vmlaq_s32(v_src_x, v_src_y, v_step4);
vst1q_s32(map_row + x, v_src_index);
v_x = vaddq_f32(v_x, v_4);
}
f32 yx = m[2] * y_ + m[4], yy = m[3] * y_ + m[5];
for (ptrdiff_t x_ = x + j; x < blockWidth; ++x, ++x_)
{
f32 src_x_f = m[0] * x_ + yx;
f32 src_y_f = m[1] * x_ + yy;
s32 src_x = floorf(src_x_f), src_y = floorf(src_y_f);
src_x = std::max(0, std::min<s32>(ssize.width - 1, src_x));
src_y = std::max(0, std::min<s32>(ssize.height - 1, src_y));
map_row[x] = src_y * srcStride + src_x;
}
}
// make remap
remapNearestNeighborReplicate(Size2D(blockWidth, blockHeight), srcBase, &map[0],
getRowPtr(dstBase, dstStride, i) + j, dstStride);
}
}
}
else if (borderMode == BORDER_MODE_CONSTANT)
{
int32x4_t v_m1_4 = vdupq_n_s32(-1);
float32x4_t v_zero4 = vdupq_n_f32(0.0f);
for (size_t i = 0; i < dsize.height; i += BLOCK_SIZE)
{
size_t blockHeight = std::min<size_t>(BLOCK_SIZE, dsize.height - i);
for (size_t j = 0; j < dsize.width; j += BLOCK_SIZE)
{
size_t blockWidth = std::min<size_t>(BLOCK_SIZE, dsize.width - j);
// compute table
for (size_t y = 0; y < blockHeight; ++y)
{
s32 * map_row = getRowPtr(&map[0], blockWidth * sizeof(s32), y);
size_t x = 0, y_ = y + i;
f32 indeces[4] = { j + 0.0f, j + 1.0f, j + 2.0f, j + 3.0f };
float32x4_t v_x = vld1q_f32(indeces), v_y = vdupq_n_f32(y_);
float32x4_t v_yx = vmlaq_f32(v_m4, v_m2, v_y), v_yy = vmlaq_f32(v_m5, v_m3, v_y);
for ( ; x + 4 <= blockWidth; x += 4)
{
float32x4_t v_src_xf = vmlaq_f32(v_yx, v_m0, v_x);
float32x4_t v_src_yf = vmlaq_f32(v_yy, v_m1, v_x);
int32x4_t v_src_x = vcvtq_s32_f32(v_src_xf);
int32x4_t v_src_y = vcvtq_s32_f32(v_src_yf);
uint32x4_t v_mask = vandq_u32(vandq_u32(vcgeq_f32(v_src_xf, v_zero4), vcleq_s32(v_src_x, v_width4)),
vandq_u32(vcgeq_f32(v_src_yf, v_zero4), vcleq_s32(v_src_y, v_height4)));
int32x4_t v_src_index = vbslq_s32(v_mask, vmlaq_s32(v_src_x, v_src_y, v_step4), v_m1_4);
vst1q_s32(map_row + x, v_src_index);
v_x = vaddq_f32(v_x, v_4);
}
f32 yx = m[2] * y_ + m[4], yy = m[3] * y_ + m[5];
for (ptrdiff_t x_ = x + j; x < blockWidth; ++x, ++x_)
{
f32 src_x_f = m[0] * x_ + yx;
f32 src_y_f = m[1] * x_ + yy;
s32 src_x = floorf(src_x_f), src_y = floorf(src_y_f);
map_row[x] = (src_x >= 0) && (src_x < (s32)ssize.width) &&
(src_y >= 0) && (src_y < (s32)ssize.height) ? src_y * srcStride + src_x : -1;
}
}
// make remap
remapNearestNeighborConst(Size2D(blockWidth, blockHeight), srcBase, &map[0],
getRowPtr(dstBase, dstStride, i) + j, dstStride, borderValue);
}
}
}
#else
(void)ssize;
(void)dsize;
(void)srcBase;
(void)srcStride;
(void)m;
(void)dstBase;
(void)dstStride;
(void)borderMode;
(void)borderValue;
#endif
}
void warpAffineLinear(const Size2D &ssize, const Size2D &dsize,
const u8 * srcBase, ptrdiff_t srcStride,
const f32 * m,
u8 * dstBase, ptrdiff_t dstStride,
BORDER_MODE borderMode, u8 borderValue)
{
internal::assertSupportedConfiguration(isWarpAffineLinearSupported(ssize));
#ifdef CAROTENE_NEON
using namespace internal;
s32 _map[((BLOCK_SIZE * BLOCK_SIZE) << 2) + 16];
f32 _coeffs[((BLOCK_SIZE * BLOCK_SIZE) << 1) + 16];
s32 * map = alignPtr(_map, 16);
f32 * coeffs = alignPtr(_coeffs, 16);
int32x4_t v_width4 = vdupq_n_s32(ssize.width - 1), v_height4 = vdupq_n_s32(ssize.height - 1);
int32x4_t v_step4 = vdupq_n_s32(srcStride), v_1 = vdupq_n_s32(1);
float32x4_t v_zero4f = vdupq_n_f32(0.0f), v_one4f = vdupq_n_f32(1.0f);
float32x4_t v_m0 = vdupq_n_f32(m[0]);
float32x4_t v_m1 = vdupq_n_f32(m[1]);
float32x4_t v_m2 = vdupq_n_f32(m[2]);
float32x4_t v_m3 = vdupq_n_f32(m[3]);
float32x4_t v_m4 = vdupq_n_f32(m[4]);
float32x4_t v_m5 = vdupq_n_f32(m[5]);
if (borderMode == BORDER_MODE_REPLICATE)
{
int32x4_t v_zero4 = vdupq_n_s32(0);
for (size_t i = 0; i < dsize.height; i += BLOCK_SIZE)
{
size_t blockHeight = std::min<size_t>(BLOCK_SIZE, dsize.height - i);
for (size_t j = 0; j < dsize.width; j += BLOCK_SIZE)
{
size_t blockWidth = std::min<size_t>(BLOCK_SIZE, dsize.width - j);
// compute table
for (size_t y = 0; y < blockHeight; ++y)
{
s32 * map_row = getRowPtr(map, blockWidth * sizeof(s32) * 4, y);
f32 * coeff_row = getRowPtr(coeffs, blockWidth * sizeof(f32) * 2, y);
size_t x = 0, y_ = y + i;
f32 indeces[4] = { j + 0.0f, j + 1.0f, j + 2.0f, j + 3.0f };
float32x4_t v_x = vld1q_f32(indeces), v_y = vdupq_n_f32(y_), v_4 = vdupq_n_f32(4.0f);
float32x4_t v_yx = vmlaq_f32(v_m4, v_m2, v_y), v_yy = vmlaq_f32(v_m5, v_m3, v_y);
for ( ; x + 4 <= blockWidth; x += 4)
{
float32x4_t v_src_xf = vmlaq_f32(v_yx, v_m0, v_x);
float32x4_t v_src_yf = vmlaq_f32(v_yy, v_m1, v_x);
int32x4_t v_src_x = vcvtq_s32_f32(v_src_xf);
int32x4_t v_src_y = vcvtq_s32_f32(v_src_yf);
float32x4x2_t v_coeff;
v_coeff.val[0] = vsubq_f32(v_src_xf, vcvtq_f32_s32(v_src_x));
v_coeff.val[1] = vsubq_f32(v_src_yf, vcvtq_f32_s32(v_src_y));
uint32x4_t v_maskx = vcltq_f32(v_coeff.val[0], v_zero4f);
uint32x4_t v_masky = vcltq_f32(v_coeff.val[1], v_zero4f);
v_coeff.val[0] = vbslq_f32(v_maskx, vaddq_f32(v_one4f, v_coeff.val[0]), v_coeff.val[0]);
v_coeff.val[1] = vbslq_f32(v_masky, vaddq_f32(v_one4f, v_coeff.val[1]), v_coeff.val[1]);
v_src_x = vbslq_s32(v_maskx, vsubq_s32(v_src_x, v_1), v_src_x);
v_src_y = vbslq_s32(v_masky, vsubq_s32(v_src_y, v_1), v_src_y);
int32x4_t v_dst0_x = vmaxq_s32(v_zero4, vminq_s32(v_width4, v_src_x));
int32x4_t v_dst0_y = vmaxq_s32(v_zero4, vminq_s32(v_height4, v_src_y));
int32x4_t v_dst1_x = vmaxq_s32(v_zero4, vminq_s32(v_width4, vaddq_s32(v_1, v_src_x)));
int32x4_t v_dst1_y = vmaxq_s32(v_zero4, vminq_s32(v_height4, vaddq_s32(v_1, v_src_y)));
int32x4x4_t v_dst_index;
v_dst_index.val[0] = vmlaq_s32(v_dst0_x, v_dst0_y, v_step4);
v_dst_index.val[1] = vmlaq_s32(v_dst1_x, v_dst0_y, v_step4);
v_dst_index.val[2] = vmlaq_s32(v_dst0_x, v_dst1_y, v_step4);
v_dst_index.val[3] = vmlaq_s32(v_dst1_x, v_dst1_y, v_step4);
vst2q_f32(coeff_row + (x << 1), v_coeff);
vst4q_s32(map_row + (x << 2), v_dst_index);
v_x = vaddq_f32(v_x, v_4);
}
f32 yx = m[2] * y_ + m[4], yy = m[3] * y_ + m[5];
for (ptrdiff_t x_ = x + j; x < blockWidth; ++x, ++x_)
{
f32 src_x_f = m[0] * x_ + yx;
f32 src_y_f = m[1] * x_ + yy;
s32 src0_x = (s32)floorf(src_x_f);
s32 src0_y = (s32)floorf(src_y_f);
coeff_row[(x << 1) + 0] = src_x_f - src0_x;
coeff_row[(x << 1) + 1] = src_y_f - src0_y;
s32 src1_y = std::max(0, std::min<s32>(ssize.height - 1, src0_y + 1));
src0_y = std::max(0, std::min<s32>(ssize.height - 1, src0_y));
s32 src1_x = std::max(0, std::min<s32>(ssize.width - 1, src0_x + 1));
src0_x = std::max(0, std::min<s32>(ssize.width - 1, src0_x));
map_row[(x << 2) + 0] = src0_y * srcStride + src0_x;
map_row[(x << 2) + 1] = src0_y * srcStride + src1_x;
map_row[(x << 2) + 2] = src1_y * srcStride + src0_x;
map_row[(x << 2) + 3] = src1_y * srcStride + src1_x;
}
}
remapLinearReplicate(Size2D(blockWidth, blockHeight),
srcBase, &map[0], &coeffs[0],
getRowPtr(dstBase, dstStride, i) + j, dstStride);
}
}
}
else if (borderMode == BORDER_MODE_CONSTANT)
{
float32x4_t v_zero4 = vdupq_n_f32(0.0f);
int32x4_t v_m1_4 = vdupq_n_s32(-1);
for (size_t i = 0; i < dsize.height; i += BLOCK_SIZE)
{
size_t blockHeight = std::min<size_t>(BLOCK_SIZE, dsize.height - i);
for (size_t j = 0; j < dsize.width; j += BLOCK_SIZE)
{
size_t blockWidth = std::min<size_t>(BLOCK_SIZE, dsize.width - j);
// compute table
for (size_t y = 0; y < blockHeight; ++y)
{
s32 * map_row = getRowPtr(map, blockWidth * sizeof(s32) * 4, y);
f32 * coeff_row = getRowPtr(coeffs, blockWidth * sizeof(f32) * 2, y);
size_t x = 0, y_ = y + i;
f32 indeces[4] = { j + 0.0f, j + 1.0f, j + 2.0f, j + 3.0f };
float32x4_t v_x = vld1q_f32(indeces), v_y = vdupq_n_f32(y_), v_4 = vdupq_n_f32(4.0f);
float32x4_t v_yx = vmlaq_f32(v_m4, v_m2, v_y), v_yy = vmlaq_f32(v_m5, v_m3, v_y);
for ( ; x + 4 <= blockWidth; x += 4)
{
float32x4_t v_src_xf = vmlaq_f32(v_yx, v_m0, v_x);
float32x4_t v_src_yf = vmlaq_f32(v_yy, v_m1, v_x);
int32x4_t v_src_x0 = vcvtq_s32_f32(v_src_xf);
int32x4_t v_src_y0 = vcvtq_s32_f32(v_src_yf);
float32x4x2_t v_coeff;
v_coeff.val[0] = vsubq_f32(v_src_xf, vcvtq_f32_s32(v_src_x0));
v_coeff.val[1] = vsubq_f32(v_src_yf, vcvtq_f32_s32(v_src_y0));
uint32x4_t v_maskx = vcltq_f32(v_coeff.val[0], v_zero4f);
uint32x4_t v_masky = vcltq_f32(v_coeff.val[1], v_zero4f);
v_coeff.val[0] = vbslq_f32(v_maskx, vaddq_f32(v_one4f, v_coeff.val[0]), v_coeff.val[0]);
v_coeff.val[1] = vbslq_f32(v_masky, vaddq_f32(v_one4f, v_coeff.val[1]), v_coeff.val[1]);
v_src_x0 = vbslq_s32(v_maskx, vsubq_s32(v_src_x0, v_1), v_src_x0);
v_src_y0 = vbslq_s32(v_masky, vsubq_s32(v_src_y0, v_1), v_src_y0);
int32x4_t v_src_x1 = vaddq_s32(v_src_x0, v_1);
int32x4_t v_src_y1 = vaddq_s32(v_src_y0, v_1);
int32x4x4_t v_dst_index;
v_dst_index.val[0] = vmlaq_s32(v_src_x0, v_src_y0, v_step4);
v_dst_index.val[1] = vmlaq_s32(v_src_x1, v_src_y0, v_step4);
v_dst_index.val[2] = vmlaq_s32(v_src_x0, v_src_y1, v_step4);
v_dst_index.val[3] = vmlaq_s32(v_src_x1, v_src_y1, v_step4);
uint32x4_t v_mask_x0 = vandq_u32(vcgeq_f32(v_src_xf, v_zero4), vcleq_s32(v_src_x0, v_width4));
uint32x4_t v_mask_x1 = vandq_u32(vcgeq_f32(vaddq_f32(v_src_xf, v_one4f), v_zero4), vcleq_s32(v_src_x1, v_width4));
uint32x4_t v_mask_y0 = vandq_u32(vcgeq_f32(v_src_yf, v_zero4), vcleq_s32(v_src_y0, v_height4));
uint32x4_t v_mask_y1 = vandq_u32(vcgeq_f32(vaddq_f32(v_src_yf, v_one4f), v_zero4), vcleq_s32(v_src_y1, v_height4));
v_dst_index.val[0] = vbslq_s32(vandq_u32(v_mask_x0, v_mask_y0), v_dst_index.val[0], v_m1_4);
v_dst_index.val[1] = vbslq_s32(vandq_u32(v_mask_x1, v_mask_y0), v_dst_index.val[1], v_m1_4);
v_dst_index.val[2] = vbslq_s32(vandq_u32(v_mask_x0, v_mask_y1), v_dst_index.val[2], v_m1_4);
v_dst_index.val[3] = vbslq_s32(vandq_u32(v_mask_x1, v_mask_y1), v_dst_index.val[3], v_m1_4);
vst2q_f32(coeff_row + (x << 1), v_coeff);
vst4q_s32(map_row + (x << 2), v_dst_index);
v_x = vaddq_f32(v_x, v_4);
}
f32 yx = m[2] * y_ + m[4], yy = m[3] * y_ + m[5];
for (ptrdiff_t x_ = x + j; x < blockWidth; ++x, ++x_)
{
f32 src_x_f = m[0] * x_ + yx;
f32 src_y_f = m[1] * x_ + yy;
s32 src0_x = (s32)floorf(src_x_f), src1_x = src0_x + 1;
s32 src0_y = (s32)floorf(src_y_f), src1_y = src0_y + 1;
coeff_row[(x << 1) + 0] = src_x_f - src0_x;
coeff_row[(x << 1) + 1] = src_y_f - src0_y;
map_row[(x << 2) + 0] = (src0_x >= 0) && (src0_x < (s32)ssize.width) &&
(src0_y >= 0) && (src0_y < (s32)ssize.height) ? src0_y * srcStride + src0_x : -1;
map_row[(x << 2) + 1] = (src1_x >= 0) && (src1_x < (s32)ssize.width) &&
(src0_y >= 0) && (src0_y < (s32)ssize.height) ? src0_y * srcStride + src1_x : -1;
map_row[(x << 2) + 2] = (src0_x >= 0) && (src0_x < (s32)ssize.width) &&
(src1_y >= 0) && (src1_y < (s32)ssize.height) ? src1_y * srcStride + src0_x : -1;
map_row[(x << 2) + 3] = (src1_x >= 0) && (src1_x < (s32)ssize.width) &&
(src1_y >= 0) && (src1_y < (s32)ssize.height) ? src1_y * srcStride + src1_x : -1;
}
}
remapLinearConst(Size2D(blockWidth, blockHeight),
srcBase, &map[0], &coeffs[0],
getRowPtr(dstBase, dstStride, i) + j, dstStride, borderValue);
}
}
}
#else
(void)ssize;
(void)dsize;
(void)srcBase;
(void)srcStride;
(void)m;
(void)dstBase;
(void)dstStride;
(void)borderMode;
(void)borderValue;
#endif
}
} // namespace CAROTENE_NS

View File

@ -0,0 +1,464 @@
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3-clause BSD License)
*
* Copyright (C) 2015, NVIDIA Corporation, all rights reserved.
* Third party copyrights are property of their respective owners.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort (including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include "remap.hpp"
namespace CAROTENE_NS {
bool isWarpPerspectiveNearestNeighborSupported(const Size2D &ssize)
{
#if SIZE_MAX > UINT32_MAX
return !(ssize.width > 0xffffFFFF || ssize.height > 0xffffFFFF) && // Restrict image size since internal index evaluation
// is performed with u32
isSupportedConfiguration();
#else
(void)ssize;
return isSupportedConfiguration();
#endif
}
bool isWarpPerspectiveLinearSupported(const Size2D &ssize)
{
#if SIZE_MAX > UINT32_MAX
return !(ssize.width > 0xffffFFFF || ssize.height > 0xffffFFFF) && // Restrict image size since internal index evaluation
// is performed with u32
isSupportedConfiguration();
#else
(void)ssize;
return isSupportedConfiguration();
#endif
}
void warpPerspectiveNearestNeighbor(const Size2D &ssize, const Size2D &dsize,
const u8 * srcBase, ptrdiff_t srcStride,
const f32 * m,
u8 * dstBase, ptrdiff_t dstStride,
BORDER_MODE borderMode, u8 borderValue)
{
internal::assertSupportedConfiguration(isWarpPerspectiveNearestNeighborSupported(ssize));
#ifdef CAROTENE_NEON
using namespace internal;
s32 _map[BLOCK_SIZE * BLOCK_SIZE + 16];
s32 * map = alignPtr(_map, 16);
int32x4_t v_width4 = vdupq_n_s32(ssize.width - 1), v_height4 = vdupq_n_s32(ssize.height - 1);
int32x4_t v_step4 = vdupq_n_s32(srcStride);
float32x4_t v_4 = vdupq_n_f32(4.0f);
float32x4_t v_m0 = vdupq_n_f32(m[0]);
float32x4_t v_m1 = vdupq_n_f32(m[1]);
float32x4_t v_m2 = vdupq_n_f32(m[2]);
float32x4_t v_m3 = vdupq_n_f32(m[3]);
float32x4_t v_m4 = vdupq_n_f32(m[4]);
float32x4_t v_m5 = vdupq_n_f32(m[5]);
float32x4_t v_m6 = vdupq_n_f32(m[6]);
float32x4_t v_m7 = vdupq_n_f32(m[7]);
float32x4_t v_m8 = vdupq_n_f32(m[8]);
if (borderMode == BORDER_MODE_REPLICATE)
{
int32x4_t v_zero4 = vdupq_n_s32(0);
for (size_t i = 0; i < dsize.height; i += BLOCK_SIZE)
{
size_t blockHeight = std::min<size_t>(BLOCK_SIZE, dsize.height - i);
for (size_t j = 0; j < dsize.width; j += BLOCK_SIZE)
{
size_t blockWidth = std::min<size_t>(BLOCK_SIZE, dsize.width - j);
// compute table
for (size_t y = 0; y < blockHeight; ++y)
{
s32 * map_row = getRowPtr(&map[0], blockWidth * sizeof(s32), y);
size_t x = 0, y_ = y + i;
f32 indeces[4] = { j + 0.0f, j + 1.0f, j + 2.0f, j + 3.0f };
float32x4_t v_x = vld1q_f32(indeces), v_y = vdupq_n_f32(y_);
float32x4_t v_yx = vmlaq_f32(v_m6, v_m3, v_y), v_yy = vmlaq_f32(v_m7, v_m4, v_y),
v_yw = vmlaq_f32(v_m8, v_m5, v_y);
for ( ; x + 4 <= blockWidth; x += 4)
{
float32x4_t v_src_xf = vmlaq_f32(v_yx, v_m0, v_x);
float32x4_t v_src_yf = vmlaq_f32(v_yy, v_m1, v_x);
float32x4_t v_wf = vrecpq_f32(vmlaq_f32(v_yw, v_m2, v_x));
v_src_xf = vmulq_f32(v_wf, v_src_xf);
v_src_yf = vmulq_f32(v_wf, v_src_yf);
int32x4_t v_src_x = vmaxq_s32(v_zero4, vminq_s32(v_width4, vcvtq_s32_f32(v_src_xf)));
int32x4_t v_src_y = vmaxq_s32(v_zero4, vminq_s32(v_height4, vcvtq_s32_f32(v_src_yf)));
int32x4_t v_src_index = vmlaq_s32(v_src_x, v_src_y, v_step4);
vst1q_s32(map_row + x, v_src_index);
v_x = vaddq_f32(v_x, v_4);
}
f32 yx = m[3] * y_ + m[6], yy = m[4] * y_ + m[7], yw = m[5] * y_ + m[8];
for (ptrdiff_t x_ = x + j; x < blockWidth; ++x, ++x_)
{
f32 w_f = 1.0f / (m[2] * x_ + yw);
f32 src_x_f = (m[0] * x_ + yx) * w_f;
f32 src_y_f = (m[1] * x_ + yy) * w_f;
s32 src_x = floorf(src_x_f), src_y = floorf(src_y_f);
src_x = std::max(0, std::min<s32>(ssize.width - 1, src_x));
src_y = std::max(0, std::min<s32>(ssize.height - 1, src_y));
map_row[x] = src_y * srcStride + src_x;
}
}
// make remap
remapNearestNeighborReplicate(Size2D(blockWidth, blockHeight), srcBase, &map[0],
getRowPtr(dstBase, dstStride, i) + j, dstStride);
}
}
}
else if (borderMode == BORDER_MODE_CONSTANT)
{
int32x4_t v_m1_4 = vdupq_n_s32(-1);
float32x4_t v_zero4 = vdupq_n_f32(0.0f);
for (size_t i = 0; i < dsize.height; i += BLOCK_SIZE)
{
size_t blockHeight = std::min<size_t>(BLOCK_SIZE, dsize.height - i);
for (size_t j = 0; j < dsize.width; j += BLOCK_SIZE)
{
size_t blockWidth = std::min<size_t>(BLOCK_SIZE, dsize.width - j);
// compute table
for (size_t y = 0; y < blockHeight; ++y)
{
s32 * map_row = getRowPtr(&map[0], blockWidth * sizeof(s32), y);
size_t x = 0, y_ = y + i;
f32 indeces[4] = { j + 0.0f, j + 1.0f, j + 2.0f, j + 3.0f };
float32x4_t v_x = vld1q_f32(indeces), v_y = vdupq_n_f32(y_);
float32x4_t v_yx = vmlaq_f32(v_m6, v_m3, v_y), v_yy = vmlaq_f32(v_m7, v_m4, v_y),
v_yw = vmlaq_f32(v_m8, v_m5, v_y);
for ( ; x + 4 <= blockWidth; x += 4)
{
float32x4_t v_src_xf = vmlaq_f32(v_yx, v_m0, v_x);
float32x4_t v_src_yf = vmlaq_f32(v_yy, v_m1, v_x);
float32x4_t v_wf = vrecpq_f32(vmlaq_f32(v_yw, v_m2, v_x));
v_src_xf = vmulq_f32(v_wf, v_src_xf);
v_src_yf = vmulq_f32(v_wf, v_src_yf);
int32x4_t v_src_x = vcvtq_s32_f32(v_src_xf);
int32x4_t v_src_y = vcvtq_s32_f32(v_src_yf);
uint32x4_t v_mask = vandq_u32(vandq_u32(vcgeq_f32(v_src_xf, v_zero4), vcleq_s32(v_src_x, v_width4)),
vandq_u32(vcgeq_f32(v_src_yf, v_zero4), vcleq_s32(v_src_y, v_height4)));
int32x4_t v_src_index = vbslq_s32(v_mask, vmlaq_s32(v_src_x, v_src_y, v_step4), v_m1_4);
vst1q_s32(map_row + x, v_src_index);
v_x = vaddq_f32(v_x, v_4);
}
f32 yx = m[3] * y_ + m[6], yy = m[4] * y_ + m[7], yw = m[5] * y_ + m[8];
for (ptrdiff_t x_ = x + j; x < blockWidth; ++x, ++x_)
{
f32 w_f = 1.0f / (m[2] * x_ + yw);
f32 src_x_f = (m[0] * x_ + yx) * w_f;
f32 src_y_f = (m[1] * x_ + yy) * w_f;
s32 src_x = floorf(src_x_f), src_y = floorf(src_y_f);
map_row[x] = (src_x >= 0) && (src_x < (s32)ssize.width) &&
(src_y >= 0) && (src_y < (s32)ssize.height) ? src_y * srcStride + src_x : -1;
}
}
// make remap
remapNearestNeighborConst(Size2D(blockWidth, blockHeight), srcBase, &map[0],
getRowPtr(dstBase, dstStride, i) + j, dstStride, borderValue);
}
}
}
#else
(void)ssize;
(void)dsize;
(void)srcBase;
(void)srcStride;
(void)m;
(void)dstBase;
(void)dstStride;
(void)borderMode;
(void)borderValue;
#endif
}
void warpPerspectiveLinear(const Size2D &ssize, const Size2D &dsize,
const u8 * srcBase, ptrdiff_t srcStride,
const f32 * m,
u8 * dstBase, ptrdiff_t dstStride,
BORDER_MODE borderMode, u8 borderValue)
{
internal::assertSupportedConfiguration(isWarpPerspectiveLinearSupported(ssize));
#ifdef CAROTENE_NEON
using namespace internal;
s32 _map[((BLOCK_SIZE * BLOCK_SIZE) << 2) + 16];
f32 _coeffs[((BLOCK_SIZE * BLOCK_SIZE) << 1) + 16];
s32 * map = alignPtr(_map, 16);
f32 * coeffs = alignPtr(_coeffs, 16);
int32x4_t v_width4 = vdupq_n_s32(ssize.width - 1), v_height4 = vdupq_n_s32(ssize.height - 1);
int32x4_t v_step4 = vdupq_n_s32(srcStride), v_1 = vdupq_n_s32(1);
float32x4_t v_zero4f = vdupq_n_f32(0.0f), v_one4f = vdupq_n_f32(1.0f);
float32x4_t v_4 = vdupq_n_f32(4.0f);
float32x4_t v_m0 = vdupq_n_f32(m[0]);
float32x4_t v_m1 = vdupq_n_f32(m[1]);
float32x4_t v_m2 = vdupq_n_f32(m[2]);
float32x4_t v_m3 = vdupq_n_f32(m[3]);
float32x4_t v_m4 = vdupq_n_f32(m[4]);
float32x4_t v_m5 = vdupq_n_f32(m[5]);
float32x4_t v_m6 = vdupq_n_f32(m[6]);
float32x4_t v_m7 = vdupq_n_f32(m[7]);
float32x4_t v_m8 = vdupq_n_f32(m[8]);
if (borderMode == BORDER_MODE_REPLICATE)
{
int32x4_t v_zero4 = vdupq_n_s32(0);
for (size_t i = 0; i < dsize.height; i += BLOCK_SIZE)
{
size_t blockHeight = std::min<size_t>(BLOCK_SIZE, dsize.height - i);
for (size_t j = 0; j < dsize.width; j += BLOCK_SIZE)
{
size_t blockWidth = std::min<size_t>(BLOCK_SIZE, dsize.width - j);
// compute table
for (size_t y = 0; y < blockHeight; ++y)
{
s32 * map_row = getRowPtr(map, blockWidth * sizeof(s32) * 4, y);
f32 * coeff_row = getRowPtr(coeffs, blockWidth * sizeof(f32) * 2, y);
size_t x = 0, y_ = y + i;
f32 indeces[4] = { j + 0.0f, j + 1.0f, j + 2.0f, j + 3.0f };
float32x4_t v_x = vld1q_f32(indeces), v_y = vdupq_n_f32(y_);
float32x4_t v_yx = vmlaq_f32(v_m6, v_m3, v_y), v_yy = vmlaq_f32(v_m7, v_m4, v_y),
v_yw = vmlaq_f32(v_m8, v_m5, v_y);
for ( ; x + 4 <= blockWidth; x += 4)
{
float32x4_t v_src_xf = vmlaq_f32(v_yx, v_m0, v_x);
float32x4_t v_src_yf = vmlaq_f32(v_yy, v_m1, v_x);
float32x4_t v_wf = vrecpq_f32(vmlaq_f32(v_yw, v_m2, v_x));
v_src_xf = vmulq_f32(v_wf, v_src_xf);
v_src_yf = vmulq_f32(v_wf, v_src_yf);
int32x4_t v_src_x = vcvtq_s32_f32(v_src_xf);
int32x4_t v_src_y = vcvtq_s32_f32(v_src_yf);
float32x4x2_t v_coeff;
v_coeff.val[0] = vsubq_f32(v_src_xf, vcvtq_f32_s32(v_src_x));
v_coeff.val[1] = vsubq_f32(v_src_yf, vcvtq_f32_s32(v_src_y));
uint32x4_t v_maskx = vcltq_f32(v_coeff.val[0], v_zero4f);
uint32x4_t v_masky = vcltq_f32(v_coeff.val[1], v_zero4f);
v_coeff.val[0] = vbslq_f32(v_maskx, vaddq_f32(v_one4f, v_coeff.val[0]), v_coeff.val[0]);
v_coeff.val[1] = vbslq_f32(v_masky, vaddq_f32(v_one4f, v_coeff.val[1]), v_coeff.val[1]);
v_src_x = vbslq_s32(v_maskx, vsubq_s32(v_src_x, v_1), v_src_x);
v_src_y = vbslq_s32(v_masky, vsubq_s32(v_src_y, v_1), v_src_y);
int32x4_t v_dst0_x = vmaxq_s32(v_zero4, vminq_s32(v_width4, v_src_x));
int32x4_t v_dst0_y = vmaxq_s32(v_zero4, vminq_s32(v_height4, v_src_y));
int32x4_t v_dst1_x = vmaxq_s32(v_zero4, vminq_s32(v_width4, vaddq_s32(v_1, v_src_x)));
int32x4_t v_dst1_y = vmaxq_s32(v_zero4, vminq_s32(v_height4, vaddq_s32(v_1, v_src_y)));
int32x4x4_t v_dst_index;
v_dst_index.val[0] = vmlaq_s32(v_dst0_x, v_dst0_y, v_step4);
v_dst_index.val[1] = vmlaq_s32(v_dst1_x, v_dst0_y, v_step4);
v_dst_index.val[2] = vmlaq_s32(v_dst0_x, v_dst1_y, v_step4);
v_dst_index.val[3] = vmlaq_s32(v_dst1_x, v_dst1_y, v_step4);
vst2q_f32(coeff_row + (x << 1), v_coeff);
vst4q_s32(map_row + (x << 2), v_dst_index);
v_x = vaddq_f32(v_x, v_4);
}
f32 yx = m[3] * y_ + m[6], yy = m[4] * y_ + m[7], yw = m[5] * y_ + m[8];
for (ptrdiff_t x_ = x + j; x < blockWidth; ++x, ++x_)
{
f32 w_f = 1.0f / (m[2] * x_ + yw);
f32 src_x_f = (m[0] * x_ + yx) * w_f;
f32 src_y_f = (m[1] * x_ + yy) * w_f;
s32 src0_x = (s32)floorf(src_x_f);
s32 src0_y = (s32)floorf(src_y_f);
coeff_row[(x << 1) + 0] = src_x_f - src0_x;
coeff_row[(x << 1) + 1] = src_y_f - src0_y;
s32 src1_y = std::max(0, std::min<s32>(ssize.height - 1, src0_y + 1));
src0_y = std::max(0, std::min<s32>(ssize.height - 1, src0_y));
s32 src1_x = std::max(0, std::min<s32>(ssize.width - 1, src0_x + 1));
src0_x = std::max(0, std::min<s32>(ssize.width - 1, src0_x));
map_row[(x << 2) + 0] = src0_y * srcStride + src0_x;
map_row[(x << 2) + 1] = src0_y * srcStride + src1_x;
map_row[(x << 2) + 2] = src1_y * srcStride + src0_x;
map_row[(x << 2) + 3] = src1_y * srcStride + src1_x;
}
}
remapLinearReplicate(Size2D(blockWidth, blockHeight),
srcBase, &map[0], &coeffs[0],
getRowPtr(dstBase, dstStride, i) + j, dstStride);
}
}
}
else if (borderMode == BORDER_MODE_CONSTANT)
{
float32x4_t v_zero4 = vdupq_n_f32(0.0f);
int32x4_t v_m1_4 = vdupq_n_s32(-1);
for (size_t i = 0; i < dsize.height; i += BLOCK_SIZE)
{
size_t blockHeight = std::min<size_t>(BLOCK_SIZE, dsize.height - i);
for (size_t j = 0; j < dsize.width; j += BLOCK_SIZE)
{
size_t blockWidth = std::min<size_t>(BLOCK_SIZE, dsize.width - j);
// compute table
for (size_t y = 0; y < blockHeight; ++y)
{
s32 * map_row = getRowPtr(map, blockWidth * sizeof(s32) * 4, y);
f32 * coeff_row = getRowPtr(coeffs, blockWidth * sizeof(f32) * 2, y);
size_t x = 0, y_ = y + i;
f32 indeces[4] = { j + 0.0f, j + 1.0f, j + 2.0f, j + 3.0f };
float32x4_t v_x = vld1q_f32(indeces), v_y = vdupq_n_f32(y_);
float32x4_t v_yx = vmlaq_f32(v_m6, v_m3, v_y), v_yy = vmlaq_f32(v_m7, v_m4, v_y),
v_yw = vmlaq_f32(v_m8, v_m5, v_y);
for ( ; x + 4 <= blockWidth; x += 4)
{
float32x4_t v_src_xf = vmlaq_f32(v_yx, v_m0, v_x);
float32x4_t v_src_yf = vmlaq_f32(v_yy, v_m1, v_x);
float32x4_t v_wf = vrecpq_f32(vmlaq_f32(v_yw, v_m2, v_x));
v_src_xf = vmulq_f32(v_wf, v_src_xf);
v_src_yf = vmulq_f32(v_wf, v_src_yf);
int32x4_t v_src_x0 = vcvtq_s32_f32(v_src_xf);
int32x4_t v_src_y0 = vcvtq_s32_f32(v_src_yf);
float32x4x2_t v_coeff;
v_coeff.val[0] = vsubq_f32(v_src_xf, vcvtq_f32_s32(v_src_x0));
v_coeff.val[1] = vsubq_f32(v_src_yf, vcvtq_f32_s32(v_src_y0));
uint32x4_t v_maskx = vcltq_f32(v_coeff.val[0], v_zero4f);
uint32x4_t v_masky = vcltq_f32(v_coeff.val[1], v_zero4f);
v_coeff.val[0] = vbslq_f32(v_maskx, vaddq_f32(v_one4f, v_coeff.val[0]), v_coeff.val[0]);
v_coeff.val[1] = vbslq_f32(v_masky, vaddq_f32(v_one4f, v_coeff.val[1]), v_coeff.val[1]);
v_src_x0 = vbslq_s32(v_maskx, vsubq_s32(v_src_x0, v_1), v_src_x0);
v_src_y0 = vbslq_s32(v_masky, vsubq_s32(v_src_y0, v_1), v_src_y0);
int32x4_t v_src_x1 = vaddq_s32(v_src_x0, v_1);
int32x4_t v_src_y1 = vaddq_s32(v_src_y0, v_1);
int32x4x4_t v_dst_index;
v_dst_index.val[0] = vmlaq_s32(v_src_x0, v_src_y0, v_step4);
v_dst_index.val[1] = vmlaq_s32(v_src_x1, v_src_y0, v_step4);
v_dst_index.val[2] = vmlaq_s32(v_src_x0, v_src_y1, v_step4);
v_dst_index.val[3] = vmlaq_s32(v_src_x1, v_src_y1, v_step4);
uint32x4_t v_mask_x0 = vandq_u32(vcgeq_f32(v_src_xf, v_zero4), vcleq_s32(v_src_x0, v_width4));
uint32x4_t v_mask_x1 = vandq_u32(vcgeq_f32(vaddq_f32(v_src_xf, v_one4f), v_zero4), vcleq_s32(v_src_x1, v_width4));
uint32x4_t v_mask_y0 = vandq_u32(vcgeq_f32(v_src_yf, v_zero4), vcleq_s32(v_src_y0, v_height4));
uint32x4_t v_mask_y1 = vandq_u32(vcgeq_f32(vaddq_f32(v_src_yf, v_one4f), v_zero4), vcleq_s32(v_src_y1, v_height4));
v_dst_index.val[0] = vbslq_s32(vandq_u32(v_mask_x0, v_mask_y0), v_dst_index.val[0], v_m1_4);
v_dst_index.val[1] = vbslq_s32(vandq_u32(v_mask_x1, v_mask_y0), v_dst_index.val[1], v_m1_4);
v_dst_index.val[2] = vbslq_s32(vandq_u32(v_mask_x0, v_mask_y1), v_dst_index.val[2], v_m1_4);
v_dst_index.val[3] = vbslq_s32(vandq_u32(v_mask_x1, v_mask_y1), v_dst_index.val[3], v_m1_4);
vst2q_f32(coeff_row + (x << 1), v_coeff);
vst4q_s32(map_row + (x << 2), v_dst_index);
v_x = vaddq_f32(v_x, v_4);
}
f32 yx = m[3] * y_ + m[6], yy = m[4] * y_ + m[7], yw = m[5] * y_ + m[8];
for (ptrdiff_t x_ = x + j; x < blockWidth; ++x, ++x_)
{
f32 w_f = 1.0f / (m[2] * x_ + yw);
f32 src_x_f = (m[0] * x_ + yx) * w_f;
f32 src_y_f = (m[1] * x_ + yy) * w_f;
s32 src0_x = (s32)floorf(src_x_f), src1_x = src0_x + 1;
s32 src0_y = (s32)floorf(src_y_f), src1_y = src0_y + 1;
coeff_row[(x << 1) + 0] = src_x_f - src0_x;
coeff_row[(x << 1) + 1] = src_y_f - src0_y;
map_row[(x << 2) + 0] = (src0_x >= 0) && (src0_x < (s32)ssize.width) &&
(src0_y >= 0) && (src0_y < (s32)ssize.height) ? src0_y * srcStride + src0_x : -1;
map_row[(x << 2) + 1] = (src1_x >= 0) && (src1_x < (s32)ssize.width) &&
(src0_y >= 0) && (src0_y < (s32)ssize.height) ? src0_y * srcStride + src1_x : -1;
map_row[(x << 2) + 2] = (src0_x >= 0) && (src0_x < (s32)ssize.width) &&
(src1_y >= 0) && (src1_y < (s32)ssize.height) ? src1_y * srcStride + src0_x : -1;
map_row[(x << 2) + 3] = (src1_x >= 0) && (src1_x < (s32)ssize.width) &&
(src1_y >= 0) && (src1_y < (s32)ssize.height) ? src1_y * srcStride + src1_x : -1;
}
}
remapLinearConst(Size2D(blockWidth, blockHeight),
srcBase, &map[0], &coeffs[0],
getRowPtr(dstBase, dstStride, i) + j, dstStride, borderValue);
}
}
}
#else
(void)ssize;
(void)dsize;
(void)srcBase;
(void)srcStride;
(void)m;
(void)dstBase;
(void)dstStride;
(void)borderMode;
(void)borderValue;
#endif
}
} // namespace CAROTENE_NS

3
3rdparty/ffmpeg/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
downloads/
*.dll
ffmpeg_version.cmake

25
3rdparty/ffmpeg/ffmpeg.cmake vendored Normal file
View File

@ -0,0 +1,25 @@
# Binary branch name: ffmpeg/master_20160715
# Binaries were created for OpenCV: 0e6aa189cb9a9642b0ae7983d301693516faad5d
set(FFMPEG_BINARIES_COMMIT "7eef9080d3271c7547d303fa839a62e1124ff1e6")
set(FFMPEG_FILE_HASH_BIN32 "3bb2a8388af90adf6c762210e696400d")
set(FFMPEG_FILE_HASH_BIN64 "ebcfc963f0a94f7e83d58d60eaf23849")
set(FFMPEG_FILE_HASH_CMAKE "f99941d10c1e87bf16b9055e8fc91ab2")
set(FFMPEG_DOWNLOAD_URL ${OPENCV_FFMPEG_URL};$ENV{OPENCV_FFMPEG_URL};https://raw.githubusercontent.com/opencv/opencv_3rdparty/${FFMPEG_BINARIES_COMMIT}/ffmpeg/)
ocv_download(PACKAGE opencv_ffmpeg.dll
HASH ${FFMPEG_FILE_HASH_BIN32}
URL ${FFMPEG_DOWNLOAD_URL}
DESTINATION_DIR ${CMAKE_CURRENT_LIST_DIR})
ocv_download(PACKAGE opencv_ffmpeg_64.dll
HASH ${FFMPEG_FILE_HASH_BIN64}
URL ${FFMPEG_DOWNLOAD_URL}
DESTINATION_DIR ${CMAKE_CURRENT_LIST_DIR})
ocv_download(PACKAGE ffmpeg_version.cmake
HASH ${FFMPEG_FILE_HASH_CMAKE}
URL ${FFMPEG_DOWNLOAD_URL}
DESTINATION_DIR ${CMAKE_CURRENT_LIST_DIR})
include(${CMAKE_CURRENT_LIST_DIR}/ffmpeg_version.cmake)

View File

@ -1,11 +0,0 @@
set(HAVE_FFMPEG 1)
set(HAVE_FFMPEG_CODEC 1)
set(HAVE_FFMPEG_FORMAT 1)
set(HAVE_FFMPEG_UTIL 1)
set(HAVE_FFMPEG_SWSCALE 1)
set(HAVE_GENTOO_FFMPEG 1)
set(ALIASOF_libavcodec_VERSION 55.18.102)
set(ALIASOF_libavformat_VERSION 55.12.100)
set(ALIASOF_libavutil_VERSION 52.38.100)
set(ALIASOF_libswscale_VERSION 2.3.100)

View File

@ -1 +0,0 @@
#include "cap_ffmpeg_impl.hpp"

520
3rdparty/ffmpeg/license.txt vendored Normal file
View File

@ -0,0 +1,520 @@
Copyright (C) 2001 Fabrice Bellard
FFmpeg is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
FFmpeg is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with FFmpeg; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
==================================================================================
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@ -1,2 +0,0 @@
set path=c:\dev\msys32\bin;%path% & gcc -Wall -shared -o opencv_ffmpeg.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat -lavcodec -lavdevice -lswscale -lavutil -lws2_32
set path=c:\dev\msys64\bin;%path% & gcc -m64 -Wall -shared -o opencv_ffmpeg_64.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat64 -lavcodec64 -lavdevice64 -lswscale64 -lavutil64 -lws2_32

Binary file not shown.

Binary file not shown.

View File

@ -1,42 +1,38 @@
The build script is to be fixed.
Right now it assumes that 32-bit MinGW is in the system path and
64-bit mingw is installed to c:\Apps\MinGW64.
* On Linux and other Unix flavors OpenCV uses default or user-built ffmpeg/libav libraries.
If user builds ffmpeg/libav from source and wants OpenCV to stay BSD library, not GPL/LGPL,
he/she should use --enabled-shared configure flag and make sure that no GPL components are
enabled (some notable examples are x264 (H264 encoder) and libac3 (Dolby AC3 audio codec)).
See https://www.ffmpeg.org/legal.html for details.
It is important that gcc is used, not g++!
Otherwise the produced DLL will likely be dependent on libgcc_s_dw2-1.dll or similar DLL.
While we want to make the DLLs with minimum dependencies: Win32 libraries + msvcrt.dll.
If you want to play very safe and do not want to use FFMPEG at all, regardless of whether it's installed on
your system or not, configure and build OpenCV using CMake with WITH_FFMPEG=OFF flag. OpenCV will then use
AVFoundation (OSX), GStreamer (Linux) or other available backends supported by opencv_videoio module.
ffopencv.c is really a C++ source, hence -x c++ is used.
There is also our self-contained motion jpeg codec, which you can use without any worries.
It handles CV_FOURCC('M', 'J', 'P', 'G') streams within an AVI container (".avi").
How to update opencv_ffmpeg.dll and opencv_ffmpeg_64.dll when a new version of FFMPEG is release?
* On Windows OpenCV uses pre-built ffmpeg binaries, built with proper flags (without GPL components) and
wrapped with simple, stable OpenCV-compatible API.
The binaries are opencv_ffmpeg.dll (version for 32-bit Windows) and
opencv_ffmpeg_64.dll (version for 64-bit Windows).
1. Install 32-bit MinGW + MSYS from
http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/
Let's assume, it's installed in C:\MSYS32.
2. Install 64-bit MinGW. http://mingw-w64.sourceforge.net/
Let's assume, it's installed in C:\MSYS64
3. Copy C:\MSYS32\msys to C:\MSYS64\msys. Edit C:\MSYS64\msys\etc\fstab, change C:\MSYS32 to C:\MSYS64.
See build_win32.txt for the build instructions, if you want to rebuild opencv_ffmpeg*.dll from scratch.
4. Now you have working MSYS32 and MSYS64 environments.
Launch, one by one, C:\MSYS32\msys\msys.bat and C:\MSYS64\msys\msys.bat to create your home directories.
The pre-built opencv_ffmpeg*.dll is:
* LGPL library, not BSD libraries.
* Loaded at runtime by opencv_videoio module.
If it succeeds, ffmpeg can be used to decode/encode videos;
otherwise, other API is used.
4. Download ffmpeg-x.y.z.tar.gz (where x.y.z denotes the actual ffmpeg version).
Copy it to C:\MSYS{32|64}\msys\home\<loginname> directory.
FFMPEG build contains H264 encoder based on the OpenH264 library, that should be installed separatelly.
OpenH264 Video Codec provided by Cisco Systems, Inc.
See https://github.com/cisco/openh264/releases for details and OpenH264 license.
Downloaded binary file can be placed into global system path (System32 or SysWOW64) or near application binaries.
You can also specify location of binary file via OPENH264_LIBRARY_PATH environment variable.
5. To build 32-bit ffmpeg libraries, run C:\MSYS32\msys\msys.bat and type the following commands:
If LGPL/GPL software can not be supplied with your OpenCV-based product, simply exclude
opencv_ffmpeg*.dll from your distribution; OpenCV will stay fully functional except for the ability to
decode/encode videos using FFMPEG (though, it may still be able to do that using other API,
such as Video for Windows, Windows Media Foundation or our self-contained motion jpeg codec).
5.1. tar -xzf ffmpeg-x.y.z.tar.gz
5.2. mkdir build
5.3. cd build
5.4. ../ffmpeg-x.y.z/configure --enable-w32threads
5.5. make
5.6. make install
5.7. cd /local/lib
5.8. strip -g *.a
6. Then repeat the same for 64-bit case. The output libs: libavcodec.a etc. need to be renamed to libavcodec64.a etc.
7. Then, copy all those libs to <opencv>\3rdparty\lib\, copy the headers to <opencv>\3rdparty\include\ffmpeg_.
8. Then, go to <opencv>\3rdparty\ffmpeg, edit make.bat
(change paths to the actual paths to your msys32 and msys64 distributions) and then run make.bat
See license.txt for the FFMPEG copyright notice and the licensing terms.

File diff suppressed because it is too large Load Diff

View File

@ -1,116 +0,0 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_AVFFT_H
#define AVCODEC_AVFFT_H
/**
* @file
* @ingroup lavc_fft
* FFT functions
*/
/**
* @defgroup lavc_fft FFT functions
* @ingroup lavc_misc
*
* @{
*/
typedef float FFTSample;
typedef struct FFTComplex {
FFTSample re, im;
} FFTComplex;
typedef struct FFTContext FFTContext;
/**
* Set up a complex FFT.
* @param nbits log2 of the length of the input array
* @param inverse if 0 perform the forward transform, if 1 perform the inverse
*/
FFTContext *av_fft_init(int nbits, int inverse);
/**
* Do the permutation needed BEFORE calling ff_fft_calc().
*/
void av_fft_permute(FFTContext *s, FFTComplex *z);
/**
* Do a complex FFT with the parameters defined in av_fft_init(). The
* input data must be permuted before. No 1.0/sqrt(n) normalization is done.
*/
void av_fft_calc(FFTContext *s, FFTComplex *z);
void av_fft_end(FFTContext *s);
FFTContext *av_mdct_init(int nbits, int inverse, double scale);
void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input);
void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
void av_mdct_end(FFTContext *s);
/* Real Discrete Fourier Transform */
enum RDFTransformType {
DFT_R2C,
IDFT_C2R,
IDFT_R2C,
DFT_C2R,
};
typedef struct RDFTContext RDFTContext;
/**
* Set up a real FFT.
* @param nbits log2 of the length of the input array
* @param trans the type of transform
*/
RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);
void av_rdft_calc(RDFTContext *s, FFTSample *data);
void av_rdft_end(RDFTContext *s);
/* Discrete Cosine Transform */
typedef struct DCTContext DCTContext;
enum DCTTransformType {
DCT_II = 0,
DCT_III,
DCT_I,
DST_I,
};
/**
* Set up DCT.
* @param nbits size of the input array:
* (1 << nbits) for DCT-II, DCT-III and DST-I
* (1 << nbits) + 1 for DCT-I
*
* @note the first element of the input of DST-I is ignored
*/
DCTContext *av_dct_init(int nbits, enum DCTTransformType type);
void av_dct_calc(DCTContext *s, FFTSample *data);
void av_dct_end (DCTContext *s);
/**
* @}
*/
#endif /* AVCODEC_AVFFT_H */

View File

@ -1,95 +0,0 @@
/*
* DXVA2 HW acceleration
*
* copyright (c) 2009 Laurent Aimar
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_DXVA_H
#define AVCODEC_DXVA_H
/**
* @file
* @ingroup lavc_codec_hwaccel_dxva2
* Public libavcodec DXVA2 header.
*/
#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0600
#undef _WIN32_WINNT
#endif
#if !defined(_WIN32_WINNT)
#define _WIN32_WINNT 0x0600
#endif
#include <stdint.h>
#include <d3d9.h>
#include <dxva2api.h>
/**
* @defgroup lavc_codec_hwaccel_dxva2 DXVA2
* @ingroup lavc_codec_hwaccel
*
* @{
*/
#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards
/**
* This structure is used to provides the necessary configurations and data
* to the DXVA2 FFmpeg HWAccel implementation.
*
* The application must make it available as AVCodecContext.hwaccel_context.
*/
struct dxva_context {
/**
* DXVA2 decoder object
*/
IDirectXVideoDecoder *decoder;
/**
* DXVA2 configuration used to create the decoder
*/
const DXVA2_ConfigPictureDecode *cfg;
/**
* The number of surface in the surface array
*/
unsigned surface_count;
/**
* The array of Direct3D surfaces used to create the decoder
*/
LPDIRECT3DSURFACE9 *surface;
/**
* A bit field configuring the workarounds needed for using the decoder
*/
uint64_t workaround;
/**
* Private to the FFmpeg AVHWAccel implementation
*/
unsigned report_id;
};
/**
* @}
*/
#endif /* AVCODEC_DXVA_H */

View File

@ -1,397 +0,0 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_OLD_CODEC_IDS_H
#define AVCODEC_OLD_CODEC_IDS_H
#include "libavutil/common.h"
/*
* This header exists to prevent new codec IDs from being accidentally added to
* the deprecated list.
* Do not include it directly. It will be removed on next major bump
*
* Do not add new items to this list. Use the AVCodecID enum instead.
*/
CODEC_ID_NONE = AV_CODEC_ID_NONE,
/* video codecs */
CODEC_ID_MPEG1VIDEO,
CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
CODEC_ID_MPEG2VIDEO_XVMC,
CODEC_ID_H261,
CODEC_ID_H263,
CODEC_ID_RV10,
CODEC_ID_RV20,
CODEC_ID_MJPEG,
CODEC_ID_MJPEGB,
CODEC_ID_LJPEG,
CODEC_ID_SP5X,
CODEC_ID_JPEGLS,
CODEC_ID_MPEG4,
CODEC_ID_RAWVIDEO,
CODEC_ID_MSMPEG4V1,
CODEC_ID_MSMPEG4V2,
CODEC_ID_MSMPEG4V3,
CODEC_ID_WMV1,
CODEC_ID_WMV2,
CODEC_ID_H263P,
CODEC_ID_H263I,
CODEC_ID_FLV1,
CODEC_ID_SVQ1,
CODEC_ID_SVQ3,
CODEC_ID_DVVIDEO,
CODEC_ID_HUFFYUV,
CODEC_ID_CYUV,
CODEC_ID_H264,
CODEC_ID_INDEO3,
CODEC_ID_VP3,
CODEC_ID_THEORA,
CODEC_ID_ASV1,
CODEC_ID_ASV2,
CODEC_ID_FFV1,
CODEC_ID_4XM,
CODEC_ID_VCR1,
CODEC_ID_CLJR,
CODEC_ID_MDEC,
CODEC_ID_ROQ,
CODEC_ID_INTERPLAY_VIDEO,
CODEC_ID_XAN_WC3,
CODEC_ID_XAN_WC4,
CODEC_ID_RPZA,
CODEC_ID_CINEPAK,
CODEC_ID_WS_VQA,
CODEC_ID_MSRLE,
CODEC_ID_MSVIDEO1,
CODEC_ID_IDCIN,
CODEC_ID_8BPS,
CODEC_ID_SMC,
CODEC_ID_FLIC,
CODEC_ID_TRUEMOTION1,
CODEC_ID_VMDVIDEO,
CODEC_ID_MSZH,
CODEC_ID_ZLIB,
CODEC_ID_QTRLE,
CODEC_ID_TSCC,
CODEC_ID_ULTI,
CODEC_ID_QDRAW,
CODEC_ID_VIXL,
CODEC_ID_QPEG,
CODEC_ID_PNG,
CODEC_ID_PPM,
CODEC_ID_PBM,
CODEC_ID_PGM,
CODEC_ID_PGMYUV,
CODEC_ID_PAM,
CODEC_ID_FFVHUFF,
CODEC_ID_RV30,
CODEC_ID_RV40,
CODEC_ID_VC1,
CODEC_ID_WMV3,
CODEC_ID_LOCO,
CODEC_ID_WNV1,
CODEC_ID_AASC,
CODEC_ID_INDEO2,
CODEC_ID_FRAPS,
CODEC_ID_TRUEMOTION2,
CODEC_ID_BMP,
CODEC_ID_CSCD,
CODEC_ID_MMVIDEO,
CODEC_ID_ZMBV,
CODEC_ID_AVS,
CODEC_ID_SMACKVIDEO,
CODEC_ID_NUV,
CODEC_ID_KMVC,
CODEC_ID_FLASHSV,
CODEC_ID_CAVS,
CODEC_ID_JPEG2000,
CODEC_ID_VMNC,
CODEC_ID_VP5,
CODEC_ID_VP6,
CODEC_ID_VP6F,
CODEC_ID_TARGA,
CODEC_ID_DSICINVIDEO,
CODEC_ID_TIERTEXSEQVIDEO,
CODEC_ID_TIFF,
CODEC_ID_GIF,
CODEC_ID_DXA,
CODEC_ID_DNXHD,
CODEC_ID_THP,
CODEC_ID_SGI,
CODEC_ID_C93,
CODEC_ID_BETHSOFTVID,
CODEC_ID_PTX,
CODEC_ID_TXD,
CODEC_ID_VP6A,
CODEC_ID_AMV,
CODEC_ID_VB,
CODEC_ID_PCX,
CODEC_ID_SUNRAST,
CODEC_ID_INDEO4,
CODEC_ID_INDEO5,
CODEC_ID_MIMIC,
CODEC_ID_RL2,
CODEC_ID_ESCAPE124,
CODEC_ID_DIRAC,
CODEC_ID_BFI,
CODEC_ID_CMV,
CODEC_ID_MOTIONPIXELS,
CODEC_ID_TGV,
CODEC_ID_TGQ,
CODEC_ID_TQI,
CODEC_ID_AURA,
CODEC_ID_AURA2,
CODEC_ID_V210X,
CODEC_ID_TMV,
CODEC_ID_V210,
CODEC_ID_DPX,
CODEC_ID_MAD,
CODEC_ID_FRWU,
CODEC_ID_FLASHSV2,
CODEC_ID_CDGRAPHICS,
CODEC_ID_R210,
CODEC_ID_ANM,
CODEC_ID_BINKVIDEO,
CODEC_ID_IFF_ILBM,
CODEC_ID_IFF_BYTERUN1,
CODEC_ID_KGV1,
CODEC_ID_YOP,
CODEC_ID_VP8,
CODEC_ID_PICTOR,
CODEC_ID_ANSI,
CODEC_ID_A64_MULTI,
CODEC_ID_A64_MULTI5,
CODEC_ID_R10K,
CODEC_ID_MXPEG,
CODEC_ID_LAGARITH,
CODEC_ID_PRORES,
CODEC_ID_JV,
CODEC_ID_DFA,
CODEC_ID_WMV3IMAGE,
CODEC_ID_VC1IMAGE,
CODEC_ID_UTVIDEO,
CODEC_ID_BMV_VIDEO,
CODEC_ID_VBLE,
CODEC_ID_DXTORY,
CODEC_ID_V410,
CODEC_ID_XWD,
CODEC_ID_CDXL,
CODEC_ID_XBM,
CODEC_ID_ZEROCODEC,
CODEC_ID_MSS1,
CODEC_ID_MSA1,
CODEC_ID_TSCC2,
CODEC_ID_MTS2,
CODEC_ID_CLLC,
CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
CODEC_ID_EXR = MKBETAG('0','E','X','R'),
CODEC_ID_AVRP = MKBETAG('A','V','R','P'),
CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'),
CODEC_ID_AVUI = MKBETAG('A','V','U','I'),
CODEC_ID_AYUV = MKBETAG('A','Y','U','V'),
CODEC_ID_V308 = MKBETAG('V','3','0','8'),
CODEC_ID_V408 = MKBETAG('V','4','0','8'),
CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'),
CODEC_ID_SANM = MKBETAG('S','A','N','M'),
CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'),
CODEC_ID_SNOW = AV_CODEC_ID_SNOW,
/* various PCM "codecs" */
CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
CODEC_ID_PCM_S16LE = 0x10000,
CODEC_ID_PCM_S16BE,
CODEC_ID_PCM_U16LE,
CODEC_ID_PCM_U16BE,
CODEC_ID_PCM_S8,
CODEC_ID_PCM_U8,
CODEC_ID_PCM_MULAW,
CODEC_ID_PCM_ALAW,
CODEC_ID_PCM_S32LE,
CODEC_ID_PCM_S32BE,
CODEC_ID_PCM_U32LE,
CODEC_ID_PCM_U32BE,
CODEC_ID_PCM_S24LE,
CODEC_ID_PCM_S24BE,
CODEC_ID_PCM_U24LE,
CODEC_ID_PCM_U24BE,
CODEC_ID_PCM_S24DAUD,
CODEC_ID_PCM_ZORK,
CODEC_ID_PCM_S16LE_PLANAR,
CODEC_ID_PCM_DVD,
CODEC_ID_PCM_F32BE,
CODEC_ID_PCM_F32LE,
CODEC_ID_PCM_F64BE,
CODEC_ID_PCM_F64LE,
CODEC_ID_PCM_BLURAY,
CODEC_ID_PCM_LXF,
CODEC_ID_S302M,
CODEC_ID_PCM_S8_PLANAR,
/* various ADPCM codecs */
CODEC_ID_ADPCM_IMA_QT = 0x11000,
CODEC_ID_ADPCM_IMA_WAV,
CODEC_ID_ADPCM_IMA_DK3,
CODEC_ID_ADPCM_IMA_DK4,
CODEC_ID_ADPCM_IMA_WS,
CODEC_ID_ADPCM_IMA_SMJPEG,
CODEC_ID_ADPCM_MS,
CODEC_ID_ADPCM_4XM,
CODEC_ID_ADPCM_XA,
CODEC_ID_ADPCM_ADX,
CODEC_ID_ADPCM_EA,
CODEC_ID_ADPCM_G726,
CODEC_ID_ADPCM_CT,
CODEC_ID_ADPCM_SWF,
CODEC_ID_ADPCM_YAMAHA,
CODEC_ID_ADPCM_SBPRO_4,
CODEC_ID_ADPCM_SBPRO_3,
CODEC_ID_ADPCM_SBPRO_2,
CODEC_ID_ADPCM_THP,
CODEC_ID_ADPCM_IMA_AMV,
CODEC_ID_ADPCM_EA_R1,
CODEC_ID_ADPCM_EA_R3,
CODEC_ID_ADPCM_EA_R2,
CODEC_ID_ADPCM_IMA_EA_SEAD,
CODEC_ID_ADPCM_IMA_EA_EACS,
CODEC_ID_ADPCM_EA_XAS,
CODEC_ID_ADPCM_EA_MAXIS_XA,
CODEC_ID_ADPCM_IMA_ISS,
CODEC_ID_ADPCM_G722,
CODEC_ID_ADPCM_IMA_APC,
CODEC_ID_VIMA = MKBETAG('V','I','M','A'),
/* AMR */
CODEC_ID_AMR_NB = 0x12000,
CODEC_ID_AMR_WB,
/* RealAudio codecs*/
CODEC_ID_RA_144 = 0x13000,
CODEC_ID_RA_288,
/* various DPCM codecs */
CODEC_ID_ROQ_DPCM = 0x14000,
CODEC_ID_INTERPLAY_DPCM,
CODEC_ID_XAN_DPCM,
CODEC_ID_SOL_DPCM,
/* audio codecs */
CODEC_ID_MP2 = 0x15000,
CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
CODEC_ID_AAC,
CODEC_ID_AC3,
CODEC_ID_DTS,
CODEC_ID_VORBIS,
CODEC_ID_DVAUDIO,
CODEC_ID_WMAV1,
CODEC_ID_WMAV2,
CODEC_ID_MACE3,
CODEC_ID_MACE6,
CODEC_ID_VMDAUDIO,
CODEC_ID_FLAC,
CODEC_ID_MP3ADU,
CODEC_ID_MP3ON4,
CODEC_ID_SHORTEN,
CODEC_ID_ALAC,
CODEC_ID_WESTWOOD_SND1,
CODEC_ID_GSM, ///< as in Berlin toast format
CODEC_ID_QDM2,
CODEC_ID_COOK,
CODEC_ID_TRUESPEECH,
CODEC_ID_TTA,
CODEC_ID_SMACKAUDIO,
CODEC_ID_QCELP,
CODEC_ID_WAVPACK,
CODEC_ID_DSICINAUDIO,
CODEC_ID_IMC,
CODEC_ID_MUSEPACK7,
CODEC_ID_MLP,
CODEC_ID_GSM_MS, /* as found in WAV */
CODEC_ID_ATRAC3,
CODEC_ID_VOXWARE,
CODEC_ID_APE,
CODEC_ID_NELLYMOSER,
CODEC_ID_MUSEPACK8,
CODEC_ID_SPEEX,
CODEC_ID_WMAVOICE,
CODEC_ID_WMAPRO,
CODEC_ID_WMALOSSLESS,
CODEC_ID_ATRAC3P,
CODEC_ID_EAC3,
CODEC_ID_SIPR,
CODEC_ID_MP1,
CODEC_ID_TWINVQ,
CODEC_ID_TRUEHD,
CODEC_ID_MP4ALS,
CODEC_ID_ATRAC1,
CODEC_ID_BINKAUDIO_RDFT,
CODEC_ID_BINKAUDIO_DCT,
CODEC_ID_AAC_LATM,
CODEC_ID_QDMC,
CODEC_ID_CELT,
CODEC_ID_G723_1,
CODEC_ID_G729,
CODEC_ID_8SVX_EXP,
CODEC_ID_8SVX_FIB,
CODEC_ID_BMV_AUDIO,
CODEC_ID_RALF,
CODEC_ID_IAC,
CODEC_ID_ILBC,
CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'),
CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'),
CODEC_ID_OPUS = MKBETAG('O','P','U','S'),
/* subtitle codecs */
CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
CODEC_ID_DVD_SUBTITLE = 0x17000,
CODEC_ID_DVB_SUBTITLE,
CODEC_ID_TEXT, ///< raw UTF-8 text
CODEC_ID_XSUB,
CODEC_ID_SSA,
CODEC_ID_MOV_TEXT,
CODEC_ID_HDMV_PGS_SUBTITLE,
CODEC_ID_DVB_TELETEXT,
CODEC_ID_SRT,
CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'),
CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'),
CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'),
CODEC_ID_SAMI = MKBETAG('S','A','M','I'),
CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'),
CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'),
/* other specific kind of codecs (generally used for attachments) */
CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
CODEC_ID_TTF = 0x18000,
CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'),
CODEC_ID_XBIN = MKBETAG('X','B','I','N'),
CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'),
CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'),
CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
* stream (only used by libavformat) */
CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
* stream (only used by libavformat) */
CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
#endif /* AVCODEC_OLD_CODEC_IDS_H */

View File

@ -1,173 +0,0 @@
/*
* Video Acceleration API (shared data between FFmpeg and the video player)
* HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1
*
* Copyright (C) 2008-2009 Splitted-Desktop Systems
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_VAAPI_H
#define AVCODEC_VAAPI_H
/**
* @file
* @ingroup lavc_codec_hwaccel_vaapi
* Public libavcodec VA API header.
*/
#include <stdint.h>
/**
* @defgroup lavc_codec_hwaccel_vaapi VA API Decoding
* @ingroup lavc_codec_hwaccel
* @{
*/
/**
* This structure is used to share data between the FFmpeg library and
* the client video application.
* This shall be zero-allocated and available as
* AVCodecContext.hwaccel_context. All user members can be set once
* during initialization or through each AVCodecContext.get_buffer()
* function call. In any case, they must be valid prior to calling
* decoding functions.
*/
struct vaapi_context {
/**
* Window system dependent data
*
* - encoding: unused
* - decoding: Set by user
*/
void *display;
/**
* Configuration ID
*
* - encoding: unused
* - decoding: Set by user
*/
uint32_t config_id;
/**
* Context ID (video decode pipeline)
*
* - encoding: unused
* - decoding: Set by user
*/
uint32_t context_id;
/**
* VAPictureParameterBuffer ID
*
* - encoding: unused
* - decoding: Set by libavcodec
*/
uint32_t pic_param_buf_id;
/**
* VAIQMatrixBuffer ID
*
* - encoding: unused
* - decoding: Set by libavcodec
*/
uint32_t iq_matrix_buf_id;
/**
* VABitPlaneBuffer ID (for VC-1 decoding)
*
* - encoding: unused
* - decoding: Set by libavcodec
*/
uint32_t bitplane_buf_id;
/**
* Slice parameter/data buffer IDs
*
* - encoding: unused
* - decoding: Set by libavcodec
*/
uint32_t *slice_buf_ids;
/**
* Number of effective slice buffer IDs to send to the HW
*
* - encoding: unused
* - decoding: Set by libavcodec
*/
unsigned int n_slice_buf_ids;
/**
* Size of pre-allocated slice_buf_ids
*
* - encoding: unused
* - decoding: Set by libavcodec
*/
unsigned int slice_buf_ids_alloc;
/**
* Pointer to VASliceParameterBuffers
*
* - encoding: unused
* - decoding: Set by libavcodec
*/
void *slice_params;
/**
* Size of a VASliceParameterBuffer element
*
* - encoding: unused
* - decoding: Set by libavcodec
*/
unsigned int slice_param_size;
/**
* Size of pre-allocated slice_params
*
* - encoding: unused
* - decoding: Set by libavcodec
*/
unsigned int slice_params_alloc;
/**
* Number of slices currently filled in
*
* - encoding: unused
* - decoding: Set by libavcodec
*/
unsigned int slice_count;
/**
* Pointer to slice data buffer base
* - encoding: unused
* - decoding: Set by libavcodec
*/
const uint8_t *slice_data;
/**
* Current size of slice data
*
* - encoding: unused
* - decoding: Set by libavcodec
*/
uint32_t slice_data_size;
};
/* @} */
#endif /* AVCODEC_VAAPI_H */

View File

@ -1,162 +0,0 @@
/*
* VDA HW acceleration
*
* copyright (c) 2011 Sebastien Zwickert
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_VDA_H
#define AVCODEC_VDA_H
/**
* @file
* @ingroup lavc_codec_hwaccel_vda
* Public libavcodec VDA header.
*/
#include <stdint.h>
// emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
// http://openradar.appspot.com/8026390
#undef __GNUC_STDC_INLINE__
#define Picture QuickdrawPicture
#include <VideoDecodeAcceleration/VDADecoder.h>
#undef Picture
#include "libavcodec/version.h"
/**
* @defgroup lavc_codec_hwaccel_vda VDA
* @ingroup lavc_codec_hwaccel
*
* @{
*/
/**
* This structure is used to provide the necessary configurations and data
* to the VDA FFmpeg HWAccel implementation.
*
* The application must make it available as AVCodecContext.hwaccel_context.
*/
struct vda_context {
/**
* VDA decoder object.
*
* - encoding: unused
* - decoding: Set/Unset by libavcodec.
*/
VDADecoder decoder;
/**
* The Core Video pixel buffer that contains the current image data.
*
* encoding: unused
* decoding: Set by libavcodec. Unset by user.
*/
CVPixelBufferRef cv_buffer;
/**
* Use the hardware decoder in synchronous mode.
*
* encoding: unused
* decoding: Set by user.
*/
int use_sync_decoding;
/**
* The frame width.
*
* - encoding: unused
* - decoding: Set/Unset by user.
*/
int width;
/**
* The frame height.
*
* - encoding: unused
* - decoding: Set/Unset by user.
*/
int height;
/**
* The frame format.
*
* - encoding: unused
* - decoding: Set/Unset by user.
*/
int format;
/**
* The pixel format for output image buffers.
*
* - encoding: unused
* - decoding: Set/Unset by user.
*/
OSType cv_pix_fmt_type;
/**
* The current bitstream buffer.
*
* - encoding: unused
* - decoding: Set/Unset by libavcodec.
*/
uint8_t *priv_bitstream;
/**
* The current size of the bitstream.
*
* - encoding: unused
* - decoding: Set/Unset by libavcodec.
*/
int priv_bitstream_size;
/**
* The reference size used for fast reallocation.
*
* - encoding: unused
* - decoding: Set/Unset by libavcodec.
*/
int priv_allocated_size;
/**
* Use av_buffer to manage buffer.
* When the flag is set, the CVPixelBuffers returned by the decoder will
* be released automatically, so you have to retain them if necessary.
* Not setting this flag may cause memory leak.
*
* encoding: unused
* decoding: Set by user.
*/
int use_ref_buffer;
};
/** Create the video decoder. */
int ff_vda_create_decoder(struct vda_context *vda_ctx,
uint8_t *extradata,
int extradata_size);
/** Destroy the video decoder. */
int ff_vda_destroy_decoder(struct vda_context *vda_ctx);
/**
* @}
*/
#endif /* AVCODEC_VDA_H */

View File

@ -1,159 +0,0 @@
/*
* The Video Decode and Presentation API for UNIX (VDPAU) is used for
* hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1.
*
* Copyright (C) 2008 NVIDIA
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_VDPAU_H
#define AVCODEC_VDPAU_H
/**
* @file
* @ingroup lavc_codec_hwaccel_vdpau
* Public libavcodec VDPAU header.
*/
/**
* @defgroup lavc_codec_hwaccel_vdpau VDPAU Decoder and Renderer
* @ingroup lavc_codec_hwaccel
*
* VDPAU hardware acceleration has two modules
* - VDPAU decoding
* - VDPAU presentation
*
* The VDPAU decoding module parses all headers using FFmpeg
* parsing mechanisms and uses VDPAU for the actual decoding.
*
* As per the current implementation, the actual decoding
* and rendering (API calls) are done as part of the VDPAU
* presentation (vo_vdpau.c) module.
*
* @{
*/
#include <vdpau/vdpau.h>
#include <vdpau/vdpau_x11.h>
#include "libavutil/avconfig.h"
union FFVdpPictureInfo {
VdpPictureInfoH264 h264;
VdpPictureInfoMPEG1Or2 mpeg;
VdpPictureInfoVC1 vc1;
VdpPictureInfoMPEG4Part2 mpeg4;
};
/**
* This structure is used to share data between the libavcodec library and
* the client video application.
* The user shall zero-allocate the structure and make it available as
* AVCodecContext.hwaccel_context. Members can be set by the user once
* during initialization or through each AVCodecContext.get_buffer()
* function call. In any case, they must be valid prior to calling
* decoding functions.
*/
typedef struct AVVDPAUContext {
/**
* VDPAU decoder handle
*
* Set by user.
*/
VdpDecoder decoder;
/**
* VDPAU decoder render callback
*
* Set by the user.
*/
VdpDecoderRender *render;
/**
* VDPAU picture information
*
* Set by libavcodec.
*/
union FFVdpPictureInfo info;
/**
* Allocated size of the bitstream_buffers table.
*
* Set by libavcodec.
*/
int bitstream_buffers_allocated;
/**
* Useful bitstream buffers in the bitstream buffers table.
*
* Set by libavcodec.
*/
int bitstream_buffers_used;
/**
* Table of bitstream buffers.
* The user is responsible for freeing this buffer using av_freep().
*
* Set by libavcodec.
*/
VdpBitstreamBuffer *bitstream_buffers;
} AVVDPAUContext;
/** @brief The videoSurface is used for rendering. */
#define FF_VDPAU_STATE_USED_FOR_RENDER 1
/**
* @brief The videoSurface is needed for reference/prediction.
* The codec manipulates this.
*/
#define FF_VDPAU_STATE_USED_FOR_REFERENCE 2
/**
* @brief This structure is used as a callback between the FFmpeg
* decoder (vd_) and presentation (vo_) module.
* This is used for defining a video frame containing surface,
* picture parameter, bitstream information etc which are passed
* between the FFmpeg decoder and its clients.
*/
struct vdpau_render_state {
VdpVideoSurface surface; ///< Used as rendered surface, never changed.
int state; ///< Holds FF_VDPAU_STATE_* values.
#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
/** picture parameter information for all supported codecs */
union FFVdpPictureInfo info;
#endif
/** Describe size/location of the compressed video data.
Set to 0 when freeing bitstream_buffers. */
int bitstream_buffers_allocated;
int bitstream_buffers_used;
/** The user is responsible for freeing this buffer using av_freep(). */
VdpBitstreamBuffer *bitstream_buffers;
#if !AV_HAVE_INCOMPATIBLE_LIBAV_ABI
/** picture parameter information for all supported codecs */
union FFVdpPictureInfo info;
#endif
};
/* @}*/
#endif /* AVCODEC_VDPAU_H */

View File

@ -1,95 +0,0 @@
/*
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_VERSION_H
#define AVCODEC_VERSION_H
/**
* @file
* @ingroup libavc
* Libavcodec version macros.
*/
#include "libavutil/avutil.h"
#define LIBAVCODEC_VERSION_MAJOR 55
#define LIBAVCODEC_VERSION_MINOR 18
#define LIBAVCODEC_VERSION_MICRO 102
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
LIBAVCODEC_VERSION_MICRO)
#define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
LIBAVCODEC_VERSION_MICRO)
#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
/**
* FF_API_* defines may be placed below to indicate public API that will be
* dropped at a future version bump. The defines themselves are not part of
* the public API and may change, break or disappear at any time.
*/
#ifndef FF_API_REQUEST_CHANNELS
#define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_ALLOC_CONTEXT
#define FF_API_ALLOC_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 55)
#endif
#ifndef FF_API_AVCODEC_OPEN
#define FF_API_AVCODEC_OPEN (LIBAVCODEC_VERSION_MAJOR < 55)
#endif
#ifndef FF_API_OLD_DECODE_AUDIO
#define FF_API_OLD_DECODE_AUDIO (LIBAVCODEC_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_OLD_TIMECODE
#define FF_API_OLD_TIMECODE (LIBAVCODEC_VERSION_MAJOR < 55)
#endif
#ifndef FF_API_OLD_ENCODE_AUDIO
#define FF_API_OLD_ENCODE_AUDIO (LIBAVCODEC_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_OLD_ENCODE_VIDEO
#define FF_API_OLD_ENCODE_VIDEO (LIBAVCODEC_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_CODEC_ID
#define FF_API_CODEC_ID (LIBAVCODEC_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_AVCODEC_RESAMPLE
#define FF_API_AVCODEC_RESAMPLE (LIBAVCODEC_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_DEINTERLACE
#define FF_API_DEINTERLACE (LIBAVCODEC_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_DESTRUCT_PACKET
#define FF_API_DESTRUCT_PACKET (LIBAVCODEC_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_GET_BUFFER
#define FF_API_GET_BUFFER (LIBAVCODEC_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_MISSING_SAMPLE
#define FF_API_MISSING_SAMPLE (LIBAVCODEC_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_LOWRES
#define FF_API_LOWRES (LIBAVCODEC_VERSION_MAJOR < 56)
#endif
#endif /* AVCODEC_VERSION_H */

View File

@ -1,168 +0,0 @@
/*
* Copyright (C) 2003 Ivan Kalvachev
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_XVMC_H
#define AVCODEC_XVMC_H
/**
* @file
* @ingroup lavc_codec_hwaccel_xvmc
* Public libavcodec XvMC header.
*/
#include <X11/extensions/XvMC.h>
#include "avcodec.h"
/**
* @defgroup lavc_codec_hwaccel_xvmc XvMC
* @ingroup lavc_codec_hwaccel
*
* @{
*/
#define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct
the number is 1337 speak for the letters IDCT MCo (motion compensation) */
struct xvmc_pix_fmt {
/** The field contains the special constant value AV_XVMC_ID.
It is used as a test that the application correctly uses the API,
and that there is no corruption caused by pixel routines.
- application - set during initialization
- libavcodec - unchanged
*/
int xvmc_id;
/** Pointer to the block array allocated by XvMCCreateBlocks().
The array has to be freed by XvMCDestroyBlocks().
Each group of 64 values represents one data block of differential
pixel information (in MoCo mode) or coefficients for IDCT.
- application - set the pointer during initialization
- libavcodec - fills coefficients/pixel data into the array
*/
short* data_blocks;
/** Pointer to the macroblock description array allocated by
XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks().
- application - set the pointer during initialization
- libavcodec - fills description data into the array
*/
XvMCMacroBlock* mv_blocks;
/** Number of macroblock descriptions that can be stored in the mv_blocks
array.
- application - set during initialization
- libavcodec - unchanged
*/
int allocated_mv_blocks;
/** Number of blocks that can be stored at once in the data_blocks array.
- application - set during initialization
- libavcodec - unchanged
*/
int allocated_data_blocks;
/** Indicate that the hardware would interpret data_blocks as IDCT
coefficients and perform IDCT on them.
- application - set during initialization
- libavcodec - unchanged
*/
int idct;
/** In MoCo mode it indicates that intra macroblocks are assumed to be in
unsigned format; same as the XVMC_INTRA_UNSIGNED flag.
- application - set during initialization
- libavcodec - unchanged
*/
int unsigned_intra;
/** Pointer to the surface allocated by XvMCCreateSurface().
It has to be freed by XvMCDestroySurface() on application exit.
It identifies the frame and its state on the video hardware.
- application - set during initialization
- libavcodec - unchanged
*/
XvMCSurface* p_surface;
/** Set by the decoder before calling ff_draw_horiz_band(),
needed by the XvMCRenderSurface function. */
//@{
/** Pointer to the surface used as past reference
- application - unchanged
- libavcodec - set
*/
XvMCSurface* p_past_surface;
/** Pointer to the surface used as future reference
- application - unchanged
- libavcodec - set
*/
XvMCSurface* p_future_surface;
/** top/bottom field or frame
- application - unchanged
- libavcodec - set
*/
unsigned int picture_structure;
/** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence
- application - unchanged
- libavcodec - set
*/
unsigned int flags;
//}@
/** Number of macroblock descriptions in the mv_blocks array
that have already been passed to the hardware.
- application - zeroes it on get_buffer().
A successful ff_draw_horiz_band() may increment it
with filled_mb_block_num or zero both.
- libavcodec - unchanged
*/
int start_mv_blocks_num;
/** Number of new macroblock descriptions in the mv_blocks array (after
start_mv_blocks_num) that are filled by libavcodec and have to be
passed to the hardware.
- application - zeroes it on get_buffer() or after successful
ff_draw_horiz_band().
- libavcodec - increment with one of each stored MB
*/
int filled_mv_blocks_num;
/** Number of the next free data block; one data block consists of
64 short values in the data_blocks array.
All blocks before this one have already been claimed by placing their
position into the corresponding block description structure field,
that are part of the mv_blocks array.
- application - zeroes it on get_buffer().
A successful ff_draw_horiz_band() may zero it together
with start_mb_blocks_num.
- libavcodec - each decoded macroblock increases it by the number
of coded blocks it contains.
*/
int next_free_data_block_num;
};
/**
* @}
*/
#endif /* AVCODEC_XVMC_H */

View File

@ -1,69 +0,0 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVDEVICE_AVDEVICE_H
#define AVDEVICE_AVDEVICE_H
#include "version.h"
/**
* @file
* @ingroup lavd
* Main libavdevice API header
*/
/**
* @defgroup lavd Special devices muxing/demuxing library
* @{
* Libavdevice is a complementary library to @ref libavf "libavformat". It
* provides various "special" platform-specific muxers and demuxers, e.g. for
* grabbing devices, audio capture and playback etc. As a consequence, the
* (de)muxers in libavdevice are of the AVFMT_NOFILE type (they use their own
* I/O functions). The filename passed to avformat_open_input() often does not
* refer to an actually existing file, but has some special device-specific
* meaning - e.g. for x11grab it is the display name.
*
* To use libavdevice, simply call avdevice_register_all() to register all
* compiled muxers and demuxers. They all use standard libavformat API.
* @}
*/
#include "libavformat/avformat.h"
/**
* Return the LIBAVDEVICE_VERSION_INT constant.
*/
unsigned avdevice_version(void);
/**
* Return the libavdevice build-time configuration.
*/
const char *avdevice_configuration(void);
/**
* Return the libavdevice license.
*/
const char *avdevice_license(void);
/**
* Initialize libavdevice and register all the input and output devices.
* @warning This function is not thread safe.
*/
void avdevice_register_all(void);
#endif /* AVDEVICE_AVDEVICE_H */

View File

@ -1,50 +0,0 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVDEVICE_VERSION_H
#define AVDEVICE_VERSION_H
/**
* @file
* @ingroup lavd
* Libavdevice version macros
*/
#include "libavutil/avutil.h"
#define LIBAVDEVICE_VERSION_MAJOR 55
#define LIBAVDEVICE_VERSION_MINOR 3
#define LIBAVDEVICE_VERSION_MICRO 100
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
LIBAVDEVICE_VERSION_MINOR, \
LIBAVDEVICE_VERSION_MICRO)
#define LIBAVDEVICE_VERSION AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, \
LIBAVDEVICE_VERSION_MINOR, \
LIBAVDEVICE_VERSION_MICRO)
#define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT
#define LIBAVDEVICE_IDENT "Lavd" AV_STRINGIFY(LIBAVDEVICE_VERSION)
/**
* FF_API_* defines may be placed below to indicate public API that will be
* dropped at a future version bump. The defines themselves are not part of
* the public API and may change, break or disappear at any time.
*/
#endif /* AVDEVICE_VERSION_H */

File diff suppressed because it is too large Load Diff

View File

@ -1,481 +0,0 @@
/*
* copyright (c) 2001 Fabrice Bellard
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVFORMAT_AVIO_H
#define AVFORMAT_AVIO_H
/**
* @file
* @ingroup lavf_io
* Buffered I/O operations
*/
#include <stdint.h>
#include "libavutil/common.h"
#include "libavutil/dict.h"
#include "libavutil/log.h"
#include "libavformat/version.h"
#define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */
/**
* Callback for checking whether to abort blocking functions.
* AVERROR_EXIT is returned in this case by the interrupted
* function. During blocking operations, callback is called with
* opaque as parameter. If the callback returns 1, the
* blocking operation will be aborted.
*
* No members can be added to this struct without a major bump, if
* new elements have been added after this struct in AVFormatContext
* or AVIOContext.
*/
typedef struct AVIOInterruptCB {
int (*callback)(void*);
void *opaque;
} AVIOInterruptCB;
/**
* Bytestream IO Context.
* New fields can be added to the end with minor version bumps.
* Removal, reordering and changes to existing fields require a major
* version bump.
* sizeof(AVIOContext) must not be used outside libav*.
*
* @note None of the function pointers in AVIOContext should be called
* directly, they should only be set by the client application
* when implementing custom I/O. Normally these are set to the
* function pointers specified in avio_alloc_context()
*/
typedef struct AVIOContext {
/**
* A class for private options.
*
* If this AVIOContext is created by avio_open2(), av_class is set and
* passes the options down to protocols.
*
* If this AVIOContext is manually allocated, then av_class may be set by
* the caller.
*
* warning -- this field can be NULL, be sure to not pass this AVIOContext
* to any av_opt_* functions in that case.
*/
const AVClass *av_class;
unsigned char *buffer; /**< Start of the buffer. */
int buffer_size; /**< Maximum buffer size */
unsigned char *buf_ptr; /**< Current position in the buffer */
unsigned char *buf_end; /**< End of the data, may be less than
buffer+buffer_size if the read function returned
less data than requested, e.g. for streams where
no more data has been received yet. */
void *opaque; /**< A private pointer, passed to the read/write/seek/...
functions. */
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
int64_t (*seek)(void *opaque, int64_t offset, int whence);
int64_t pos; /**< position in the file of the current buffer */
int must_flush; /**< true if the next seek should flush */
int eof_reached; /**< true if eof reached */
int write_flag; /**< true if open for writing */
int max_packet_size;
unsigned long checksum;
unsigned char *checksum_ptr;
unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
int error; /**< contains the error code or 0 if no error happened */
/**
* Pause or resume playback for network streaming protocols - e.g. MMS.
*/
int (*read_pause)(void *opaque, int pause);
/**
* Seek to a given timestamp in stream with the specified stream_index.
* Needed for some network streaming protocols which don't support seeking
* to byte position.
*/
int64_t (*read_seek)(void *opaque, int stream_index,
int64_t timestamp, int flags);
/**
* A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
*/
int seekable;
/**
* max filesize, used to limit allocations
* This field is internal to libavformat and access from outside is not allowed.
*/
int64_t maxsize;
/**
* avio_read and avio_write should if possible be satisfied directly
* instead of going through a buffer, and avio_seek will always
* call the underlying seek function directly.
*/
int direct;
/**
* Bytes read statistic
* This field is internal to libavformat and access from outside is not allowed.
*/
int64_t bytes_read;
/**
* seek statistic
* This field is internal to libavformat and access from outside is not allowed.
*/
int seek_count;
/**
* writeout statistic
* This field is internal to libavformat and access from outside is not allowed.
*/
int writeout_count;
} AVIOContext;
/* unbuffered I/O */
/**
* Return AVIO_FLAG_* access flags corresponding to the access permissions
* of the resource in url, or a negative value corresponding to an
* AVERROR code in case of failure. The returned access flags are
* masked by the value in flags.
*
* @note This function is intrinsically unsafe, in the sense that the
* checked resource may change its existence or permission status from
* one call to another. Thus you should not trust the returned value,
* unless you are sure that no other processes are accessing the
* checked resource.
*/
int avio_check(const char *url, int flags);
/**
* Allocate and initialize an AVIOContext for buffered I/O. It must be later
* freed with av_free().
*
* @param buffer Memory block for input/output operations via AVIOContext.
* The buffer must be allocated with av_malloc() and friends.
* @param buffer_size The buffer size is very important for performance.
* For protocols with fixed blocksize it should be set to this blocksize.
* For others a typical size is a cache page, e.g. 4kb.
* @param write_flag Set to 1 if the buffer should be writable, 0 otherwise.
* @param opaque An opaque pointer to user-specific data.
* @param read_packet A function for refilling the buffer, may be NULL.
* @param write_packet A function for writing the buffer contents, may be NULL.
* The function may not change the input buffers content.
* @param seek A function for seeking to specified byte position, may be NULL.
*
* @return Allocated AVIOContext or NULL on failure.
*/
AVIOContext *avio_alloc_context(
unsigned char *buffer,
int buffer_size,
int write_flag,
void *opaque,
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
int64_t (*seek)(void *opaque, int64_t offset, int whence));
void avio_w8(AVIOContext *s, int b);
void avio_write(AVIOContext *s, const unsigned char *buf, int size);
void avio_wl64(AVIOContext *s, uint64_t val);
void avio_wb64(AVIOContext *s, uint64_t val);
void avio_wl32(AVIOContext *s, unsigned int val);
void avio_wb32(AVIOContext *s, unsigned int val);
void avio_wl24(AVIOContext *s, unsigned int val);
void avio_wb24(AVIOContext *s, unsigned int val);
void avio_wl16(AVIOContext *s, unsigned int val);
void avio_wb16(AVIOContext *s, unsigned int val);
/**
* Write a NULL-terminated string.
* @return number of bytes written.
*/
int avio_put_str(AVIOContext *s, const char *str);
/**
* Convert an UTF-8 string to UTF-16LE and write it.
* @return number of bytes written.
*/
int avio_put_str16le(AVIOContext *s, const char *str);
/**
* Passing this as the "whence" parameter to a seek function causes it to
* return the filesize without seeking anywhere. Supporting this is optional.
* If it is not supported then the seek function will return <0.
*/
#define AVSEEK_SIZE 0x10000
/**
* Oring this flag as into the "whence" parameter to a seek function causes it to
* seek by any means (like reopening and linear reading) or other normally unreasonable
* means that can be extremely slow.
* This may be ignored by the seek code.
*/
#define AVSEEK_FORCE 0x20000
/**
* fseek() equivalent for AVIOContext.
* @return new position or AVERROR.
*/
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence);
/**
* Skip given number of bytes forward
* @return new position or AVERROR.
*/
int64_t avio_skip(AVIOContext *s, int64_t offset);
/**
* ftell() equivalent for AVIOContext.
* @return position or AVERROR.
*/
static av_always_inline int64_t avio_tell(AVIOContext *s)
{
return avio_seek(s, 0, SEEK_CUR);
}
/**
* Get the filesize.
* @return filesize or AVERROR
*/
int64_t avio_size(AVIOContext *s);
/**
* feof() equivalent for AVIOContext.
* @return non zero if and only if end of file
*/
int url_feof(AVIOContext *s);
/** @warning currently size is limited */
int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3);
/**
* Force flushing of buffered data to the output s.
*
* Force the buffered data to be immediately written to the output,
* without to wait to fill the internal buffer.
*/
void avio_flush(AVIOContext *s);
/**
* Read size bytes from AVIOContext into buf.
* @return number of bytes read or AVERROR
*/
int avio_read(AVIOContext *s, unsigned char *buf, int size);
/**
* @name Functions for reading from AVIOContext
* @{
*
* @note return 0 if EOF, so you cannot use it if EOF handling is
* necessary
*/
int avio_r8 (AVIOContext *s);
unsigned int avio_rl16(AVIOContext *s);
unsigned int avio_rl24(AVIOContext *s);
unsigned int avio_rl32(AVIOContext *s);
uint64_t avio_rl64(AVIOContext *s);
unsigned int avio_rb16(AVIOContext *s);
unsigned int avio_rb24(AVIOContext *s);
unsigned int avio_rb32(AVIOContext *s);
uint64_t avio_rb64(AVIOContext *s);
/**
* @}
*/
/**
* Read a string from pb into buf. The reading will terminate when either
* a NULL character was encountered, maxlen bytes have been read, or nothing
* more can be read from pb. The result is guaranteed to be NULL-terminated, it
* will be truncated if buf is too small.
* Note that the string is not interpreted or validated in any way, it
* might get truncated in the middle of a sequence for multi-byte encodings.
*
* @return number of bytes read (is always <= maxlen).
* If reading ends on EOF or error, the return value will be one more than
* bytes actually read.
*/
int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen);
/**
* Read a UTF-16 string from pb and convert it to UTF-8.
* The reading will terminate when either a null or invalid character was
* encountered or maxlen bytes have been read.
* @return number of bytes read (is always <= maxlen)
*/
int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen);
int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
/**
* @name URL open modes
* The flags argument to avio_open must be one of the following
* constants, optionally ORed with other flags.
* @{
*/
#define AVIO_FLAG_READ 1 /**< read-only */
#define AVIO_FLAG_WRITE 2 /**< write-only */
#define AVIO_FLAG_READ_WRITE (AVIO_FLAG_READ|AVIO_FLAG_WRITE) /**< read-write pseudo flag */
/**
* @}
*/
/**
* Use non-blocking mode.
* If this flag is set, operations on the context will return
* AVERROR(EAGAIN) if they can not be performed immediately.
* If this flag is not set, operations on the context will never return
* AVERROR(EAGAIN).
* Note that this flag does not affect the opening/connecting of the
* context. Connecting a protocol will always block if necessary (e.g. on
* network protocols) but never hang (e.g. on busy devices).
* Warning: non-blocking protocols is work-in-progress; this flag may be
* silently ignored.
*/
#define AVIO_FLAG_NONBLOCK 8
/**
* Use direct mode.
* avio_read and avio_write should if possible be satisfied directly
* instead of going through a buffer, and avio_seek will always
* call the underlying seek function directly.
*/
#define AVIO_FLAG_DIRECT 0x8000
/**
* Create and initialize a AVIOContext for accessing the
* resource indicated by url.
* @note When the resource indicated by url has been opened in
* read+write mode, the AVIOContext can be used only for writing.
*
* @param s Used to return the pointer to the created AVIOContext.
* In case of failure the pointed to value is set to NULL.
* @param flags flags which control how the resource indicated by url
* is to be opened
* @return 0 in case of success, a negative value corresponding to an
* AVERROR code in case of failure
*/
int avio_open(AVIOContext **s, const char *url, int flags);
/**
* Create and initialize a AVIOContext for accessing the
* resource indicated by url.
* @note When the resource indicated by url has been opened in
* read+write mode, the AVIOContext can be used only for writing.
*
* @param s Used to return the pointer to the created AVIOContext.
* In case of failure the pointed to value is set to NULL.
* @param flags flags which control how the resource indicated by url
* is to be opened
* @param int_cb an interrupt callback to be used at the protocols level
* @param options A dictionary filled with protocol-private options. On return
* this parameter will be destroyed and replaced with a dict containing options
* that were not found. May be NULL.
* @return 0 in case of success, a negative value corresponding to an
* AVERROR code in case of failure
*/
int avio_open2(AVIOContext **s, const char *url, int flags,
const AVIOInterruptCB *int_cb, AVDictionary **options);
/**
* Close the resource accessed by the AVIOContext s and free it.
* This function can only be used if s was opened by avio_open().
*
* The internal buffer is automatically flushed before closing the
* resource.
*
* @return 0 on success, an AVERROR < 0 on error.
* @see avio_closep
*/
int avio_close(AVIOContext *s);
/**
* Close the resource accessed by the AVIOContext *s, free it
* and set the pointer pointing to it to NULL.
* This function can only be used if s was opened by avio_open().
*
* The internal buffer is automatically flushed before closing the
* resource.
*
* @return 0 on success, an AVERROR < 0 on error.
* @see avio_close
*/
int avio_closep(AVIOContext **s);
/**
* Open a write only memory stream.
*
* @param s new IO context
* @return zero if no error.
*/
int avio_open_dyn_buf(AVIOContext **s);
/**
* Return the written size and a pointer to the buffer. The buffer
* must be freed with av_free().
* Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
*
* @param s IO context
* @param pbuffer pointer to a byte buffer
* @return the length of the byte buffer
*/
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
/**
* Iterate through names of available protocols.
*
* @param opaque A private pointer representing current protocol.
* It must be a pointer to NULL on first iteration and will
* be updated by successive calls to avio_enum_protocols.
* @param output If set to 1, iterate over output protocols,
* otherwise over input protocols.
*
* @return A static string containing the name of current protocol or NULL
*/
const char *avio_enum_protocols(void **opaque, int output);
/**
* Pause and resume playing - only meaningful if using a network streaming
* protocol (e.g. MMS).
* @param pause 1 for pause, 0 for resume
*/
int avio_pause(AVIOContext *h, int pause);
/**
* Seek to a given timestamp relative to some component stream.
* Only meaningful if using a network streaming protocol (e.g. MMS.).
* @param stream_index The stream index that the timestamp is relative to.
* If stream_index is (-1) the timestamp should be in AV_TIME_BASE
* units from the beginning of the presentation.
* If a stream_index >= 0 is used and the protocol does not support
* seeking based on component streams, the call will fail.
* @param timestamp timestamp in AVStream.time_base units
* or if there is no stream specified then in AV_TIME_BASE units.
* @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
* and AVSEEK_FLAG_ANY. The protocol may silently ignore
* AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
* fail if used and not supported.
* @return >= 0 on success
* @see AVInputFormat::read_seek
*/
int64_t avio_seek_time(AVIOContext *h, int stream_index,
int64_t timestamp, int flags);
#endif /* AVFORMAT_AVIO_H */

View File

@ -1,82 +0,0 @@
/*
* Version macros.
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVFORMAT_VERSION_H
#define AVFORMAT_VERSION_H
/**
* @file
* @ingroup libavf
* Libavformat version macros
*/
#include "libavutil/avutil.h"
#define LIBAVFORMAT_VERSION_MAJOR 55
#define LIBAVFORMAT_VERSION_MINOR 12
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
LIBAVFORMAT_VERSION_MICRO)
#define LIBAVFORMAT_VERSION AV_VERSION(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
LIBAVFORMAT_VERSION_MICRO)
#define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT
#define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
/**
* FF_API_* defines may be placed below to indicate public API that will be
* dropped at a future version bump. The defines themselves are not part of
* the public API and may change, break or disappear at any time.
*/
#ifndef FF_API_OLD_AVIO
#define FF_API_OLD_AVIO (LIBAVFORMAT_VERSION_MAJOR < 55)
#endif
#ifndef FF_API_PKT_DUMP
#define FF_API_PKT_DUMP (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_ALLOC_OUTPUT_CONTEXT
#define FF_API_ALLOC_OUTPUT_CONTEXT (LIBAVFORMAT_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_FORMAT_PARAMETERS
#define FF_API_FORMAT_PARAMETERS (LIBAVFORMAT_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_NEW_STREAM
#define FF_API_NEW_STREAM (LIBAVFORMAT_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_SET_PTS_INFO
#define FF_API_SET_PTS_INFO (LIBAVFORMAT_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_CLOSE_INPUT_FILE
#define FF_API_CLOSE_INPUT_FILE (LIBAVFORMAT_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_READ_PACKET
#define FF_API_READ_PACKET (LIBAVFORMAT_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_ASS_SSA
#define FF_API_ASS_SSA (LIBAVFORMAT_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_R_FRAME_RATE
#define FF_API_R_FRAME_RATE 1
#endif
#endif /* AVFORMAT_VERSION_H */

View File

@ -1,52 +0,0 @@
/*
* copyright (c) 2006 Mans Rullgard
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_ADLER32_H
#define AVUTIL_ADLER32_H
#include <stdint.h>
#include "attributes.h"
/**
* @defgroup lavu_adler32 Adler32
* @ingroup lavu_crypto
* @{
*/
/**
* Calculate the Adler32 checksum of a buffer.
*
* Passing the return value to a subsequent av_adler32_update() call
* allows the checksum of multiple buffers to be calculated as though
* they were concatenated.
*
* @param adler initial checksum value
* @param buf pointer to input buffer
* @param len size of input buffer
* @return updated checksum
*/
unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf,
unsigned int len) av_pure;
/**
* @}
*/
#endif /* AVUTIL_ADLER32_H */

View File

@ -1,65 +0,0 @@
/*
* copyright (c) 2007 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_AES_H
#define AVUTIL_AES_H
#include <stdint.h>
#include "attributes.h"
#include "version.h"
/**
* @defgroup lavu_aes AES
* @ingroup lavu_crypto
* @{
*/
extern const int av_aes_size;
struct AVAES;
/**
* Allocate an AVAES context.
*/
struct AVAES *av_aes_alloc(void);
/**
* Initialize an AVAES context.
* @param key_bits 128, 192 or 256
* @param decrypt 0 for encryption, 1 for decryption
*/
int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt);
/**
* Encrypt or decrypt a buffer using a previously initialized context.
* @param count number of 16 byte blocks
* @param dst destination array, can be equal to src
* @param src source array, can be equal to dst
* @param iv initialization vector for CBC mode, if NULL then ECB will be used
* @param decrypt 0 for encryption, 1 for decryption
*/
void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
/**
* @}
*/
#endif /* AVUTIL_AES_H */

View File

@ -1,154 +0,0 @@
/*
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* Macro definitions for various function/variable attributes
*/
#ifndef AVUTIL_ATTRIBUTES_H
#define AVUTIL_ATTRIBUTES_H
#ifdef __GNUC__
# define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y)
#else
# define AV_GCC_VERSION_AT_LEAST(x,y) 0
#endif
#ifndef av_always_inline
#if AV_GCC_VERSION_AT_LEAST(3,1)
# define av_always_inline __attribute__((always_inline)) inline
#elif defined(_MSC_VER)
# define av_always_inline __forceinline
#else
# define av_always_inline inline
#endif
#endif
#ifndef av_extern_inline
#if defined(__ICL) && __ICL >= 1210 || defined(__GNUC_STDC_INLINE__)
# define av_extern_inline extern inline
#else
# define av_extern_inline inline
#endif
#endif
#if AV_GCC_VERSION_AT_LEAST(3,1)
# define av_noinline __attribute__((noinline))
#else
# define av_noinline
#endif
#if AV_GCC_VERSION_AT_LEAST(3,1)
# define av_pure __attribute__((pure))
#else
# define av_pure
#endif
#ifndef av_restrict
#define av_restrict restrict
#endif
#if AV_GCC_VERSION_AT_LEAST(2,6)
# define av_const __attribute__((const))
#else
# define av_const
#endif
#if AV_GCC_VERSION_AT_LEAST(4,3)
# define av_cold __attribute__((cold))
#else
# define av_cold
#endif
#if AV_GCC_VERSION_AT_LEAST(4,1)
# define av_flatten __attribute__((flatten))
#else
# define av_flatten
#endif
#if AV_GCC_VERSION_AT_LEAST(3,1)
# define attribute_deprecated __attribute__((deprecated))
#else
# define attribute_deprecated
#endif
/**
* Disable warnings about deprecated features
* This is useful for sections of code kept for backward compatibility and
* scheduled for removal.
*/
#ifndef AV_NOWARN_DEPRECATED
#if AV_GCC_VERSION_AT_LEAST(4,6)
# define AV_NOWARN_DEPRECATED(code) \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
code \
_Pragma("GCC diagnostic pop")
#else
# define AV_NOWARN_DEPRECATED(code) code
#endif
#endif
#if defined(__GNUC__)
# define av_unused __attribute__((unused))
#else
# define av_unused
#endif
/**
* Mark a variable as used and prevent the compiler from optimizing it
* away. This is useful for variables accessed only from inline
* assembler without the compiler being aware.
*/
#if AV_GCC_VERSION_AT_LEAST(3,1)
# define av_used __attribute__((used))
#else
# define av_used
#endif
#if AV_GCC_VERSION_AT_LEAST(3,3)
# define av_alias __attribute__((may_alias))
#else
# define av_alias
#endif
#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
# define av_uninit(x) x=x
#else
# define av_uninit(x) x
#endif
#ifdef __GNUC__
# define av_builtin_constant_p __builtin_constant_p
# define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos)))
#else
# define av_builtin_constant_p(x) 0
# define av_printf_format(fmtpos, attrpos)
#endif
#if AV_GCC_VERSION_AT_LEAST(2,5)
# define av_noreturn __attribute__((noreturn))
#else
# define av_noreturn
#endif
#endif /* AVUTIL_ATTRIBUTES_H */

View File

@ -1,149 +0,0 @@
/*
* Audio FIFO
* Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com>
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* Audio FIFO Buffer
*/
#ifndef AVUTIL_AUDIO_FIFO_H
#define AVUTIL_AUDIO_FIFO_H
#include "avutil.h"
#include "fifo.h"
#include "samplefmt.h"
/**
* @addtogroup lavu_audio
* @{
*/
/**
* Context for an Audio FIFO Buffer.
*
* - Operates at the sample level rather than the byte level.
* - Supports multiple channels with either planar or packed sample format.
* - Automatic reallocation when writing to a full buffer.
*/
typedef struct AVAudioFifo AVAudioFifo;
/**
* Free an AVAudioFifo.
*
* @param af AVAudioFifo to free
*/
void av_audio_fifo_free(AVAudioFifo *af);
/**
* Allocate an AVAudioFifo.
*
* @param sample_fmt sample format
* @param channels number of channels
* @param nb_samples initial allocation size, in samples
* @return newly allocated AVAudioFifo, or NULL on error
*/
AVAudioFifo *av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels,
int nb_samples);
/**
* Reallocate an AVAudioFifo.
*
* @param af AVAudioFifo to reallocate
* @param nb_samples new allocation size, in samples
* @return 0 if OK, or negative AVERROR code on failure
*/
int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples);
/**
* Write data to an AVAudioFifo.
*
* The AVAudioFifo will be reallocated automatically if the available space
* is less than nb_samples.
*
* @see enum AVSampleFormat
* The documentation for AVSampleFormat describes the data layout.
*
* @param af AVAudioFifo to write to
* @param data audio data plane pointers
* @param nb_samples number of samples to write
* @return number of samples actually written, or negative AVERROR
* code on failure. If successful, the number of samples
* actually written will always be nb_samples.
*/
int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples);
/**
* Read data from an AVAudioFifo.
*
* @see enum AVSampleFormat
* The documentation for AVSampleFormat describes the data layout.
*
* @param af AVAudioFifo to read from
* @param data audio data plane pointers
* @param nb_samples number of samples to read
* @return number of samples actually read, or negative AVERROR code
* on failure. The number of samples actually read will not
* be greater than nb_samples, and will only be less than
* nb_samples if av_audio_fifo_size is less than nb_samples.
*/
int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples);
/**
* Drain data from an AVAudioFifo.
*
* Removes the data without reading it.
*
* @param af AVAudioFifo to drain
* @param nb_samples number of samples to drain
* @return 0 if OK, or negative AVERROR code on failure
*/
int av_audio_fifo_drain(AVAudioFifo *af, int nb_samples);
/**
* Reset the AVAudioFifo buffer.
*
* This empties all data in the buffer.
*
* @param af AVAudioFifo to reset
*/
void av_audio_fifo_reset(AVAudioFifo *af);
/**
* Get the current number of samples in the AVAudioFifo available for reading.
*
* @param af the AVAudioFifo to query
* @return number of samples available for reading
*/
int av_audio_fifo_size(AVAudioFifo *af);
/**
* Get the current number of samples in the AVAudioFifo available for writing.
*
* @param af the AVAudioFifo to query
* @return number of samples available for writing
*/
int av_audio_fifo_space(AVAudioFifo *af);
/**
* @}
*/
#endif /* AVUTIL_AUDIO_FIFO_H */

View File

@ -1,6 +0,0 @@
#include "version.h"
#if FF_API_AUDIOCONVERT
#include "channel_layout.h"
#endif

View File

@ -1,66 +0,0 @@
/*
* copyright (c) 2010 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* simple assert() macros that are a bit more flexible than ISO C assert().
* @author Michael Niedermayer <michaelni@gmx.at>
*/
#ifndef AVUTIL_AVASSERT_H
#define AVUTIL_AVASSERT_H
#include <stdlib.h>
#include "avutil.h"
#include "log.h"
/**
* assert() equivalent, that is always enabled.
*/
#define av_assert0(cond) do { \
if (!(cond)) { \
av_log(NULL, AV_LOG_PANIC, "Assertion %s failed at %s:%d\n", \
AV_STRINGIFY(cond), __FILE__, __LINE__); \
abort(); \
} \
} while (0)
/**
* assert() equivalent, that does not lie in speed critical code.
* These asserts() thus can be enabled without fearing speedloss.
*/
#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 0
#define av_assert1(cond) av_assert0(cond)
#else
#define av_assert1(cond) ((void)0)
#endif
/**
* assert() equivalent, that does lie in speed critical code.
*/
#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
#define av_assert2(cond) av_assert0(cond)
#else
#define av_assert2(cond) ((void)0)
#endif
#endif /* AVUTIL_AVASSERT_H */

View File

@ -1,8 +0,0 @@
/* Generated by ffconf */
#ifndef AVUTIL_AVCONFIG_H
#define AVUTIL_AVCONFIG_H
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
#define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
#endif /* AVUTIL_AVCONFIG_H */

View File

@ -1,302 +0,0 @@
/*
* Copyright (c) 2007 Mans Rullgard
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_AVSTRING_H
#define AVUTIL_AVSTRING_H
#include <stddef.h>
#include "attributes.h"
/**
* @addtogroup lavu_string
* @{
*/
/**
* Return non-zero if pfx is a prefix of str. If it is, *ptr is set to
* the address of the first character in str after the prefix.
*
* @param str input string
* @param pfx prefix to test
* @param ptr updated if the prefix is matched inside str
* @return non-zero if the prefix matches, zero otherwise
*/
int av_strstart(const char *str, const char *pfx, const char **ptr);
/**
* Return non-zero if pfx is a prefix of str independent of case. If
* it is, *ptr is set to the address of the first character in str
* after the prefix.
*
* @param str input string
* @param pfx prefix to test
* @param ptr updated if the prefix is matched inside str
* @return non-zero if the prefix matches, zero otherwise
*/
int av_stristart(const char *str, const char *pfx, const char **ptr);
/**
* Locate the first case-independent occurrence in the string haystack
* of the string needle. A zero-length string needle is considered to
* match at the start of haystack.
*
* This function is a case-insensitive version of the standard strstr().
*
* @param haystack string to search in
* @param needle string to search for
* @return pointer to the located match within haystack
* or a null pointer if no match
*/
char *av_stristr(const char *haystack, const char *needle);
/**
* Locate the first occurrence of the string needle in the string haystack
* where not more than hay_length characters are searched. A zero-length
* string needle is considered to match at the start of haystack.
*
* This function is a length-limited version of the standard strstr().
*
* @param haystack string to search in
* @param needle string to search for
* @param hay_length length of string to search in
* @return pointer to the located match within haystack
* or a null pointer if no match
*/
char *av_strnstr(const char *haystack, const char *needle, size_t hay_length);
/**
* Copy the string src to dst, but no more than size - 1 bytes, and
* null-terminate dst.
*
* This function is the same as BSD strlcpy().
*
* @param dst destination buffer
* @param src source string
* @param size size of destination buffer
* @return the length of src
*
* @warning since the return value is the length of src, src absolutely
* _must_ be a properly 0-terminated string, otherwise this will read beyond
* the end of the buffer and possibly crash.
*/
size_t av_strlcpy(char *dst, const char *src, size_t size);
/**
* Append the string src to the string dst, but to a total length of
* no more than size - 1 bytes, and null-terminate dst.
*
* This function is similar to BSD strlcat(), but differs when
* size <= strlen(dst).
*
* @param dst destination buffer
* @param src source string
* @param size size of destination buffer
* @return the total length of src and dst
*
* @warning since the return value use the length of src and dst, these
* absolutely _must_ be a properly 0-terminated strings, otherwise this
* will read beyond the end of the buffer and possibly crash.
*/
size_t av_strlcat(char *dst, const char *src, size_t size);
/**
* Append output to a string, according to a format. Never write out of
* the destination buffer, and always put a terminating 0 within
* the buffer.
* @param dst destination buffer (string to which the output is
* appended)
* @param size total size of the destination buffer
* @param fmt printf-compatible format string, specifying how the
* following parameters are used
* @return the length of the string that would have been generated
* if enough space had been available
*/
size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) av_printf_format(3, 4);
/**
* Print arguments following specified format into a large enough auto
* allocated buffer. It is similar to GNU asprintf().
* @param fmt printf-compatible format string, specifying how the
* following parameters are used.
* @return the allocated string
* @note You have to free the string yourself with av_free().
*/
char *av_asprintf(const char *fmt, ...) av_printf_format(1, 2);
/**
* Convert a number to a av_malloced string.
*/
char *av_d2str(double d);
/**
* Unescape the given string until a non escaped terminating char,
* and return the token corresponding to the unescaped string.
*
* The normal \ and ' escaping is supported. Leading and trailing
* whitespaces are removed, unless they are escaped with '\' or are
* enclosed between ''.
*
* @param buf the buffer to parse, buf will be updated to point to the
* terminating char
* @param term a 0-terminated list of terminating chars
* @return the malloced unescaped string, which must be av_freed by
* the user, NULL in case of allocation failure
*/
char *av_get_token(const char **buf, const char *term);
/**
* Split the string into several tokens which can be accessed by
* successive calls to av_strtok().
*
* A token is defined as a sequence of characters not belonging to the
* set specified in delim.
*
* On the first call to av_strtok(), s should point to the string to
* parse, and the value of saveptr is ignored. In subsequent calls, s
* should be NULL, and saveptr should be unchanged since the previous
* call.
*
* This function is similar to strtok_r() defined in POSIX.1.
*
* @param s the string to parse, may be NULL
* @param delim 0-terminated list of token delimiters, must be non-NULL
* @param saveptr user-provided pointer which points to stored
* information necessary for av_strtok() to continue scanning the same
* string. saveptr is updated to point to the next character after the
* first delimiter found, or to NULL if the string was terminated
* @return the found token, or NULL when no token is found
*/
char *av_strtok(char *s, const char *delim, char **saveptr);
/**
* Locale-independent conversion of ASCII isdigit.
*/
int av_isdigit(int c);
/**
* Locale-independent conversion of ASCII isgraph.
*/
int av_isgraph(int c);
/**
* Locale-independent conversion of ASCII isspace.
*/
int av_isspace(int c);
/**
* Locale-independent conversion of ASCII characters to uppercase.
*/
static inline int av_toupper(int c)
{
if (c >= 'a' && c <= 'z')
c ^= 0x20;
return c;
}
/**
* Locale-independent conversion of ASCII characters to lowercase.
*/
static inline int av_tolower(int c)
{
if (c >= 'A' && c <= 'Z')
c ^= 0x20;
return c;
}
/**
* Locale-independent conversion of ASCII isxdigit.
*/
int av_isxdigit(int c);
/**
* Locale-independent case-insensitive compare.
* @note This means only ASCII-range characters are case-insensitive
*/
int av_strcasecmp(const char *a, const char *b);
/**
* Locale-independent case-insensitive compare.
* @note This means only ASCII-range characters are case-insensitive
*/
int av_strncasecmp(const char *a, const char *b, size_t n);
/**
* Thread safe basename.
* @param path the path, on DOS both \ and / are considered separators.
* @return pointer to the basename substring.
*/
const char *av_basename(const char *path);
/**
* Thread safe dirname.
* @param path the path, on DOS both \ and / are considered separators.
* @return the path with the separator replaced by the string terminator or ".".
* @note the function may change the input string.
*/
const char *av_dirname(char *path);
enum AVEscapeMode {
AV_ESCAPE_MODE_AUTO, ///< Use auto-selected escaping mode.
AV_ESCAPE_MODE_BACKSLASH, ///< Use backslash escaping.
AV_ESCAPE_MODE_QUOTE, ///< Use single-quote escaping.
};
/**
* Consider spaces special and escape them even in the middle of the
* string.
*
* This is equivalent to adding the whitespace characters to the special
* characters lists, except it is guaranteed to use the exact same list
* of whitespace characters as the rest of libavutil.
*/
#define AV_ESCAPE_FLAG_WHITESPACE 0x01
/**
* Escape only specified special characters.
* Without this flag, escape also any characters that may be considered
* special by av_get_token(), such as the single quote.
*/
#define AV_ESCAPE_FLAG_STRICT 0x02
/**
* Escape string in src, and put the escaped string in an allocated
* string in *dst, which must be freed with av_free().
*
* @param dst pointer where an allocated string is put
* @param src string to escape, must be non-NULL
* @param special_chars string containing the special characters which
* need to be escaped, can be NULL
* @param mode escape mode to employ, see AV_ESCAPE_MODE_* macros.
* Any unknown value for mode will be considered equivalent to
* AV_ESCAPE_MODE_BACKSLASH, but this behaviour can change without
* notice.
* @param flags flags which control how to escape, see AV_ESCAPE_FLAG_ macros
* @return the length of the allocated string, or a negative error code in case of error
* @see av_bprint_escape()
*/
int av_escape(char **dst, const char *src, const char *special_chars,
enum AVEscapeMode mode, int flags);
/**
* @}
*/
#endif /* AVUTIL_AVSTRING_H */

View File

@ -1,314 +0,0 @@
/*
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_AVUTIL_H
#define AVUTIL_AVUTIL_H
/**
* @file
* external API header
*/
/**
* @mainpage
*
* @section ffmpeg_intro Introduction
*
* This document describes the usage of the different libraries
* provided by FFmpeg.
*
* @li @ref libavc "libavcodec" encoding/decoding library
* @li @ref lavfi "libavfilter" graph-based frame editing library
* @li @ref libavf "libavformat" I/O and muxing/demuxing library
* @li @ref lavd "libavdevice" special devices muxing/demuxing library
* @li @ref lavu "libavutil" common utility library
* @li @ref lswr "libswresample" audio resampling, format conversion and mixing
* @li @ref lpp "libpostproc" post processing library
* @li @ref lsws "libswscale" color conversion and scaling library
*
* @section ffmpeg_versioning Versioning and compatibility
*
* Each of the FFmpeg libraries contains a version.h header, which defines a
* major, minor and micro version number with the
* <em>LIBRARYNAME_VERSION_{MAJOR,MINOR,MICRO}</em> macros. The major version
* number is incremented with backward incompatible changes - e.g. removing
* parts of the public API, reordering public struct members, etc. The minor
* version number is incremented for backward compatible API changes or major
* new features - e.g. adding a new public function or a new decoder. The micro
* version number is incremented for smaller changes that a calling program
* might still want to check for - e.g. changing behavior in a previously
* unspecified situation.
*
* FFmpeg guarantees backward API and ABI compatibility for each library as long
* as its major version number is unchanged. This means that no public symbols
* will be removed or renamed. Types and names of the public struct members and
* values of public macros and enums will remain the same (unless they were
* explicitly declared as not part of the public API). Documented behavior will
* not change.
*
* In other words, any correct program that works with a given FFmpeg snapshot
* should work just as well without any changes with any later snapshot with the
* same major versions. This applies to both rebuilding the program against new
* FFmpeg versions or to replacing the dynamic FFmpeg libraries that a program
* links against.
*
* However, new public symbols may be added and new members may be appended to
* public structs whose size is not part of public ABI (most public structs in
* FFmpeg). New macros and enum values may be added. Behavior in undocumented
* situations may change slightly (and be documented). All those are accompanied
* by an entry in doc/APIchanges and incrementing either the minor or micro
* version number.
*/
/**
* @defgroup lavu Common utility functions
*
* @brief
* libavutil contains the code shared across all the other FFmpeg
* libraries
*
* @note In order to use the functions provided by avutil you must include
* the specific header.
*
* @{
*
* @defgroup lavu_crypto Crypto and Hashing
*
* @{
* @}
*
* @defgroup lavu_math Maths
* @{
*
* @}
*
* @defgroup lavu_string String Manipulation
*
* @{
*
* @}
*
* @defgroup lavu_mem Memory Management
*
* @{
*
* @}
*
* @defgroup lavu_data Data Structures
* @{
*
* @}
*
* @defgroup lavu_audio Audio related
*
* @{
*
* @}
*
* @defgroup lavu_error Error Codes
*
* @{
*
* @}
*
* @defgroup lavu_misc Other
*
* @{
*
* @defgroup lavu_internal Internal
*
* Not exported functions, for internal usage only
*
* @{
*
* @}
*/
/**
* @addtogroup lavu_ver
* @{
*/
/**
* Return the LIBAVUTIL_VERSION_INT constant.
*/
unsigned avutil_version(void);
/**
* Return the libavutil build-time configuration.
*/
const char *avutil_configuration(void);
/**
* Return the libavutil license.
*/
const char *avutil_license(void);
/**
* @}
*/
/**
* @addtogroup lavu_media Media Type
* @brief Media Type
*/
enum AVMediaType {
AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA
AVMEDIA_TYPE_VIDEO,
AVMEDIA_TYPE_AUDIO,
AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous
AVMEDIA_TYPE_SUBTITLE,
AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse
AVMEDIA_TYPE_NB
};
/**
* Return a string describing the media_type enum, NULL if media_type
* is unknown.
*/
const char *av_get_media_type_string(enum AVMediaType media_type);
/**
* @defgroup lavu_const Constants
* @{
*
* @defgroup lavu_enc Encoding specific
*
* @note those definition should move to avcodec
* @{
*/
#define FF_LAMBDA_SHIFT 7
#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
#define FF_LAMBDA_MAX (256*128-1)
#define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
/**
* @}
* @defgroup lavu_time Timestamp specific
*
* FFmpeg internal timebase and timestamp definitions
*
* @{
*/
/**
* @brief Undefined timestamp value
*
* Usually reported by demuxer that work on containers that do not provide
* either pts or dts.
*/
#define AV_NOPTS_VALUE ((int64_t)UINT64_C(0x8000000000000000))
/**
* Internal time base represented as integer
*/
#define AV_TIME_BASE 1000000
/**
* Internal time base represented as fractional value
*/
#define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
/**
* @}
* @}
* @defgroup lavu_picture Image related
*
* AVPicture types, pixel formats and basic image planes manipulation.
*
* @{
*/
enum AVPictureType {
AV_PICTURE_TYPE_NONE = 0, ///< Undefined
AV_PICTURE_TYPE_I, ///< Intra
AV_PICTURE_TYPE_P, ///< Predicted
AV_PICTURE_TYPE_B, ///< Bi-dir predicted
AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4
AV_PICTURE_TYPE_SI, ///< Switching Intra
AV_PICTURE_TYPE_SP, ///< Switching Predicted
AV_PICTURE_TYPE_BI, ///< BI type
};
/**
* Return a single letter to describe the given picture type
* pict_type.
*
* @param[in] pict_type the picture type @return a single character
* representing the picture type, '?' if pict_type is unknown
*/
char av_get_picture_type_char(enum AVPictureType pict_type);
/**
* @}
*/
#include "common.h"
#include "error.h"
#include "version.h"
#include "mathematics.h"
#include "rational.h"
#include "intfloat_readwrite.h"
#include "log.h"
#include "pixfmt.h"
/**
* Return x default pointer in case p is NULL.
*/
static inline void *av_x_if_null(const void *p, const void *x)
{
return (void *)(intptr_t)(p ? p : x);
}
/**
* Compute the length of an integer list.
*
* @param elsize size in bytes of each list element (only 1, 2, 4 or 8)
* @param term list terminator (usually 0 or -1)
* @param list pointer to the list
* @return length of the list, in elements, not counting the terminator
*/
unsigned av_int_list_length_for_size(unsigned elsize,
const void *list, uint64_t term) av_pure;
/**
* Compute the length of an integer list.
*
* @param term list terminator (usually 0 or -1)
* @param list pointer to the list
* @return length of the list, in elements, not counting the terminator
*/
#define av_int_list_length(list, term) \
av_int_list_length_for_size(sizeof(*(list)), list, term)
/**
* @}
* @}
*/
#endif /* AVUTIL_AVUTIL_H */

View File

@ -1,67 +0,0 @@
/*
* Copyright (c) 2006 Ryan Martell. (rdm4@martellventures.com)
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_BASE64_H
#define AVUTIL_BASE64_H
#include <stdint.h>
/**
* @defgroup lavu_base64 Base64
* @ingroup lavu_crypto
* @{
*/
/**
* Decode a base64-encoded string.
*
* @param out buffer for decoded data
* @param in null-terminated input string
* @param out_size size in bytes of the out buffer, must be at
* least 3/4 of the length of in
* @return number of bytes written, or a negative value in case of
* invalid input
*/
int av_base64_decode(uint8_t *out, const char *in, int out_size);
/**
* Encode data to base64 and null-terminate.
*
* @param out buffer for encoded data
* @param out_size size in bytes of the out buffer (including the
* null terminator), must be at least AV_BASE64_SIZE(in_size)
* @param in input buffer containing the data to encode
* @param in_size size in bytes of the in buffer
* @return out or NULL in case of error
*/
char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
/**
* Calculate the output size needed to base64-encode x bytes to a
* null-terminated string.
*/
#define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1)
/**
* @}
*/
#endif /* AVUTIL_BASE64_H */

View File

@ -1,77 +0,0 @@
/*
* Blowfish algorithm
* Copyright (c) 2012 Samuel Pitoiset
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_BLOWFISH_H
#define AVUTIL_BLOWFISH_H
#include <stdint.h>
/**
* @defgroup lavu_blowfish Blowfish
* @ingroup lavu_crypto
* @{
*/
#define AV_BF_ROUNDS 16
typedef struct AVBlowfish {
uint32_t p[AV_BF_ROUNDS + 2];
uint32_t s[4][256];
} AVBlowfish;
/**
* Initialize an AVBlowfish context.
*
* @param ctx an AVBlowfish context
* @param key a key
* @param key_len length of the key
*/
void av_blowfish_init(struct AVBlowfish *ctx, const uint8_t *key, int key_len);
/**
* Encrypt or decrypt a buffer using a previously initialized context.
*
* @param ctx an AVBlowfish context
* @param xl left four bytes halves of input to be encrypted
* @param xr right four bytes halves of input to be encrypted
* @param decrypt 0 for encryption, 1 for decryption
*/
void av_blowfish_crypt_ecb(struct AVBlowfish *ctx, uint32_t *xl, uint32_t *xr,
int decrypt);
/**
* Encrypt or decrypt a buffer using a previously initialized context.
*
* @param ctx an AVBlowfish context
* @param dst destination array, can be equal to src
* @param src source array, can be equal to dst
* @param count number of 8 byte blocks
* @param iv initialization vector for CBC mode, if NULL ECB will be used
* @param decrypt 0 for encryption, 1 for decryption
*/
void av_blowfish_crypt(struct AVBlowfish *ctx, uint8_t *dst, const uint8_t *src,
int count, uint8_t *iv, int decrypt);
/**
* @}
*/
#endif /* AVUTIL_BLOWFISH_H */

Some files were not shown because too many files have changed in this diff Show More