1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-22 11:53:04 +04:00

Compare commits

...

5923 Commits

Author SHA1 Message Date
Alexander Alekhin ae4cb571ab Set status to beta 2014-11-07 19:22:46 +03:00
Vadim Pisarevsky 4f2aeeffaa Merge pull request #3403 from vpisarev:moved_partition 2014-11-07 16:04:56 +00:00
Vadim Pisarevsky d58cadc1ea moved cv::partition from private.hpp to operations.hpp, to expose the function to users 2014-11-07 18:14:39 +03:00
Vadim Pisarevsky 47838a4a22 Merge pull request #3402 from vpisarev:fixed_python_tests 2014-11-07 14:34:14 +00:00
Vadim Pisarevsky 80a985c894 fixed path to the checkerboard image 2014-11-07 15:57:42 +03:00
Vadim Pisarevsky 9b13b07639 Merge pull request #3400 from vpisarev:fixed_umat_test_crash 2014-11-07 12:50:26 +00:00
Alexander Alekhin 569a95e9e1 Merge pull request #3394 from akarsakov:ocl_canny 2014-11-07 12:42:24 +00:00
Vadim Pisarevsky fe4e1913f0 Merge pull request #3357 from briansp2020:master 2014-11-07 12:02:53 +00:00
Vadim Pisarevsky 573be75f50 Merge pull request #3392 from wangyan42164:houghlines_bug_fix 2014-11-07 11:52:58 +00:00
Vadim Pisarevsky 1abc26905d Merge pull request #3397 from ElenaGvozdeva:ocl_WarpAffine_test 2014-11-07 11:52:35 +00:00
Vadim Pisarevsky 7c8789dc12 fixed my_umat(roi).clone() test by disabling poorly aligned ROI's. Real fix of the problem will require a separate branch in UMat::copyTo(). 2014-11-07 14:49:48 +03:00
Yan Wang 0692bf5f34 Fix HoughLines crashes (Bug #3959).
Avoid phi exceed PI/2 to get the negative value of cos(phi).
2014-11-07 17:52:16 +08:00
Alexander Karsakov 7c870014fb Correctly unrolled some cycles 2014-11-07 12:13:00 +03:00
Alexander Alekhin f50f249f80 Merge pull request #3138 from alalek:icv_update 2014-11-06 15:58:14 +00:00
Alexander Alekhin ff095bbbfc Merge pull request #3396 from akarsakov:ocl_pow_fix 2014-11-06 15:49:42 +00:00
ElenaGvozdeva 7dd059c084 fixed test for ocl WarpAffine 2014-11-06 17:19:45 +03:00
Alexander Karsakov 462c3c25a9 Removed incorrect using of rootn() and powr() in ocl_pow 2014-11-06 16:23:02 +03:00
Alexander Karsakov 0ec0aeb7d0 Minor optimization for ocl_canny 2014-11-06 13:07:33 +03:00
Vadim Pisarevsky 5044e0f590 Merge pull request #3372 from pokeefe:add-test-for-projection-decomposition 2014-11-06 08:40:36 +00:00
Vadim Pisarevsky cf0cc00547 Merge pull request #3391 from alalek:ocl_failure_messages 2014-11-06 08:37:34 +00:00
Vadim Pisarevsky 1d804bc695 Merge pull request #3360 from mirab:threshold_triangle 2014-11-06 08:36:24 +00:00
Brian Park e4fa217a62 remove the unnecessary header file 2014-11-05 20:12:18 -08:00
Alexander Alekhin 4eb16122c0 ocl: change processing of OpenCL failures
disable "unwanted" messages
2014-11-05 19:44:36 +03:00
Miroslav Benes 4046f0398a Make Otsu and Triangle algorithms mutually exclusive
Make Otsu and Triangle algorithms mutually exclusive in cv::threshold code.

Signed-off-by: Miroslav Benes <mbenes@suse.cz>
2014-11-05 16:04:26 +01:00
Vadim Pisarevsky da6898f758 Merge pull request #3389 from blackibiza84:master 2014-11-05 14:58:27 +00:00
Vadim Pisarevsky c91b0e7ac4 Merge pull request #3217 from avdmitry:samples_cpp_data 2014-11-05 14:57:46 +00:00
Vadim Pisarevsky 46ac0048f8 Merge pull request #3377 from jlblancoc:master 2014-11-05 14:56:23 +00:00
Vadim Pisarevsky 91a8ea5e60 Merge pull request #3387 from YusukeSuzuki:cap_v4l_rgb24fix 2014-11-05 11:42:51 +00:00
Vadim Pisarevsky 7de4e0496c Merge pull request #3390 from vbystricky:fix_houghlines 2014-11-05 11:41:12 +00:00
Vadim Pisarevsky 5efad375e0 Merge pull request #3384 from ilya-lavrenov:neon_new 2014-11-05 11:26:53 +00:00
Vadim Pisarevsky 72419c3778 Merge pull request #3373 from berak:patch-2 2014-11-05 11:14:59 +00:00
Vadim Pisarevsky c4906c7f43 Merge pull request #3388 from bartaandras:master 2014-11-05 11:04:06 +00:00
Michele Adduci e181c76d21 Updated test_features2d.cpp with latest API change 2014-11-05 12:03:28 +01:00
Michele Adduci 914b78b8bb Updated ORB test with parameters 2014-11-05 12:00:31 +01:00
Vadim Pisarevsky d052d863eb Merge pull request #3315 from abak:seamless-refactor 2014-11-05 10:41:32 +00:00
vbystricky 957e5ef8eb Fix OpenCL version of HoughLinesP function 2014-11-05 14:31:06 +04:00
Alexander Alekhin 58e054a003 IPPICV: disable boxFilter 16SC1/16UC1 (performance) 2014-11-05 13:26:23 +03:00
Alexander Alekhin 1c9f590f0d IPPICV: disable NormDiff_L1_16s_C1R for IPP/ICV 8.2/8.2.1 2014-11-05 13:26:23 +03:00
Alexander Alekhin 5d213582f7 update IPPICV package 2014-11-05 13:26:23 +03:00
Michele Adduci e1bb844475 Fix cudafeatures2d and cudastereo with new 3.0 APIs for ORB and StereoBM 2014-11-05 10:42:02 +01:00
bartaandras 21227ba092 Fixed calc_output_scale with NO_OUTPUT_SCALE flag set. 2014-11-04 11:35:45 +01:00
Yusuke Suzuki 9cd08c662c add V4L2_PIX_FMT_RGB24 convert code 2014-11-04 15:21:30 +09:00
Brian Park 9e3a2cbab2 check input paramter by checking the image size 2014-11-03 21:38:15 -08:00
berak c2cb3b515d support older gcc versions 2014-11-02 08:16:29 +01:00
Ilya Lavrenov 1fe5441185 cv::convertMaps 2014-11-01 10:13:28 -07:00
Ilya Lavrenov aa11e102fd removed saturation from pyramids 2014-11-01 13:23:45 +03:00
Ilya Lavrenov 8d0383180c fixes for cv::warpAffine 2014-11-01 13:19:52 +03:00
Ilya Lavrenov 15af3f7114 fixes in VResizeLinearVec_32s8u 2014-11-01 13:19:52 +03:00
Ilya Lavrenov a4dd2162f2 cv::resize (INTER_LANCZOS4) 2014-11-01 13:19:52 +03:00
Ilya Lavrenov 1b01e1fe68 cv::resize (INTER_AREA CV_16S, CV_32F) 2014-11-01 13:19:52 +03:00
Ilya Lavrenov 4ed696d770 cv::compareHist (CV_COMP_INTERSECT) 2014-11-01 13:19:51 +03:00
Ilya Lavrenov 5ca25ab8f0 cv::pow (integer power) 2014-11-01 13:19:51 +03:00
Ilya Lavrenov ccdc71286c cv::polarToCart 2014-11-01 13:19:51 +03:00
Ilya Lavrenov d5f006eee5 cv::magnitude; cv::corner** 2014-11-01 13:19:51 +03:00
Ilya Lavrenov fb97273b3c cv::phase; cv::cartToPolar 2014-11-01 13:19:51 +03:00
Ilya Lavrenov 7e6fb668ed cv::pyrUp 2014-11-01 13:19:51 +03:00
Ilya Lavrenov 46faf592fc cv::warpAffine 2014-11-01 13:19:51 +03:00
Ilya Lavrenov 85a814f748 VResizeLinearVec_32s8u 2014-11-01 13:19:51 +03:00
Vadim Pisarevsky dce629d0e2 Merge pull request #3343 from mshabunin:doxygen-docs 2014-10-30 10:45:03 +00:00
Vadim Pisarevsky e19a12f655 Merge pull request #3361 from mshabunin:fix-drawing 2014-10-30 10:44:21 +00:00
Brian Park 5de5f26223 Merge remote-tracking branch 'upstream/master' 2014-10-29 23:15:22 -07:00
Alexander Alekhin cae89a7a88 Merge pull request #3318 from akarsakov:ocl_cvtcolor 2014-10-29 14:25:09 +00:00
Alexander Alekhin fd59551ff0 Merge pull request #3354 from vbystricky:oclopt_convertScaleAbs 2014-10-29 13:53:56 +00:00
Alexander Alekhin efebd83bc8 Merge pull request #3159 from ElenaGvozdeva:ocl_gemm 2014-10-29 11:18:06 +00:00
Alexander Alekhin 4a9cfbf806 Merge pull request #3379 from akarsakov:gftt_empty_src 2014-10-28 17:19:57 +00:00
Alexander Karsakov 967a88759f Don't process empty src image in GFTT 2014-10-28 16:06:36 +03:00
ElenaGvozdeva d88fdd0378 use LOCAL_SIZE+1 2014-10-28 15:18:31 +03:00
Alexander Karsakov 643c906f3d Added optimized loading to YUV2RGB_422 kernel 2014-10-28 15:07:51 +03:00
Alexander Alekhin fae2eb8a1a Merge pull request #3353 from Chuanbo-Weng:master 2014-10-28 10:23:18 +00:00
Alexander Alekhin 30222c7be8 Merge pull request #3359 from akarsakov:ocl_buildMaps 2014-10-28 09:18:31 +00:00
Jose-Luis Blanco-Claraco 539acaf348 OpenCVConfig.cmake: Fix CMake CMP0012 warning
"TRUE"/"FALSE" should not be used as literals, as CMake has to decide
whether they are literals or variable names (sigh).
This patch should make it work with any version of CMake and with any
user-side decision on old vs. new policy behavior.
2014-10-28 09:46:18 +01:00
Alexander Karsakov 1466621f99 Added loading 4 pixels in line instead of 2 to RGB[A] -> YUV(420) kernel 2014-10-27 16:00:34 +03:00
Alexander Karsakov ebfaf4c5d8 Added checking that z is non zero to buildWarpPlaneMaps kernel 2014-10-27 15:38:44 +03:00
Alexander Karsakov 0aab779532 Overload PlaneWarper::buildMaps method from base class 2014-10-27 15:36:52 +03:00
ElenaGvozdeva 65b8a1cb37 Some small fixes 2014-10-27 14:38:22 +03:00
Elena Gvozdeva c5a2879ce0 use vectors 2014-10-27 14:38:22 +03:00
Elena Gvozdeva 2d89df1804 use local memory 2014-10-27 14:38:21 +03:00
Elena Gvozdeva d78bc3c321 naive implementation 2014-10-27 14:38:21 +03:00
Alexander Alekhin dee56598e9 Merge pull request #3369 from vbystricky:fix_scaleAdd 2014-10-27 10:03:29 +00:00
Pat O'Keefe 83ccdabe7e Add test for calib3d function decomposeProjectionMatrix(...) 2014-10-25 19:11:02 -06:00
Alexander Alekhin 1f08d8cb6f Merge pull request #3367 from akarsakov:ocl_image2d 2014-10-24 16:01:21 +00:00
Alexander Alekhin 1fbad26fe3 Merge pull request #3342 from alalek:perf_stability_check 2014-10-24 16:00:20 +00:00
vbystricky 8466911ad0 Move _dst.create() to the begining of scaleAdd function 2014-10-24 18:27:47 +04:00
Alexander Alekhin caba92f2b8 Merge pull request #3284 from vbystricky:oclopt_stereoBM 2014-10-24 12:59:13 +00:00
Alexander Alekhin 63383ef1d8 Merge pull request #3368 from alalek:amd_clfinish 2014-10-24 12:58:21 +00:00
Alexander Karsakov 237cb93143 Added extra checks to ocl::Image2D 2014-10-24 15:04:42 +03:00
Alexander Alekhin 579a7fff6d ocl: restore clFinish() in unmap() for AMD devices
This reverts commit 7d91b8efcd.
2014-10-24 14:29:38 +04:00
Maksim Shabunin 071e78d02e Disabled videoio_video_prop_fps test
This test does not return correct values with some software configurations.
Possible problem with ffmpeg on buildbot's linux-slave.
2014-10-24 11:37:15 +04:00
vbystricky 21ad8e92d4 Optimize OpenCL version of StereoBM function
Fix problems on NVidia devices.
2014-10-23 20:18:53 +04:00
Alexander Karsakov 3a263c6326 Added tests for Image2D 2014-10-23 14:23:37 +03:00
Maksim Shabunin e85ae5f2f0 Fixed imgcodecs tests
- Imgcodecs_Image, write_imageseq - assuming JPEG images have losses
- Imgcodecs_Drawing, c_regression - replaced assert calls
- Imgcodecs_Drawing - exact comparison with reference image
2014-10-23 12:38:42 +04:00
Miroslav Benes 5b1fd739d9 Add Triangle thresholding algorithm
Add Triangle method for automatic threshold computation next to the existing
Otsu's method. Triangle deals better with images whose histogram does not
contain dominant peak.

See paper Zack GW, Rogers WE, Latt SA.: Automatic measurement of sister
chromatid exchange frequency. J Histochem Cytochem. 1977 Jul;25(7):741-53.
2014-10-22 16:54:39 +02:00
Alexander Karsakov 62d4393883 Small optimization for buildMaps kernels in case rowsPerWI > 1 2014-10-22 17:43:29 +03:00
Maksim Shabunin ba5f343c38 Basic doxygen documentation support
- updated existing Doxyfile.in
- added corresponding cmake instructions
- added some specific files (layout, icon)
- clean existing doxygen warnings
2014-10-22 15:24:15 +04:00
Brian Park f83a76cdeb add input paramter checking that verifies the existance of the input files to stero_match example 2014-10-21 22:47:49 -07:00
Vadim Pisarevsky e40567eaee Merge pull request #3352 from alucarded:BackgroundSubtractorMOG2_optimization 2014-10-22 01:55:23 +00:00
vbystricky a8aa6381d9 Optimize OpenCL version of conversScaleAbs function 2014-10-21 19:20:20 +04:00
Alexander Karsakov 60367907fe Used direct float calculations 2014-10-21 17:18:03 +03:00
Alexander Karsakov 5aa9ac9a77 Added OCL code for YUV422 -> RGB[A]|BGR[A] color conversion 2014-10-21 17:18:03 +03:00
Alexander Karsakov c8707b891b Added OCL code for RGB[A]|BGR[A] -> YUV_[YV12|IYUV] color conversion 2014-10-21 17:18:03 +03:00
Alexander Karsakov 8c91604f5a Added OCL code for YUV2GRAY_420 color conversion 2014-10-21 17:18:02 +03:00
Alexander Karsakov 1cc17a7186 Added OCL code for YUV2BGR_YV12 and YUV2BGR_IYUV color conversions 2014-10-21 17:18:02 +03:00
Alexander Karsakov 85b60ee3cb Added support for YUV2RGB[A]_NV21 and YUV2BGR[A]_NV21 conversion 2014-10-21 17:18:02 +03:00
Alexander Alekhin 8ab6852927 added performance validation check 2014-10-21 15:23:19 +04:00
Alexander Alekhin 54b59c3cfb Merge pull request #3355 from ElenaGvozdeva:predictOptimalVectorWidth 2014-10-21 11:23:06 +00:00
ElenaGvozdeva 070e5ec042 Changed predictOptimalVectorWidth function, now it is possible to choose vector size. 2014-10-21 13:13:15 +03:00
Alexander Alekhin 322593e89f Merge pull request #3256 from vbystricky:oclopt_BFMatcher 2014-10-21 08:59:23 +00:00
Tomasz Posłuszny 8dd213c829 BackgroundSubtractorMOG2, learningRate=0 optimization 2014-10-20 19:45:31 +02:00
Chuanbo Weng 2b52bb092a Update hog.cpp
Update according to vbystricky's comments
2014-10-20 18:14:38 +08:00
Vadim Pisarevsky 4de9605b7b Merge pull request #3344 from mshabunin:java_automation 2014-10-20 06:50:34 +00:00
Vadim Pisarevsky d767c9df58 Merge pull request #3349 from a-wi:DShow_Strsafe_header_v3 2014-10-20 06:49:18 +00:00
Vadim Pisarevsky 926b64fff7 Merge pull request #3292 from mshabunin:fix-ios-warnings 2014-10-20 06:41:51 +00:00
Chuanbo Weng 7452eef6e9 Correctly enable OpenCL mode in tapi's hog example.
For current OpenCV-CL architecture, if the data buffer
allocated in UMat are cpu buffer(not ocl buffer) under
cpu mode, and then pass this UMat to an OpenCL kernel
as an argument, the OpenCL path will fail and fallback
to cpu mode. Take HOGDescriptor::oclSvmDetector as an example:
    ocl::setUseOpenCL(false);
    //data allocated in hog.oclSvmDetector will be cpu buffer
    hog.setSVMDetector(HOGDescriptor::getDaimlerPeopleDetector());
    ocl::setUseOpenCL(true);
    //We enabled OpenCL, but hog.oclSvmDetector are cpu buffer,
    //so it will fail in the function ocl_classify_hists
    //when reach to this line
    //idx = k.set(idx, ocl::KernelArg::PtrReadOnly(detector));
    hog.detectMultiScale(img, found, hit_threshold, win_stride,
            Size(0, 0), scale, gr_threshold);

Similar problems heppen on img_aux and img. So we should re-define
or re-set these UMat when do mode switch (CPU -> OpenCL) in order
to make their data be allocated by ocl and then OpenCL path will
succeed.

Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com>
2014-10-20 11:50:46 +08:00
Vadim Pisarevsky 55f490485b Merge pull request #3348 from vpisarev:refactor_algorithms2 2014-10-18 18:52:35 +00:00
Artur Wieczorek dcbe797980 Include strsafe.h to compile successfully under MinGW in Debug mode. 2014-10-18 20:38:34 +02:00
Vadim Pisarevsky dcee883961 fixed MSVC warnings and iOS framework compile error 2014-10-18 21:58:34 +04:00
Vadim Pisarevsky e4418e186e Merge pull request #3345 from D-Alex:master 2014-10-18 17:00:31 +00:00
Vadim Pisarevsky c45d2642ca Merge pull request #3347 from Nerei:memory_leak_in_viz_opencv30 2014-10-18 16:57:35 +00:00
Vadim Pisarevsky b37a641cc9 fixed bug in automatic SVM training 2014-10-18 20:53:39 +04:00
Vadim Pisarevsky d2b9dc5530 quickly corrected the previous refactoring of features2d: moved from set(SOME_PROP, val) to setSomeProp(val) 2014-10-18 20:44:26 +04:00
Anatoly Baksheev cb95d1df35 viz: fixed memory leak 2014-10-18 18:17:42 +04:00
Alexander Duda 11ebaf673f fix warning in template Scalar::mul gcc < 4.8
In this particular case t shadows transpose of the base class Matx:
types.hpp:1805:14: warning: declaration of ‘t’ shadows a member of
'this' [-Wshadow]

Changelog gcc 4.8: The option -Wshadow no longer warns if a declaration
shadows a function declaration.

This warning is problematic because it prevents the module
opencv_contrib/modules/ruby to pass the build process
2014-10-18 14:22:27 +02:00
vbystricky 3787388eac Optimize OpenCL version of BFMatcher 2014-10-17 19:48:45 +04:00
Maksim Shabunin c5a1650ac0 Refactoring in gen_java.py script 2014-10-17 19:36:24 +04:00
Maksim Shabunin 276bed3e4a final fix 2014-10-17 18:29:30 +04:00
Maksim Shabunin 571ebb2373 Fixing iOS clang warnings, part 3 2014-10-17 18:15:21 +04:00
Maksim Shabunin ef3d02214b Fixing iOS clang warnings, part 2 2014-10-17 18:14:54 +04:00
Maksim Shabunin d3821e8cd7 Forgotten punctuation 2014-10-17 18:14:54 +04:00
Maksim Shabunin 420737e098 Fixing iOS clang warnings, part 1 2014-10-17 18:14:54 +04:00
Maksim Shabunin 630eddf25a Extracted repeated cmake instruction block 2014-10-17 18:14:53 +04:00
Maksim Shabunin f379bcc6d3 Suppressed some iOS framework compilation warnings 2014-10-17 18:14:53 +04:00
Vadim Pisarevsky 22ff1e8826 Merge pull request #3339 from vpisarev:refactor_features2d_take4 2014-10-17 14:07:06 +00:00
Vadim Pisarevsky 4038beb67e fixed incorrect array access in solvepnp (which affected debug builds only) 2014-10-17 17:01:39 +04:00
Vadim Pisarevsky 3f37e034a0 another fix in opencv_world 2014-10-17 16:09:09 +04:00
Vadim Pisarevsky 8d9e619412 fixed opencv_world build 2014-10-17 16:05:38 +04:00
Vadim Pisarevsky 1a809ca89b fixed msvc compile warning 2014-10-17 15:56:27 +04:00
Vadim Pisarevsky cc11a8d183 Merge branch 'refactor_features2d_take4' of https://github.com/vpisarev/opencv into refactor_features2d_take4
Conflicts:
	modules/features2d/src/orb.cpp
2014-10-17 15:13:35 +04:00
Vadim Pisarevsky 54e65598bd fixed error in OpenCL ORB 2014-10-17 15:02:57 +04:00
Vadim Pisarevsky 1176d4ef84 fixed some more compile errors and test failures 2014-10-17 15:02:56 +04:00
Vadim Pisarevsky d36b546df8 trying to fix strange compiler bug 2014-10-17 14:56:58 +04:00
Vadim Pisarevsky 9c9ecc22e2 fixed opencv_java build 2014-10-17 14:56:58 +04:00
Vadim Pisarevsky fa76c634ec ok; all the tests now pass 2014-10-17 14:56:58 +04:00
Vadim Pisarevsky 01d3848f17 all the tests now pass except for MSER 2014-10-17 14:56:58 +04:00
Vadim Pisarevsky 162384a838 fixed several test failures; currently 9 out of 73 tests fail 2014-10-17 14:56:58 +04:00
Vadim Pisarevsky 06d4aa6060 now all the samples and opencv_contrib compile! 2014-10-17 14:56:58 +04:00
Vadim Pisarevsky 09df1a286b OpenCV with the refactored features2d compiles! contrib is broken for now; the tests are not tried yet 2014-10-17 14:56:58 +04:00
Vadim Pisarevsky 2e915026a0 yet another attempt to refactor features2d; the first commit, features2d does not even compile 2014-10-17 14:56:58 +04:00
Vadim Pisarevsky f6f839eb3c trying to resolve the merge conflict 2014-10-17 14:46:08 +04:00
Vadim Pisarevsky c5292c2549 fixed error in OpenCL ORB 2014-10-17 14:30:12 +04:00
Vadim Pisarevsky c422bdc3f8 fixed some more compile errors and test failures 2014-10-17 14:22:02 +04:00
Vadim Pisarevsky 48a860a335 trying to fix strange compiler bug 2014-10-16 23:10:00 +04:00
Vadim Pisarevsky 61cddd8b63 fixed opencv_java build 2014-10-16 22:52:04 +04:00
Vadim Pisarevsky 25a7d023dd ok; all the tests now pass 2014-10-16 21:59:38 +04:00
Vadim Pisarevsky c5261ea3d2 all the tests now pass except for MSER 2014-10-16 20:58:29 +04:00
Alexander Alekhin af1d29db83 Merge pull request #3332 from lupustr3:pvlasov/implementation_detector 2014-10-16 14:51:53 +00:00
Vadim Pisarevsky 97a5dd0ead fixed several test failures; currently 9 out of 73 tests fail 2014-10-16 17:00:40 +04:00
Vadim Pisarevsky d017faa06c now all the samples and opencv_contrib compile! 2014-10-16 16:34:22 +04:00
Alexander Alekhin 4525a5f2be Merge pull request #3338 from ilya-lavrenov:ios_fixes 2014-10-16 11:53:41 +00:00
Vadim Pisarevsky b30ad42609 Merge pull request #3270 from boaz001:patch-1 2014-10-16 10:09:28 +00:00
Ilya Lavrenov c54ef78220 fixes 2014-10-16 09:55:22 +04:00
Boaz Stolk ae81006eab Applied proposed fix 2014-10-15 22:36:38 +02:00
Vadim Pisarevsky 5e667ee53a OpenCV with the refactored features2d compiles! contrib is broken for now; the tests are not tried yet 2014-10-15 22:49:17 +04:00
Vadim Pisarevsky a10a7279a8 Merge pull request #3334 from micha137:patch-2 2014-10-15 10:32:16 +00:00
Vadim Pisarevsky 968fe91c8e Merge pull request #3333 from micha137:patch-1 2014-10-15 10:31:59 +00:00
Vadim Pisarevsky 18ef0cfe81 Merge pull request #3335 from ilya-lavrenov:neon_ios 2014-10-15 10:29:54 +00:00
Pavel Vlasov 45958eaabc Implementation detector and selector for IPP and OpenCL;
IPP can be switched on and off on runtime;

Optional implementation collector was added (switched off by default in CMake). Gathers data of implementation used in functions and report this info through performance TS;

TS modifications for implementations control;
2014-10-15 14:24:41 +04:00
Adrien BAK 5442de7d99 adjust numerical precision for windows build 2014-10-15 12:47:53 +09:00
Adrien BAK 82a5ff8540 fix warnings in samples 2014-10-15 11:09:33 +09:00
Adrien BAK 9972059476 suppress warnings 2014-10-14 19:07:15 +09:00
Adrien BAK 53d11f490d whitespace 2014-10-14 16:45:02 +09:00
Adrien BAK 5c98209127 whitespaces 2014-10-14 16:31:22 +09:00
Adrien BAK ee210afc44 white space 2014-10-14 16:10:53 +09:00
Adrien BAK cb76d00f5f precalculate indices 2014-10-14 16:08:45 +09:00
Adrien BAK 419450689b remove unnecessary buffer copies 2014-10-14 16:08:45 +09:00
Adrien BAK b4504639c8 refactor poisson_solver 2014-10-14 16:08:45 +09:00
Adrien BAK 6bfea73716 move calls to ptr<> 2014-10-14 16:08:45 +09:00
Adrien BAK 4a5ea85094 another useless include 2014-10-14 16:08:45 +09:00
Adrien BAK df312a4ffa at<> -> ptr<> 2014-10-14 16:08:45 +09:00
Adrien BAK 5a16de2ef6 .size().width -> cols 2014-10-14 16:08:45 +09:00
Adrien BAK 980496bb0e remove useless include 2014-10-14 16:08:45 +09:00
Adrien BAK d2719ea92f change numerical precision because of architecture discrepancy 2014-10-14 16:08:45 +09:00
Adrien BAK 1c75fa7297 norm -> cvtest::norm 2014-10-14 16:08:45 +09:00
Adrien BAK c6ffa5059d remove useless includes 2014-10-14 16:08:45 +09:00
Adrien BAK 0f0bda9722 factor conditional save 2014-10-14 16:08:45 +09:00
Adrien BAK 11d89ad7c1 coding guidelines 2014-10-14 16:08:45 +09:00
Adrien BAK 53f4f06a15 remove debugging code 2014-10-14 16:08:45 +09:00
Adrien BAK c69016467d replace implementation of dst 2014-10-14 16:08:44 +09:00
Adrien BAK 89e7860572 replace double by float 2014-10-14 16:08:44 +09:00
Adrien BAK ed9f6a3cb4 simplify a line 2014-10-14 16:08:44 +09:00
Adrien BAK e46810eabe this has been submitted to the daily wtf 2014-10-14 16:08:44 +09:00
Adrien BAK 47b01be0a4 replace 8 loops by 2 2014-10-14 16:08:44 +09:00
Adrien BAK b04d06938d replace double* by vector<double> 2014-10-14 16:08:44 +09:00
Adrien BAK a14bfb331d remove logging 2014-10-14 16:08:44 +09:00
Adrien BAK a361cc9479 remove some more useless buffers and rename a bunch of variables 2014-10-14 16:08:44 +09:00
Adrien BAK 61fe623cf1 backport bug fix 2014-10-14 16:08:44 +09:00
Adrien BAK d46c466e20 remove useless buffers 2014-10-14 16:08:44 +09:00
Adrien BAK 89be83e5be rename variables 2014-10-14 16:08:43 +09:00
Adrien BAK b3ddc2b9a7 refactor array_product 2014-10-14 16:08:43 +09:00
Adrien BAK 33c15d6309 rename stuff, adds logging and replace shitty else if chain by switch 2014-10-14 16:08:43 +09:00
Adrien BAK 1f6acc23fa adds header guards + move impl to proper file 2014-10-14 16:08:43 +09:00
Adrien BAK e8c2f2ee3e constness 2014-10-14 16:08:43 +09:00
Adrien BAK 2f046ae873 fix grayscale loading 2014-10-14 16:08:43 +09:00
Adrien BAK 63715a899e fix regressiont ests npr 2014-10-14 16:08:43 +09:00
Adrien BAK ed0eb139cb improve decolor tests 2014-10-14 16:08:43 +09:00
Adrien BAK 0a3aab288a improved cloning test 2014-10-14 16:08:42 +09:00
Vadim Pisarevsky 1796a26fc7 yet another attempt to refactor features2d; the first commit, features2d does not even compile 2014-10-13 23:01:45 +04:00
Ilya Lavrenov 69c82b4c2b ability to compile for iOS with Neon 2014-10-13 22:57:50 +04:00
micha137 67b2380d19 Update table_of_content_introduction.rst 2014-10-13 16:31:37 +02:00
micha137 96cd0d82e5 Update tutorials.rst
Change some wording
2014-10-13 16:20:47 +02:00
Vadim Pisarevsky 83ef276697 Merge pull request #3330 from vpisarev:fix_upnp_perf 2014-10-12 04:46:27 +00:00
Vadim Pisarevsky 3b250d6e9c this is trivial change; the main change is in opencv_extra - added regression data for perf tests 2014-10-11 22:57:22 +04:00
Vadim Pisarevsky a798386660 Merge pull request #3326 from ilya-lavrenov:neon_canny 2014-10-11 17:58:24 +00:00
Vadim Pisarevsky 1edefac4dc Merge pull request #3276 from asmorkalov:abidrk/pyStitching 2014-10-11 17:39:55 +00:00
Vadim Pisarevsky 8b7c0a7893 Merge pull request #3308 from edgarriba:master 2014-10-11 17:33:28 +00:00
Vadim Pisarevsky c37acef077 Merge pull request #3328 from ilya-lavrenov:warp_tests 2014-10-11 17:19:52 +00:00
Vadim Pisarevsky b4c3f465fb Merge pull request #3325 from a-wi:Dshow_capture_v3 2014-10-11 16:04:02 +00:00
Ilya Lavrenov faf91a466c imrpoved output of warp test in case of failure 2014-10-11 02:35:02 -07:00
edgarriba 4071c4e7c9 Updating to c++ interfaces 2014-10-11 01:44:46 +02:00
Ilya Lavrenov af04a85303 fixes for cv::accumulate** 2014-10-10 10:00:13 -07:00
Artur Wieczorek ec93d103b7 Refactored code responsible for printing debug messages in DShow video capture module to reduce footprint in Release mode.
Replace printf function used for diagnostic purposes with dedicated DebugPrintOut function to output debug messages. This function is effective only in Debug mode and its body becomes empty in Release mode to reduce footprint.
2014-10-10 17:49:01 +02:00
Vadim Pisarevsky a3916113b9 Merge pull request #3254 from ilya-lavrenov:neon_scale_add 2014-10-10 14:26:14 +00:00
Ilya Lavrenov 5f23d99918 the rest modes of cv::Mat::convertTo 2014-10-10 14:10:50 +00:00
Vadim Pisarevsky f6b1c2a0b6 Merge pull request #3324 from akarsakov:fix_lpsolver_tests 2014-10-10 10:59:09 +00:00
Artur Wieczorek c54928e003 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-10 08:53:52 +02:00
Artur Wieczorek efd237b8b8 Fixed media type guid for I420 in DShow capture.
FOURCC code bytes should be placed in the reverse order.
2014-10-10 08:53:50 +02:00
Artur Wieczorek de0b46a765 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-10 08:53:48 +02:00
Vadim Pisarevsky ca5e73a9d0 Merge pull request #3283 from abak:fix-cloning-illumination-change-noipp 2014-10-09 14:57:57 +00:00
Vadim Pisarevsky 397870d7a5 Merge pull request #3279 from akarsakov:ocl_houghlines 2014-10-09 14:56:45 +00:00
Vadim Pisarevsky 263fd81bbc Merge pull request #3245 from avdmitry:hello_opencv_sample 2014-10-09 14:56:13 +00:00
Vadim Pisarevsky 9575a82a9e Merge pull request #3299 from felixendres:orb_keypoint_detector_threshold 2014-10-09 14:52:38 +00:00
Vadim Pisarevsky 6fa6e3d3d5 Merge pull request #3301 from MC-Escherichia:fix_gen_javadoc_py_prints 2014-10-09 14:50:36 +00:00
Vadim Pisarevsky bc7ab6c2df Merge pull request #3302 from berak:doc_fix_constants_30 2014-10-09 14:48:58 +00:00
Vadim Pisarevsky 0c1b405964 Merge pull request #3320 from ElenaGvozdeva:gemm_doc 2014-10-09 14:12:51 +00:00
Vadim Pisarevsky f238c69511 Merge pull request #3321 from vbystricky:oclShowRunErrors 2014-10-09 14:11:30 +00:00
Ilya Lavrenov 4babecf3b0 fixes for cv::addWeighted and cv::Mat::dot 2014-10-09 12:55:52 +00:00
vbystricky 1d280352f4 Add code for print errors of OpenCL kernels runing 2014-10-09 13:59:38 +04:00
Alexander Karsakov a8169f08fc Used checking norm of results for LPSolver accuracy tests 2014-10-09 13:32:56 +04:00
ElenaGvozdeva 75601ccf9e small change in description for Gemm 2014-10-09 11:39:44 +03:00
Ilya Lavrenov 183e378bd0 cv::resize (INTER_LINEAR && INTER_CUBIC) 2014-10-08 13:11:38 -07:00
Ilya Lavrenov 00b8f0dec1 cv::pyrUp 2014-10-08 12:04:49 -07:00
Ilya Lavrenov 48a9905f5d cv::pyrDown 2014-10-08 11:47:46 -07:00
Alexander Alekhin 4f48a05906 Merge pull request #3317 from akarsakov:ocl_cvtcolor_perf_tests 2014-10-08 14:44:21 +00:00
Alexander Karsakov dfff9a8125 Added OCL performance test for YUV2RGB_IYUV, YUV2GRAY_420, RGB2YUV_IYUV, YUV2RGB_YUY2, YUV2GRAY_YUY2 color conversion modes 2014-10-08 17:25:51 +04:00
Vadim Pisarevsky ac730d9f53 Merge pull request #3312 from berak:b_3945_30 2014-10-08 08:40:55 +00:00
Ilya Lavrenov 7166b7b640 cv::cvtColor (RGB2Luv CV_8U) 2014-10-07 13:49:05 -07:00
Ilya Lavrenov 1c1c41d3be cv::cvtColor (Luv2RGB CV_8U) 2014-10-07 13:35:11 -07:00
Ilya Lavrenov 06461b401a cv::cvtColor (Lab2BGR CV_8U) 2014-10-07 10:27:28 -07:00
Ilya Lavrenov 71c3e67cb2 cv::cvtColor (HLS2RGB CV_8U) 2014-10-07 15:37:21 +00:00
Ilya Lavrenov c173d9fa18 cv::cvtColor (RGB2HLS CV_8U) 2014-10-07 15:33:09 +00:00
Ilya Lavrenov 8d367d4b4d cv::cvtColor (HSV2RGB CV_8U) 2014-10-07 15:25:02 +00:00
Ilya Lavrenov eb3046f7d3 cv::cvtColor (Gray2RGB5x5) 2014-10-07 14:10:39 +00:00
Alexander Karsakov 66a8acfd3d Optimization for HoughLinesP 2014-10-07 17:53:33 +04:00
berak 56fcc41d70 bugfix #3945 pass idx,idx1 by reference instead of static vars 2014-10-07 12:19:54 +02:00
Alexander Alekhin 14d5358982 Merge pull request #3210 from akarsakov:ocl_gftt_opt 2014-10-07 09:06:54 +00:00
Maksim Shabunin 21a27687d0 Merge pull request #3304 from eltermann:master 2014-10-07 07:35:59 +00:00
edgarriba 9698cc93d9 Merge branch 'master' of https://github.com/edgarriba/opencv 2014-10-07 09:10:44 +02:00
edgarriba 88aed15ffa Removing windows compilation crashes 2014-10-07 09:10:03 +02:00
edgarriba 022ec106f0 Removing windows compilation crashes 2014-10-07 08:35:00 +02:00
edgarriba f317d1277f Merge remote-tracking branch 'upstream/master' 2014-10-06 23:46:30 +02:00
Ilya Lavrenov f91e461ea0 cv::cvtColor (RGB5x52Gray) 2014-10-06 13:06:08 -07:00
Ilya Lavrenov a84c4ac197 cv::cvtColor (RGBRGB5x5) 2014-10-06 12:40:41 -07:00
Ilya Lavrenov b9f57bda05 cv::cvtColor (RGB5x52RGB) 2014-10-06 11:55:12 -07:00
Ilya Lavrenov 28ee84b731 cv::cvtColor (BGR[A]2RGB[A]) 2014-10-06 11:18:33 -07:00
edgarriba 2494e028c0 Updating upnp sanity heck 2014-10-06 18:18:03 +02:00
edgarriba 1709421c2c Updating sanity check 2014-10-06 17:43:01 +02:00
edgarriba 71dd9a6f1b Updating sanity check 2014-10-06 17:22:43 +02:00
Maksim Shabunin 478dd01c91 Merge pull request #3293 from a-wi:MSMF_remove_ATL_dependency_v3 2014-10-06 14:43:13 +00:00
edgarriba 862b675bee Updating sanity check 2014-10-06 16:23:21 +02:00
edgarriba f328f9a10d Removing whitespaces 2014-10-06 14:53:06 +02:00
Ilya Lavrenov a54f6bb08b cv::cvtColor 2014-10-06 11:52:41 +00:00
edgarriba 72fb85f6a0 Removing whitespaces 2014-10-06 13:01:23 +02:00
edgarriba 4d54f35a96 Updating documentation 2014-10-06 10:31:50 +02:00
edgarriba d6bf209bb3 Updating for N=2 2014-10-06 10:28:04 +02:00
eltermann c87af333b3 Documentation fix on py_tutorials 2014-10-04 19:14:11 -03:00
Matthew Conway 92efe4534b update gen_javadoc prints to python3 syntax fixed #3768 2014-10-04 14:48:03 -04:00
Dmitriy Anisimov 4c08581e48 opencv_version 2014-10-04 21:39:57 +04:00
berak 7cb3f3def7 change remaining c-api CV_ prefixes in constants 2014-10-04 14:10:12 +02:00
Ilya Lavrenov 00f16e9178 neon 2014-10-03 08:43:02 +00:00
edgarriba dc76ca5fc9 Updating documentation 2014-10-02 21:39:29 +02:00
edgarriba 7520544840 Return the estimated focal length 2014-10-02 17:05:42 +02:00
edgarriba ea893bf9d9 Updating UPNP documentation 2014-10-02 17:05:06 +02:00
edgarriba 7429454171 Add UPNP acc_test and perf_test 2014-10-02 16:45:59 +02:00
edgarriba a5b3a205d9 Add UPNP case + Modify model_points 2014-10-02 16:45:04 +02:00
edgarriba 84475ef1de UPNP code for N=1 2014-10-02 16:43:50 +02:00
edgarriba 71f4894d87 Added UPNP flag 2014-10-02 16:43:15 +02:00
Maksim Shabunin b8457be394 Merge pull request #3216 from xantares:patch-1 2014-10-02 13:25:06 +00:00
Felix Endres ee6835492c Exposing the FAST detector threshold for ORB
Implemented as a new optional parameter for
the constructor of the ORB detector. The
change of this parameter has been included
in the orb unit test.
2014-10-02 12:17:01 +02:00
Artur Wieczorek 3a0b375104 Remove ATL dependency from MSMF capture code.
Use _com_ptr_t instead of CComPtr in ComPtr wrapper to avoid ATL dependency.
2014-10-01 12:02:28 +02:00
Ilya Lavrenov 6f05a250be optimization of cv::CLAHE (~3x) 2014-09-30 12:40:11 -07:00
Ilya Lavrenov af6a64d76b cv::accumulate functions 2014-09-30 11:07:45 -07:00
Ilya Lavrenov be3efdf274 cv::sum refactoring 2014-09-30 14:36:21 +00:00
Ilya Lavrenov a3e56114d1 cv::multiply 2014-09-30 14:20:22 +00:00
Alexander Alekhin 7e8846b81e Merge pull request #3223 from vbystricky:oclopt_BgSubMOG2 2014-09-30 13:39:20 +00:00
Alexander Alekhin 4d63362206 Merge pull request #3278 from akarsakov:ocl_houghlines_perf_test 2014-09-30 10:49:14 +00:00
xantares 9d13c7b1e2 Move cmake config files too on non-windows hosts. 2014-09-30 09:36:37 +00:00
Ilya Lavrenov 81548a30aa cv::medianBLur 2014-09-30 07:59:33 +00:00
Alexander Karsakov 4880dd0cd6 Added performance test for OCL version of HoughLines and HoughLinesP 2014-09-30 11:03:54 +04:00
Adrien BAK 037f27c882 change masking to patchNaNs 2014-09-30 14:58:40 +09:00
Adrien BAK 2411556242 fix photo::cloning::IlluminationChange when IPP is used 2014-09-30 14:28:44 +09:00
Ilya Lavrenov 8e1ccfae3d cv::boxFilter 2014-09-29 13:54:31 -07:00
Ilya Lavrenov 1c491c42cd fix for cornerHarris 2014-09-29 14:59:46 +00:00
Alexander Karsakov eaf5a163b1 Added HoughLinesP OCL implementation 2014-09-29 16:48:16 +04:00
Maksim Shabunin 148e64d4bc Merge pull request #3277 from a-wi:CMake_FFMPEG_config_v3 2014-09-29 08:42:02 +00:00
Alexander Karsakov 3695a31606 Combined counter and corner buffers into one 2014-09-29 11:10:57 +04:00
Artur Wieczorek 34533dc569 Use FFMPEG capture only if HAVE_FFMPEG flag is defined. 2014-09-29 00:39:35 +02:00
Artur Wieczorek 655b22e050 Fixed CMake issue with FFMPEG videoio configuration 2014-09-29 00:39:05 +02:00
Ilya Lavrenov bbc161e1cb fix for cv::Mat::convertTo with scale 2014-09-28 14:51:30 -07:00
Ilya Lavrenov f50f0ba63e cv::norm 2014-09-28 07:28:33 -07:00
Ilya Lavrenov 44ea50f1c4 cv::countNonZero 2014-09-28 07:06:53 -07:00
Ilya Lavrenov 34a571d37f cv::Mat::dot 2014-09-28 05:00:22 -07:00
Ilya Lavrenov e46332a183 cv::Mat::convertTo with scale and shift 2014-09-28 03:49:56 -07:00
Ilya Lavrenov 74e60e44ad cv::compare 2014-09-28 02:41:08 -07:00
Ilya Lavrenov 857a2d5bfd cv::addWeighted 2014-09-28 01:11:07 -07:00
abidrahmank 797143d515 extending stitching module for Java and Python bindings 2014-09-27 19:35:49 +04:00
Vadim Pisarevsky e6f653af44 Merge pull request #3269 from asmorkalov:ocv_gstreamer3 2014-09-27 15:25:20 +00:00
Vadim Pisarevsky f187fd99da Merge pull request #3271 from mgeorg:reset_ffmpeg_mutex 2014-09-27 13:09:24 +00:00
Vadim Pisarevsky 01a883df0c Merge pull request #3267 from a-wi:MSMF_capture_fixes_v3 2014-09-27 13:07:12 +00:00
Manfred Georg 8d95c91805 set ffmpeg mutex to NULL on destruction. 2014-09-26 09:44:25 -07:00
Ilya Lavrenov d090fcf2fe cv::moments (CV_8UC1) 2014-09-26 14:39:04 +00:00
Ilya Lavrenov 09fbc78a97 cv::threshold 2014-09-26 13:16:48 +00:00
Ilya Lavrenov b4fc87c380 cv::remap 2014-09-26 10:35:28 +00:00
Ilya Lavrenov 6377f5a458 fixed warps accuracy tests 2014-09-26 09:41:46 +00:00
Ilya Lavrenov 4dd6148646 cv::resize 16uc1 2014-09-26 09:41:46 +00:00
Ilya Lavrenov c0b702a994 cv::resize area 2x 2014-09-26 09:41:45 +00:00
Ilya Lavrenov 12001a42f9 corners 2014-09-26 09:41:45 +00:00
Ilya Lavrenov d30ce2b9ac canny 2014-09-26 09:41:45 +00:00
Maksim Shabunin 047abb0050 Merge pull request #3258 from ilya-lavrenov:neon_convert 2014-09-26 09:27:16 +00:00
Alexander Smorkalov 23456d67e5 Added test on CAP_PROP_FRAMECOUNT option for cv::VideoCapture 2014-09-26 10:50:22 +04:00
Alexander Smorkalov 15251056ba Fixed compatibility with GStreamer 1.x 2014-09-26 10:45:08 +04:00
Alexander Smorkalov cc6e6aa028 Fixed query of basic VideoCapture properties. Added tests for them. 2014-09-25 14:40:54 +04:00
Artur Wieczorek 302b138aa7 CMake configuration for MSMF capture
Applied in PR3247 to 2.4 branch.
2014-09-25 12:05:54 +02:00
Artur Wieczorek b91bd6716c Fixed MSMF file capture error while opening the file containing unsupported video stream format
Applied in PR3260 to 2.4 branch
2014-09-25 11:54:15 +02:00
Artur Wieczorek 8f334b4e41 Fixed assertion warning in MSMF frame grabber
Applied in PR3251 to 2.4 branch
2014-09-25 11:51:31 +02:00
Artur Wieczorek 7c00b17085 Fixed MSMF video capture initialization
Applied in PR3251 to 2.4 branch.
2014-09-25 11:49:31 +02:00
Artur Wieczorek 25cf51637d Fix linking error under Win 7 - do not import MinCore_Downlevel.lib if target is Win 7 or earlier.
Applied in PR3243 to 2.4 branch.
2014-09-25 11:45:11 +02:00
Artur Wieczorek 6ad3427426 Fixed compilation errors under VS 2010 and Win 7
Applied in PR3240 to 2.4 branch.
2014-09-25 11:43:13 +02:00
Ilya Lavrenov 345b1369be correct neon rounding 2014-09-25 07:54:52 +00:00
Vadim Pisarevsky 120594163f Merge pull request #3249 from mshabunin:java_wrap 2014-09-24 16:58:56 +00:00
Vadim Pisarevsky 541b627d21 Merge pull request #3257 from Atanahel:gbt_bugfix_master 2014-09-24 12:25:18 +00:00
Vadim Pisarevsky d7418fc9ec Merge pull request #3259 from ilya-lavrenov:neon_scale_add_f32 2014-09-24 12:11:53 +00:00
Ilya Lavrenov 5d018c090f Neon optimization of cv::scaleAdd (CV_32F) 2014-09-23 21:16:29 +04:00
Ilya Lavrenov 4b3f2c1972 Neon optimization of Mat::convertTo 2014-09-23 15:06:17 +00:00
Benoit Seguin 450734cc32 Correction of the integer data treated as floating point data bug, already corrected in the 2.4 branch. 2014-09-23 14:03:20 +02:00
Vadim Pisarevsky ecbec7235f Merge pull request #3253 from asmorkalov:ocv_gstreamer2 2014-09-23 11:51:25 +00:00
Alexander Smorkalov 0518455163 More accurate selection of color space conversion element for GStreamer 1.x 2014-09-23 14:18:44 +04:00
Alexander Smorkalov aa57634213 Fixed compatibility with GStreamer 1.x. 2014-09-23 14:04:53 +04:00
Vadim Pisarevsky 7752483486 Merge pull request #3252 from GravityJack:point-division 2014-09-23 08:43:43 +00:00
Alexander Smorkalov a419b64347 Fixed GStreamer encoding pipeline frame drop for most cases.
For several muxers and encoders GStreamer still drops the last frame.
2014-09-23 12:31:51 +04:00
Vadim Pisarevsky 281ce441a8 Merge pull request #3250 from ilya-lavrenov:neon_convert_scale_abs 2014-09-23 07:15:24 +00:00
vbystricky a75807354d Optimize OpenCL version function BackgroundSubstractionMOG2 2014-09-23 10:33:30 +04:00
Dmitriy Anisimov 71348651eb fixed display_image tutorial sample 2014-09-23 07:45:52 +04:00
Dmitriy Anisimov 55c799a474 fixed warnings in documents 2014-09-23 07:45:52 +04:00
Dmitriy Anisimov ec03d6e6fc removed cpp/tutorial_code/images/ 2014-09-23 07:45:52 +04:00
Dmitriy Anisimov 1007c06d44 initial commit 2014-09-23 07:45:51 +04:00
Marc Rollins c8ede7c9ea Updating documentation to reflect division operations. 2014-09-22 12:07:16 -07:00
Marc Rollins f32a6fb9a1 Adding element-wise division operators to Point3_ class. 2014-09-22 11:59:11 -07:00
Marc Rollins fb9bbf99c4 Adding division operators to Point_ class.
Performs element-wise division.
2014-09-22 11:54:52 -07:00
Vadim Pisarevsky 1c0b9469f5 Merge pull request #3248 from ilya-lavrenov:arm_sum 2014-09-22 17:32:36 +00:00
Ilya Lavrenov 515be70867 Neon optimization of cv::convertScaleAbs 2014-09-22 15:47:46 +00:00
Vadim Pisarevsky 488920168a Merge pull request #3239 from mshabunin:xfeatures2d_fix 2014-09-22 15:28:42 +00:00
xantares d391a6d49f Also test for target. 2014-09-22 15:14:35 +00:00
Ilya Lavrenov 27b933ba5a Neon optimization of cv::sum 2014-09-22 09:22:03 +00:00
Maksim Shabunin 0d7b44db50 Java wrappers now support nested namespaces and classes
- wrapper support python3
- added wrapper log
- generating full name for nested namespaces and classes
2014-09-22 11:47:03 +04:00
Maksim Shabunin 6337fd0650 Support of bioinspired contrib module wrapping
- added java wrapper
- disabled python wrapper
2014-09-22 11:43:29 +04:00
Vadim Pisarevsky 892999c40c Merge pull request #3237 from mshabunin:java_test_detection 2014-09-19 13:35:47 +00:00
Maksim Shabunin 5e3e438edb Fix xfeatures2d dependencies 2014-09-19 16:41:33 +04:00
Maksim Shabunin 2992e3a1b6 Fixed android test detection and some spaces in CMakeLists.txt 2014-09-19 13:11:59 +04:00
Maksim Shabunin cff5e3ee88 Changed java tests detection procedure 2014-09-19 12:34:42 +04:00
Vadim Pisarevsky d1fba0686e Merge pull request #3233 from niebles:master 2014-09-18 17:47:55 +00:00
Juan Carlos Niebles 0c988f00bc Merge github.com:Itseez/opencv 2014-09-18 12:00:28 -05:00
Juan Carlos Niebles dc49e11527 removed setter methods, replaced by CV_PROP_RW macro 2014-09-18 09:39:35 -05:00
Vadim Pisarevsky d1afa0e370 Merge pull request #3234 from vpisarev:fixed_photo_test_failure 2014-09-18 13:06:54 +00:00
Vadim Pisarevsky 1578dd1027 Merge pull request #2702 from GregoryMorse:patch-3 2014-09-18 12:38:54 +00:00
Vadim Pisarevsky 06e55ddf38 Merge pull request #2893 from ilya-lavrenov:tapi_vector_width_intel 2014-09-18 12:05:24 +00:00
Vadim Pisarevsky 470f427a95 Merge pull request #3232 from Chuanbo-Weng:master 2014-09-18 11:48:29 +00:00
Vadim Pisarevsky aa6ba149bc make sure ptr<> is called with proper parameter, otherwise the assertion fails 2014-09-18 15:47:59 +04:00
Juan Carlos Niebles 1162f0ed63 fixed whitespaces 2014-09-17 19:02:12 -05:00
Juan Carlos Niebles f610c88103 extended python interface for KalmanFilter 2014-09-17 18:45:48 -05:00
Vadim Pisarevsky 458bde5e24 Merge pull request #3180 from mshabunin:java_ptr_support 2014-09-17 12:07:43 +00:00
Vadim Pisarevsky 3bc174f1bb Merge pull request #3230 from znah:ipp_median_fix 2014-09-17 12:06:32 +00:00
Chuanbo Weng c5552788c5 Use vload to read unaligned data instead of dereference operator.
According to opencl 1.2 spec 6.1.5:
    For arguments to a __kernel function declared to be a pointer to a
    data type, the OpenCL compiler can assume that the pointee is always
    appropriately aligned as required by the data type. The behavior of
    an unaligned load or store is undefined, except for the
    vloadn, vload_halfn, vstoren, and vstore_halfn functions defined in
    section 6.12.7.

Original code read data of type T from address not aligned by multiple
of sizeof(T), so the result is incorrect. With this patch, the cases
./opencv_perf_imgproc
--gtest_filter=OCL_ImgSize_TmplSize_Method_MatType_MatchTemplate.MatchTemplate/*
could work well with beignet 0.9.3.

Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com>
2014-09-17 19:28:07 +08:00
Vadim Pisarevsky 60a1cc34b8 Merge pull request #3231 from vpisarev:reenable_cpp_samples 2014-09-17 10:53:21 +00:00
Vadim Pisarevsky 5884e4039f Merge pull request #3229 from the-glu:master 2014-09-17 10:02:36 +00:00
Vadim Pisarevsky 4a0364ded5 Merge pull request #3220 from asmorkalov:ocv_gstreamer 2014-09-17 09:55:49 +00:00
Vadim Pisarevsky d14d4bc110 Merge pull request #3215 from dmitrygribanov:dg/stitching-wave-correction-bugfix 2014-09-17 09:52:34 +00:00
Vadim Pisarevsky 550bd24ca8 Merge pull request #3226 from whoshuu:patch-1 2014-09-17 09:52:01 +00:00
Vadim Pisarevsky 9bba2443b7 Merge pull request #3227 from PhilLab:patch-3 2014-09-17 09:50:43 +00:00
Vadim Pisarevsky aa4a80defc the samples from the main repository should not depend on modules from opencv_contrib 2014-09-17 13:49:48 +04:00
Alexander Mordvintsev 0319120adc fix: ippiFilterMedianBorder sometimes crash when doing in-place filtering 2014-09-17 13:26:39 +04:00
Maximilien Cuony 9ac0b06ff1 Fix typo in error for extrinsic parameters 2014-09-17 09:32:19 +02:00
Philipp Hasper 68fe45b594 Doc: Fixing indentation 2014-09-17 09:29:17 +02:00
Huu Nguyen 81b9be1623 Fix implicit narrowing error in initializer list
The implicit narrowing in the initializer list throws a compiler error for some compilers with C++11 support turned on. The specific error message is: "error: narrowing conversion of 'PyInt_AsLong(((PyObject*)o))' from 'long int' to 'double' inside { }".

Tested on Clang 5.1.0 and Mac OS X 10.9.4.
2014-09-16 15:30:10 -07:00
Alexander Alekhin 4689426a91 Merge pull request #3208 from vbystricky:oclopt_Filter2D 2014-09-16 13:03:45 +00:00
Alexander Smorkalov 38887e6ea9 Code review fixes. 2014-09-16 14:52:41 +04:00
Alexander Smorkalov 3ea8be7292 Several fixes for GStreamer support in OpenCV
- Accurate ASYC task handling for both GStreamer generations.
- Correct video duration request for videos.
- More accurate pipeline destruction.
- Correct color space conversion plugin for GStreamer 1.0.
2014-09-15 13:47:09 +04:00
Vadim Pisarevsky c445ce6125 Merge pull request #3218 from berak:docfix_colormap_30 2014-09-15 07:34:16 +00:00
Vadim Pisarevsky 65744cd87d Merge pull request #3175 from avdmitry:modern_doc_theme 2014-09-14 20:10:36 +00:00
berak ad20feaca0 small corrections to applyColorMap docs 2014-09-14 21:15:48 +02:00
Vadim Pisarevsky 4057e27539 Merge pull request #3126 from avdmitry:move_KDTree_to_ml 2014-09-14 18:57:23 +00:00
Vadim Pisarevsky f8254a1011 Merge pull request #3200 from pierriko:master 2014-09-14 18:50:33 +00:00
Vadim Pisarevsky e5ab0ac294 Merge pull request #3201 from PhilLab:patch-3 2014-09-14 18:49:35 +00:00
Vadim Pisarevsky e810f3052d Merge pull request #3206 from stonier:parallel_qt 2014-09-14 18:48:51 +00:00
Vadim Pisarevsky 46718cae28 Merge pull request #3209 from PhilLab:patch-5 2014-09-14 18:47:21 +00:00
Vadim Pisarevsky 8d61ecbc4d Merge pull request #3205 from parafin:ximea_unix-3.0 2014-09-14 18:44:41 +00:00
Vadim Pisarevsky 87f0010f42 Merge pull request #3203 from parafin:bug_3858-3.0 2014-09-14 18:44:06 +00:00
Vadim Pisarevsky 8fe18fefdd Merge pull request #3207 from jamoque:more-better-fixes 2014-09-14 18:41:06 +00:00
Vadim Pisarevsky ad9f9e2ce7 Merge pull request #3213 from mshabunin:png_iccp_strip 2014-09-14 18:39:33 +00:00
xantares 5d0467e769 Update CMakeLists.txt 2014-09-13 15:49:34 +02:00
Dmitriy Anisimov a6b29be55b minor change: moved algorithm type to the end of params 2014-09-13 15:06:07 +04:00
Dmitry Gribanov ee0da48bd2 Feature based stitching's wave correction bugfix.
When we have similar matrices in input, then algorithm returns matrices
with NaN values.
2014-09-12 18:07:54 +04:00
Maksim Shabunin 88aea1d52f Stripped iCCP chunk from png files 2014-09-12 16:30:23 +04:00
Andrey Pavlenko 79f593a429 Merge pull request #3198 from mshabunin:java_test_fix 2014-09-11 16:15:25 +00:00
Alexander Karsakov 8c08714b8c Remove two "set" kernel call 2014-09-11 18:11:23 +04:00
vbystricky b0bf8478e5 Optimization OpenCL version of Filter2D 2014-09-11 12:59:51 +04:00
Maksim Shabunin 39874ef742 Fixed some failing java tests
- fixed lena.png extension
- fixed getTextSize wrapper
- added junit html report generation
2014-09-11 11:56:05 +04:00
Philipp Hasper ac206ccb05 Visual Studio tutorial: updated library names 2014-09-10 19:12:06 +02:00
GregoryMorse b5a4159efc 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.

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

Conflicts:
	modules/highgui/src/cap_msmf.cpp
	modules/highgui/src/cap_msmf.hpp
	modules/highgui/src/ppltasks_winrt.h

Fix merge conflicts

VS 2013 Update 2 library bug fix integrated

a-wi's changed integrated
2014-09-10 17:05:52 +08:00
Vadim Pisarevsky 71edf1b5f1 Merge pull request #3189 from mshabunin:python_cross_build 2014-09-10 07:57:09 +00:00
Vadim Pisarevsky 2e950eb41b Merge pull request #3196 from PhilLab:patch-4 2014-09-10 07:56:13 +00:00
jeremy 56091bae1f changing many instances of the same grammar error in documentation 2014-09-09 17:03:59 -05:00
Daniel Stonier d3ad26926d fixed support for parallelised imshows with qt via the gui receiver. 2014-09-10 03:29:17 +09:00
Igor Kuzmin ed402c5be6 XIMEA cam support: allow on OS X too 2014-09-09 19:25:14 +04:00
Igor Kuzmin 4d45a2c43f XIMEA cam support: use correct library for 64 bit Linux 2014-09-09 19:24:16 +04:00
Igor Kuzmin 74827c35ff fix for issue 3858 (remove unneeded #include's)
also use correct include path on Linux
2014-09-09 19:22:20 +04:00
Philipp Hasper 62c704d1e9 Updated PnP parameter documentation 2014-09-09 12:24:05 +02:00
Alexander Alekhin f03b11d271 Merge pull request #3199 from apavlenko:fix_docs_typo 2014-09-09 09:18:43 +00:00
Pierrick Koch aeda3d2d69 [samples/pyhton] fix common {LINE->CV}_AA 2014-09-09 11:04:24 +02:00
Andrey Pavlenko a8db3df8f6 typo: rect -> roi 2014-09-09 12:25:14 +04:00
Maksim Shabunin c42424f2db Fixed android samples build 2014-09-08 23:22:29 +04:00
Maksim Shabunin 93c03ef05b Fixed android java test build 2014-09-08 19:21:32 +04:00
Maksim Shabunin b3bae170ed Fixed java tests build
- disabled xfeature2d dependency for java wrappers
- fixed java wrappers build after cmake rerun
- disabled opencv_ml tests temporarily
- fixed Imgproc usage in java tests
2014-09-08 18:30:03 +04:00
Andrey Pavlenko 43714b9d03 disabling java bindings for xfeatures2d module due to build errors 2014-09-08 18:30:03 +04:00
Philipp Hasper cc7aa5890d Fixing documentation links 2014-09-08 14:41:29 +02:00
Alexander Alekhin 0b53ca2848 Merge pull request #3192 from jkua:master 2014-09-08 11:02:16 +00:00
Alexander Alekhin eac4042ed5 Merge pull request #3195 from akarsakov:ocl_rm_mul24 2014-09-08 11:00:59 +00:00
Alexander Karsakov c942c6539a Remove mul24 since id can be larger 2^23 2014-09-08 13:11:58 +04:00
Dmitriy Anisimov ad00e0dd43 tt & header background colors changed 2014-09-06 14:15:04 +04:00
Dmitriy Anisimov dfaf75f502 moving algorithm type to param 2014-09-06 09:29:32 +04:00
Dmitriy Anisimov e7b3a73b62 fixed all known issues 2014-09-05 21:56:25 +04:00
Alexander Karsakov 39b27a19be Refactoring and optimization 2014-09-05 12:20:29 +04:00
Alexander Karsakov d59a6fa518 Optimization for getLines 2014-09-05 11:37:16 +04:00
John Kua fb0c0eaa7c Fixed bad non-ASCII character in how_to_scan_images.cpp which causes a compile error 2014-09-04 16:36:36 -07:00
Vadim Pisarevsky 618c75fe3d Merge pull request #3182 from berak:videowriter_docfix_30 2014-09-04 17:09:18 +00:00
Vadim Pisarevsky 26c284b225 Merge pull request #3167 from akarsakov:ocl_rm_clFinish 2014-09-04 17:00:10 +00:00
berak 5f9d5c483c adding fourcc to VideoWriter docs
underline
2014-09-04 16:09:22 +02:00
Alexander Karsakov fee8f29f48 Refactoring, minor optimization 2014-09-04 16:31:30 +04:00
Maksim Shabunin 2c2cdcf789 Changed cmake python library search startegy for crosscompiling 2014-09-04 16:29:46 +04:00
Vadim Pisarevsky ffd1df0cb5 Merge pull request #3186 from akarsakov:ocl_fixes 2014-09-04 08:54:24 +00:00
Vadim Pisarevsky 64a53de27d Merge pull request #3185 from ElenaGvozdeva:ocl_norm 2014-09-04 08:53:47 +00:00
Ilya Lavrenov 98e7d4ceec changed optimal vector width for Intel 2014-09-04 11:59:41 +04:00
Elena Gvozdeva 9fe11db7e2 disabled IPP acceleration for 3-channel norms and for CV_8S only for APPLE 2014-09-04 10:38:45 +04:00
Dmitriy Anisimov e7af509c86 different enhancements 2014-09-03 22:25:08 +04:00
Alexander Karsakov 07d57db91c Fixed calculation of l_stack_size 2014-09-03 17:40:17 +04:00
Alexander Alekhin 97ab91dcc9 Merge pull request #3187 from akarsakov:ocl_disabled_minmaxidx 2014-09-03 12:56:24 +00:00
Alexander Karsakov 7d91b8efcd Removed redundant clFinish() after clEnqueueUnmapMemObject()
sss
2014-09-03 14:54:05 +04:00
Alexander Karsakov f57a4bf87b Disabled minMaxIdx for 32FC1 since it occasionally fails on AMD devices (e.g. A10-6800K) 2014-09-03 14:36:51 +04:00
Vadim Pisarevsky 0276cc90c2 Merge pull request #3184 from ilya-lavrenov:arm 2014-09-03 05:40:19 +00:00
Vadim Pisarevsky 0fd21baaa2 Merge pull request #3174 from rokm:samples-fix 2014-09-02 15:52:56 +00:00
Alexander Alekhin 7dd666e444 Merge pull request #3181 from akarsakov:ocl_mul_scale_test_fix 2014-09-02 13:46:46 +00:00
Alexander Karsakov ec827bed8e Changed check to NORM_RELATIVE for OCL.Mat_Scalar_Scale tests 2014-09-02 16:05:50 +04:00
Alexander Karsakov a48c1c8248 Added workaround for Nvidia: take into account that 3-channel vector type takes 4*elem_size in local memory. 2014-09-02 12:38:02 +04:00
Alexander Karsakov 214dab39f6 Fixed BORDER_REFLECT and BORDER_REFLECT_101 extrapolation for case x > 2*maxV 2014-09-02 11:53:31 +04:00
Vadim Pisarevsky a125cd6c6d Merge pull request #3169 from znah:py_wrap 2014-09-01 18:01:12 +00:00
Vadim Pisarevsky 6c3dd4984c Merge pull request #3179 from alekcac:update_in_youtube_url 2014-09-01 18:00:13 +00:00
Ilya Lavrenov 5d3a128cd3 NEON impl on cv::convertScaleAba CV_32f 2014-09-01 17:04:36 +00:00
Vadim Pisarevsky 3bafe64666 Merge pull request #3170 from ElenaGvozdeva:ocl_fix 2014-09-01 10:40:02 +00:00
Vadim Pisarevsky 3e574cd26a Merge pull request #3173 from rokm:cuda-6.5 2014-09-01 10:38:43 +00:00
Vadim Pisarevsky 1f85ffa11b Merge pull request #3166 from akarsakov:ocl_native_sqrt 2014-09-01 10:36:50 +00:00
Alexander Alekhin 6abce51481 Merge pull request #3176 from ilya-lavrenov:ipp_arm 2014-09-01 09:56:34 +00:00
Alexander Mordvintsev c1032b6232 remove structured_edge_detection.hpp from blacklist
don't discard pure virtual methods in hdr_parser.py (was broken anyway)
2014-09-01 13:55:41 +04:00
Ilya Lavrenov 040ff7993f don't use IPP on ARM 2014-09-01 12:30:49 +04:00
Alexander Shishkov acc2efab50 updated links to the official OpenCV youtube channel 2014-09-01 11:28:43 +04:00
Maksim Shabunin 66ed9ddbe3 Added Ptr<T> support to Java wrappers 2014-09-01 11:24:44 +04:00
Vadim Pisarevsky 43c2c119e9 Merge pull request #3177 from PhilLab:patch-3 2014-09-01 06:16:29 +00:00
Dmitriy Anisimov 5f3ee657ce removed kdtree declaration from interface 2014-08-31 21:39:47 +04:00
Dmitriy Anisimov 5d4bd700a7 slight changes, theme become more similar with current 2014-08-31 18:12:34 +04:00
Philipp Hasper e310added4 Fixing Matx ostream operator
cv::Matx could not be converted to c::Mat automatically
2014-08-31 14:37:43 +02:00
Dmitriy Anisimov 3334c06e8b initial commit 2014-08-30 12:55:45 +04:00
Rok Mandeljc d9db950c0e samples: gpu: performance: SURF is now part of opencv_xfeatures2d 2014-08-30 01:01:08 +02:00
Rok Mandeljc db391fdfdd samples: gpu: performance: BackgroundSubtractorMOG is now part of opencv_bgsegm module 2014-08-30 01:01:08 +02:00
Rok Mandeljc fbf28bcc63 samples: gpu: performance: fix include path for opencv_xfeatures2d
As opencv_xfeatures2d is part of opencv-contrib and not opencv repository,
${OpenCV_SOURCE_DIR}/modules/modules/include is not a correct include
path - use ${opencv_xfeatures2d_SOURCE_DIR}/include instead
2014-08-30 01:01:08 +02:00
Rok Mandeljc 653bca8b74 samples: gpu: super_resolution: disable simple optical flow
The cv::superres::createOptFlow_Simple() function along with the
simple optical flow class implementation is currently commented out
in the superres module's code, so comment it out in the example as well.
2014-08-30 01:01:08 +02:00
Rok Mandeljc f739990f4c samples: gpu: performance: removed FGDStatModel performance comparison test
The FGD background subtraction model was part of opencv_legacy module;
as it is gone now, it makes little sense to benchmark the GPU version,
either, so the whole test is removed.
2014-08-30 01:01:08 +02:00
Rok Mandeljc 51311779b3 samples: gpu: performance: remove inclusion of opencv2/legacy.hpp header
The header is gone now, along with the opencv_legacy module.
2014-08-30 01:01:08 +02:00
Rok Mandeljc e0c8721830 samples: gpu: removed inclusion of non-existent opencv2/contrib/contrib.hpp header, re-introduced TickMeter class in a separate header
This patch removes inclusion of opencv2/contrib/contrib.hpp header,
which does not exist anymore due to removal of opencv_contrib module.

The samples including this header appear to be doing so in order to
use TickMeter class; therefore, the latter is now provided by tick_meter.hpp
header file, located in samples/gpu folder.
2014-08-30 01:01:08 +02:00
Rok Mandeljc 8908b22c9d samples: gpu: removed softcascade example
The example in question cannot be compiled anymore as the softcascade
module has been removed in 3858f2291d.
2014-08-30 01:01:08 +02:00
Rok Mandeljc eb3cb77296 Fixes for compiling with CUDA 6.5
Based on commit feb74b125d from 2.4.9 branch.
2014-08-29 23:09:02 +02:00
Alexander Alekhin 4d474d40e7 Merge pull request #3171 from akarsakov:amd_fft_fix 2014-08-29 16:28:31 +00:00
Alexander Alekhin 4c404cb4cc Merge pull request #3172 from ilya-lavrenov:tapi_transpose_amd 2014-08-29 14:51:38 +00:00
Ilya Lavrenov 71ec6144bd attempt to fix compilation of OpenCL cv::transpose for AMD 2014-08-29 16:59:30 +04:00
Alexander Karsakov d4e6812be2 Added check AmdFft version to be sure that AmdFft binaries are available 2014-08-29 14:23:18 +04:00
Elena Gvozdeva 31ac73c315 fix for cv::memopTypeToStr 2014-08-29 14:18:52 +04:00
Alexander Alekhin 57fec2f2da OCL: enable clAmdFftGetVersion 2014-08-29 13:45:04 +04:00
Vadim Pisarevsky 6ccb7e169d Merge pull request #3163 from StevenPuttemans:fix_nonfree_items 2014-08-29 08:08:52 +00:00
Alexander Karsakov 491bf41356 Disabled native_sqrt for double, since it may be not implemented and gives compilation error. 2014-08-28 17:01:49 +04:00
StevenPuttemans d27e440b2a continue fixing nonfree elements
fixed dependency of stitching module on xfeatures2d module as optional
fixed the initModule_xfeatures2d function that was called in module stitching since it is in another namespace than the standard cv one.
2014-08-28 13:30:47 +02:00
Vadim Pisarevsky 21f1a0ee49 Merge pull request #3161 from ElenaGvozdeva:ocl_perf_gemm 2014-08-28 10:41:11 +00:00
Vadim Pisarevsky 83a0f0ddb1 Merge pull request #3162 from alekcac:fix_in_py_tutor 2014-08-28 10:39:52 +00:00
Alexander Alekhin b332152bef Merge pull request #2956 from ilya-lavrenov:tapi_accumulate 2014-08-28 09:08:51 +00:00
Alexander Karsakov 6b6c7ccfea Added accuracy tests with real and generated data 2014-08-27 17:58:48 +04:00
Alexander Karsakov f7aadd07f6 Added getLines, fill_accum_local kernels 2014-08-27 17:57:22 +04:00
Vadim Pisarevsky d66815978a Merge pull request #3117 from KruchDmitriy:canny_opt 2014-08-27 10:07:55 +00:00
Vadim Pisarevsky 4d9d7e6ded Merge pull request #3160 from akarsakov:ocl_dft_double_support 2014-08-27 10:06:34 +00:00
Alexander Shishkov 9dc5c58f62 Update py_setup_in_windows.rst 2014-08-27 11:49:37 +04:00
Alexander Karsakov a89ff402fc Refactoring of OCL_FftPlan class 2014-08-27 10:33:25 +04:00
Vadim Pisarevsky 2811d40840 Merge pull request #3158 from arielelkin:master 2014-08-26 16:07:10 +00:00
Vadim Pisarevsky b5d073ad3f Merge pull request #3149 from StevenPuttemans:fix_nonfree_includes 2014-08-26 16:03:53 +00:00
Vadim Pisarevsky 7189112308 Merge pull request #3152 from PhilLab:VideoCaptureFix 2014-08-26 16:02:46 +00:00
Vadim Pisarevsky 89605fac04 Merge pull request #3155 from vbystricky:ocloptLaplacian 2014-08-26 16:01:44 +00:00
Elena Gvozdeva 46b6a095a2 changed perf test for ocl_gemm 2014-08-26 15:05:36 +04:00
VBystricky 9ee0789174 Fix issues 2014-08-26 14:39:11 +04:00
PhilLab a0e4600364 VideoCapture did not detect an unopened camera 2014-08-26 09:42:46 +02:00
Alexander Alekhin 6d253a2068 Merge pull request #2921 from ilya-lavrenov:tapi_memop 2014-08-26 06:34:20 +00:00
StevenPuttemans 564a8ed208 adapted all nonfree header inclusion since it doesn't exist anymore as a module 2014-08-25 21:31:34 +02:00
Ariel Elkin d06c73861d Doc: update video processing tutorial code for OpenCV v2.4.9 and v3a 2014-08-25 15:13:13 -03:00
Vadim Pisarevsky b1d01dc757 Merge pull request #3157 from PhilLab:pnpFix 2014-08-25 18:11:10 +00:00
Vadim Pisarevsky 5301fe729e Merge pull request #3154 from PhilLab:patch-4 2014-08-25 18:09:27 +00:00
Vadim Pisarevsky 2211cfe783 Merge pull request #3151 from PhilLab:orbNoKeypoints 2014-08-25 17:10:45 +00:00
PhilLab e95c33dd18 PnP solver: fixed element-wise access 2014-08-25 17:06:17 +02:00
Alexander Karsakov 3ae95150c7 Added double support for OCL version of DFT 2014-08-25 18:08:43 +04:00
vbystricky e75cd74f5a Optimize OpenCL version of Laplacian filter for kernel size great than 3 2014-08-25 17:56:09 +04:00
Philipp Hasper 30742d21d8 CUDA optical flow stubs: missing parameter 2014-08-25 14:49:21 +02:00
Vadim Pisarevsky 3b59a10584 Merge pull request #3153 from PhilLab:patch-3 2014-08-25 11:29:42 +00:00
Alexander Karsakov 038bfb98ec Added fill_accum kernel 2014-08-25 13:55:09 +04:00
Ilya Lavrenov 7017b1250a used new stratehy in cv::accumulate** 2014-08-25 11:25:54 +04:00
Ilya Lavrenov 2c6b7a52e9 improved cv::ocl::predictOptimalVectorWidth 2014-08-25 11:25:01 +04:00
Ilya Lavrenov a350b76738 optimization of cv::accumulate** 2014-08-25 11:25:01 +04:00
Ilya Lavrenov 2f46cf5ddb changed base types for cv::memopTypeToStr 2014-08-25 11:23:46 +04:00
Philipp Hasper 9b1136518c ORB.cl : fixed redefinition of val 2014-08-23 19:07:14 +02:00
Dmitriy Anisimov 9ddb23e025 first implementation KNearest wrapper on KDTree 2014-08-23 18:41:32 +04:00
PhilLab 92826a0436 ORB crashed with no keypoints present 2014-08-23 14:02:15 +02:00
Alexander Karsakov 5c1f71de51 Added make_point_list kernel 2014-08-22 16:50:01 +04:00
Vadim Pisarevsky 4b84d5d2c1 Merge pull request #3139 from bmagyar:patch-2 2014-08-22 12:16:41 +00:00
Vadim Pisarevsky e7539bd2c8 Merge pull request #3144 from ElenaGvozdeva:ocl_morphSmall 2014-08-22 12:14:06 +00:00
Vadim Pisarevsky f624f92e7a Merge pull request #3142 from akarsakov:fix_cvtcolor_luv_rgb_master 2014-08-22 07:24:21 +00:00
U-KruchininD-ПК\KruchininD 6ed168d3af New optimization for canny
new hysteresis

delete whitespaces

fix problem with mad24

Dynamic work group size

dynamic work group size

Fix problem with warnings

Fix some problems with border

Another one fix

Delete trailing whitespaces

some changes

fix problem with warning
2014-08-22 11:22:15 +04:00
Vadim Pisarevsky decebeea0e Merge pull request #3140 from braindevices:master 2014-08-22 07:17:36 +00:00
Vadim Pisarevsky 887a950243 Merge pull request #3116 from shubhra:master 2014-08-22 07:15:40 +00:00
Vadim Pisarevsky 0eb1c7edb1 Merge pull request #3127 from GravityJack:size-math-ops 2014-08-22 07:14:13 +00:00
Vadim Pisarevsky b56933d9dc Merge pull request #3131 from znah:python_namespaces 2014-08-22 07:12:31 +00:00
Vadim Pisarevsky 1efc3cff36 Merge pull request #3124 from f-morozov:optim_pr 2014-08-22 07:04:43 +00:00
Elena Gvozdeva 7ad6b47bc9 fixed ocl_boxFilter 2014-08-22 10:31:13 +04:00
Marc Rollins 17e8d51124 Fixing uninitialized temporary. 2014-08-21 11:41:12 -07:00
Marc Rollins 703921e2fd Reverting pass-by-value changes to arithmetic operators. 2014-08-21 10:37:36 -07:00
Alexander Alekhin 552bda92a9 Merge pull request #3146 from alalek:extra_for_pr3042 2014-08-21 16:47:13 +00:00
Alexander Alekhin 9a7673f950 dummy commit 2014-08-21 20:15:35 +04:00
Alexander Alekhin d47a2988a9 Merge pull request #3128 from asmorkalov:android_tegra_optimizations_build_fix 2014-08-21 15:48:10 +00:00
Alexander Mordvintsev c23d6b67ee blacklisted 'tracking' due to some linking problem 2014-08-21 18:45:50 +04:00
Alexander Mordvintsev 2a9e252f77 fix namespace conflicts (like cv::inpaint and cv::xphoto::inpaint)
whitespace fix
2014-08-21 17:33:21 +04:00
Alexander Karsakov 3d222d313b Fixed range for 'v' channel for 8U images 2014-08-21 17:22:06 +04:00
Elena Gvozdeva 5302e56071 fix for ocl_morphSmall 2014-08-21 16:31:24 +04:00
Alexander Mordvintsev 74c77d826f base class name resolution
fixed find_obj.py
2014-08-21 14:51:03 +04:00
Vadim Pisarevsky de2a8d3706 Merge pull request #3135 from thorikawa:fix-arithmetic-exception-with-ipp 2014-08-21 05:41:18 +00:00
f-morozov 0ae89fe2be AKAZE optimizations 2014-08-21 09:34:52 +04:00
Vadim Pisarevsky 5afaa6b1e7 Merge pull request #3129 from PhilLab:patch-2 2014-08-21 05:30:17 +00:00
Shubhra Pandit 7b2a1d15cc Doc changes for feature changes 1544 and 1557 2014-08-20 20:49:50 -04:00
Ling Wang@z77x a218bdb0d7 fix cmake ocv_add_samples for opencv_contrib/modules/bioinspired
If a sample containing subdirs, a Cmake error will be raised, since the original code can only install FILES.
2014-08-20 08:36:44 -07:00
Vadim Pisarevsky 44e04da79c Merge pull request #2942 from ernest-galbrun:tvl1_chambolle 2014-08-20 14:21:08 +00:00
Bence Magyar 1118a7d15a Update tocDefinitions.rst
Second fix in docs needed for https://github.com/Itseez/opencv_contrib/pull/70
http://www.build.opencv.org/buildbot/builders/precommit-contrib_docs/builds/277
2014-08-20 15:32:05 +02:00
Vadim Pisarevsky b2cd954f24 Merge pull request #3042 from edgarriba:master 2014-08-20 13:18:37 +00:00
Poly Takahiro Horikawa cb0ab87646 Fix arithmetic exception when pass an empty mat with IPP option on. 2014-08-19 19:19:53 -07:00
Vadim Pisarevsky 57a1343f10 Merge pull request #3133 from bmagyar:patch-1 2014-08-19 22:23:59 +00:00
Vadim Pisarevsky a223479107 Merge pull request #3099 from f-morozov:akaze_tutorial 2014-08-19 22:22:23 +00:00
Bence Magyar 04b2d9a453 Fix color table
Apart from not displaying the table, it breaks the doc build of https://github.com/Itseez/opencv_contrib/pull/70.
2014-08-19 18:00:13 +02:00
Alexander Mordvintsev 40d0f853d6 removing modules from blacklist 2014-08-19 19:19:11 +04:00
Alexander Mordvintsev c4c731c0aa fixing warnings
keep old const names for compatibility
2014-08-19 16:57:37 +04:00
Alexander Mordvintsev c22dcb04af fixing warnings 2014-08-19 16:40:09 +04:00
Alexander Mordvintsev e74cddfbd1 put consts into python submodules
maintain set of visited namespaces in CppHeaderParser
WARNING: REMOVED const name conversion (SomeConstName -> SOME_CONST_NAME), discussion needed
2014-08-19 16:40:09 +04:00
Alexander Mordvintsev 6d1c02ffed unified namespace population with 'init_submodule' 2014-08-19 16:40:08 +04:00
Alexander Mordvintsev 4a519a25f3 nested classes support 2014-08-19 16:40:08 +04:00
Alexander Mordvintsev 5ad7f9910f function namespaces partially work 2014-08-19 16:40:07 +04:00
Alexander Mordvintsev e85e83f491 handling namespaces on parsing functions
submodule method tables generation
2014-08-19 16:40:06 +04:00
f-morozov 886319c81d AKAZE fixes and tracking tutorial 2014-08-19 16:35:20 +04:00
PhilLab e09adc4fde Clarified parameter useExtrinsicGuess in solvePnP 2014-08-19 11:08:16 +02:00
Vadim Pisarevsky 8658aef3bf Merge pull request #3104 from dkanafeev:new_ipp_func_master 2014-08-19 09:06:45 +00:00
Vadim Pisarevsky 24163eb929 Merge pull request #3122 from akarsakov:cvtcolor_perf_test_fix 2014-08-19 09:01:35 +00:00
Vadim Pisarevsky 70679b49fc Merge pull request #3121 from akarsakov:ocl_dft_opt 2014-08-19 08:57:53 +00:00
Vadim Pisarevsky bfacad1a99 Merge pull request #3119 from mshabunin:logistic-regression 2014-08-19 08:56:19 +00:00
Ernest Galbrun 2f077fcd99 fixed failing test in opencv_video 2014-08-19 10:00:03 +02:00
Alexander Smorkalov f38ebba34d Build fix for NVIDIA Tegra optimizations integration. 2014-08-19 11:40:25 +04:00
edgarriba deec233519 cleaned dls code 2014-08-19 00:56:13 +02:00
edgarriba 15704c384e cleaned dls code 2014-08-19 00:52:09 +02:00
edgarriba 2653d745fd updated sanity data 2014-08-19 00:35:22 +02:00
edgarriba 6ea73a5bff updated dls perf test 2014-08-19 00:22:08 +02:00
edgarriba 7e2bb63378 Merge branch 'master' of https://github.com/Itseez/opencv 2014-08-18 22:30:00 +02:00
edgarriba 211a8d31d5 Merge branch 'master' of https://github.com/edgarriba/opencv 2014-08-18 21:46:23 +02:00
edgarriba 620387fbe1 Update perf_pnp && ransac model points 2014-08-18 21:46:16 +02:00
Marc Rollins 8fc1848918 Simplifying arithmetic and comparison operator implementation.
Implementing + and - in terms of += and -=.
Implementing != in terms of ==.
2014-08-18 12:25:48 -07:00
Marc Rollins d3d9b538c7 Implementing division operators. 2014-08-18 11:48:38 -07:00
Marc Rollins d7a8166720 Implementing *= operator. Implementing * in terms of it. 2014-08-18 11:42:10 -07:00
Dmitriy Anisimov 37b1a7560c first version of moving KDTree from core to ml 2014-08-18 22:40:31 +04:00
Maksim Shabunin 108caae216 Modified logistic regression module according to comments
- Reworked documentation to reflect actual code
- Removed some unused variables
- Removed unnecessary 'cv::' modifiers
2014-08-18 19:13:59 +04:00
Maksim Shabunin 4667e18831 Updated logistic regression example
- Extracted common operations to separate functions.
- Activated first parameters set.
- Some output formatting.
- Fixed loop break condition in mini_batch_gradient function.
2014-08-18 19:06:58 +04:00
Maksim Shabunin 3e26086f82 Reworked ML logistic regression implementation, initial version 2014-08-18 19:06:58 +04:00
Maksim Shabunin 71770eb790 Fixed ML module build after merge 2014-08-18 19:06:58 +04:00
Rahul Kavi a23836231f fixed warnings in type conversions
fixed warnings in type conversions from size_t to int (in getting size of number of unique classes in a training problem).
2014-08-18 19:06:58 +04:00
Rahul Kavi d20b2a5a97 removed extra comments in train method 2014-08-18 19:06:58 +04:00
Rahul Kavi ae02ecec60 removed a couple of unnecessary comments in Logistic Regression training method 2014-08-18 19:06:58 +04:00
Rahul Kavi f20db35b78 fixed logistic regression documentation warnings 2014-08-18 19:06:58 +04:00
Rahul Kavi 21de04b4a2 fixed default constructor for LogisticRegression class declaration 2014-08-18 19:06:58 +04:00
Rahul Kavi 65eb52a247 removed default value from LogisticRegression constructor function definition 2014-08-18 19:06:57 +04:00
Rahul Kavi e7f14f3d0e fixed missing semicolon in logistic regression documentation 2014-08-18 19:06:57 +04:00
Rahul Kavi 3622de2621 updated mini_batch_size description for LogisticRegressionParams in documentation 2014-08-18 19:06:57 +04:00
Rahul Kavi e4ef0e0ca8 fixed indentation in logistic regression documentation 2014-08-18 19:06:57 +04:00
Rahul Kavi 7c97dbc196 fixed indentation in logistic regression documentation 2014-08-18 19:06:57 +04:00
Rahul Kavi aa35835cfc fixed white space in logistic regression prototype 2014-08-18 19:06:57 +04:00
Rahul Kavi 8995921cc5 fixed white space in logistic regression classifier 2014-08-18 19:06:57 +04:00
Rahul Kavi a9df50eefc updated test for logistic regression 2014-08-18 19:06:57 +04:00
Rahul Kavi b3b4e83aed updated logistic regression definition 2014-08-18 19:06:57 +04:00
Rahul Kavi 95ea09c3dc updated prototype for logistic regression classifier 2014-08-18 19:06:57 +04:00
Rahul Kavi bf2ee3c58a updated prototype for logistic regression classifier 2014-08-18 19:06:52 +04:00
Rahul Kavi 3a6deb3ed3 updated documentation to reflect new api changes for logistic regression 2014-08-18 19:06:52 +04:00
Rahul Kavi 3cdd2b2761 updated logistic regression program with new api example 2014-08-18 19:06:52 +04:00
Rahul Kavi af88f0c067 updated documentation to do reflect changes to logistic regression class 2014-08-18 19:06:52 +04:00
Rahul Kavi 1652b2a443 fixed trailing whitespaces in LogisticRegression code. 2014-08-18 19:06:52 +04:00
Rahul Kavi 5bb43f69ab removed trailing whitespaces from predict function 2014-08-18 19:06:52 +04:00
Rahul Kavi 50031ffb15 removed trailing whitespaces from updated logistic regression definition 2014-08-18 19:06:52 +04:00
Rahul Kavi 78f3b0ad1f removed unnecessary semicolon in LogisticRegression class documentation 2014-08-18 19:06:52 +04:00
Rahul Kavi 56d715b091 fixed typedef for LogisticRegression. Updated LogisticRegression prototype with newer C++ API 2014-08-18 19:06:52 +04:00
Rahul Kavi e4a90c19cc updated documentation to reflect newer changes to LogisticRegression class 2014-08-18 19:06:48 +04:00
Rahul Kavi 64aaa6e1ae updated test for logistic regression after changes to LogisticRegression class 2014-08-18 19:06:48 +04:00
Rahul Kavi d5ad4f3255 added updated logistic regression prototype with newer C++ API 2014-08-18 19:06:48 +04:00
Rahul Kavi 0e13f33193 rewrote the code to update API, removed inheritance from CvStatModel. 2014-08-18 19:06:48 +04:00
Rahul Kavi b8ea21b2e5 updated logistic regression sample program 2014-08-18 19:06:48 +04:00
Rahul Kavi 6c74439d56 fixed trailing white-space in logistic regression class 2014-08-18 19:06:48 +04:00
Rahul Kavi 7612e7af05 fixed trailing white-space in sample program for logistic regression 2014-08-18 19:06:48 +04:00
Rahul Kavi 3a6466d2e1 updated logistic regression sample program 2014-08-18 19:06:48 +04:00
Rahul Kavi 6ae43a2243 added logistic regression classifier 2014-08-18 19:06:48 +04:00
Rahul Kavi fcfeb2451b added logistic regression prototype 2014-08-18 19:06:48 +04:00
Rahul Kavi 3039ed7682 added test for logistic regression 2014-08-18 19:06:36 +04:00
Rahul Kavi 3bf6c3c2aa added documentation for logistic regression classifier 2014-08-18 19:06:36 +04:00
Rahul Kavi b9902f39b7 added reference to logistic regression document 2014-08-18 19:06:36 +04:00
Rahul Kavi 8355293306 added program to demonstrate use of logistic regression classifier 2014-08-18 19:06:36 +04:00
Rahul Kavi 62470d8a33 added sample data file to test logistic regression program 2014-08-18 19:06:36 +04:00
Alexander Karsakov cf1ae3513f Fixed getConversionInfo() for YUV2RGBA_* conversions 2014-08-18 18:34:44 +04:00
Alexander Shishkov a37640cdd0 Update perf_pnp.cpp 2014-08-18 18:34:01 +04:00
Alexander Karsakov fa818d03b8 Changed twiddle buffer creation to use OCL buffer pool (if possible) 2014-08-18 18:22:52 +04:00
Ernest Galbrun 6207d338dd merged new master branch
changed tests for tvl1 optflow
correction of a bug preventing compilation with cuda (fmin changed to fminf)
2014-08-18 15:29:45 +02:00
Vadim Pisarevsky 0ffc53bafe Merge pull request #3107 from vpisarev:fixed_win_build 2014-08-18 09:00:54 +00:00
Ernest Galbrun fae69df9a9 Merge remote-tracking branch 'remotes/origin/master' into tvl1_chambolle
Conflicts:
	modules/video/doc/motion_analysis_and_object_tracking.rst
2014-08-17 22:08:12 +02:00
Shubhra Pandit 6ca893be23 Adding feature 1544 and 1557
-cv::findHomography added a parameter for RANSAC iterations
 -cv::findHomography added a parameter for RANSAC confidence
2014-08-17 13:06:06 -04:00
Vadim Pisarevsky dea40e5e99 Merge pull request #3086 from fpuja:pragma_warning4127_fixing 2014-08-16 16:50:41 +00:00
Vadim Pisarevsky 5febdae36a Merge pull request #3114 from abidrahmank:PyBindTutorials 2014-08-16 16:45:26 +00:00
abidrahmank 7f8e1f480a Python bindings tutorial 2014-08-16 16:40:18 +05:30
Vadim Pisarevsky e9729a9601 multiple yet minor fixes to make most of the tests pass on Mac with Iris graphics 2014-08-16 00:29:10 +04:00
Vadim Pisarevsky 90905fb1e2 Merge pull request #3111 from vpisarev:make_ximgproc_compile 2014-08-15 15:08:34 +00:00
Vadim Pisarevsky 740c5234b1 fix compile problems with contributed ximgproc/xphoto 2014-08-15 18:00:41 +04:00
dkanafeev 1b0f0d7ead Intel Summer School 2014
Switch branch to master.
New IPP func - ippiCopy
Conv: YUV2GRAY_420
2014-08-15 12:54:31 +04:00
Vadim Pisarevsky daaa5a1824 removed duplicated Hershey fonts 2014-08-15 12:09:16 +04:00
Alexander Alekhin b70a391e6c fix VCS version 2014-08-15 12:09:16 +04:00
Vadim Pisarevsky dfbeaddc72 Merge pull request #3106 from LeszekSwirski:fix-gemm-buf-allocate 2014-08-15 05:44:54 +00:00
jaco dbb0fcdc7a #pragma warning4127 fixation modified 2 2014-08-14 19:27:53 +02:00
Roman Donchenko 2222393b0a Merge tag '3.0.0-alpha'
OpenCV 3.0.0 Alpha
2014-08-14 19:19:19 +04:00
Roman Donchenko fb9a143429 Set status to alpha 2014-08-14 19:17:29 +04:00
Leszek Swirski de806330fd Fix reallocation of D buffer in gemm 2014-08-14 15:54:54 +01:00
Alexander Alekhin 52ac61d87c Merge pull request #3088 from vbystricky:ocl_enableNormEtc 2014-08-14 14:34:40 +00:00
vbystricky 942ff5be57 Disable OpenCL version of minMaxIdx with mask on AMD devices 2014-08-14 17:39:41 +04:00
Vadim Pisarevsky 95a4943762 Merge pull request #3103 from vpisarev:core_imgproc_optim_rearrangements 2014-08-14 13:39:01 +00:00
Vadim Pisarevsky ed8a7fa541 Merge pull request #3101 from akarsakov:ipp_thresh_fix 2014-08-14 11:42:14 +00:00
Vadim Pisarevsky 0e46b4cd03 Merge pull request #3102 from akarsakov:ocl_denoising_fix 2014-08-14 10:59:32 +00:00
Vadim Pisarevsky 75487d43f5 fixed trailing whitespaces 2014-08-14 14:53:02 +04:00
Vadim Pisarevsky 9a5aa4b23c trying to solve compile problems; temporarily disabled some tests for just added optimization algo's 2014-08-14 14:37:30 +04:00
Alexander Alekhin cf4a536440 Merge pull request #3098 from jet47:fix-cuda-compilation 2014-08-14 10:05:49 +00:00
Vadim Pisarevsky 00b2124876 fixing more compile problems with Java bindings etc 2014-08-14 13:48:52 +04:00
Vadim Pisarevsky 4530c7ad08 trying to fix builds 2014-08-14 13:18:04 +04:00
Vadim Pisarevsky f7243be79c Merge pull request #3090 from akarsakov:ocl_reduce_fix 2014-08-14 08:52:18 +00:00
Vadim Pisarevsky 5240a03217 Merge pull request #3100 from vpisarev:disabled_neon_split_merge_on_ios 2014-08-14 08:51:44 +00:00
Vadim Pisarevsky 257463719b removed optim module; moved its functionality to core and photo modules; moved drawing functions from core to imgproc. Removed FilterEngine etc. from public API 2014-08-14 12:50:07 +04:00
vbystricky aab6f6c56f Set sync=true in ocl_minMaxIdx kernel call. For tests 2014-08-14 12:14:56 +04:00
Alexander Karsakov 75ede6e17c Minimal image size is set to 5*5 for OCL path of fastNlMeansDenoising and fastNlMeansDenoisingColored since it breaks tests with test_loop_times=30 and in general doesn't make sense for computation on GPU. 2014-08-14 12:14:33 +04:00
Alexander Karsakov 8760a344ec Fixed incorrect pointer conversion for in-place threshold 2014-08-14 11:02:55 +04:00
Vadim Pisarevsky 6f86c9f118 another mac-related fix, let's squeeze it in this PR too 2014-08-14 10:45:47 +04:00
Vadim Pisarevsky 5d8098a2c3 avoid compiler warnings 2014-08-14 10:06:10 +04:00
VBystricky c5632d412e Change epsilon for NORM_INF_2args accuracy tests 2014-08-13 23:50:32 +04:00
Vadim Pisarevsky a602185fb6 Merge pull request #3097 from mshabunin:gdal-support 2014-08-13 19:26:10 +00:00
Vadim Pisarevsky 5f590ebed0 Merge pull request #3094 from Adil-Ibragimov:minor_fixes_in_Mat-data 2014-08-13 18:28:51 +00:00
Vadim Pisarevsky 71ff228ad3 Merge pull request #3089 from Adil-Ibragimov:fix_cuda_constness 2014-08-13 18:09:42 +00:00
Vadim Pisarevsky a37876ab95 fixed build of iOS framework another time; clang does not like the new NEON-optimized split/merge 2014-08-13 19:59:26 +04:00
jaco b81dcbdf2a #pragma warning4127 fixation modified
Now use cleaner approach:

#pragma warning( push )
#pragma warning( disable: ThatWarning )
//code with ThatWarning here
#pragma warning( pop )
2014-08-13 17:59:16 +02:00
Vladislav Vinogradov 9786e0a760 fix cudabgsegm module compilation 2014-08-13 19:20:23 +04:00
vbystricky 1fe403f461 Enable OpenCL version of norm and convertScaleAbs or 32F data
Fix error in minmaxloc.cl
Change test for convertScaleAbs
Fix minMaxIdx for _src2 align
Change epsilon on the tests
2014-08-13 18:33:01 +04:00
mshabunin 3ed89a8879 Merge with master and fix conflicts 2014-08-13 18:24:11 +04:00
Vladislav Vinogradov 8392296eda remove -fvisibility-inlines-hidden from CUDA compiler flags
it generates warning
2014-08-13 18:08:48 +04:00
Vladislav Vinogradov f5d9359da8 use directory-based include_directories command if we build with CUDA 2014-08-13 18:08:08 +04:00
Vladislav Vinogradov 0825120f6a move CUDA compilation step from ocv_glob_module_sources to ocv_add_library 2014-08-13 18:07:31 +04:00
Vadim Pisarevsky 12c69ad490 Merge pull request #3095 from vpisarev:restore_ocl_div_mul_and_repeat 2014-08-13 13:56:19 +00:00
Adil Ibragimov 9ac06a9333 fix for gcc 2014-08-13 16:34:18 +04:00
Vadim Pisarevsky d97f9fc477 now the tests pass with loop_times==30 2014-08-13 16:32:01 +04:00
Adil Ibragimov 8a4a1bb018 Several type of formal refactoring:
1. someMatrix.data -> someMatrix.prt()
2. someMatrix.data + someMatrix.step * lineIndex -> someMatrix.ptr( lineIndex )
3. (SomeType*) someMatrix.data -> someMatrix.ptr<SomeType>()
4. someMatrix.data -> !someMatrix.empty() ( or !someMatrix.data -> someMatrix.empty() ) in logical expressions
2014-08-13 15:21:35 +04:00
Vadim Pisarevsky 30111a786a Merge pull request #3085 from nickdademo:pvapi_fix_decimation_enum 2014-08-13 10:51:46 +00:00
Vadim Pisarevsky 3cd7941098 Merge pull request #3083 from akarsakov:ocl_transpose_check_locmem 2014-08-13 10:50:51 +00:00
Vadim Pisarevsky 01bd4961e3 Merge pull request #3081 from akarsakov:small_fixes 2014-08-13 10:50:33 +00:00
Alexander Karsakov c3100eeb19 Fixed buffer initialization in reduce kernel. Enabled OCL version of reduce for SUM, MAX, MIN modes. 2014-08-13 12:03:06 +04:00
Adil Ibragimov dfd0b297ce datastart must be non-const in CUDA. 2014-08-13 11:11:33 +04:00
Alexander Alekhin 28f3a44e33 Merge pull request #3080 from ElenaGvozdeva:ocl_stich 2014-08-12 16:52:41 +00:00
edgarriba 3c3d695d4d Perf test update 2014-08-12 18:29:43 +02:00
edgarriba 301ed34142 removed old headers 2014-08-12 17:36:23 +02:00
edgarriba 7da9800694 removed old headers 2014-08-12 17:22:35 +02:00
edgarriba 4a214c08e5 removed old code 2014-08-12 17:07:38 +02:00
edgarriba 12f8d8069d removed old code 2014-08-12 16:49:19 +02:00
edgarriba 1dec1645e5 Merge branch 'master' of https://github.com/Itseez/opencv 2014-08-12 16:45:22 +02:00
edgarriba de2861e7a9 DLS performance modifications 2014-08-12 16:20:22 +02:00
edgarriba d1f4f6f4b8 DLS performance modifications 2014-08-12 16:15:19 +02:00
Alexander Karsakov 713ddb89bd Set minimum matrix size for AmdBlas::gemm to 20 since it works incorrect for small sizes 2014-08-12 18:02:29 +04:00
Vadim Pisarevsky c97c0be4f2 Merge pull request #3082 from ElenaGvozdeva:ocl_morphSmall 2014-08-12 13:56:59 +00:00
Vadim Pisarevsky 5505aa28ce Merge pull request #3078 from vpisarev:refactor_features2d_take3 2014-08-12 13:56:17 +00:00
jaco 58b3bc2d7e #pragma warning4127 fixed for cvstd.inl.hpp 2014-08-12 15:28:39 +02:00
Nick D'Ademo 91676de638 Change decimation enum values so they can be used in resolution calculations.
BUGFIX: Fixed bugged when setting PVAPI property CV_CAP_PROP_FRAME_HEIGHT.
2014-08-12 15:18:11 +02:00
Alexander Karsakov b4d3b34acf Disabled ippiFilterBoxBorder_* in case maskSize equal roiSize for any dimension 2014-08-12 16:38:11 +04:00
Elena Gvozdeva 1c7ee88b84 fixed test for ocl PlaneWarperTest 2014-08-12 16:37:34 +04:00
Alexander Karsakov 3deea1c3ce Added check required local memory size for non-inplace transpose kernel 2014-08-12 16:26:08 +04:00
Vadim Pisarevsky 5119564579 Merge pull request #3033 from nathanjackson:clahe_datatypes 2014-08-12 10:45:29 +00:00
Vadim Pisarevsky 1629d50999 removed some more trailing whitespaces 2014-08-12 14:33:18 +04:00
Alexander Karsakov 5898dcae4a Added ROUNDING_EPS for identical rounding after dividing on different platforms 2014-08-12 14:28:48 +04:00
Alexander Alekhin da806cc3e7 Merge pull request #3073 from vbystricky:ocl_fixMinMaxLoc 2014-08-12 10:21:41 +00:00
Elena Gvozdeva 8124d10526 fixed Erode and Dilate in case of kernel = Mat() 2014-08-12 12:19:13 +04:00
vbystricky 6fb282aa39 Remove mul24, for CV8UC3 3840x2160 it generates implementation specific result 2014-08-12 11:25:23 +04:00
Alexander Karsakov 10b3d00fd1 Increased epsilon for passing test with IPPICV 2014-08-12 10:42:42 +04:00
Vadim Pisarevsky bca4eb5e00 fixed more doc builder warnings 2014-08-12 10:40:23 +04:00
Alexander Karsakov f3dfdfef8a Fixed warning with "uninitialized local variable" 2014-08-12 10:35:15 +04:00
Nathan Jackson 563200fbf6 CPU (non-OpenCL) CLAHE now supports CV_16UC1. 2014-08-11 18:25:08 -04:00
Vadim Pisarevsky d119afafdb removed the stuff that's now in xfeatures2d; temporarily added dummy definition of SIFT to make doc builder pass (will remove it later) 2014-08-12 00:30:06 +04:00
Vadim Pisarevsky fe7b48aa8f removed the stuff that's now in xfeatures2d; temporarily added dummy definition of SIFT to make doc builder pass (will remove it later) 2014-08-12 00:29:56 +04:00
Vadim Pisarevsky 27d2d3cbac fixed doc builder complains and the test failures 2014-08-12 00:03:40 +04:00
Vadim Pisarevsky 31df47b6ea moved nonfree and a part of features2d to opencv_contrib/xfeatures2d 2014-08-11 23:26:39 +04:00
Vadim Pisarevsky f937f4d951 Merge pull request #3077 from kenlck:master 2014-08-11 16:41:30 +00:00
Vadim Pisarevsky 6df1198e8b Merge pull request #3071 from mshabunin:stitch-fix 2014-08-11 16:08:40 +00:00
edgarriba dccc10ff12 DLS perf 2014-08-11 17:53:43 +02:00
edgarriba 2666da892f DLS perf update 2014-08-11 17:09:26 +02:00
Alexander Alekhin 8fd61c9aa6 Merge pull request #3075 from akarsakov:ipp_imgproc_fix 2014-08-11 15:02:53 +00:00
Alexander Alekhin 73115233bb Merge pull request #3074 from ElenaGvozdeva:ocl_lut 2014-08-11 15:01:25 +00:00
edgarriba cc81b4a5cd SOLVEPNP_* flags whitespace 2014-08-11 16:31:28 +02:00
edgarriba afdb67b462 SOLVEPNP_* flags 2014-08-11 16:28:09 +02:00
Vadim Pisarevsky 8202ab37d8 Merge pull request #3072 from nickdademo:pvapi_decimation_binning 2014-08-11 14:04:38 +00:00
Alexander Alekhin b7d1a70919 Merge pull request #3063 from akarsakov:ocl_warps_check 2014-08-11 13:20:11 +00:00
Low Chin Kian 911e1bd1e4 Allow full range IPv4 support, up to 255.255.255.255
Signed-off-by: Low Chin Kian <kenlck1990@gmail.com>
2014-08-11 21:08:37 +08:00
Elena Gvozdeva b73b28ab9c fix for ocl_lut 2014-08-11 16:21:55 +04:00
vbystricky dfe5fff2f5 Restore OpenCL branch for minmaxLoc on float data 2014-08-11 15:57:29 +04:00
Alexander Karsakov 498da24b8b Disabled some IPP calls of cvtColor since it breaks OCL accuracy tests
with test_loop_times=30
2014-08-11 15:52:53 +04:00
Alexander Karsakov 835b5e2179 Disabled ippiConvert_32f16s_C1R since it breaks OCL accuracy tests of remap with test_loop_times=30. 2014-08-11 15:50:06 +04:00
Alexander Karsakov 6b0e63b652 Enabled IPPMorphReplicate in case BORDER_CONSTANT only for 3x3 kernels. 2014-08-11 15:37:05 +04:00
Nick D'Ademo 2b94bcffb9 Added get and set for additional PVAPI properties: DecimationHorizontal, DecimationVertical, BinningX, BinningY 2014-08-11 13:30:36 +02:00
mshabunin c54b8f9b00 Merge remote-tracking branch 'master' into stitch-fix
* 'master' of github.com:itseez/opencv: (82 commits)
  moved part of video to contrib/{outflow, bgsegm}; moved matlab to contrib
  added some basic functionality needed by the new face module (moved from the old "contrib")
  moved to the new opencv_contrib/face module
  fixed various warnings and obvious errors reported by clang compiler and the coverity tool.
  Fixed review comment from Vadim Pisarevsky
  modified farneback sample to use T-API
  ECC patch by the author (G. Evangelidis); fixed some OCL Farneback optical flow test failures on Mac
  small fix for GaussianBlur ocl test
  fix binary package build
  small fix for ocl_resize
  fix IOS framework
  fixed test ocl_MatchTemplate for sparse matrix
  Fixed typos
  fixing error, wrong template method param.
  fixing Mac build
  some formal changes (generally adding constness)
  Fixed choice of kercn and rowsPerWI for non-Intel device.
  fixed nDiffs for CalcBackProject
  fixed tests for ocl_filter2d, ocl_matchTemplate, ocl_histogram.cpp
  Fixed issue: Mat::copyTo(UMat) if device copy is obsolete. Added test.
  ...

Conflicts:
	modules/core/include/opencv2/core/mat.inl.hpp
2014-08-11 14:50:08 +04:00
edgarriba 90b3086f4a RANSAC test confidence 0.99 2014-08-11 12:31:10 +02:00
Vadim Pisarevsky 07744af790 Merge pull request #3066 from vpisarev:minor_fixes 2014-08-11 10:27:30 +00:00
edgarriba 6c8b11afee DLS test 2014-08-11 11:31:18 +02:00
edgarriba b7a19a9a5f Removed Timer 2014-08-11 11:06:05 +02:00
edgarriba d7f0b9de25 DLS test 2014-08-11 11:02:00 +02:00
Vadim Pisarevsky 0f66e2757b Merge pull request #3069 from vpisarev:refactor_video 2014-08-11 08:47:59 +00:00
edgarriba c7f6c0cb9f Fixed warnings + RANSAC confidence to double 2014-08-11 10:17:42 +02:00
edgarriba 213241c06a DLS test update 2014-08-11 09:44:24 +02:00
Vadim Pisarevsky 8368d54d36 Merge pull request #3061 from ElenaGvozdeva:ocl_resize 2014-08-11 06:41:48 +00:00
Vadim Pisarevsky 9ef373f6a5 Merge pull request #3038 from yury-gorbachev:core_arithm_neon 2014-08-10 20:20:04 +00:00
Vadim Pisarevsky d0137b6d2d moved part of video to contrib/{outflow, bgsegm}; moved matlab to contrib 2014-08-10 23:24:16 +04:00
Vadim Pisarevsky 4de4ff5682 Merge pull request #3067 from vpisarev:minor_fixes2 2014-08-10 10:52:57 +00:00
Vadim Pisarevsky 92f326a1b1 Merge pull request #3068 from vpisarev:added_face_module 2014-08-10 10:50:56 +00:00
Vadim Pisarevsky e2f24f43c9 added some basic functionality needed by the new face module (moved from the old "contrib") 2014-08-10 01:54:16 +04:00
Vadim Pisarevsky e49536e88b moved to the new opencv_contrib/face module 2014-08-10 01:52:54 +04:00
Vadim Pisarevsky 05e7c29de5 fixed various warnings and obvious errors reported by clang compiler and the coverity tool. 2014-08-10 00:10:05 +04:00
edgarriba 2d26f60192 test dls 2014-08-09 21:54:22 +02:00
edgarriba 3780de9d98 test for DLS 2014-08-09 21:26:38 +02:00
edgarriba e2edfecb80 fixed white space 2014-08-09 21:08:46 +02:00
edgarriba 67eb6dde75 warning removed 2014-08-09 20:55:18 +02:00
edgarriba 591355d2c8 remove whitespaces 2014-08-09 20:49:44 +02:00
edgarriba 9547110533 Update tutorial 2014-08-09 19:47:42 +02:00
edgarriba bc250c2e3f bug fixed 2014-08-09 19:15:46 +02:00
edgarriba 80b4f99b1e bug fixed 2014-08-09 18:16:44 +02:00
edgarriba d09b404178 tutorial update 2014-08-09 17:32:52 +02:00
edgarriba 7ecad71ab0 fixed warnings 2014-08-09 17:18:47 +02:00
edgarriba 8c4b8cc0b4 fixed warnings 2014-08-09 17:14:24 +02:00
Yury Gorbachev 9a233999a9 Fixed review comment from Vadim Pisarevsky 2014-08-09 13:37:53 +04:00
Vadim Pisarevsky 09907eeb62 Merge pull request #2639 from kazuki-ma:cv_mat_foreach 2014-08-09 08:25:05 +00:00
Vadim Pisarevsky 68305703bd modified farneback sample to use T-API 2014-08-08 22:45:07 +04:00
Vadim Pisarevsky 0224a20ff6 ECC patch by the author (G. Evangelidis); fixed some OCL Farneback optical flow test failures on Mac 2014-08-08 22:33:40 +04:00
Vadim Pisarevsky 99eed2d885 Merge pull request #3057 from Adil-Ibragimov:adding-constness 2014-08-08 17:27:47 +00:00
Vadim Pisarevsky 72cac5e19f Merge pull request #3065 from alalek:fix_binary_package_build 2014-08-08 17:19:04 +00:00
Vadim Pisarevsky 62f90219fc Merge pull request #3064 from ElenaGvozdeva:ocl_GaussianBlur 2014-08-08 17:16:38 +00:00
Vadim Pisarevsky 74457cd3b5 Merge pull request #3055 from akarsakov:copyto_UMat_fix 2014-08-08 14:20:02 +00:00
Vadim Pisarevsky ce0297ed61 Merge pull request #3050 from ElenaGvozdeva:ocl_fixed_impg 2014-08-08 14:06:49 +00:00
Vadim Pisarevsky 88672f414b Merge pull request #3056 from akarsakov:ocl_setIdentity_fix 2014-08-08 14:03:46 +00:00
Vadim Pisarevsky 951014803b Merge pull request #3060 from akarsakov:ocl_dft_fix 2014-08-08 14:03:27 +00:00
Vadim Pisarevsky 1da3f9d85f Merge pull request #3062 from alalek:fix_ios_framework 2014-08-08 14:01:04 +00:00
Elena Gvozdeva 7cba3ac4f8 small fix for GaussianBlur ocl test 2014-08-08 17:47:57 +04:00
edgarriba 3f5d3b2d40 video opening path modified 2014-08-08 15:36:27 +02:00
Alexander Alekhin b3a54d588b fix binary package build 2014-08-08 17:24:59 +04:00
edgarriba f8c5acee4c modified number test points 2014-08-08 15:20:38 +02:00
Alexander Karsakov 7849c35de1 Changed check condition in tests for warpAffine and warpPerspective 2014-08-08 17:14:38 +04:00
Maksim Shabunin f908c2b0e3 Revert "Avoid obtaining several identical dimensions between two LSH sub-vectors by choosing orthogonal sub-vectors."
This reverts commit e85bacff7b.
2014-08-08 16:59:24 +04:00
Maksim Shabunin 032c363ea0 Revert "Fix a heap issue with static on Windows"
This reverts commit 8e93c19de3.
2014-08-08 16:59:13 +04:00
Maksim Shabunin 0be18aca81 Revert "Allows to choose orthogonal sub-vectors for LSH without using a static table among LshTable instances"
This reverts commit e63d7de87c.
2014-08-08 16:58:35 +04:00
Maksim Shabunin 4c54b287e4 Revert "Fix local variable shadowing"
This reverts commit 2f8b5731da.
2014-08-08 16:55:10 +04:00
edgarriba 7d8a16ae39 remove unused tutorials 2014-08-08 14:45:43 +02:00
Elena Gvozdeva b7899c3d5c small fix for ocl_resize 2014-08-08 16:12:10 +04:00
Alexander Alekhin 03435c0d74 fix IOS framework 2014-08-08 15:57:54 +04:00
edgarriba 8b732e086d updated ransanc model 2014-08-08 13:52:15 +02:00
edgarriba c07cd007eb Multi class tutorial compilation 2014-08-08 11:46:26 +02:00
Elena Gvozdeva b5f251c815 fixed test ocl_MatchTemplate for sparse matrix 2014-08-08 13:37:18 +04:00
Alexander Karsakov 6ad4521b78 Fixed typos 2014-08-08 13:11:35 +04:00
Alexander Alekhin d0f789dc90 Merge pull request #3044 from akarsakov:fix_ocl_tests 2014-08-07 20:14:17 +00:00
Adil Ibragimov 8dab2ffce7 fixing error, wrong template method param. 2014-08-07 17:43:32 +04:00
Adil Ibragimov 6b05ca589d fixing Mac build 2014-08-07 17:06:22 +04:00
edgarriba e5a91a8be8 Modification Ransac model points 2014-08-07 14:59:01 +02:00
Adil Ibragimov 98d5731ad8 some formal changes (generally adding constness) 2014-08-07 15:49:14 +04:00
Alexander Karsakov c5ad6de596 Fixed choice of kercn and rowsPerWI for non-Intel device. 2014-08-07 15:37:26 +04:00
Elena Gvozdeva 7dd7dd97cd fixed nDiffs for CalcBackProject 2014-08-07 15:36:00 +04:00
Elena Gvozdeva c9b5d8cf4c fixed tests for ocl_filter2d, ocl_matchTemplate, ocl_histogram.cpp 2014-08-07 15:36:00 +04:00
edgarriba 8c08258cf2 moved headers 2014-08-07 13:06:24 +02:00
edgarriba 3a2cf37115 fixed conflicts 2014-08-07 12:41:47 +02:00
edgarriba 837f001789 update cmake 2014-08-07 11:55:17 +02:00
edgarriba 381574bdb7 Modified cmake 2014-08-07 11:33:32 +02:00
Alexander Karsakov 00221e96fd Fixed issue: Mat::copyTo(UMat) if device copy is obsolete. Added test. 2014-08-07 13:16:02 +04:00
Alexander Karsakov 44fbfb2cf6 Fixed extrapolation in pyrDown 2014-08-07 10:39:25 +04:00
Alexander Karsakov 2a0b39d30a Fixed calculate_histogram kernel 2014-08-07 10:39:24 +04:00
Alexander Karsakov eb9fdb0164 Fixed rounding in remap INTER_LINEAR mode 2014-08-07 10:39:24 +04:00
Alexander Karsakov fec21239c8 Revert optimization for warpAffine INTER_NEAREST mode 2014-08-07 10:39:18 +04:00
Vadim Pisarevsky d30729a816 Merge pull request #3047 from prattmic:python2and3 2014-08-07 06:38:37 +00:00
Vadim Pisarevsky 44f24efad4 Merge pull request #3054 from zillatrooper:master 2014-08-07 06:34:31 +00:00
arc 3d0a270a66 Merge branch 'master' into python2and3 2014-08-07 01:04:26 -04:00
Michael Pratt e9ccadebed Support Python 2 and 3 in test script
Add Python 3 support to the Python test.py script.

The print function is used in place of the print statement.

The urlopen function has been moved to urllib.request in Python 3, so
attempt to import it from either location.

TestCase.assert_() has been deprecated in place of
TestCase.assertTrue().

The tests all pass in both Python 2 and 3.
2014-08-07 00:51:48 -04:00
Michael Pratt 7d41ce23a7 Build Python 3 bindings in subdirectory
Build the Python 3 cv2 module in lib/python3/, to avoid potential naming
conflicts with the Python 2 bindings.

The Python 2 bindings are placed directly in lib/, where they are
required for the Buildbot to successfully execute the Python tests.
2014-08-07 00:21:42 -04:00
Michael Pratt d921cde4d2 Add opencv_matlab to Python ignored modules
Requested by @vpisarev in #3047.
2014-08-07 00:16:49 -04:00
Vadim Pisarevsky 0428ce4703 Merge pull request #3037 from PhilLab:pnpPatch 2014-08-06 20:21:05 +00:00
Björn Wöldecke f3aa4bdf59 fix misinterpretation of empty window name
The documentation states, that a NULL or an empty window name can be used
to refer to the control panel. But the string parameters of the C++ frontend
methods cannot be NULL and converting an empty string to a const char* by
c_str() doesn't produce a NULL pointer, but an empty string. Unfortunately,
the const char* pointer is just passed on to the standard C functions in
the QT backend, which doesn't check for the empty string case.

There are two places where the empty string check could have been introduced:
inside the frontend or inside the backend. As long as the documentation only
mentions this as a special case for the QT backend, the best place seems to
be there.
2014-08-06 19:02:48 +02:00
Vadim Pisarevsky ca183707f2 Merge pull request #3039 from alalek:ocv_world 2014-08-06 14:52:52 +00:00
Vadim Pisarevsky bab5700a09 Merge pull request #3013 from ElenaGvozdeva:ocl_matchTemplate 2014-08-06 11:26:07 +00:00
Vadim Pisarevsky d611684d9e Merge pull request #3041 from adrians:optimize_split 2014-08-06 09:22:38 +00:00
edgarriba f1b6809eee Updated Utils functions 2014-08-06 10:05:26 +02:00
edgarriba 2881f2a096 Fixed warnings 2014-08-06 09:21:38 +02:00
edgarriba d2665b655e Fixed warnings 2014-08-06 08:41:14 +02:00
Michael Pratt 9d9411555f Place Python library out in dedicated folder
Place the built Python module library in a dedicated folder inside of
lib/.  This ensures that even if the Python 2 and Python 3 module names
conflict, they will not overwrite one another.
2014-08-06 02:31:30 -04:00
Michael Pratt 976c727eec Fix a few more PYTHON_NUMPY_INCLUDE_PATH
The previous commit fixing references to PYTHON_NUMPY_INCLUDE_PATH
missed a few unset()s.
2014-08-06 02:30:35 -04:00
edgarriba e14f91dd37 Update headers 2014-08-06 08:18:11 +02:00
edgarriba ddf5c86f3a Added code 2014-08-06 08:12:55 +02:00
edgarriba 57d2cb8962 deleted: src/CsvReader.cpp
deleted:    src/CsvReader.h
	deleted:    src/CsvWriter.cpp
	deleted:    src/CsvWriter.h
	deleted:    src/Mesh.cpp
	deleted:    src/Mesh.h
	deleted:    src/Model.cpp
	deleted:    src/Model.h
	deleted:    src/ModelRegistration.cpp
	deleted:    src/ModelRegistration.h
	deleted:    src/PnPProblem.cpp
	deleted:    src/PnPProblem.h
	deleted:    src/RobustMatcher.cpp
	deleted:    src/RobustMatcher.h
	deleted:    src/Utils.cpp
	deleted:    src/Utils.h
	deleted:    src/main_detection.cpp
	deleted:    src/main_registration.cpp
	deleted:    src/main_verification.cpp
	deleted:    src/test_pnp.cpp
2014-08-06 08:11:03 +02:00
Michael Pratt 218b12c557 Merge branch 'master' into python2and3 2014-08-06 01:45:07 -04:00
edgarriba 43301096d3 Update tutorial 2014-08-05 20:06:47 +02:00
Alexander Alekhin fc0f254f00 make distrib with world (shared libs) 2014-08-05 20:37:18 +04:00
Alexander Alekhin 55188fe991 world fix 2014-08-05 20:12:35 +04:00
edgarriba 7b0be9cf8f Update code 2014-08-05 17:27:20 +02:00
edgarriba 0d2bc9b0a1 Removed whitespaces 2014-08-05 17:02:06 +02:00
edgarriba 2353436cb5 Removed whitespace 2014-08-05 16:53:30 +02:00
Alexander Alekhin d2f1c00719 Merge pull request #3045 from vbystricky:ocl_MeanStdDevFix 2014-08-05 14:52:22 +00:00
edgarriba 4447dbe265 Removed whitespace 2014-08-05 16:41:07 +02:00
Alexander Alekhin 06547120aa Merge pull request #3043 from vbystricky:ocl_ConvertToAccurTestFix 2014-08-05 14:17:06 +00:00
Alexander Alekhin 74d2a6eed1 Merge pull request #3035 from ElenaGvozdeva:ocl_test_fix 2014-08-05 14:16:16 +00:00
edgarriba e3afc32693 Removed whitespace 2014-08-05 16:16:05 +02:00
edgarriba 55819ae464 Tutorial code restructure 2014-08-05 15:48:54 +02:00
vbystricky 774d277c1f Fix error in OpenCl version of meanstddev for continues src and not continues mask 2014-08-05 17:30:06 +04:00
edgarriba 23785faf02 Update for NON BOOST libraries 2014-08-05 14:47:06 +02:00
vbystricky 2637b18b67 Fix epsilon for OpenCL function ConverTo, for convertation from float to integer types 2014-08-05 16:34:23 +04:00
edgarriba 16e750dd37 Update for Boost libraries 2014-08-05 14:02:23 +02:00
edgarriba 1727e0acf6 Update for Boost libraries 2014-08-05 14:00:23 +02:00
edgarriba dfa3ccdea9 Update for Boost libraries 2014-08-05 13:43:01 +02:00
edgarriba a3e74ec521 Merge remote-tracking branch 'upstream/master'
Conflicts:
	modules/calib3d/doc/camera_calibration_and_3d_reconstruction.rst
2014-08-05 12:59:47 +02:00
Elena Gvozdeva 7999fbf765 fixed ocl_integral 2014-08-05 12:01:28 +04:00
Elena Gvozdeva f32b52ea8d fixed test for CvtColor RGB -> Luv 2014-08-05 11:54:26 +04:00
Elena Gvozdeva 8c2c3b54d9 fixed ocl tests for BlendLinear, BoxFilter, Integral 2014-08-05 11:41:08 +04:00
Adrian Stratulat b2acd1f75a Vectorize split & merge for NEON 2014-08-05 06:51:36 +00:00
Vadim Pisarevsky a05ce00a65 Merge pull request #2879 from alalek:ocl_runtime_flags 2014-08-04 16:43:01 +00:00
Vadim Pisarevsky a58767eff8 Merge pull request #3036 from vbystricky:ocl_NormAccurTestFix 2014-08-04 14:54:12 +00:00
Vadim Pisarevsky 432b7cb235 Merge pull request #3032 from vpisarev:refactor_ml2 2014-08-04 14:51:38 +00:00
Yury Gorbachev 61423a2d47 ARM NEON accelerated implementation of cv::addWeighted, cv::inRange and cv::compare functions.
NOT verified on target platform, compilation passes with and without NEON.
2014-08-04 16:44:51 +04:00
unknown 3fe4980ce1 Double precision for solvePnPRansac() 2014-08-04 14:20:32 +02:00
vbystricky 2d587ad691 Prevent generating test case with mask filled 0 only 2014-08-04 15:12:36 +04:00
Vadim Pisarevsky cb9b88e65b fixed more compile warnings on Windows 2014-08-04 14:22:31 +04:00
Vadim Pisarevsky dbedc63c55 Merge pull request #3034 from jet47:fix-compilation 2014-08-04 09:38:34 +00:00
Vladislav Vinogradov a3da3a01e1 fix test_opencv_imgproc compilation 2014-08-04 12:13:33 +04:00
Vladislav Vinogradov cdb7b83741 fix python module compilation with enabled CUDA support:
filterout all CUDA related headers from python module include headers
2014-08-04 12:12:51 +04:00
Alexander Alekhin add9ce46c3 Merge pull request #3030 from vbystricky:ocl_DotReduceAccurTestFix 2014-08-04 08:09:38 +00:00
Vadim Pisarevsky 222f8a3d5e hopefully fixed test failure on Linux 2014-08-04 01:16:45 +04:00
Vadim Pisarevsky 24b01a8e4f continuing to debug boost and fix MSVC compile errors 2014-08-03 21:21:11 +04:00
Vadim Pisarevsky 98a1181240 fixed the condition 2014-08-03 13:15:43 +04:00
Vadim Pisarevsky 79b593d8d8 more fixes and more debugging code 2014-08-03 13:08:03 +04:00
Vadim Pisarevsky eeb786fcfd fixed compile warnings from MSVC; fixed warnings in Python bindings; added some debugging code 2014-08-03 12:46:28 +04:00
Vadim Pisarevsky 9cb79b9abb temporarily disabled java bindings for ml; hopefully fixed warnings etc. 2014-08-03 04:28:31 +04:00
Vadim Pisarevsky 8e9d1d9fe6 temporarily disabled java bindings for ml; hopefully fixed warnings etc. 2014-08-03 04:28:20 +04:00
Vadim Pisarevsky 2520e335d1 removed many extra whitespaces; fixed 1 warning 2014-08-03 03:08:25 +04:00
Vadim Pisarevsky 28ca6ac05e fixed building html docs 2014-08-03 02:34:47 +04:00
Vadim Pisarevsky d3cdfefa03 Merge pull request #3027 from vbystricky:cvtColorLuv2RGB 2014-08-02 21:52:24 +00:00
Vadim Pisarevsky c6593d02a6 updated docs 2014-08-03 01:41:30 +04:00
Vadim Pisarevsky c20ff6ce19 made everything compile and even run somehow 2014-08-03 01:41:09 +04:00
VBystricky 2026094691 Increase epsilon for OpenCL version UMatDot and ReduceAvg accurency tests 2014-08-02 13:21:34 +04:00
Alexander Alekhin c595457ea0 Merge pull request #3011 from vbystricky:oclopt_morthosmall 2014-08-01 17:21:59 +00:00
Alexander Alekhin 11dd36f3aa Merge pull request #3028 from vbystricky:ocl_MergeAccurTestFix 2014-08-01 17:15:53 +00:00
Alexander Alekhin b33a093844 Merge pull request #3029 from vbystricky:ocl_UMatOpAccurTestFix 2014-08-01 17:15:38 +00:00
Roman Donchenko 74e58ddbb1 Disable the broken fisheye undistortImage test 2014-08-01 19:50:17 +04:00
VBystricky 0f9b79ef64 Change min-max to clamp 2014-08-01 19:45:11 +04:00
vbystricky aad4104297 Fix accurency test for OpenCL matrix operations 2014-08-01 18:30:20 +04:00
vbystricky 184c5917bf Fix accurency test of OpenCL merge function. 2014-08-01 17:53:24 +04:00
Vadim Pisarevsky 936536a284 Merge pull request #2671 from syilma:HomographyDecomp 2014-08-01 13:08:20 +00:00
Vadim Pisarevsky d01ca30f55 Merge pull request #3018 from fradelg:master 2014-08-01 13:06:36 +00:00
Ernest Galbrun 6594d52185 Merge remote-tracking branch 'remotes/origin/master' into tvl1_chambolle 2014-08-01 14:54:55 +02:00
vbystricky b724208510 Fix Luv2RGB function 2014-08-01 16:39:12 +04:00
Roman Donchenko 983e75e5de Merge remote-tracking branch 'origin/master' into merge-2.4 2014-08-01 15:01:41 +04:00
Vadim Pisarevsky 345b69d5f7 Merge pull request #3024 from jet47:fix-cudabgsegm-compilation 2014-08-01 09:42:40 +00:00
Vadim Pisarevsky 05164bf713 Merge pull request #2608 from Siddharthk:master 2014-08-01 09:13:32 +00:00
Alexander Alekhin b3e31fb8d6 Merge pull request #3023 from vbystricky:ocl_minMaxLoc 2014-08-01 08:57:37 +00:00
edgarriba 3e2a57ff35 Update for non Eigen users 2014-08-01 10:48:39 +02:00
Fco. Javier Delgado del Hoyo 625fd61313 Removed OpticalFlowBM test from cudaoptflow module 2014-08-01 09:28:19 +02:00
Vadim Pisarevsky 18de8dee62 Merge pull request #3009 from vpisarev:ios_experiments 2014-07-31 18:20:07 +00:00
Alexander Alekhin f8aecb2a32 Merge pull request #3002 from vbystricky:oclopt_pyrdown 2014-07-31 15:43:18 +00:00
vbystricky b48e487d53 Enable ocl version of minmaxloc with mask 2014-07-31 19:12:10 +04:00
vbystricky 11a0e3ff78 Fix error in OCL minmaxloc 2014-07-31 19:04:38 +04:00
Ernest Galbrun 7b8bb4248b Merge branch 'cuda_concurrency' into tvl1_chambolle 2014-07-31 16:08:57 +02:00
Ernest Galbrun ae26368e78 Merge branch 'master' into cuda_concurrency 2014-07-31 16:03:51 +02:00
Ernest Galbrun 917107e635 removed bm legacy 2014-07-31 16:01:54 +02:00
Alexander Alekhin 17a6b8cdc0 Merge pull request #3021 from ElenaGvozdeva:ocl_flip 2014-07-31 13:56:44 +00:00
Vladislav Vinogradov 7030a1f9a2 fix cudabgsegm module compilation 2014-07-31 17:55:59 +04:00
Elena Gvozdeva 9db8592aa8 fixed ocl_flip for cn==3 2014-07-31 16:57:47 +04:00
Vadim Pisarevsky 2f2a9ad536 Merge pull request #3020 from vpisarev:ocl_disable_more_funcs 2014-07-31 12:54:13 +00:00
Vadim Pisarevsky b0cd822924 trying to make the tests pass 2014-07-31 14:24:21 +04:00
Vadim Pisarevsky 10b60f8d16 continuing refactoring ml samples; added "max vote" response to ANN_MLP. Probably, should make it in less hacky way 2014-07-31 14:12:10 +04:00
edgarriba 56704b5e95 Update tutorial 2014-07-31 11:47:59 +02:00
edgarriba 08e8f9ca45 Added some definitions 2014-07-31 11:47:26 +02:00
Michael Pratt 52df3b232d Reference PYTHON_NUMPY_INCLUDE_DIRS not PYTHON_NUMPY_INCLUDE_PATH
PYTHON_NUMPY_INCLUDE_PATH was a typo, it should have been
PYTHON_NUMPY_INCLUDE_DIRS.
2014-07-31 03:27:06 -04:00
Fco. Javier Delgado del Hoyo fd10557e78 Removed cvCalcOpticalFlowBM from cudaoptflow test 2014-07-31 09:21:44 +02:00
Fco. Javier Delgado del Hoyo 8def44047a Removed cvCalcOpticalFlowBM from performance test 2014-07-31 09:08:29 +02:00
Michael Pratt c9876c3cd8 Merge branch 'master' into python2and3 2014-07-31 01:13:16 -04:00
Samson Yilma 4fe04775d1 Merge remote-tracking branch 'upstream/master' into HomographyDecomp 2014-07-30 20:36:41 -04:00
Samson Yilma 3b608fa489 added comment. 2014-07-30 19:32:37 -04:00
Samson Yilma 3c5eb7de84 updated documentation for decomposeHomography 2014-07-30 18:53:33 -04:00
Vadim Pisarevsky 223cdcd0ee fixed compilation of some samples; fixed ANN_MLP::predict 2014-07-30 22:53:46 +04:00
Vadim Pisarevsky 1a1097ab23 Merge pull request #2983 from wnoise:shrink-global-cuda-usage 2014-07-30 15:55:02 +00:00
Vadim Pisarevsky ef8647fe30 put IPP ReduceSum_32f back 2014-07-30 19:12:11 +04:00
edgarriba 9a25cb012d Update some text 2014-07-30 17:05:06 +02:00
Vadim Pisarevsky 2ab7fb6051 Merge pull request #3017 from f-morozov:akaze 2014-07-30 15:03:47 +00:00
Vadim Pisarevsky 5267ed46c7 1. disabled OpenCL acceleration for cv::multiply() (CV_32F), cv::divide (CV_32F), cv::convertScaleAbs (CV_32F) and cv::reduce (SUM, CV_32F), cv::reduce (MIN & MAX), cv::flip (3-channel case).
2. changed the number of test loops from 1 to 30 (except for cv::pow() test, which fails for yet unknown reason)
3. disabled IPP acceleration for 3-channel norms.
4. modified relativeNorm test function to handle very small values
2014-07-30 18:19:47 +04:00
f-morozov 7f82960897 AKAZE fixes, tests and tutorial 2014-07-30 18:02:08 +04:00
edgarriba 85ccac2633 Added help() 2014-07-30 15:23:52 +02:00
Vadim Pisarevsky a782ee93de Merge pull request #2992 from snikulov:upmerge_jpeg_tweak 2014-07-30 12:48:41 +00:00
Vadim Pisarevsky e368f17caf fixed python bindings generation 2014-07-30 16:11:08 +04:00
edgarriba 4a86900761 Added help() 2014-07-30 13:32:27 +02:00
edgarriba 69f1ee8732 Code tutorial 2014-07-30 13:08:19 +02:00
edgarriba 6ff58f02e2 Code tutorial 2014-07-30 12:57:18 +02:00
edgarriba 94968c81e0 Code tutorial 2014-07-30 12:57:11 +02:00
edgarriba b58979d057 Code tutorial 2014-07-30 12:57:04 +02:00
edgarriba 38c2cc8521 Code tutorial 2014-07-30 12:56:55 +02:00
edgarriba 31bec45998 Code tutorial 2014-07-30 12:56:46 +02:00
edgarriba b33a2f24fa Code tutorial 2014-07-30 12:56:30 +02:00
edgarriba 9d18f5c458 Code tutorial 2014-07-30 12:56:22 +02:00
edgarriba 6f5876f8f7 Code tutorial 2014-07-30 12:55:35 +02:00
edgarriba 2848f43acc Code tutorial 2014-07-30 12:54:49 +02:00
edgarriba 319dbd2eb7 Code tutorial 2014-07-30 12:53:43 +02:00
edgarriba 924e062426 Code tutorial 2014-07-30 12:53:24 +02:00
edgarriba 3b24aa2441 Code tutorial 2014-07-30 12:53:14 +02:00
edgarriba be4c1afb0b Code tutorial 2014-07-30 12:53:06 +02:00
edgarriba 550e3721ae Code tutorial 2014-07-30 12:51:59 +02:00
edgarriba 64c164c111 Code tutorial 2014-07-30 12:39:46 +02:00
edgarriba 74e52df3cd Code tutorial 2014-07-30 12:33:27 +02:00
edgarriba 7334e54a63 Code tutorial 2014-07-30 12:31:19 +02:00
Elena Gvozdeva 90ac88cb8e use std::min,max 2014-07-30 14:28:02 +04:00
edgarriba 0ac84755a0 Update tutorial 2014-07-30 12:10:29 +02:00
edgarriba b6b0c2aa8e MACRO for EIGEN libraries 2014-07-30 11:22:25 +02:00
vbystricky bd8894002e Fix some problems 2014-07-30 11:56:28 +04:00
Fco. Javier Delgado del Hoyo d3d0434f07 Removed opencv_legacy dependency from cudaoptflow 2014-07-30 09:00:23 +02:00
vbystricky 878dec65c8 Optimize OpenCL version of morfology and box filters for small filter kernels 2014-07-30 10:32:52 +04:00
Sergei Nikulov eaec132091 #2992: update after review 2014-07-30 00:03:41 +04:00
Vadim Pisarevsky ba3783d205 initial commit; ml has been refactored; it compiles and the tests run well; some other modules, apps and samples do not compile; to be fixed 2014-07-29 23:54:23 +04:00
Vadim Pisarevsky dce1824a91 Merge pull request #2940 from davembradley:master 2014-07-29 17:22:30 +00:00
Vadim Pisarevsky cf2a307832 Merge pull request #2991 from kovand11:calibrateDebevecFix 2014-07-29 16:58:32 +00:00
Andrey Pavlenko 4c8a9c5d70 Merge pull request #3012 from vpisarev:clean_objdetect 2014-07-29 15:29:35 +00:00
Vadim Pisarevsky 101769d26c eliminated some unnecessary instructions 2014-07-29 18:10:18 +04:00
Vadim Pisarevsky a1791c6be3 Merge pull request #3016 from fradelg:master 2014-07-29 13:50:35 +00:00
Fco. Javier Delgado del Hoyo b8bc99676d Another typo in comment inside OpenNI2 cmake file 2014-07-29 11:13:00 +02:00
Fco. Javier Delgado del Hoyo 6e4562bb56 Fixed typo in OpenNI2 cmake file 2014-07-29 11:10:58 +02:00
Elena Gvozdeva dbb5993d13 added dft for all platforms 2014-07-29 12:21:52 +04:00
Elena Gvozdeva dc3c691c8c new block size for dft 2014-07-29 12:06:20 +04:00
Elena Gvozdeva e7216a5987 Used float instead of int for CV_8U in sumTemplate 2014-07-29 11:34:39 +04:00
Vadim Pisarevsky 277802483f Merge pull request #2987 from anishp:master 2014-07-28 21:15:39 +00:00
Vadim Pisarevsky e9bed17d98 Merge pull request #3008 from jet47:fix-cudacodec-dependecies 2014-07-28 21:13:59 +00:00
siddharth 4cdc155eac test 2014-07-29 00:15:11 +05:30
siddharth 0972a2d758 Fixed mixed cloning bug 2014-07-29 00:15:11 +05:30
siddharth 88d05a89d4 removed build error
Whitespaces removed
2014-07-29 00:15:11 +05:30
siddharth 14d0b763ec changed demo tutorial path 2014-07-29 00:15:11 +05:30
siddharth 1a14d8506d recursive filter output corrected 2014-07-29 00:15:11 +05:30
siddharth 14631be59f Updated Documentation 2014-07-29 00:15:11 +05:30
Vadim Pisarevsky 41df63aacd Merge pull request #3010 from vpisarev:ocl_disable_some_norms2 2014-07-28 17:24:42 +00:00
Vadim Pisarevsky a587759d76 Merge pull request #2989 from smvv:gstreamer_capture_init 2014-07-28 16:00:33 +00:00
Vadim Pisarevsky 962b519708 Merge pull request #2996 from akarsakov:ocl_dft_new_concept 2014-07-28 15:59:59 +00:00
Vadim Pisarevsky 0c749fd7e5 Merge pull request #2998 from ernest-galbrun:cuda_concurrency 2014-07-28 15:59:43 +00:00
Vadim Pisarevsky af83884dc7 disabled ocl_minmaxloc on 32-bit data completely 2014-07-28 19:35:06 +04:00
Vadim Pisarevsky 1925fab427 disabled some more stuff 2014-07-28 19:32:06 +04:00
Vadim Pisarevsky 11e9e375a3 fixed compile warning with GCC 2014-07-28 19:23:46 +04:00
Vadim Pisarevsky 2fd01dcced fixed doc builder warnings 2014-07-28 17:18:28 +04:00
Vadim Pisarevsky 97f6dd1820 trying to make OpenCL builder green 2014-07-28 17:16:02 +04:00
Vadim Pisarevsky 1ad9827fc4 removed ERFilter (to be moved to opencv_contrib/modules/text) and lineMOD (to be moved to opencv_contrib/modules/rgbd) 2014-07-28 16:48:53 +04:00
Ernest Galbrun 5623701acb performance issue for cuda TVL1 when gamma = 0 2014-07-28 14:24:21 +02:00
Vadim Pisarevsky 00263dd664 Merge pull request #2179 from adishavit:feature-SupportClipboardCopyOnWindows 2014-07-28 11:52:27 +00:00
Vadim Pisarevsky f42bb0bd65 disable OpenCL difference norms with mask, since some of the tests fail 2014-07-28 15:45:54 +04:00
Vadim Pisarevsky 4255746c00 fixed compile warnings and removed extra whitespaces 2014-07-28 15:20:25 +04:00
Vadim Pisarevsky 1310dc4ca2 Merge pull request #2994 from znah:py_hpp_glob 2014-07-28 11:15:21 +00:00
Vadim Pisarevsky 50a1def80b Merge pull request #3006 from smvv:fix_findContours_for_python2 2014-07-28 11:13:45 +00:00
Vadim Pisarevsky cb492cc24d Merge pull request #3007 from kobigurk:master 2014-07-28 11:12:14 +00:00
Vadim Pisarevsky ef0f010437 Merge pull request #3003 from ElenaGvozdeva:ocl_sum 2014-07-28 11:08:08 +00:00
Vadim Pisarevsky 4dfb613c3e optimized Bayer=>RGB/RGBA/Gray conversion using Neon intrinsics. Fixed recently introduced build error in iOS framework. 2014-07-28 14:54:41 +04:00
Alexander Karsakov fecfaf4092 Using std::map in PlanCache 2014-07-28 14:19:47 +04:00
edgarriba 4ddc6a4a77 Update for DLS test 2014-07-28 12:03:02 +02:00
edgarriba 0427b70a2f Filtering solutions with imaginary part 2014-07-28 12:01:39 +02:00
Ernest Galbrun df8f1a4355 removed legacy header 2014-07-28 10:58:19 +02:00
Elena Gvozdeva 27d97aa231 fixed 2014-07-28 12:21:00 +04:00
Vladislav Vinogradov ba706177cb fix cudacodec module dependecies 2014-07-28 12:13:52 +04:00
Alexander Mordvintsev 586ace1873 double to float cast warning fix 2014-07-27 18:25:42 +04:00
Kobi Gurkan 6cac76bfe4 fixes tab indentation - replacing with 4 spaces 2014-07-27 17:14:54 +03:00
Kobi Gurkan fc8f0e341b adding support for 16-bit 4 channel tiffs
- when IMREAD_UNCHANGED is set in flags, the tiff is read with 4 channels
- adding test for read/write
2014-07-27 17:09:05 +03:00
Alexander Mordvintsev 5f47f70183 module blacklist 2014-07-27 18:03:27 +04:00
Alexander Mordvintsev a2ae1db31c 'adas' extra module doesn't produce .lib on windows (causes link error) 2014-07-27 17:41:12 +04:00
Alexander Mordvintsev 9ab3b89c53 pass header list to gen2.py by a text file (avoid command line length limit on windows) 2014-07-27 17:17:36 +04:00
Alexander Mordvintsev 42ecfc5538 fixed parsing enums with tailing comma
gen2.py reports headers it processes
cmake file restructured
2014-07-27 17:17:35 +04:00
Alexander Mordvintsev 964657a155 glob for python module dependences 2014-07-27 17:17:35 +04:00
Alexander Mordvintsev 1d1bfd3d7d automatic search for headers for python wrapper generation 2014-07-27 17:17:35 +04:00
Sander Mathijs van Veen d25770ee76 Fix Python 2 bindings for findContours
The sanity check prevents Python 2 from calling findContours, because the
Python 2 bindings pass an empty matrix for `_contours`. If `_contours` is not
empty, the channel and depth check should determine whether the matrix is of
the correct type and size.

Note: the Python 2 bindings passes a matrix of type `STD_VECTOR_MAT` to
parameters of the type `OutputArrayOfArrays`.
2014-07-26 16:40:09 +02:00
Vadim Pisarevsky 7da0e37ba8 Merge pull request #2999 from jpuigcerver:traincascade_choose_threads 2014-07-25 13:24:47 +00:00
Vadim Pisarevsky ee90b88dd7 Merge pull request #2720 from pglotov:master 2014-07-25 12:54:22 +00:00
Vadim Pisarevsky 8e80f9b7a8 Merge pull request #1292 from adrians:neon-pull 2014-07-25 12:29:49 +00:00
Vadim Pisarevsky 603030b005 Merge pull request #2993 from vbystricky:oclopt_warp_affine 2014-07-25 11:26:24 +00:00
Elena Gvozdeva fe29af2e58 Fixed bug in reduce.cl 2014-07-25 14:51:30 +04:00
edgarriba 5f35bed5c5 Delete Debug functions 2014-07-25 11:54:41 +02:00
edgarriba 9cad1dfa0d Update C headers for DLS 2014-07-25 11:49:20 +02:00
edgarriba 5980613317 Update 2014-07-25 11:46:28 +02:00
vbystricky e49d148d47 Optimize ocl function pyrDown 2014-07-25 13:39:19 +04:00
edgarriba 5f54a22d29 Update documentation for DLS 2014-07-25 11:39:06 +02:00
edgarriba a4e21c8fa8 Update DLS test 2014-07-25 11:29:34 +02:00
Alexander Karsakov 37d01e2d27 Added license header, using cv::Ptr, small fixes. 2014-07-25 13:27:00 +04:00
edgarriba a3f065c409 DLS working 2014-07-25 11:01:47 +02:00
Adrian Stratulat a98ce86ca3 Add NEON intrinsics to core/src/arithm.cpp 2014-07-24 19:45:32 +00:00
Andrey Pavlenko 1f0ca00d75 Merge pull request #3000 from akarsakov:ocl_dft_new_tests 2014-07-24 13:30:16 +00:00
Alexander Karsakov e51c0810b6 Added accuracy and performance tests for DFT all modes. 2014-07-24 15:17:31 +04:00
Alexander Karsakov 66ac46214d Final refactoring, fixes 2014-07-24 13:23:02 +04:00
Joan Puigcerver 16a82b1747 Added an option to traincascade program to select the maximum number of threads to use during training 2014-07-23 22:47:51 +02:00
Sander Mathijs van Veen facb2f9a81 Reset class members to NULL after gst_*_unref() 2014-07-23 19:15:16 +02:00
edgarriba 48c4a79d2e DLS full algorithm compiling 2014-07-23 17:26:03 +02:00
Sander Mathijs van Veen f8442da945 Initialize all pointers of CvCapture_GStreamer correctly 2014-07-23 14:41:17 +02:00
Ernest Galbrun 551ab83cf2 trailing whitespace 2014-07-23 14:34:22 +02:00
Ernest Galbrun d7038423dd Merge branch 'master' of https://github.com/Itseez/opencv 2014-07-23 14:21:45 +02:00
Ernest Galbrun 6a769c92b3 modified default stream initialization to allow concurrent calls modified cuda surf.cuda.cpp to allow concurrent call 2014-07-23 14:21:21 +02:00
Vadim Pisarevsky da1ac35930 Merge pull request #2990 from vbystricky:highgui_split2 2014-07-23 11:27:25 +00:00
Vadim Pisarevsky 7bd7c85b1d Merge pull request #2919 from larshg:Openni2Support 2014-07-23 11:23:48 +00:00
Alexander Alekhin 58cf2a8f19 Merge pull request #2995 from ElenaGvozdeva:ipp_DFT 2014-07-23 10:50:43 +00:00
Elena Gvozdeva 4fdd6de8e8 Fixed ippiDFT call 2014-07-23 13:39:31 +04:00
edgarriba 730fe9e582 Hessian+ cayley2rotbar 2014-07-22 17:56:25 +02:00
Alexander Karsakov 1d2cf0e20e Added nonzero_rows support 2014-07-22 18:31:08 +04:00
Alexander Karsakov 52f76a3283 Added rest Elena's changes 2014-07-22 18:31:08 +04:00
Alexander Karsakov 7791264525 Added multi-block scheme 2014-07-22 18:31:03 +04:00
Alexander Karsakov 2b9e556055 Added Elena's changes with implemented DFT_INVERSE C2C mode. 2014-07-22 18:27:31 +04:00
Alexander Karsakov b17bf031f6 Added DFT_SCALE for forward transforms 2014-07-22 18:27:31 +04:00
Alexander Karsakov 6c8b6bd0c7 Added packing to CCS format 2014-07-22 18:27:25 +04:00
Alexander Karsakov ed07241f89 Completed all forward transforms. 2014-07-22 18:27:17 +04:00
Alexander Karsakov e5a3ab3cb9 Added fftplan cache 2014-07-22 18:27:08 +04:00
Alexander Karsakov 0318d27720 Enabled precalculated wave 2014-07-22 18:26:58 +04:00
Alexander Karsakov 5dd9263848 Multi-radix with kernel generation 2014-07-22 18:25:59 +04:00
Alexander Alekhin 63a8cb594a Merge pull request #2961 from ilya-lavrenov:tapi_corners 2014-07-22 09:38:11 +00:00
vbystricky 716218cac4 Optimize ocl version of warp_affine 2014-07-22 13:22:40 +04:00
edgarriba b1b9a29e48 Extracting Eigenvalues and Eigenvectors 2014-07-21 17:45:54 +02:00
András Kovács d1c7983fe5 calibrateDebevec index fix (issue 3664) 2014-07-21 17:27:03 +02:00
Sergey Nikulov 9d107fb2d5 fixed test compilation 2014-07-21 19:26:26 +04:00
Sergey Nikulov bd144cfa64 upmerged pull req #2974 to master - added more jpeg options to imgcodecs 2014-07-21 18:56:35 +04:00
vbystricky fd51c133df Add depends from highgui to imgcodecs and videoio. And include header from imgcodecs and videoio to imgcodecs 2014-07-21 15:10:41 +04:00
Alexander Alekhin 9e3124a1c9 Merge pull request #2960 from ilya-lavrenov:tapi_perf_fix 2014-07-21 09:10:24 +00:00
Alexander Alekhin 315c80f793 Merge pull request #2986 from vbystricky:videoio_fix 2014-07-21 08:21:18 +00:00
edgarriba 40f6d320c2 last update 2014-07-21 09:31:45 +02:00
Anish Pednekar d2493393db added macro guard to enable overriding ENABLE_LOG 2014-07-20 21:06:37 +05:30
VBystricky cc703b01df Fix build errors with cap_v4l on Linux 2014-07-20 18:27:14 +04:00
Lars Glud 1242a66119 Openni2 support 2014-07-20 15:04:11 +02:00
Lars Glud 4dcd37f699 Merge remote-tracking branch 'origin/master' into Openni2Support
Conflicts:
	modules/highgui/CMakeLists.txt
	modules/highgui/include/opencv2/highgui.hpp
	modules/highgui/include/opencv2/highgui/highgui_c.h
2014-07-20 14:28:10 +02:00
Vadim Pisarevsky 9a58b1a3a0 Merge pull request #2925 from BloodAxe:osx-framework-script 2014-07-19 18:04:15 +00:00
Vadim Pisarevsky a7006ac21c Merge pull request #2979 from PhilLab:patch-2 2014-07-18 09:58:07 +00:00
Vadim Pisarevsky 17d69be902 Merge pull request #2933 from ilya-lavrenov:sse_moments 2014-07-18 09:25:22 +00:00
PhilLab e82241cba5 Function for drawing arrows
Porting the [PR 2970](https://github.com/Itseez/opencv/pull/2970) To the new InputOutputArray type
2014-07-18 10:04:44 +02:00
Aaron Denney 4644689d5a And remove final vestiges. 2014-07-17 09:43:21 -07:00
Aaron Denney 85601e03dd remove constant memory use in compute_data_cost 2014-07-17 09:43:21 -07:00
Aaron Denney 52516085d9 remove constant memory from init_data_cost 2014-07-17 09:43:21 -07:00
Aaron Denney 1ff270e41c init_message no longer uses constant memory. 2014-07-17 09:43:21 -07:00
Aaron Denney 9b8002cd43 remove use of constant memory in calc_all_iterations/compute_message/message_per_pixel 2014-07-17 09:43:21 -07:00
Aaron Denney b792419cde Remove compute_disp()'s use of constant memory. 2014-07-17 09:43:21 -07:00
Aaron Denney 6d86d63ac5 Last of csbp load_constants() gone. 2014-07-17 09:43:21 -07:00
Aaron Denney 9bc71f4cb6 Deconstify minimum disparity. 2014-07-17 09:43:21 -07:00
Aaron Denney eed5cbc5db More constant removal. 2014-07-17 09:43:21 -07:00
Aaron Denney 3ab117df04 Change struct with single static function to function. 2014-07-17 09:43:20 -07:00
Aaron Denney 021b0cb4d5 Pass max_disc_term as kernel parameter. 2014-07-17 09:43:20 -07:00
Aaron Denney 0e2ea45c93 ndisp no longer constant 2014-07-17 09:43:20 -07:00
Aaron Denney 2832cfdfe5 No longer use constant memory for image step. 2014-07-17 09:43:20 -07:00
Aaron Denney d8d946a458 Constify cuda csbp 2014-07-17 09:43:20 -07:00
Aaron Denney 2982e77495 Pass in images and scratch space so that multiple copies can run concurrently. 2014-07-17 09:43:20 -07:00
Aaron Denney fe29ed461c Move shared interface to header file rather than repeating. 2014-07-17 09:43:20 -07:00
Aaron Denney e532bd50d5 Move shared interface to header file rather than repeating. 2014-07-17 09:43:20 -07:00
Aaron Denney 1533d0448f cdata_weight always positive; fewer multiplications. 2014-07-17 09:43:20 -07:00
Aaron Denney d848704b35 cuda::DisparityBilateralFilter no longer uses constant memory for parameters
Now multiple filters can be used in the same context without stepping on each other.
2014-07-17 09:43:20 -07:00
Vadim Pisarevsky 8f8450793a Merge pull request #2964 from vbystricky:highgui_split 2014-07-16 19:29:36 +00:00
Lars Glud 8b32235854 Openni2 support 2014-07-16 12:37:53 +02:00
edgarriba 42ab7fd876 dls() no compiles 2014-07-16 00:06:29 +02:00
Petr Glotov 7a77cf584a added timelapse 2014-07-15 09:32:47 -07:00
Vadim Pisarevsky dbefbbc522 Merge pull request #2910 from ilya-lavrenov:sse2_canny 2014-07-15 09:46:28 +00:00
Vadim Pisarevsky 40370345c5 Merge pull request #2765 from pradeep-pyro:kullback_leibler 2014-07-15 08:57:31 +00:00
Vadim Pisarevsky b1793e2fb9 Merge pull request #2939 from adishavit:sample-fix_stitching_pipeline 2014-07-15 08:09:04 +00:00
edgarriba fb67ab1257 Initial DLS add 2014-07-15 09:58:49 +02:00
pradeep 7171431e7c Changed cv::log to std::log 2014-07-15 12:32:53 +08:00
VBystricky ca307669d4 Refresh code. Fix merge conflict 2014-07-14 23:30:50 +04:00
Vadim Pisarevsky b63a7e66db Merge pull request #2953 from gongzg:master 2014-07-14 19:21:15 +00:00
vbystricky d58f736935 Split highgui module to videoio and highgui 2014-07-14 23:16:47 +04:00
Vadim Pisarevsky f773cd9a3e Merge pull request #2947 from vbystricky:capDShow 2014-07-14 18:53:25 +00:00
Alexander Alekhin 381986d044 Merge pull request #2882 from akarsakov:ocl_pyrDown_opt 2014-07-14 18:48:28 +00:00
Roman Donchenko 3490a5aded Merge pull request #2962 from alalek:fix_v4l_build 2014-07-14 08:20:54 +00:00
Alexander Alekhin e169083fed Merge pull request #2918 from vbystricky:oclopt_reduce2 2014-07-12 05:00:57 +00:00
Alexander Alekhin df74a266cf Merge pull request #2963 from ilya-lavrenov:tapi_bufferpool 2014-07-11 14:55:13 +00:00
Alexander Alekhin 0876ec7a67 Merge pull request #2935 from vbystricky:oclopt_meanStdDev 2014-07-11 14:53:46 +00:00
Marvin Smith 67e23ed972 Fixing double to uchar conversion warning. 2014-07-11 07:33:42 -07:00
Alexander Alekhin cbf63b0709 Merge pull request #2851 from ilya-lavrenov:tapi_set_identity 2014-07-11 10:00:16 +00:00
Alexander Alekhin 910d8f8e0b Merge pull request #2888 from ilya-lavrenov:tapi_remap 2014-07-11 09:59:27 +00:00
Ilya Lavrenov f2a2467de3 enabled BufferPool 2014-07-11 12:21:10 +04:00
Alexander Alekhin 6dd3244019 fix build 2014-07-10 18:08:38 +04:00
Ilya Lavrenov fee3d6931b corners 2014-07-10 17:17:24 +04:00
Ilya Lavrenov c949845a6b fixed perf test 2014-07-10 16:03:31 +04:00
Alexander Alekhin a0816c6d15 Merge pull request #2927 from ilya-lavrenov:tapi_lut 2014-07-10 09:38:37 +00:00
Vadim Pisarevsky 347eaa8685 Merge pull request #2943 from vbystricky:highgui_imgcodecs 2014-07-10 05:28:44 +00:00
edgarriba 9abcd88435 Upate test ransac 2014-07-09 17:39:32 +02:00
edgarriba a5d40d7674 Test Run OK 2014-07-09 17:27:08 +02:00
edgarriba 89246e1a45 Update Ransac documentation 2014-07-09 10:59:00 +02:00
edgarriba ba5a8ee299 Solvepnpransac() returns boolean 2014-07-09 10:37:37 +02:00
Zhigang Gong 2e49ca4903 Avoid unmap an umat(ocl) which hasn't been mapped at all.
According to opencl 1.2 spec 5.4.2:
  enqueues a command to unmap a previously mapped region of a memory object.
  ...
  CL_INVALID_VALUE if mapped_ptr is not a valid pointer returned by
  clEnqueueMapBuffer, or clEnqueueMapImage for memobj.

So if the u->data is not from a clEnqueueMapBuffer call, we should not
call clEnqueueUnmapMemObject() unmap it. With this patch, the cases
./opencv_test_video --gtest_filter=OCL_Video/FarnebackOpticalFlow.Mat/*
could work well with beignet 0.9.1, Otherwise, it will get a
CL_INVALID_VALUE at the clEnqueueUnmapMemObject().

Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
2014-07-09 16:21:20 +08:00
pradeep 0d49f97128 Fixed truncation warning 2014-07-09 15:29:47 +08:00
pradeep f8b23cff18 Fixed test errors, added support for C data types. 2014-07-09 13:39:40 +08:00
Alexander Alekhin 0f1a0a9818 Merge pull request #2951 from ilya-lavrenov:tapi_ipp_filter2d 2014-07-08 15:21:35 +00:00
edgarriba ce07024a44 Updated solvePnPRansac() 2014-07-08 17:09:55 +02:00
Ilya Lavrenov e8f5c2fcf6 OpenCL before IPP 2014-07-08 18:51:27 +04:00
edgarriba e395e03040 Real Time Pose tutorial 2014-07-08 16:34:49 +02:00
edgarriba b74cfe8c2c nothing 2014-07-08 16:26:56 +02:00
edgarriba ac8cce3963 solvepnpransac() confidence added 2014-07-08 16:23:25 +02:00
edgarriba 747c6a2bd2 solvepnpransac() interface changed 2014-07-08 16:07:30 +02:00
Roman Donchenko a3bde36c84 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/calib3d/include/opencv2/calib3d/calib3d.hpp
	modules/contrib/doc/facerec/facerec_api.rst
	modules/contrib/include/opencv2/contrib/contrib.hpp
	modules/contrib/src/facerec.cpp
	modules/core/include/opencv2/core/mat.hpp
	modules/features2d/include/opencv2/features2d/features2d.hpp
	modules/highgui/src/loadsave.cpp
	modules/imgproc/src/pyramids.cpp
	modules/ocl/include/opencv2/ocl/cl_runtime/cl_runtime.hpp
	modules/python/src2/gen.py
	modules/python/test/test.py
	modules/superres/test/test_superres.cpp
	samples/cpp/facerec_demo.cpp
2014-07-08 14:33:56 +04:00
vbystricky 7fe7facfee Remove unused variable 2014-07-08 13:29:28 +04:00
vbystricky eb8366bb0a DShow camera as IVideoCapture object 2014-07-08 12:28:34 +04:00
Alexander Alekhin e79ceb4b45 Merge pull request #2936 from ilya-lavrenov:tapi_minmaxloc_opt 2014-07-08 07:30:49 +00:00
Vadim Pisarevsky d05d235c01 Merge pull request #2669 from Adil-Ibragimov:flann_distance_fix 2014-07-07 13:35:09 +00:00
vbystricky 4286f60387 Extract imgcodecs module from highgui 2014-07-07 16:28:08 +04:00
Vadim Pisarevsky e1553d5da3 Merge pull request #2929 from ilya-lavrenov:sse_pow 2014-07-07 11:22:26 +00:00
Vadim Pisarevsky b2ab1b758a Merge pull request #2937 from ilya-lavrenov:sse_patch_nans 2014-07-07 11:20:30 +00:00
Vadim Pisarevsky 41dcd0ac03 Merge pull request #2941 from ilya-lavrenov:sse_inrange 2014-07-07 11:19:54 +00:00
Alexander Alekhin 7d9f79b130 Merge pull request #2944 from bkueng:fix_compiler_error 2014-07-07 11:18:31 +00:00
Ernest Galbrun 62fed8b7b2 retry after failure to load from the build bot 2014-07-07 12:55:07 +02:00
Ernest Galbrun 3d8e05d711 documentation formatting 2014-07-07 12:46:59 +02:00
Ernest Galbrun 5c8e679bdc still a couple tabs and trailing whitespaces... 2014-07-07 12:34:23 +02:00
Ernest Galbrun ca6fb27ea6 removed some tabs 2014-07-07 09:49:57 +02:00
Ernest Galbrun eb6c598678 changed nullptr to NULL to avoid c++11 (failed to build on linux)
replaces tabs with spaces
2014-07-07 09:32:48 +02:00
Beat Küng 90dce84314 imgproc: fix compiler error for gcc 4.8
this bug was introduced in a73809e6.
2014-07-05 09:27:11 +02:00
edgarriba dd52d1b526 New Ransac implementation WORKING 2014-07-04 17:20:17 +02:00
Ernest Galbrun 062e1cbe06 edited documentation to take into account changes in TVL1 2014-07-04 15:45:58 +02:00
Ernest Galbrun 4bd55c6f73 added comments and reference for Chambolle paper 2014-07-04 15:33:34 +02:00
Ernest Galbrun 693c4e5741 debug of cuda_tvl1 => pass tests succesfully 2014-07-04 14:23:09 +02:00
Ilya Lavrenov e2b86974ae SSE2 optimization of cv::patchNaNs 2014-07-04 10:27:44 +04:00
Ilya Lavrenov e04c39b089 SSE2 optimization of cv::inRange 2014-07-04 10:11:18 +04:00
Adi Shavit b449bd5150 Clarified code. 2014-07-03 22:45:11 +03:00
Adi Shavit e25dca21d1 Fixed indentation. 2014-07-03 22:29:45 +03:00
Adi Shavit d44e3c369d Added documentation. 2014-07-03 22:29:44 +03:00
Adi Shavit 68827072c9 [HighGUI] On Windows: Support Ctrl+C to copy image to clipboard. 2014-07-03 22:29:43 +03:00
David Bradley b71744082b cudabgsegm module was not compiling. Changing all references of opencv2/legacy.hpp to opencv2/cudalegacy.hpp seemed to work.
I'm new at this so it would be good to have someone familiar with the build system confirm the change.
2014-07-03 15:15:23 -04:00
Adi Shavit 7674f3ddbf Added call to clone() to avoid unexpected change to external data.
- Fix both stitching_detailed.cpp sample and cv::Stitcher.
2014-07-03 22:14:58 +03:00
Ernest Galbrun 32707317fa Merge branch 'master' into tvl1_ali 2014-07-03 15:30:59 +02:00
Ernest Galbrun 3e577b090e removed legacy from cmake dependency
removed legacy tests in cudaoptflow
2014-07-03 15:26:51 +02:00
Alexander Alekhin 964b260937 Merge pull request #2932 from ilya-lavrenov:tapi_other_vendors 2014-07-03 13:02:41 +00:00
Ilya Lavrenov 55d84cf815 optimization of cv::minMaxLoc - used min/max 2014-07-03 16:56:22 +04:00
vbystricky 690c932d7f Change groups count for Intel 2014-07-03 15:50:56 +04:00
Ilya Lavrenov 2fe07abf83 use vectors for devices of all vendors 2014-07-03 15:32:34 +04:00
Ilya Lavrenov 8fdbdb131d SSE4.1 optimiation of cv::Moments CV_16U 2014-07-03 15:04:06 +04:00
edgarriba e0c4936c99 Input/Output Arrays (DOES NOT COMPILE) 2014-07-03 12:23:03 +02:00
Ernest Galbrun 1ea1cafa00 added modification on cudaoptflow/include/opencv2/cudaoptflow.hpp 2014-07-03 12:07:19 +02:00
Alexander Alekhin d183554600 Merge pull request #2931 from alalek:mac_fix_master 2014-07-03 09:26:52 +00:00
Alexander Alekhin e6c305cb75 Merge pull request #2897 from vbystricky:oclopt_sepFilter2D 2014-07-03 09:26:05 +00:00
Alexander Alekhin c5d3c08256 ocl: add try-catch for OpenCL device getter 2014-07-03 12:18:19 +04:00
Ilya Lavrenov 93f8581b69 fixed warnings 2014-07-03 11:10:28 +04:00
Ilya Lavrenov e5b63d43f2 sse2 optimization of inv_sqrt_64f 2014-07-03 01:33:49 +04:00
Alexander Alekhin effff27c4e Merge pull request #2928 from ilya-lavrenov:tapi_warp_fix 2014-07-02 19:06:46 +00:00
Ilya Lavrenov 46e2216165 fixed cv::warpPerspective 2014-07-02 19:32:10 +04:00
Ernest Galbrun b66a13183e added cuda support for chambolle parameter 2014-07-02 17:06:52 +02:00
Ilya Lavrenov 10c772fa7f minor optimization of cv::LUT 2014-07-02 18:50:21 +04:00
Vadim Pisarevsky 133d861d65 Merge pull request #2915 from SpecLad:core-useless-casts 2014-07-02 14:25:52 +00:00
Vadim Pisarevsky 8539d424b2 Merge pull request #2071 from pemmanuelviel:LshOrthogonalSubvectors 2014-07-02 14:24:09 +00:00
Vadim Pisarevsky c3329ff79d Merge pull request #2856 from sanchom:master 2014-07-02 14:22:56 +00:00
edgarriba 6eb1426ea2 First version Ransac (DOESN'T COMPILE) 2014-07-02 14:53:12 +02:00
Alexander Alekhin dcf96b2da7 Merge pull request #2922 from ilya-lavrenov:mac_fix 2014-07-02 12:18:11 +00:00
Ernest Galbrun afb9b9540c performance issue when gamma=0 2014-07-02 12:01:59 +02:00
Vadim Pisarevsky 0e534b5a25 Merge pull request #2923 from alalek:ocl_default_device_ignore_cpu 2014-07-02 09:56:59 +00:00
Vadim Pisarevsky d6233b13ba Merge pull request #2913 from ilya-lavrenov:sse2_precornerdetect 2014-07-02 09:55:51 +00:00
Alexander Alekhin d65abcaedb Merge pull request #2830 from mlyashko:moments 2014-07-02 09:14:48 +00:00
Ernest Galbrun f2e09d048c changed default value for gamma (now 0 -> no use of gamma) 2014-07-02 10:38:32 +02:00
Alexander Alekhin b1ac35e14a ocl: fix mac and superres test 2014-07-02 11:54:20 +04:00
Ilya Lavrenov 43e4946cca fix for fisheye 2014-07-02 11:53:53 +04:00
vbystricky a3b9884674 Change global buffer to local 2014-07-02 11:36:25 +04:00
Marvin Smith 561703ca27 Fixed the compiler warnings for the demo program. 2014-07-01 17:04:28 -07:00
Marvin Smith 14548227ca Adding support for GDAL raster images. 2014-07-01 16:29:11 -07:00
Ilya Lavrenov d40cb39616 SSE2 optimization of magnitude calculation 2014-07-02 00:05:55 +04:00
Ievgen Khvedchenia 92ead5fab3 Fix cmake to build OpenCV framework on OSX 2014-07-01 22:31:57 +03:00
Vadim Pisarevsky 1b18ebf28a Merge pull request #2905 from Jazmann:2.4 2014-07-01 18:41:15 +00:00
Vadim Pisarevsky 15197eb09b Merge pull request #2911 from ilya-lavrenov:sse2_convert_scale_abs 2014-07-01 17:31:37 +00:00
Vadim Pisarevsky fe4bdcd71b Merge pull request #2895 from fradelg:master 2014-07-01 17:16:22 +00:00
Vadim Pisarevsky f6cf68094f Merge pull request #2917 from mmaraya:bug_3872 2014-07-01 16:40:08 +00:00
Alexander Alekhin 6bb8c46d9a Merge pull request #2906 from ilya-lavrenov:tapi_transpose 2014-07-01 13:21:35 +00:00
Vadim Pisarevsky d826bcdbbb Merge pull request #2914 from alalek:fix2.4 2014-07-01 11:02:04 +00:00
Ilya Lavrenov 070be56e14 fixed warnings 2014-07-01 14:32:16 +04:00
Alexander Alekhin 157257b072 ocl: don't use OpenCL CPU device in default setup 2014-07-01 14:25:31 +04:00
Ernest Galbrun c45e645d6c Merge branch 'master' into tvl1_ali 2014-07-01 10:17:07 +02:00
Mike Maraya 95550c2582 test.py: Check if camera_calibration.tar.gz file exists before downloading it, opencv bug #3782 2014-06-30 22:17:52 -04:00
Ilya Lavrenov 972119bff3 sse2 optimization of cv::convertScaleAbs 2014-07-01 02:21:00 +04:00
Ilya Lavrenov 54e4ef657c optimized cv::transpose inplace 2014-07-01 00:36:13 +04:00
Ilya Lavrenov 9c8b9fc733 cv::transpose 2014-06-30 19:07:45 +04:00
Alexander Alekhin cbd0511a56 Merge pull request #2907 from ilya-lavrenov:tapi_perf_transpose 2014-06-30 14:59:36 +00:00
Ilya Lavrenov 978f7eb44a added perf test for transpose inplace 2014-06-30 18:33:26 +04:00
Roman Donchenko ebb0255e19 Remove a couple of useless casts in core headers
This helps users who compile their code with -Wuseless-cast.
2014-06-30 16:12:04 +04:00
Alexander Alekhin 5c8cd76893 fix bug with invalid signature size (should not be less than signatureLength()) 2014-06-30 16:03:20 +04:00
Alexander Alekhin 3a8af7d691 fix python tests 2014-06-30 16:03:07 +04:00
Alexander Alekhin acbabedac9 Merge pull request #2869 from ilya-lavrenov:tapi_warps 2014-06-30 11:59:13 +00:00
Alexander Alekhin e0584bb818 Merge pull request #2876 from vbystricky:oclopt_integralsum 2014-06-30 10:06:54 +00:00
Alexander Alekhin 1493160f26 Merge pull request #2899 from ilya-lavrenov:tapi_ex 2014-06-30 10:05:24 +00:00
Alexander Alekhin b304868d91 Merge pull request #2886 from ilya-lavrenov:tapi_inrange 2014-06-30 10:04:04 +00:00
Alexander Alekhin 667a9328fb Merge pull request #2829 from ilya-lavrenov:tapi_cvtcolor 2014-06-30 10:02:41 +00:00
Michael Pratt cac1218eef Build both Python 2 and Python 3 bindings
If both Python 2 and Python 3 are found, then build bindings for both of
them during the build process.  Currently, one version of Python is
detected automatically, and building for the other requires changes the
CMake config.

The largest chunk of this change generalizes OpenCVDetectPython.cmake to
find both a Python 2 and Python 3 version of Python.  Secondly, the
opencv_python module is split into two modules, opencv_python2 and
opencv_python3.  Both are built from the same source. but for different
versions of Python.
2014-06-29 20:08:13 -04:00
Ilya Lavrenov 654bdde8ed SSE2 optimization of cv::preCornerDetect 2014-06-30 01:51:53 +04:00
Ernest Galbrun 5101a7fc00 replaced tabs by spaces 2014-06-27 15:41:39 +02:00
Alexander Karsakov d5c99a07b6 Use fma only for Intel devices 2014-06-27 12:59:44 +04:00
Ilya Lavrenov 36db85a94d optimized some operations 2014-06-27 12:52:29 +04:00
Alexander Alekhin 2d81595ed4 Merge pull request #2852 from ilya-lavrenov:tapi_abs 2014-06-27 08:21:06 +00:00
Roman Donchenko e8850bf84a Merge pull request #2626 from KayKwon:matlab_formatter 2014-06-26 17:40:26 +04:00
Roman Donchenko 1576e24c93 Merge pull request #2672 from a-wi:findContours 2014-06-26 17:35:08 +04:00
Roman Donchenko e89e3066e8 Merge pull request #2774 from 23pointsNorth:lsd-nfa-fix 2014-06-26 17:29:27 +04:00
Roman Donchenko 1138fbb940 Merge pull request #2766 from akarsakov:pyr_border_constant 2014-06-26 17:28:44 +04:00
Roman Donchenko e9bb750d4e Merge pull request #2858 from 23pointsNorth:patch-3 2014-06-26 17:24:25 +04:00
Roman Donchenko b0a70787e1 Merge pull request #2824 from abidrahmank:pylsd 2014-06-26 17:22:54 +04:00
vbystricky 1a73aa1f6a Change local size 2014-06-26 15:43:40 +04:00
Ilya Lavrenov 16ab6ec534 ported changes from PR #2867 2014-06-26 13:52:44 +04:00
Ilya Lavrenov a3592cd068 added ocl_** function 2014-06-26 13:18:03 +04:00
Ilya Lavrenov ad9272e836 reverted to original plain C++ code 2014-06-26 13:13:01 +04:00
mlyashko 6f2fea7ea5 added perftest for moments 2014-06-26 13:05:43 +04:00
vbystricky 730ead44fe Optimize OpenCL version of sepFilter2D 2014-06-26 12:46:03 +04:00
Andrey Pavlenko d4f938ed56 Merge pull request #2894 from vpisarev:cleanup_project_tree1 2014-06-25 17:12:20 +00:00
Vadim Pisarevsky c4fdf71bb3 fixed some more compile warnings on Windows 2014-06-25 20:22:56 +04:00
Roman Donchenko 436342d5f4 Merge pull request #2880 from GravityJack:SparseMatIterator-build-fix 2014-06-25 16:32:18 +04:00
Roman Donchenko b21b8ff9d7 Merge pull request #2891 from nisargthakkar:dims_zero_on_release 2014-06-25 16:27:33 +04:00
Vadim Pisarevsky 8f2aaff6d7 fixed compile warnings on Windows 2014-06-25 16:17:52 +04:00
Fco. Javier Delgado del Hoyo 47e345bcb6 Change comment according to fix 2014-06-25 11:49:26 +02:00
Fco. Javier Delgado del Hoyo a73809e6fc Fix GCC 4.9 compiler warning 2014-06-25 11:46:05 +02:00
Vadim Pisarevsky 66f2e527b6 removed extra whitespaces 2014-06-24 23:05:24 +04:00
Vadim Pisarevsky 07c0d50edf put the detection-based tracker back (to objdetect module), so that the Android face detection sample builds fine. The patch by Konstantin Matskevich that adds C++11 threads support has been merged in too. Also, fixed compile error in the doc builder. 2014-06-24 21:16:09 +04:00
Alexander Alekhin ea2228774d Merge pull request #2881 from mlyashko:moments_opt 2014-06-24 16:19:52 +00:00
Alexander Alekhin ea1b14ee95 Merge pull request #2786 from ElenaGvozdeva:ocl_matchTemplate 2014-06-24 16:12:42 +00:00
Vadim Pisarevsky 3858f2291d removed contrib, legacy and softcsscade modules; removed latentsvm and datamatrix detector from objdetect. removed haartraining and sft apps.
some of the stuff will be moved to opencv_contrib module.
in order to make this PR pass buildbot, please, comment off opencv_legacy, opencv_contrib and opencv_softcascade test runs.
2014-06-24 19:18:51 +04:00
vbystricky 09bcc061dd Change kernel for optimization. Remove restriction to align data
Fix kernel compilation errors on AMD system

Fix licanse information in cl file

Support CV_64F destination type

Change build options of the kernel

Optimize sum of square

Remove separate kernel for integral square

Increase epsilon for perfomance tests

Increase epsilon for perfomance tests

Test double support on AMD devices

Fix some issues

Try to fix problems with AMD device

Try to solve problem with AMD device

Fix error of destination size in kernel

Fix warnings
2014-06-24 18:32:52 +04:00
Vadim Pisarevsky fb8fa3fdac Merge pull request #2889 from Ilya-Krylov:fisheye 2014-06-24 12:06:19 +00:00
Vadim Pisarevsky b6769c9db1 Merge pull request #2892 from PhilLab:patch-1 2014-06-24 11:52:37 +00:00
Jasper f45da9866a Fix for VTK6.2 issue. 2014-06-24 11:52:56 +01:00
PhilLab 3ece65ad62 Updates python feature matching tutorial
The given ORB parameter was misspelled
2014-06-24 11:35:22 +02:00
Nisarg Thakkar 98421e5970 Fix for Bug#3757: All dimension values are 0 after release is called 2014-06-23 20:15:23 +05:30
Alexander Alekhin 6d4c4dcd94 Merge pull request #2887 from ilya-lavrenov:ipp_morph_fix 2014-06-23 14:27:10 +00:00
Alexander Alekhin 4f1d06d14a Merge pull request #2874 from vbystricky:ocl_LUTAMDfix 2014-06-23 14:23:26 +00:00
Ilya Krylov 84bb77e914 Fixed android and windows x64 build issues 2014-06-23 17:06:40 +04:00
Ilya Lavrenov 87f4b47a4f optimized INTER_LINEAR mode 2014-06-23 16:25:05 +04:00
Ilya Lavrenov e89cee35e5 optimized cv::inRange 2014-06-23 13:12:08 +04:00
Ilya Lavrenov 0528d2e2b3 added 32s to 32u conversion 2014-06-23 13:09:54 +04:00
Elena Gvozdeva c23da52564 Fixed core for CCORR and SQDIFF. Used float instead of int for CV_8U. Fixed conditions for call dft. 2014-06-23 11:37:47 +04:00
mlyashko 44ffa42064 replaced factors computation by precomputed values, added kernel for
binary mode
2014-06-23 11:04:39 +04:00
Ilya Lavrenov 007593cab7 cvtColor - optimized index calculations; usage of build-in functions 2014-06-23 02:10:42 +04:00
Ilya Lavrenov 863784efc6 added extra condition 2014-06-22 19:18:14 +04:00
Alexander Alekhin 6952b90ed0 Merge pull request #2790 from akarsakov:ocl_pyrUp_unroll 2014-06-20 13:49:14 +00:00
Alexander Karsakov eeddda4701 Optimization of cv::pyrDown for 8UC1. 2014-06-20 16:46:51 +04:00
Alexander Alekhin 01a98fae93 Merge pull request #2878 from vbystricky:ocl_integral_sqsum_perf_test 2014-06-20 08:49:36 +00:00
Alexander Alekhin 6e0d77469a Merge pull request #2864 from ilya-lavrenov:tapi_boxfilter 2014-06-20 08:47:51 +00:00
Alexander Alekhin 07446ec954 Merge pull request #2847 from ilya-lavrenov:tapi_pow 2014-06-20 08:47:18 +00:00
Alexander Alekhin 7688a18264 Merge pull request #2840 from ilya-lavrenov:tapi_calchist 2014-06-20 08:46:32 +00:00
Marc Rollins 05e0b3b7e6 Fixing build error when using post-increment operator. 2014-06-19 14:14:10 -07:00
vbystricky 655465d9f8 Increase epsilon for pass sanity check 2014-06-19 18:52:25 +04:00
vbystricky eb54c83985 Fix error 2014-06-19 18:09:23 +04:00
Alexander Alekhin d9daa0cbaa ocl: added runtime flags for debugging 2014-06-19 17:52:46 +04:00
vbystricky 6d6ad1b1d9 Change threshold 2014-06-19 17:45:04 +04:00
vbystricky b32fbe72f6 Add peromance tests for OCL integral sum of square 2014-06-19 17:07:09 +04:00
Roman Donchenko 6a94862fef Merge pull request #2870 from 23pointsNorth:patch-5 2014-06-19 16:52:00 +04:00
Roman Donchenko cb69a5c29a Merge pull request #2868 from neo008:2.4 2014-06-19 16:51:37 +04:00
Andrey Pavlenko 75742fcd01 Merge pull request #2843 from berak:f_export_bow_24 2014-06-19 09:08:32 +00:00
Roman Donchenko acebfcd24f Merge pull request #2832 from BRAINSia:20140605_Upstream 2014-06-19 11:57:52 +04:00
Alexander Alekhin c99ce0f427 Merge pull request #2846 from alalek:2.4_fix_python_warnings 2014-06-18 13:19:11 +00:00
Andrey Pavlenko 65953fe39a Merge pull request #2863 from apavlenko:disable_cuda_stubs_defaults 2014-06-18 16:13:13 +04:00
vbystricky ea6da6ee95 Change uchar2 to short 2014-06-18 15:44:56 +04:00
vbystricky 9391ccfe35 Move some variables into #ifdef 2014-06-18 15:03:09 +04:00
Hans Johnson 4c7ed03b5f COMP: Fix problem with narrowing in c++11
modules/core/src/arithm.cpp:345:51:
error: constant expression evaluates to 4294967295 which cannot be narrowed to type 'int' [-Wc++11-narrowing]
static int CV_DECL_ALIGNED(16) v64f_absmask[] = { 0xffffffff, 0x7fffffff, 0xffffffff, 0x7fffffff };
                                                  ^~~~~~~~~~

Converted to unsigned int.  This variable is only used to initialize a bit pattern anywhy for a 128bit type.
2014-06-17 15:49:06 -05:00
Ilya Lavrenov c41a134394 increased number of rows per work-item 2014-06-17 19:24:25 +04:00
Alexander Alekhin ce5bae1c67 Merge pull request #2871 from vbystricky:oclopt_integral 2014-06-17 18:23:31 +04:00
Alexander Karsakov 06fb5da7c8 Removed storing of zeros in local memory 2014-06-17 17:24:11 +04:00
Elena Gvozdeva dcaa8735ba used vector data types for CCORR cn==1 2014-06-17 17:09:39 +04:00
Elena Gvozdeva 13db948023 added dft for CCORR 2014-06-17 17:09:38 +04:00
Elena Gvozdeva 82da445a15 changed CCOEFF cn==1 2014-06-17 17:09:38 +04:00
Elena Gvozdeva a7036d9668 changed support for 3-channels, changed CCOEFF 2014-06-17 17:06:51 +04:00
Alexander Alekhin 1db9cc3f0d Merge pull request #2854 from ilya-lavrenov:tapi_filter2d 2014-06-17 16:59:00 +04:00
Alexander Alekhin 04628d770c Merge pull request #2849 from ElenaGvozdeva:ocl_matchTemplate_3cn 2014-06-17 14:37:52 +04:00
Ilya Lavrenov 93712e913a optimization of cv::warpAffine INTER_CUBIC 2014-06-17 00:47:19 +04:00
vbystricky 606df0469a Fix pointer conversion 2014-06-16 18:14:05 +04:00
vbystricky 9bf296eeb0 Small refactoring 2014-06-16 17:17:16 +04:00
Ilya Lavrenov c424d36041 optimized cv::boxFilter 2014-06-16 17:00:10 +04:00
Daniel Angelov 660d7cd3ae Updated findHomography docs branch 2.4
Updated the documents to give warning to the users of `findHomography` that the function may return an empty matrix in some cases. 
The user must take care of checking that.
2014-06-16 13:05:17 +01:00
Ilya Lavrenov 7391df386f fixed usage of reshape 2014-06-16 15:19:13 +04:00
vbystricky 6550c4f682 Join kernel code for int and float destination types 2014-06-16 15:08:15 +04:00
Neo Alienson b6e25a9fc7 Fix typos 2014-06-16 18:48:10 +08:00
Ilya Lavrenov 6dd658a0af optimized cv::setIdentity 2014-06-16 13:41:43 +04:00
Alexander Alekhin f269a89792 Merge pull request #2865 from ilya-lavrenov:morph 2014-06-16 13:35:57 +04:00
Alexander Alekhin 758a1eb63d Merge pull request #2855 from ilya-lavrenov:tapi_warpp_fix 2014-06-16 13:22:03 +04:00
vbystricky 504bc7634a Remove pre_invalid parameter 2014-06-16 13:07:39 +04:00
Ilya Lavrenov d5244eb645 invoking OCL before IPP 2014-06-16 12:33:13 +04:00
Andrey Pavlenko 724f5e7f19 Don't build CUDA modules stubs by default (use -DBUILD_CUDA_STUBS=ON if need them) 2014-06-16 11:18:52 +04:00
Daniel Angelov 54292a8376 Removed "CV_" prefix from constants in docs
The `calib3d.hpp` has a definition of the constant that does not contain the prefix "CV_".
The affected methods were `findHomography` and `findEssentialMat`.
Now the documentation updates the definition of the constants to conform to the header.
2014-06-14 18:41:04 +01:00
Sancho McCann e1e243588e Bugfix: Memory leak in deletion of er_stack nodes of ERFilter. 2014-06-12 11:02:06 -07:00
Vadim Pisarevsky 45f21e4f12 Merge pull request #2783 from daferna2:master 2014-06-12 21:41:28 +04:00
Vadim Pisarevsky 2c134318f7 Merge pull request #2784 from saree90:bugfix_Simplex 2014-06-12 21:41:10 +04:00
Vadim Pisarevsky 41ceadf9ed Merge pull request #2799 from 23pointsNorth:patch-1 2014-06-12 21:40:53 +04:00
Vadim Pisarevsky afe6b66d33 Merge pull request #2828 from otsedom:updating_and_adding_haarcascades_mcs 2014-06-12 21:39:50 +04:00
Vadim Pisarevsky 052c8516a8 Merge pull request #2845 from shaibagon:patch-1 2014-06-12 21:38:56 +04:00
Vadim Pisarevsky ad7440c014 Merge pull request #2850 from Sekunde:master 2014-06-12 21:38:41 +04:00
Vadim Pisarevsky 2b2ce3f6e9 Merge pull request #2726 from Ilya-Krylov:2.4 2014-06-12 21:37:47 +04:00
Vadim Pisarevsky 3391caf434 Merge pull request #2779 from pemmanuelviel:kmeansppSquareDist 2014-06-12 21:35:28 +04:00
Ilya Lavrenov 7ccbe10970 fixed cv::warpPerspective 2014-06-12 15:17:24 +04:00
Ilya Lavrenov 316c044e06 used abs in reduction operations 2014-06-11 18:54:43 +04:00
Ilya Lavrenov f1e24381d1 used abs 2014-06-11 18:33:46 +04:00
Ilya Lavrenov b2c2aabd04 used built-in functions 2014-06-11 18:32:42 +04:00
Alexander Alekhin 14671e0cd6 Merge pull request #2823 from ilya-lavrenov:tapi_warpaffine 2014-06-11 14:41:29 +04:00
berak 3500c940d4 add Bag of Words to python wrapper 2014-06-11 11:50:22 +02:00
侯骥 055adc2302 Update MatchTemplate_Demo.cpp 2014-06-11 10:29:30 +02:00
Elena Gvozdeva feeb386bf3 Added support for 3-channels 2014-06-11 11:49:22 +04:00
Daniel Fernandes b3655233f1 Changing #include to generic video.hpp
Per https://github.com/Itseez/opencv/pull/2783#discussion_r13573590
2014-06-11 02:00:21 -05:00
Alexander Alekhin 88ceee05c6 Merge pull request #2837 from ilya-lavrenov:tapi_norm_relative 2014-06-10 22:21:09 +04:00
Ilya Lavrenov 33239fca70 cv::equalizeHist 2014-06-10 19:32:46 +04:00
Alexander Alekhin 96ce9810a9 Merge pull request #2844 from ilya-lavrenov:tapi_perf_pow 2014-06-10 19:32:03 +04:00
Ilya Lavrenov c9528b3952 optimized histogram merging 2014-06-10 19:32:01 +04:00
Ilya Lavrenov eeaa4b3665 eliminated convertTo 2014-06-10 19:32:01 +04:00
Ilya Lavrenov c072c28e28 optimized cv::calcHist 2014-06-10 19:32:00 +04:00
Alexander Alekhin 071daa1d8f Merge pull request #2839 from ilya-lavrenov:tapi_fix 2014-06-10 19:30:26 +04:00
Alexander Alekhin bf39f694ea Merge pull request #2835 from ilya-lavrenov:defects 2014-06-10 19:29:47 +04:00
Ilya Lavrenov 03f665e870 some optimizaions of cv::pow 2014-06-10 18:37:35 +04:00
Shai 91201b225a Update global_motion.cpp
An extremely rare case where, for numeric reasons bestM finds more inliers than ninliersMax. 
This RARE case causes memory corruption and a nasty seg fault.
2014-06-10 17:31:18 +03:00
Alexander Alekhin 4d0848b3e8 fix -Wmaybe-uninitialized warning (initialize pointers to NULL) 2014-06-10 18:12:38 +04:00
Ilya Lavrenov 9edd24fe51 changed power in cv::pow test to test actual kernel 2014-06-10 17:41:43 +04:00
Ilya Lavrenov 556206de2d fixed defects found by coverity scan 2014-06-10 13:14:51 +04:00
Roman Donchenko 1f4ddbe5b6 Merge pull request #2705 from KonstantinMatskevich:face_recognition_labels_info 2014-06-10 12:24:56 +04:00
Roman Donchenko e0f40a7f4a Merge pull request #2841 from SpecLad:merge-2.4 2014-06-10 11:50:12 +04:00
Alexander Alekhin 8681b52dba Merge pull request #2838 from ilya-lavrenov:tapi_warnings 2014-06-09 20:25:28 +04:00
Ilya Lavrenov 634da9f3bf added norm_inf support to minmaxloc kernel 2014-06-09 20:05:26 +04:00
Roman Donchenko 659d21332e Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/contrib/src/spinimages.cpp
2014-06-09 18:03:03 +04:00
Ilya Lavrenov 0b2cafb08b bixed cv::boxFilter 2014-06-09 17:09:44 +04:00
Ilya Lavrenov cf72d2695c fixed possible runtime error 2014-06-09 16:48:59 +04:00
Roman Donchenko 278616bada Merge pull request #2813 from 23pointsNorth:patch-2 2014-06-09 15:58:24 +04:00
Ilya Lavrenov ff6f5d4d24 fixed warnings 2014-06-09 15:54:10 +04:00
Roman Donchenko ed1c56e063 Merge pull request #2817 from bf:patch-1 2014-06-09 15:06:07 +04:00
Roman Donchenko 4ef311949b Merge pull request #2834 from atinfinity:pullreq/140606-TickMeter-2.4 2014-06-09 14:29:44 +04:00
Roman Donchenko 150dd39b08 Merge pull request #2822 from timedia:akaze-java 2014-06-09 14:27:51 +04:00
Roman Donchenko 3a35ca5190 Merge pull request #2831 from alalek:android_examples 2014-06-09 14:26:31 +04:00
Roman Donchenko 64344f4545 Merge pull request #2818 from StevenPuttemans:fix_linux_tutorial 2014-06-09 13:37:39 +04:00
Andrey Pavlenko 02b32d86d3 moving FaceRecognizer2 from public header to .cpp 2014-06-09 13:26:45 +04:00
Ilya Lavrenov 7f2662b310 fixes 2014-06-09 00:50:14 +04:00
Ilya Lavrenov 5403bdd228 optimized cv::norm with NORM_RELATIVE 2014-06-07 21:26:40 +04:00
Ilya Lavrenov 2040995801 optimized cv::norm with 2 args 2014-06-07 20:45:28 +04:00
berak fc610979bb export BOW to script wrappers 2014-06-07 16:34:53 +02:00
atinfinity f08d88fa78 fixed calculation method of "cv::TickMeter" 2014-06-07 07:29:22 +09:00
Ilya Lavrenov 1a7a262f74 optimized cv::norm with NORM_INF 2014-06-06 19:34:26 +04:00
Alexander Alekhin e430ab1a58 Merge pull request #2785 from akarsakov:ocl_pyrDown_borders 2014-06-06 18:53:14 +04:00
Alexander Alekhin ea417ac04a Merge pull request #2755 from vbystricky:oclopt_LUT 2014-06-06 18:52:40 +04:00
Ilya Lavrenov fd5a8b3e97 minmaxloc 2014-06-06 18:39:08 +04:00
Alexander Alekhin f30301d171 Merge pull request #2801 from ilya-lavrenov:tapi_reduction 2014-06-06 18:38:22 +04:00
Alexander Alekhin 15b6fd2ec4 android: allow to build & run examples without Android OpenCV Manager 2014-06-06 18:01:04 +04:00
Konstantin Matskevich 59c8edfd98 facerec2 2014-06-06 15:57:11 +04:00
VBystricky 5d924b7a75 If lut table has one channel and src aligned to 4, work with src as with one channel matrix 2014-06-05 19:31:31 +04:00
VBystricky 0c0ebca855 Read 4 pixel for aligned data with 1 channel 2014-06-04 23:50:23 +04:00
VBystricky 8a5f2781fc Fix kernel by comments 2014-06-04 20:13:42 +04:00
Alexander Alekhin 3f485d58bb Merge pull request #2808 from ilya-lavrenov:tapi_normalize_mask 2014-06-04 18:10:13 +04:00
Alexander Alekhin a42259421c Merge pull request #2794 from mletavin:pullreq/140516-median 2014-06-04 16:36:37 +04:00
Modesto Castrillón b327312bd3 Updated and added haarcascade_mcs*.xml files 2014-06-04 12:24:33 +01:00
Alexander Alekhin 47f1026ce0 Merge pull request #2820 from ilya-lavrenov:tapi_flip 2014-06-04 15:22:07 +04:00
Ilya Lavrenov 405f12fe80 optimized cv::flip (CV_8UC1) 2014-06-04 14:21:42 +04:00
Alexander Alekhin 6d3413bc6a Merge pull request #2810 from ilya-lavrenov:tapi_copytomask 2014-06-04 12:23:36 +04:00
Alexander Alekhin c2ca059baf Merge pull request #2798 from ilya-lavrenov:tapi_copymakeborder 2014-06-04 12:22:52 +04:00
Alexander Alekhin ab9dff12d5 Merge pull request #2812 from arkunze:pullreq/140520-filter2D 2014-06-04 12:20:54 +04:00
Alexander Alekhin ee8adc10a1 Merge pull request #2821 from ilya-lavrenov:tapi_reduce 2014-06-04 12:18:30 +04:00
Alexander Alekhin a49ea6d066 Merge pull request #2826 from ilya-lavrenov:tapi_perf_warp 2014-06-04 12:11:54 +04:00
Roman Donchenko 85edb9e9b1 Merge pull request #1552 from Exocoder:gtk3 2014-06-04 12:07:17 +04:00
Tony f0887a99e2 On branch gtk3
Changes to be committed:
	modified:   CMakeLists.txt
Corrected merge error from last resync
2014-06-03 21:29:54 +01:00
Tony bd12d64641 Merge branch 'gtk3' of https://github.com/Exocoder/opencv into gtk3
resyncing gtk3 with remote.
2014-06-03 20:55:49 +01:00
Ilya Lavrenov 108527c951 added missed INTER_CUBIC 2014-06-03 21:46:30 +04:00
Alexander Alekhin 607cd37b48 Merge pull request #2750 from ilya-lavrenov:tapi_convertto 2014-06-03 16:36:48 +04:00
Ilya Lavrenov 2cc4cf3644 optimized cv::warpAffine 2014-06-03 13:45:22 +04:00
Muto Masayuki 518d0df201 Add AKAZE support for the Java wrapper 2014-06-03 18:41:58 +09:00
Alexander Alekhin 93af92c878 Merge pull request #2795 from ilya-lavrenov:tapi_setto 2014-06-03 13:21:05 +04:00
Alexander Alekhin 5e8a3cde94 Merge pull request #2757 from ElenaGvozdeva:ocl_flip 2014-06-03 13:19:42 +04:00
Ilya Lavrenov 26b73a7bbd merged 2 kernels 2014-06-03 13:14:51 +04:00
abidrahmank 530fc99947 Issue #3709 - PyBindings for LSD
Corrected crashing in Python bindings while using LSD_REFINE_NONE flags
Corrected not drawing lines in drawSegments and compareSegments in Python bindings
2014-06-03 14:25:33 +05:30
Alexander Alekhin 72385979c4 Merge pull request #2761 from ilya-lavrenov:tapi_warpers 2014-06-02 20:37:17 +04:00
Roman Donchenko c836613bad Merge pull request #2819 from SpecLad:merge-2.4 2014-06-02 17:12:07 +04:00
mletavin e224e72bbc Added condition to use optimized kernels for images of size that multiple of 4 only 2014-06-02 15:58:59 +04:00
Ilya Lavrenov ab428c9dbd optimized cv::copyMakeBorder 2014-06-02 15:46:44 +04:00
Ilya Lavrenov 67bb1c6a70 optimized UMat::setTo 2014-06-02 15:39:36 +04:00
Ilya Lavrenov 17956a5ae5 optimized cv::normalize in case of mask 2014-06-02 15:33:19 +04:00
Alexander Alekhin fc2f79701d Merge pull request #2778 from vbystricky:oclopt_reduce 2014-06-02 13:57:57 +04:00
Alexander Alekhin a049c16ca7 Merge pull request #2751 from akarsakov:ocl_thresh_opt 2014-06-02 13:54:31 +04:00
Roman Donchenko 33087f9eaa Merge remote-tracking branch 'origin/2.4' into merge-2.4 2014-06-02 13:43:28 +04:00
StevenPuttemans 7c44a07810 fix typo in linux tutorial 2014-06-02 09:35:19 +02:00
Benjamin Flesch 62533d0d26 perspectiveTransform simplify assert() for better debuggin
When using perspectiveTransform in rather complicated settings, it would be easier for developers to have two separate assertions for each part of the boolean expression in order to pinpoint problems more efficiently. In my case I am struggling in Python2.7 with finding out whether scn+1 == m.cols or the depth == CV_32F || depth == CV_64F is making a problem, which is kind of hard.
2014-06-02 00:27:32 +02:00
Alexander Alekhin abe37659cc Merge pull request #2811 from arkunze:pullreq/140516-erode 2014-06-01 02:30:39 +04:00
Alexander Alekhin 78badcd651 Merge pull request #2781 from ilya-lavrenov:tapi_meanstddev 2014-05-31 22:50:44 +04:00
Alexander Alekhin 89e4118b30 Merge pull request #2809 from ilya-lavrenov:tapi_copy_perf 2014-05-31 22:49:34 +04:00
Alexander Alekhin 17d6083e01 Merge pull request #2787 from ilya-lavrenov:tapi_repeat 2014-05-31 22:46:21 +04:00
Daniel Angelov ce1b6e2137 Fixed inconsistency with flag names
Fixed inconsistency with flag names for solvePnP. 
The default value for the function lacks the CV_ prefix. The code checks against "ITERATIVE". The suggested values for the parameters *include* the prefix.
Even though the enum CV_ITERATIVE (+ CV_P3P, CV_EPNP) = ITERATIVE (& P3P, EPNP), lets show to the users only one of them.
Now the user sees only {ITERATIVE, P3P, EPNP}.
2014-05-30 23:59:32 +01:00
Alexander Alekhin d4a1936c2d Merge pull request #2807 from alalek:disable_tests_KAZE 2014-05-30 19:11:08 +04:00
Ilya Lavrenov 80470f9cf6 added performance test 2014-05-30 18:34:04 +04:00
Ilya Lavrenov 7f818e9bc3 optimized UMat::copyTo with mask 2014-05-30 18:27:55 +04:00
Alexander Alekhin 6126788535 Merge pull request #2800 from krodyush:pullreq/140516-opticalflow-imgext-fix 2014-05-30 16:35:23 +04:00
krodyush 2e2ca58b70 fix according review 2014-05-30 15:44:51 +04:00
Alexander Alekhin d210132b99 Merge pull request #2638 from mlyashko:floodfill_perftest 2014-05-30 00:42:42 +04:00
Alexander Alekhin 316e6a8f2b Merge pull request #2804 from ilya-lavrenov:tapi_perf 2014-05-30 00:38:11 +04:00
Alexander Alekhin 776728ef2a KAZE: disable tests (too many crashes) 2014-05-29 23:12:48 +04:00
Ilya Lavrenov d156f5af6d added missed tests for cv::norm, cv::normalize 2014-05-29 16:00:38 +04:00
Roman Donchenko 67e9708621 Merge pull request #2773 from abidrahmank:pycascade 2014-05-29 14:51:45 +04:00
Roman Donchenko 9a5e9d3442 Merge pull request #2771 from SpecLad:pvs-checks-opencv 2014-05-29 14:50:42 +04:00
Roman Donchenko a8608bd0ac Merge pull request #2777 from alexstadnik:master 2014-05-29 14:43:30 +04:00
Roman Donchenko f57f39276a Merge pull request #2782 from HapeMask:py3_flann 2014-05-29 14:40:38 +04:00
mlyashko f0e3940558 perftest for floodfill 2014-05-29 13:36:13 +04:00
Ilya Lavrenov c52a77b90f optimized cv::UMat::dot 2014-05-29 13:16:16 +04:00
Ilya Lavrenov 579499d900 optimized cv::sum (CV_8UC1) 2014-05-28 19:46:08 +04:00
Ilya Lavrenov 002a79bfc4 optimized cv::countNonZero 2014-05-28 18:42:42 +04:00
Ilya Lavrenov 7804d57f8b optimized index calculation 2014-05-28 18:01:03 +04:00
Ilya Lavrenov 33173d900a optimized cv::meanStdDev 2014-05-28 17:55:30 +04:00
Elena Gvozdeva 437927b7bb optimized index access 2014-05-28 16:27:08 +04:00
Alexander Alekhin 5a268dd27c Merge pull request #2797 from ElenaGvozdeva:ocl_MT 2014-05-28 13:39:48 +04:00
mletavin 68883775fb Adding explicit variable conversion in ocl_medianFilter() to suppress build errors on Linux & Mac 2014-05-28 13:30:50 +04:00
Alexander Alekhin 0ea572d772 Merge pull request #2796 from berak:b_3674_24 2014-05-28 13:28:30 +04:00
berak 2bacd8b702 2 fixed unassigned reshapes in em (#3674) 2014-05-28 10:37:16 +02:00
krodyush 153ac43d3b opencl opticaflow fix that enables buffer2image extension 2014-05-28 10:34:11 +04:00
Daniel Angelov 3ab3367310 Updating missed defines in documentation
Updating missed defines in documentation. The new defines (in imgproc.hpp) state they have a prefix of COLOR instead of CV.
2014-05-27 18:09:12 +01:00
Alexander Alekhin c9db91ace5 Merge pull request #2788 from alalek:icv_public 2014-05-27 18:52:02 +04:00
mletavin df9c75b270 Moved new kernels under conditional compilation to disable their build for 3-channel images; added condition to use new kernels only for images that are big enough 2014-05-27 16:16:00 +04:00
Elena Gvozdeva 40eea303ec OCL: matchTemplate: changed perf test 2014-05-27 14:31:11 +04:00
Roman Donchenko aa170cfb5b Merge pull request #2793 from alalek:run_android_env 2014-05-27 13:35:11 +04:00
Roman Donchenko 68165b1af0 Merge pull request #2792 from SpecLad:merge-2.4 2014-05-27 12:44:23 +04:00
Alexander Karsakov 8e54845049 Removed useless multiplication by 4 2014-05-27 10:52:20 +04:00
vbystricky b4498d1d48 Fix some errors 2014-05-26 16:55:31 +04:00
vbystricky 63584bffda fix code in the kernel 2014-05-26 16:54:26 +04:00
vbystricky 04433b2d2b Change buffer cols count from 64 to 32 2014-05-26 16:54:25 +04:00
vbystricky 169351b01d Optimize openCL version of reduce function 2014-05-26 16:54:25 +04:00
vbystricky cfabf32492 Fix some errors 2014-05-26 16:53:01 +04:00
vbystricky 48d82fd911 Fix some errors 2014-05-26 16:53:01 +04:00
vbystricky a8bfab3cb7 Optimize OpenCL LUT function 2014-05-26 16:53:00 +04:00
vbystricky 6667cea0f4 Optimize OpenCL LUT function 2014-05-26 16:53:00 +04:00
vbystricky 72727111c7 Use 4 pixels for one unit. Some ocl code refactoring 2014-05-26 16:52:59 +04:00
vbystricky 47b092e527 Optimize OpenCL LUT function 2014-05-26 16:52:59 +04:00
mletavin 4a37ac303a Added new Intel-optimized 3x3 and 5x5 kernels to medianFilter.cl file and corresponding code to host in smooth.cpp
Only Intel platform and 1 channel images are supported.
2014-05-26 15:54:18 +04:00
Alexander Alekhin e6f6905868 run.py: propagate OPENCV* env variables only with --android_propagate_opencv_env flag 2014-05-26 14:32:52 +04:00
Ilya Lavrenov 50fa809a96 fixed cv::mixChannels 2014-05-26 14:20:16 +04:00
Alexander Karsakov 5022a0fae3 Added new border types for pyrDown 2014-05-26 13:57:03 +04:00
Alexander Alekhin 766600529b run.py: added --android_env parameter 2014-05-26 13:27:31 +04:00
Ilya Lavrenov ec3c68c8ea fix 2014-05-26 12:19:07 +03:00
Ilya Lavrenov bd5e4c6c49 other kernels now use row scheme 2014-05-26 12:19:06 +03:00
Ilya Lavrenov 15738bf7ef multiple rows in KF kernel 2014-05-26 12:19:06 +03:00
Ilya Lavrenov 5ee398bfd6 multiple rows per work-item 2014-05-26 12:19:05 +03:00
Roman Donchenko 0a2d22bf31 Merge remote-tracking branch 'origin/2.4' into merge-2.4 2014-05-26 12:32:14 +04:00
Alexander Alekhin ab2749d648 Merge pull request #2709 from alalek:icv_update_binary_pack 2014-05-23 15:09:43 +04:00
Alexander Karsakov 4910242732 Unroll pyrUp kernel 2014-05-23 14:58:34 +04:00
Alexander Alekhin 52ba76143c icv: fix test eps on Mac for failed perf test 2014-05-23 14:54:09 +04:00
Ilya Lavrenov c83455d8a4 optimized cv::repeat 2014-05-23 13:16:27 +03:00
Alexander Alekhin 0f7fbe4458 icv: enable public IPPICV packages 2014-05-23 13:43:31 +04:00
Alexander Alekhin c43e32854a Merge pull request #2713 from alalek:icv_enable_fns 2014-05-23 13:35:45 +04:00
Roman Donchenko 09f9b35bc6 Merge pull request #2742 from StevenPuttemans:feature_3176 2014-05-22 18:03:56 +04:00
Saree90 7f7064e3b9 DownhillSolverImpl::innerDownhillSimplex something looks broken here:
Mat_<double> coord_sum(1,ndim,0.0),buf(1,ndim,0.0),y(1,ndim,0.0);
nfunk = 0;
for(i=0;i<ndim+1;++i)
{
y(i) = f->calc(p[i]);
}
y has only ndim elements, while the loop goes over ndim+1
2014-05-22 22:52:37 +10:00
StevenPuttemans fea4396023 Added more info on the data input variable of kmeans 2014-05-22 12:56:44 +02:00
Alexander Alekhin 7249622ce7 Merge pull request #2772 from akarsakov:ocl_pyramids 2014-05-22 13:23:50 +04:00
Alexander Alekhin 694d7726b5 Merge pull request #2762 from ilya-lavrenov:ipp_sort 2014-05-22 12:30:53 +04:00
Daniel Fernandes a0459c2352 Merge branch 'master' of https://github.com/Itseez/opencv 2014-05-21 17:59:10 -05:00
Daniel Fernandes 6598b97b96 Fixed MATLAB bridge
MATLAB bridge.hpp was missing definition for Ptr<DenseOpticalFlow>
2014-05-21 17:57:35 -05:00
Gabe Schwartz c19b6ed20e Fixed pyopencv_to w/FLANN IndexParams in python3.
The keys() and values() functions on dictionaries in Python 3 no longer
return lists.  pyopencv_to() for flann::IndexParams now iterates over
the dictionary in a way that is version-agnostic.
2014-05-21 15:21:41 -04:00
Alexander Alekhin d940093fb5 Merge pull request #2723 from ilya-lavrenov:tapi_intel_vector_width 2014-05-21 19:56:00 +04:00
Alexander Alekhin cf5dd88cf2 Merge pull request #2776 from ilya-lavrenov:tapi_meanstddev 2014-05-21 17:43:29 +04:00
Pierre-Emmanuel Viel ec99f96c62 Add the ensureSimpleDistance() method to ensure the user the returned distance is not ^2 (the default for L2 for instance) 2014-05-21 13:16:12 +02:00
Pierre-Emmanuel Viel 2f8b5731da Fix local variable shadowing 2014-05-21 12:27:38 +02:00
Alexander Karsakov fa1ed5580d Fixed cv::pyrUp performance test 2014-05-21 14:09:21 +04:00
Alexey Stadnik 73bfcf856d Added Haar cascade for russian cars licence plate detection, 16 stages cascade, pretty fast. 2014-05-21 12:51:15 +04:00
Ilya Lavrenov 0e1b37675c added performance test for cv::meanStdDev with mask 2014-05-21 11:50:31 +04:00
Alexander Alekhin 7032a5a46c Merge pull request #2763 from ilya-lavrenov:tapi_perf_norm_relative 2014-05-21 11:44:25 +04:00
Aaron Kunze ab1a37d564 Bug fixes for filter2D and associated tests. 2014-05-20 22:30:09 -07:00
Konstantin Matskevich 8d4a76925c fixed binary compatibility 2014-05-21 09:25:15 +04:00
abidrahmank 31291ced11 Issue #2540 : Python bindings for various "detectMultiScale()" 2014-05-21 08:26:16 +05:30
Pierre-Emmanuel Viel 00367cfb00 Merge remote-tracking branch 'upstream/2.4' into LshOrthogonalSubvectors 2014-05-21 01:31:52 +02:00
Pierre-Emmanuel Viel e63d7de87c Allows to choose orthogonal sub-vectors for LSH without using a static table among LshTable instances 2014-05-20 22:52:11 +02:00
Daniel Angelov 3ca7717e17 Fixed scanning bug identified in comments in pull request #1119.
NFA calculations now generate better line segments.
2014-05-20 21:25:31 +01:00
Alexander Karsakov 511ed4388e Disabled BORDER_CONSTANT for pyramid functions. 2014-05-20 17:28:47 +04:00
Roman Donchenko 7ea1bf3cf0 Fixed several problems found by PVS-Studio.
This fixes all problems from the article "Checking OpenCV with PVS-Studio"
<http://www.viva64.com/en/b/0191/> that are not already fixed and are
not in 3rdparty or the legacy module.

The problems fixed are two instances of useless code and one instance
of unspecified behavior (right-shifting a negative number).
2014-05-20 13:54:00 +04:00
Ilya Krylov 3678020c28 Added license to source files 2014-05-20 12:37:37 +04:00
Roman Donchenko 0ec54982b5 Merge pull request #2767 from SpecLad:merge-2.4 2014-05-20 11:50:49 +04:00
Roman Donchenko 976da2f3d3 Merge pull request #2768 from SpecLad:useless-loop 2014-05-20 11:50:29 +04:00
Roman Donchenko 3d7a457c97 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	doc/tutorials/introduction/linux_install/linux_install.rst
	modules/core/doc/operations_on_arrays.rst
	modules/core/include/opencv2/core/core.hpp
	modules/core/src/system.cpp
	modules/gpu/src/cuda/resize.cu
	modules/imgproc/doc/miscellaneous_transformations.rst
	modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst
	modules/video/src/bgfg_gaussmix2.cpp
2014-05-19 18:39:20 +04:00
Ilya Krylov 0d2fab86b4 Changed documentation for namespace fisheye 2014-05-19 18:16:00 +04:00
Ilya Krylov 651b13f72a Refactored class Fisheye to namespace fisheye 2014-05-19 17:55:32 +04:00
Roman Donchenko bea46c90b5 Remove a useless loop that copies an array to itself 2014-05-19 17:38:30 +04:00
Vadim Pisarevsky 0b4eb6a964 Merge pull request #2509 from euphrat:mog2_bgimg_gray 2014-05-19 17:36:38 +04:00
Vadim Pisarevsky c6113c6cb3 Merge pull request #2630 from isarandi:concat_corr 2014-05-19 17:36:20 +04:00
Vadim Pisarevsky 8bd1efa523 Merge pull request #2673 from BloodAxe:kaze 2014-05-19 17:35:22 +04:00
Vadim Pisarevsky 934cb6c452 Merge pull request #2680 from adrians:remove_cv_err 2014-05-19 17:35:03 +04:00
Vadim Pisarevsky 988b108858 Merge pull request #2701 from thoinvil:BugfixFilterEngineApplyROI 2014-05-19 17:34:45 +04:00
Vadim Pisarevsky 44acfc38a1 Merge pull request #2739 from StevenPuttemans:bug_1523 2014-05-19 17:33:36 +04:00
Vadim Pisarevsky e30939f09b Merge pull request #2738 from kevmitch:2.4 2014-05-19 17:33:22 +04:00
Vadim Pisarevsky 118b27f5b4 Merge pull request #2744 from jet47:kmeans-fix 2014-05-19 17:33:10 +04:00
Vadim Pisarevsky f01bd6f978 Merge pull request #2752 from jet47:pr-2746 2014-05-19 17:30:32 +04:00
Vadim Pisarevsky 165789bfcd Merge pull request #2764 from hbadino:Feature_3692 2014-05-19 17:30:18 +04:00
Roman Donchenko eded87de5b Merge pull request #2754 from thoinvil:patch-1 2014-05-19 15:41:28 +04:00
StevenPuttemans 12207ac763 fix coordinate problem with large images - bug 1523 2014-05-19 13:07:44 +02:00
Roman Donchenko 9eac451a3a Merge pull request #2741 from alalek:icv_android 2014-05-19 15:04:36 +04:00
Roman Donchenko cba5235f08 Merge pull request #2698 from GregoryMorse:patch-2 2014-05-19 14:52:58 +04:00
Roman Donchenko f77aa45cfb Merge pull request #2735 from StevenPuttemans:bug_2000 2014-05-19 14:25:47 +04:00
StevenPuttemans 7fc764f5e5 added documentation for findContours 2014-05-19 11:44:25 +02:00
Roman Donchenko f0b0d4e867 Merge pull request #2685 from znah:ocl_control_py 2014-05-19 13:38:36 +04:00
Roman Donchenko 06b335b2d7 Merge pull request #2733 from StevenPuttemans:bug_2162 2014-05-19 13:04:54 +04:00
Roman Donchenko 62e0759ba2 Merge pull request #2719 from yashdv:patch-1 2014-05-19 13:00:32 +04:00
Konstantin Matskevich a46f119fdf docs fixes 2014-05-19 09:54:15 +04:00
Kazuki Matsuda fa292c3d8d Implimentation "cv::Mat::forEach"
I propose forEach method for cv::Mat and cv::Mat_.
This is solution for the overhead of MatIterator_<_Tp>.

I runs a test that micro opecode runs all over the pixel of cv::Mat_<cv::Point3_<uint8_t>>.
And this implementation 40% faster than the simple pointer, 80% faster than iterator.
With OpenMP, 70% faster than simple pointer, 95% faster than iterator (Core i7 920).

Above all, code is more readable.

My test code is here.
    https://gist.github.com/kazuki-ma/8285876

Thanks.
2014-05-18 11:01:45 +09:00
pradeep c5b4b99350 Implemented Kullback-Leibler divergence 2014-05-17 23:44:31 +08:00
Hernan Badino 9a371de93b Switched insertion of connected components in filterSpecklesImpl 2014-05-16 18:49:45 -04:00
Roman Donchenko c9cb480844 Merge pull request #2753 from shahurik:2.4 2014-05-16 17:40:41 +04:00
Ilya Lavrenov 1e46a99d9f added performance test for cv::norm with NORM_RELATIVE 2014-05-16 14:15:31 +04:00
Ilya Lavrenov eb1dd1900b fixed conditions 2014-05-16 12:18:35 +04:00
Elena Gvozdeva c7dc884855 T-API: optimized ocl_flip 2014-05-16 11:01:10 +04:00
Alexander Karsakov 8ecb8c6a3d Optimized memory access by using stride pattern 2014-05-16 10:22:03 +04:00
Aaron Kunze 033aebe668 A more efficient workaround for erode 2014-05-15 16:31:24 -07:00
Alexander Alekhin ada2879faa Merge pull request #2756 from ElenaGvozdeva:ippi_matchTemplate 2014-05-15 18:50:01 +04:00
Ilya Lavrenov f3440888ef optimized stitching warpers 2014-05-15 16:28:34 +04:00
Elena Gvozdeva ce0b808e3c IPP: fixed ipp_matchTemplate 2014-05-15 13:05:27 +04:00
Vladislav Vinogradov 746185652a add additional tests for different input cases 2014-05-15 12:08:38 +04:00
Vladislav Vinogradov f16503743f use more accurate reshape 2014-05-15 12:08:01 +04:00
thoinvil ea038436e6 Added condition to 1st test in cv::GaussianBlur
Consistent with the test made in cv::boxFilter, it adjusts the kernel size to the source size only if the border is not BORDER_CONSTANT and if BORDER_ISOLATED is set. Otherwise, the source has to be considered possibly in a larger image (i.e. the source being a ROI) in witch the kernel should apply.
2014-05-15 08:40:13 +02:00
Vlad Shakhuro 6a93b43cae Fix svm intro tutorial 2014-05-14 21:24:57 +04:00
Roman Donchenko 0ebde64701 Merge pull request #2743 from StevenPuttemans:bugfix_3549 2014-05-14 19:49:27 +04:00
Ilya Krylov c30fef1f9d Fixed build issues 2014-05-14 18:58:39 +04:00
Alexander Mordvintsev a52979c37f exposed TVL1 optical flow to python 2014-05-14 17:45:21 +04:00
Alexander Mordvintsev 2756ae2051 exposed OpenCL-control functions to python 2014-05-14 17:42:21 +04:00
Roman Donchenko cafcfc4d0f Merge pull request #2749 from jet47:fix-bug-3678 2014-05-14 17:25:19 +04:00
Roman Donchenko 55bff44810 Merge pull request #2747 from jet47:gpu-resize-stream-fix 2014-05-14 16:34:48 +04:00
ZlodeiBaal 00e3c246fe Create haarcascade_russian_plate_number.xml
Detector for russsian vehicle registration plate
2014-05-14 15:18:56 +04:00
Vladislav Vinogradov f1e44fa5ca fix bug #3678 (cuda::integral failures) 2014-05-14 12:48:12 +04:00
Roman Donchenko f13e05cdcb Merge pull request #2740 from ilya-lavrenov:tapi_norm_fix 2014-05-14 12:40:19 +04:00
Roman Donchenko 75a1743f35 Merge pull request #2745 from yashdv:patch-3 2014-05-14 12:38:43 +04:00
Roman Donchenko 83b7fe1b82 Merge pull request #2748 from jet47:fix-bug-3690 2014-05-14 12:35:04 +04:00
Alexander Alekhin 46d672dcc3 Merge pull request #2663 from ilya-lavrenov:ipp_slow 2014-05-14 12:30:05 +04:00
Vladislav Vinogradov 7e2f7f45d7 fix bug #3690
removed invalid condition, it is always false
2014-05-14 10:47:28 +04:00
Vladislav Vinogradov 1f72873c55 fix cv::gpu::resize function
add missing stream parameter to call_resize_linear_glob
2014-05-14 10:31:28 +04:00
Ievgen Khvedchenia 12e1d7fc2b Fix "WARNING: Block quote ends without a blank line" 2014-05-13 21:07:30 +03:00
Roman Donchenko ed5d71b45f Merge pull request #2724 from znah:python_autowrap 2014-05-13 19:50:01 +04:00
Yash Vadalia 7e56cfafbc fixed a syntax error in cap_giganetix.cpp
Ticket 3458 (http://code.opencv.org/issues/3458)
2014-05-13 19:59:37 +05:30
Alexander Alekhin 6f798b1ba7 icv: android x86 build 2014-05-13 18:28:13 +04:00
Yash Vadalia 6ecd553810 Added doc for LinearPolar Transform 2014-05-13 19:36:43 +05:30
Vladislav Vinogradov 55a714c83b fix cv::kmeans function
reshape input matrix, since the function works with data
as with [N x dims] matrix
2014-05-13 18:00:17 +04:00
Alexander Mordvintsev dd67ea0210 find -> rindex 2014-05-13 17:55:57 +04:00
StevenPuttemans 1d557e6702 adding bugfix 3549 2014-05-13 15:34:30 +02:00
Alexander Karsakov 4612b4b827 Added clamp() for THRESH_TRUNC mode 2014-05-13 15:21:47 +04:00
Ilya Lavrenov d16e0b377f disabled IPP functions that slower than OpenCV 2014-05-13 15:06:38 +04:00
Roman Donchenko 10f89b9c8b Merge pull request #2737 from jet47:fix-opencv-cmake-config 2014-05-13 14:39:10 +04:00
Roman Donchenko 4a24ecd176 Merge pull request #2731 from StevenPuttemans:bug_2626 2014-05-13 14:21:36 +04:00
Ilya Lavrenov f64dfeb222 fix for cv::norm (norm_inf) 2014-05-13 14:21:07 +04:00
Roman Donchenko 2cf6cea90f Merge pull request #2730 from StevenPuttemans:bug_2740 2014-05-13 14:19:42 +04:00
Roman Donchenko c607dadc49 Merge pull request #2729 from StevenPuttemans:bug_3252 2014-05-13 14:17:09 +04:00
Roman Donchenko 83e2731c94 Merge pull request #2728 from StevenPuttemans:bug_3434 2014-05-13 14:15:38 +04:00
Ievgen Khvedchenia 87972d0d7c Fix "WARNING: Block quote ends without a blank line" 2014-05-13 13:15:24 +03:00
Kevin Mitchell 63e508abd2 doc: update/clarify behaviour of mask in floodFill
Clarify how the mask parameter is set on output and how this is
affected by the flags parameter.

resolves Feature #2942
2014-05-13 02:26:59 -07:00
StevenPuttemans 006956c324 Fixing as suggested in bug 2626, made naming same for both C, C++ and python API 2014-05-13 11:02:01 +02:00
Roman Donchenko ff2d76ec0d Merge pull request #2699 from GregoryMorse:patch-1 2014-05-13 11:58:25 +04:00
Roman Donchenko bc7b21609a Merge pull request #2692 from 1Hyena:2.4 2014-05-13 11:56:12 +04:00
Roman Donchenko f0547e5e05 Merge pull request #2727 from StevenPuttemans:bug_3484 2014-05-13 11:55:17 +04:00
Roman Donchenko ea5b411c0f Merge pull request #2725 from SpecLad:merge-2.4 2014-05-13 11:53:30 +04:00
Vladislav Vinogradov 67b562d543 fix OpenCVConfig.cmake template - missing parentheses 2014-05-13 11:37:21 +04:00
1Hyena 6c118ebc51 Changed ostringstream to ostream for new print_params and added the old
version of print_params for backwards compatibility.
2014-05-12 23:01:44 +03:00
Roman Donchenko 09674623cf Merge pull request #2714 from asmorkalov:ocv_cmake_config 2014-05-12 18:53:10 +04:00
Roman Donchenko ecfb1ab4f8 Merge pull request #2721 from zarrabeitia:2.4 2014-05-12 18:48:01 +04:00
StevenPuttemans a0a8fb4fd9 fixed bug 2626 2014-05-12 16:43:07 +02:00
StevenPuttemans 6c59e39f7c fix bug 3434 2014-05-12 16:41:22 +02:00
Roman Donchenko 313a0ad255 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/core/include/opencv2/core/internal.hpp
	modules/core/src/arithm.cpp
	modules/imgproc/src/imgwarp.cpp
	modules/objdetect/src/hog.cpp
2014-05-12 17:38:07 +04:00
StevenPuttemans e96de8821c bug 2740 added fix 2014-05-12 15:26:56 +02:00
StevenPuttemans b382984810 fix bug 3252 2014-05-12 15:01:15 +02:00
StevenPuttemans 2b4241c10b fixed bug 3484 2014-05-12 14:40:12 +02:00
Ilya Lavrenov 1e5694e082 heuristic for Intel 2014-05-12 16:08:39 +04:00
Alexander Mordvintsev 120b3a1e77 Work on python wrapped generation automation:
- all parsed headers are included into "cv2.cpp" with "pyopencv_generated_include.h"
 - types starting with "Ptr_" converted to "Ptr<...>" form (avoids many typedefs in "cv2.cpp")
2014-05-12 15:49:54 +04:00
Alexander Smorkalov e8376c789d Fix non-Android cross compilation with OpenCVConfig.cmake 2014-05-12 15:45:02 +04:00
Alexander Alekhin 1f638a3e5b icv: enable functions 2014-05-12 15:38:38 +04:00
Ilya Krylov e4a9c0f184 Fixed review comments 2014-05-12 15:37:47 +04:00
Roman Donchenko 5e47aa6300 Merge pull request #2717 from StevenPuttemans:2.4 2014-05-12 15:14:53 +04:00
Alexander Alekhin e1b5a547cc Merge pull request #2722 from ilya-lavrenov:tapi_luv_eps 2014-05-12 13:03:36 +04:00
Alexander Alekhin 7ac5c367e9 Merge pull request #2715 from akarsakov:fix_corner_min_eigen 2014-05-12 13:03:19 +04:00
Ilya Lavrenov e2558e5ee5 increased eps to pass tests 2014-05-12 11:54:15 +04:00
Konstantin Matskevich d67c9aabff docs 2014-05-12 10:09:39 +04:00
Luis Zarrabeitia bb5a22c504 highgui: fix segfault on CvCapture_GStreamer::retrieveFrame
CvCapture_GStreamer::retrieveFrame assumes that RGB videos are 24BPP.
This is not necesarily the case, unless we explicitly tell GStreamer
that we want 24BPP RGB streams.

Adding bpp=(int)24 to the appsink caps.
2014-05-11 19:00:14 -04:00
Ievgen Khvedchenia 03db61b33b FixFix documentation warnings 2014-05-10 23:06:23 +03:00
Ievgen Khvedchenia 029a8c443a Remove GSURF descriptor from KAZE algorithm 2014-05-10 20:57:37 +03:00
Ievgen Khvedchenia a068ccbf51 Fix "Title underline too short" warning 2014-05-09 22:53:28 +03:00
Ievgen Khvedchenia 616c348536 Fix documentation warnings 2014-05-09 22:31:20 +03:00
Ievgen Khvedchenia 3a8e15fad9 Fix documentation warnings 2014-05-09 22:21:26 +03:00
Ievgen Khvedchenia c4e49463a9 Initial commit of the KAZE & AKAZE docs 2014-05-09 19:35:41 +03:00
Ievgen Khvedchenia b42c268164 Temporary remove of CV_WRAP 2014-05-09 19:34:54 +03:00
Ievgen Khvedchenia 1a5fcd715d Refactor of KAZE and AKAZE:
1) Clean-up from the unused code
2) Remove of SURF extraction method
3) Enabled threading for KAZE extraction
4) Exposed new properties for runtime configuration
2014-05-09 18:46:00 +03:00
StevenPuttemans a9c7db7518 add suggestion of feature 2619 2014-05-09 13:44:12 +02:00
Alexander Alekhin eba1be711c Merge pull request #2710 from ilya-lavrenov:ipp_threshold 2014-05-08 17:33:27 +04:00
Alexander Karsakov 4e7f62fd24 Fixed ipp check for cornerMinEigenVal 2014-05-08 17:32:21 +04:00
Alexander Alekhin c74fed1fcf Merge pull request #2706 from ilya-lavrenov:ipp_2.4_warnings 2014-05-08 17:04:18 +04:00
Alexander Alekhin 7c9caab1fb Merge pull request #2708 from StevenPuttemans:2.4 2014-05-08 17:02:40 +04:00
Alexander Alekhin a82dd8ce48 Merge pull request #2700 from ilya-lavrenov:tapi_cvtColor 2014-05-08 17:01:38 +04:00
Alexander Alekhin eb240cc206 Merge pull request #2697 from PhilLab:master 2014-05-08 16:57:50 +04:00
Konstantin Matskevich aa76ef9a98 fixes 2014-05-08 15:55:55 +04:00
Alexander Alekhin 78f660024b Merge pull request #2712 from jet47:subtract-fix-3rd-attempt 2014-05-08 15:44:52 +04:00
Ilya Lavrenov 11b01cd8b9 added ipp threshold inplace 2014-05-08 13:51:25 +04:00
Ilya Lavrenov 19a2495067 fixed IPP related warnings 2014-05-08 13:31:27 +04:00
Vladislav Vinogradov 77275031ab finally fix cv::subtract 2014-05-08 13:11:42 +04:00
StevenPuttemans 99475e2976 fixed wrong download link in tutorial 2014-05-08 10:45:51 +02:00
Ilya Krylov 349ff631a5 Added sample of work of Fisheye::undistortImage and its description to documentation. Removed readPoints and readExtrinsic (useless) 2014-05-07 20:53:07 +04:00
thoinvil e50ef2dab5 Bugfix #3668 removed the comment 2014-05-07 18:27:08 +02:00
Vladislav Vinogradov 629461c836 fix output matrix allocation in cv::subtract 2014-05-07 19:52:35 +04:00
Alexander Alekhin df9aa8898d icv: fix OpenCV Windows package 2014-05-07 15:20:29 +00:00
Alexander Alekhin 35eb972e9a fix compilation on MSVS 2010 2014-05-07 15:20:29 +00:00
Alexander Alekhin 72e095b8a5 Merge pull request #2665 from ilya-lavrenov:ipp_filter2d 2014-05-07 19:17:57 +04:00
Alexander Alekhin 07d5f56707 Merge pull request #2679 from alalek:ippicv_update 2014-05-07 18:24:41 +04:00
Ilya Lavrenov 3ccaa5294e added OpenCL RGB <-> Luv conversions 2014-05-07 18:09:57 +04:00
Alexander Alekhin 9c780260c2 Merge pull request #2605 from akarsakov:ipp_min_eigen_val 2014-05-07 18:01:44 +04:00
Alexander Alekhin 849228ac6a Merge pull request #2684 from ElenaGvozdeva:ippiDFT 2014-05-07 17:57:17 +04:00
Alexander Alekhin 9e47672b2b Merge pull request #2658 from akarsakov:ipp_hough 2014-05-07 17:07:22 +04:00
Alexander Alekhin e2c7adc7c4 Merge pull request #2703 from jet47:subtract-create-dst-mat 2014-05-07 16:50:50 +04:00
Alexander Alekhin d54aa307fd Merge pull request #2676 from ilya-lavrenov:ipp_gaussianblur 2014-05-07 16:49:59 +04:00
Konstantin Matskevich 36afd4ef55 added additionalInfo in faceRecognition 2014-05-07 16:29:55 +04:00
Ilya Lavrenov abf905154f cv::fitler2D 2014-05-07 15:47:10 +04:00
Ilya Lavrenov 1ad69aba35 changes sigma in perf tests 2014-05-07 14:59:03 +04:00
Alexander Alekhin 0e1bf58195 Merge pull request #2634 from ElenaGvozdeva:ippiDCT 2014-05-07 14:49:13 +04:00
Vladislav Vinogradov 4c66614e07 fix cv::subtract function:
call dst.create(...) before using it
2014-05-07 13:15:19 +04:00
Alexander Alekhin b1a28a52fa Merge pull request #2693 from mvukad:bugfix_ippmorphop 2014-05-07 13:15:09 +04:00
GregoryMorse 38db7a78df WinRT core compatibility fixes
Update system.cpp

Update system.cpp

Update system.cpp

Update matching.cpp

Update matching.cpp
2014-05-07 06:17:37 +08:00
GregoryMorse b1443bc1bc WinRT core compatibility fixes
Update system.cpp

Update system.cpp

Update ocl.cpp

Update matching.cpp

Update ocl.cpp

Update matching.cpp
2014-05-07 06:15:54 +08:00
Thierry Hoinville 5efd2056f0 Bugfix #3668 in FilterEngine::apply(), use the ROI properly 2014-05-06 15:33:07 +02:00
Alexander Karsakov f6a8ac2f6c Changed check condition in tests in case ipp disabled. 2014-05-06 15:24:54 +04:00
Elena Gvozdeva 12279e2631 fixed 2014-05-06 14:49:03 +04:00
Alexander Alekhin 01f31dc007 Merge pull request #2687 from ilya-lavrenov:tapi_norm_inf_234cn 2014-05-06 13:27:03 +04:00
Elena Gvozdeva e362c3fb38 fixed 2014-05-06 13:09:45 +04:00
Alexander Alekhin 03b1d133df Merge pull request #2660 from arkunze:pullreq/140423-filter2D 2014-05-06 12:59:03 +04:00
Ilya Krylov 1f94b7dfc9 minor 2014-05-06 11:17:10 +04:00
Ilya Krylov ef01044b2f Added documentation for Fisheye::stereoCalibrate 2014-05-06 11:09:22 +04:00
Ievgen Khvedchenia 220de14077 Clean-up from the dead code 2014-05-05 21:48:54 +03:00
PhilLab 4ffeb01cfd Update solvepnp.cpp
Clarified assert message for allowed PnP flags
2014-05-05 17:44:59 +02:00
Alexander Alekhin e9be486534 Merge pull request #2694 from rokm:matlab 2014-05-05 19:24:07 +04:00
Alexander Alekhin 787815fd00 Merge pull request #2619 from GregoryMorse:patch-3 2014-05-05 18:00:40 +04:00
Alexander Alekhin 59cf62ad9e Merge pull request #2636 from atrebbi:#3653 2014-05-05 18:00:18 +04:00
Alexander Alekhin 87210690c2 Merge pull request #2678 from intbots:master 2014-05-05 17:55:14 +04:00
Ilya Krylov 50b291995a Added tests for stereoCalibrate 2014-05-05 17:23:03 +04:00
Alexander Alekhin f0d4ccc6cf Merge pull request #2696 from PhilLab:2.4 2014-05-05 17:08:48 +04:00
Alexander Alekhin a5378186e5 Merge pull request #2688 from akarsakov:ipp_disable_resize_8u 2014-05-05 15:21:13 +04:00
Alexander Alekhin d9d9de75db Merge pull request #2686 from vbystricky:ippicv_integral 2014-05-05 15:20:47 +04:00
Alexander Alekhin 347d5b96f3 Merge pull request #2635 from akarsakov:gaussian_float_intel 2014-05-05 15:20:20 +04:00
Alexander Karsakov eda084e123 Used AutoBuffer instead ippsMalloc 2014-05-05 14:40:59 +04:00
Ilya Krylov c2341fd446 Added stereoCalibrate for Fisheye camera model 2014-05-05 14:21:24 +04:00
PhilLab 897d0a9aaf Updated documentation: library names
updated the library names to OpenCV version 2.4.9
2014-05-05 12:16:48 +02:00
Rok Mandeljc c35fd55b0e Matlab bindings: CMakeLists.txt: use "${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}" as MEX_LIB_DIR only when compiling with MSVC, otherwise, use only "${LIBRARY_OUTPUT_PATH}" 2014-05-03 17:37:48 +02:00
Rok Mandeljc fa075c50a1 Matlab bindings: fixed the functional template to perform an explicit cast to the type of an input option that is expected. This avoids issues with ternary operator not having the same type in rvalue and lvalue, such as in the case below:
Ptr_FeatureDetector blobDetector = inputs[3].empty() ? makePtr<SimpleBlobDetector>() : inputs[3].toPtrFeatureDetector();

Which after the patch, would be:

Ptr_FeatureDetector blobDetector = inputs[3].empty() ? (Ptr_FeatureDetector) makePtr<SimpleBlobDetector>() : inputs[3].toPtrFeatureDetector();
2014-05-03 17:37:48 +02:00
Rok Mandeljc 2d47dd7038 Matlab bindings: added missing compound type declarations from photo module 2014-05-03 17:37:47 +02:00
Ievgen Khvedchenia e7e00201f1 Enabled parallel processing of the nld_step_scalar function 2014-05-02 14:07:30 +03:00
Ievgen Khvedchenia 9fc90f4069 Merged nldiffusion functions into one module with removal of duplicate functions 2014-05-01 22:24:15 +03:00
Michael Vukadinovic c1aee0c312 Fixed bug in IPPMorphOp function when looping over elements of the morphology kernel. 2014-05-01 11:52:49 -07:00
1Hyena dfdb09386f Autotuned_index now prints all info into logger instead of couting it. 2014-05-01 20:55:49 +03:00
Ievgen Khvedchenia 2df7242646 Prepare to merge KAZE and AKAZE nldiffusion_functions source files (work in progress). 2014-05-01 18:27:24 +03:00
Ievgen Khvedchenia 30f73623ce Replace runtime checks with assertions 2014-05-01 18:24:13 +03:00
Ievgen Khvedchenia 3e51da38fb Removed Feature_Suppression_Distance function that is not used anywhere. 2014-05-01 10:58:34 +03:00
Alexander Alekhin 71f871fafd replaced sanity check condition for stitching perf test 2014-04-30 18:02:06 +04:00
Alexander Karsakov 4ebe76098e Disabled IPP resize for CV_8U 2014-04-30 17:28:35 +04:00
Ilya Lavrenov c80faff42f added cn>1 support to cv::norm (NORM_INF) 2014-04-30 14:59:37 +04:00
vbystricky c9103730b6 Disable ipp integral in IPPICV version 2014-04-30 12:55:34 +04:00
Ievgen Khvedchenia ab1ef08f0e Rename file config.h to KAZEConfig.h 2014-04-29 22:17:18 +03:00
Ievgen Khvedchenia 4509fe55c2 Clean-up of getters/setters that are not needed by OpenCV 2014-04-29 21:39:27 +03:00
Ievgen Khvedchenia 2daa14e3c7 Clean-up from dead code. 2014-04-29 21:07:53 +03:00
Alexander Alekhin e8d3ebecc7 fix IPPDerivSobel condition 2014-04-29 15:36:45 +04:00
Alexander Alekhin b62e59aac0 icv: enable functions 2014-04-29 15:36:43 +04:00
Alexander Alekhin 5658ba0002 icv: update package 2014-04-29 15:35:27 +04:00
Alexander Alekhin dacf63a888 Merge pull request #2682 from ElenaGvozdeva:ippiDFT 2014-04-29 15:34:01 +04:00
Alexander Alekhin 0f22df2b0d Merge pull request #2667 from akarsakov:ipp_otsu 2014-04-29 15:15:33 +04:00
Alexander Alekhin 06746ba645 Merge pull request #2677 from ilya-lavrenov:ipp_compilation 2014-04-29 12:26:49 +04:00
Elena Gvozdeva 043b917c7d IPP: cv::dft fixed 2014-04-29 12:23:23 +04:00
Ilya Krylov e6aa8ce932 Corrected notes 2014-04-29 10:24:39 +04:00
Adrian Stratulat cbf3c1fbf1 remove unused macros 2014-04-28 19:40:11 +00:00
Ievgen Khvedchenia a134e068ef Fix wrong checking of returned descriptor type 2014-04-28 22:25:27 +03:00
Ievgen Khvedchenia c1bf453266 Wrapped nldiffusion functions with details::kaze or details::amaze namespace to avoid collision of function names 2014-04-28 20:41:44 +03:00
Ievgen Khvedchenia c68cbfced3 Fix size_t to int conversion 2014-04-28 19:32:29 +03:00
Ievgen Khvedchenia 0e3bbd7026 Fix "conditional expression constant" warning 2014-04-28 19:32:04 +03:00
Ievgen Khvedchenia a941d25f6d Fix size_t to int conversion 2014-04-28 16:46:09 +03:00
Ievgen Khvedchenia 5662294319 Rename KAZE to KAZEFeatures to fix MSVS x64 compiler error (Duplicate file name confused it) 2014-04-28 16:34:35 +03:00
Ievgen Khvedchenia 599bcfb591 Fix size_t to int conversion 2014-04-28 16:24:35 +03:00
Ievgen Khvedchenia cc0a94c536 Fix "conditional expression constant" warning 2014-04-28 16:23:58 +03:00
Elena Gvozdeva 507ea95265 fixed 2014-04-28 16:46:11 +04:00
Ievgen Khvedchenia 2162aab0e9 Remove AKAZEFeatures desctructor 2014-04-28 15:17:09 +03:00
Ievgen Khvedchenia f9d3c49023 Bugfix: wrong variable name 2014-04-28 15:14:03 +03:00
Ievgen Khvedchenia f9422f60a6 Fix Fix casting from/to int/float that caused lot of compiler warnings. 2014-04-28 15:13:42 +03:00
Elena Gvozdeva 16629bff4c Added parallel version for DCT_ROWS 2014-04-28 16:05:19 +04:00
Elena Gvozdeva 6880dbfd95 IPP: cv::dct 2014-04-28 16:05:19 +04:00
Ievgen Khvedchenia 3c596184e4 Added copyright headers for KAZE and AKAZE wrappers 2014-04-28 15:01:42 +03:00
Ievgen Khvedchenia f97e38d8a6 Fix casting from/to int/float that caused lot of compiler warnings. 2014-04-28 15:00:14 +03:00
Ilya Krylov f0f741b796 Added documentation 2014-04-28 15:27:30 +04:00
Abhijit Kundu 26c8b3a38e Added suuport for finding Intel TBB for Visual Studio 2013 2014-04-28 07:23:49 -04:00
Alexander Alekhin 649935596e Merge pull request #2653 from alalek:ipp_lut 2014-04-28 15:15:11 +04:00
Alexander Alekhin 0e5b0677c9 Merge pull request #2654 from ElenaGvozdeva:ipp_DFT 2014-04-28 15:14:40 +04:00
Alexander Alekhin 5d50917961 Merge pull request #2674 from akarsakov:ocl_hog_fix_epsilon 2014-04-28 15:06:05 +04:00
Ilya Lavrenov 59876cfb34 fixed compilation 2014-04-28 14:04:41 +04:00
Roman Donchenko c6e91e4736 Merge pull request #2675 from SpecLad:merge-2.4 2014-04-28 13:51:44 +04:00
Roman Donchenko 86ec0fc813 Merge pull request #2668 from vbystricky:perf_TransformECC 2014-04-28 13:50:50 +04:00
Ilya Lavrenov 55bbca2d09 added more types to cv::GaussianBlur 2014-04-28 13:50:28 +04:00
Roman Donchenko 47d903d968 Merge remote-tracking branch 'origin/2.4' into merge-2.4 2014-04-28 12:08:21 +04:00
Ilya Krylov 05ee15f108 Added FisheyeTest 2014-04-28 12:01:27 +04:00
Ievgen Khvedchenia 61f79c2632 Fix line ending at EOF 2014-04-28 10:53:09 +03:00
Ievgen Khvedchenia 3cfc22ae4e Fix initialisation order of parallel loop classes for AKAZE descriptor extraction 2014-04-28 10:52:05 +03:00
Ievgen Khvedchenia f3f0e06c4d Fix parenthesis in assert statements 2014-04-28 10:51:09 +03:00
Ievgen Khvedchenia 0e243541f9 Fix shadowed variable warnings 2014-04-28 10:50:46 +03:00
Alexander Karsakov b046210296 Changed epsilon for hog test, because hog detector is sensible to resize accuracy. 2014-04-28 11:37:46 +04:00
Roman Donchenko 5042ab1f32 Merge pull request #2659 from adrians:docs_pull_1 2014-04-28 11:36:12 +04:00
Ievgen Khvedchenia ba5bec1de2 Fix mutable compilation error 2014-04-27 23:07:48 +03:00
Ievgen Khvedchenia eada0f4b48 Fix shadowed i variable warning 2014-04-27 23:04:31 +03:00
Ievgen Khvedchenia 503bd38963 Enable multithreaded extraction of features using cv::parallel_for_ 2014-04-27 22:28:18 +03:00
Artur Wieczorek 59250e8288 cv::findContours: Check if type of output data structure is right to store contours (vector<vector<Point>>). 2014-04-27 19:22:29 +02:00
Samson Yilma de55126b69 Fixed warnings and parameter name mismatches, added #include needed in some platforms. 2014-04-27 13:02:36 -04:00
Samson Yilma e6420bde73 Added function decomposeHomographyMat. New files added are homography_decomp.cpp and test_homography_decomp.cpp.
Modified files calib3d.hpp and camera_calibration_and_3d_reconstruction.rst.
2014-04-26 20:13:27 -04:00
Ievgen Khvedchenia d37220e8ff Clean-up of the iostream manipulator in AKAZEConfig. 2014-04-26 23:34:38 +03:00
Ievgen Khvedchenia d8c9bb777e Fix return value of descriptorType() 2014-04-26 23:34:07 +03:00
Istvan Sarandi 4bf1df7da3 Suppress warning in constructor. 2014-04-26 00:42:26 +02:00
Alexander Karsakov 7bd9b2ac26 Added setIppErrorStatus() 2014-04-25 20:24:37 +04:00
Ilya Krylov 35e1b322cb Added test for jacobians 2014-04-25 18:36:48 +04:00
Adil Ibragimov 3bd364fce3 fixing accum_dist and operator() mismatching for HellingerDistance and KL_Divergence 2014-04-25 17:37:31 +04:00
vbystricky a13e6ab79f Fix problem with sanity check of transform ecc with ipp resize 2014-04-25 17:33:38 +04:00
Alexander Karsakov 232c37e827 Added ippiComputeThreshold_Otsu to cv::threshold 2014-04-25 17:31:45 +04:00
Ilya Krylov 9c7e0bfd33 Added fisheye camera model 2014-04-25 14:49:36 +04:00
Alexander Alekhin 7ee1d5f69b ipp: added LUT optimization 2014-04-25 12:09:06 +04:00
Elena Gvozdeva 10d1b3a534 Added parallel version for DFT_ROWS 2014-04-25 11:39:19 +04:00
Ievgen Khvedchenia 86888bdf77 Replace swap with clear (more efficient) 2014-04-24 22:01:45 +01:00
Ievgen Khvedchenia 3e24822fff Bugfix: clear input vector of key points for detection stage 2014-04-24 22:01:29 +01:00
Ievgen Khvedchenia 33b9e4b4a3 Added missing operator() 2014-04-24 22:00:51 +01:00
Ievgen Khvedchenia 36db97068c Added missing operator() 2014-04-24 22:00:37 +01:00
Alexander Alekhin 32b25de583 Merge pull request #2656 from ilya-lavrenov:ipp_copymakeborder 2014-04-24 20:30:34 +04:00
Alexander Alekhin 6b2c621d20 Merge pull request #2662 from vbystricky:ipp_MatchTempl 2014-04-24 20:25:42 +04:00
Alexander Karsakov dc91be86b2 Disabled ippiHoughLine_Region for cv::HoughLines 2014-04-24 18:00:03 +04:00
Alexander Karsakov 5580d08c6e Added setIppErrorStatus() 2014-04-24 16:48:46 +04:00
Ilya Lavrenov 46e8d9d02d cv::copyMakeBorder 2014-04-24 14:27:51 +04:00
Alexander Karsakov 1909978f7d Added ippiHoughProbLine to cv::HoughLinesP 2014-04-24 12:28:23 +04:00
vbystricky 82a198a8f2 Fix epsilon calculation for sanity check in x32 build 2014-04-24 10:48:32 +04:00
Istvan Sarandi 22d3faaeb9 Corrected expected result of matrix concatenation. 2014-04-24 03:17:40 +02:00
Istvan Sarandi c20cab9ec1 Added test for concatenation with empty matrices. 2014-04-24 03:09:07 +02:00
Istvan Sarandi 2421ac3958 Added test for concatenation with empty matrices. 2014-04-24 02:43:28 +02:00
Ievgen Khvedchenia 6d500cc6f7 Merge KAZE and AKAZE features with most recent version 2014-04-23 23:02:02 +01:00
Ievgen Khvedchenia d27ed856f2 Replace config with AKAZEConfig.h 2014-04-23 22:44:03 +01:00
Adrian Stratulat 4fb5680d91 Documentation - minor fix-ups 2014-04-23 17:30:27 +00:00
Aaron Kunze 1f8b41f390 Optimizes filter2D for Intel GPUs 2014-04-23 10:20:09 -07:00
Alexander Alekhin dcc4d3640b Merge pull request #2651 from ilya-lavrenov:ipp_minmaxidx_3cn 2014-04-23 20:06:55 +04:00
Andrey Pavlenko 8114e071c2 Merge pull request #2655 from akarsakov:ipp_fix_pyramid 2014-04-23 16:27:33 +04:00
Elena Gvozdeva 2d71c094b3 IPP: CV::dft 2014-04-23 15:52:05 +04:00
Andrey Pavlenko d93161812b Merge pull request #2620 from ilya-lavrenov:ipp_integration 2014-04-23 15:12:45 +04:00
Alexander Karsakov f3d1001c5d Changed tests for support intersection between expected and actual lists of lines. 2014-04-23 13:18:47 +04:00
Alexander Karsakov 751264f88a Added ippiHoughLine_Region to cv::HoughLines 2014-04-23 11:59:36 +04:00
Alexander Alekhin 9badfa1f83 Merge pull request #2646 from ilya-lavrenov:ipp_remap 2014-04-23 11:51:01 +04:00
Alexander Alekhin ba0ab8edb0 Merge pull request #2647 from vbystricky:ipp_norm 2014-04-23 11:50:13 +04:00
Alexander Alekhin c2319285a9 Merge pull request #2649 from ilya-lavrenov:gabor_eps 2014-04-23 11:49:43 +04:00
Alexander Karsakov 92f855f0c3 Added checking destination size for pyrUp, pyrDown. 2014-04-23 11:47:15 +04:00
Alexander Karsakov 01123aaa36 Changed integer operations to float for Intel devices 2014-04-23 11:00:32 +04:00
Ilya Lavrenov 493679dc56 cv::minMaxIdx for cn > 1 2014-04-22 23:47:04 +04:00
Alexander Alekhin e42057c487 Merge pull request #2648 from ilya-lavrenov:ipp_dist 2014-04-22 19:00:02 +04:00
Andrey Pavlenko cd01d705c9 Merge pull request #2627 from akarsakov:ipp_pyramids 2014-04-22 17:19:27 +04:00
Ilya Lavrenov 5c0a4878d7 changes eps 2014-04-22 15:49:17 +04:00
vbystricky dfe6adebb9 Fix error in arguments of ipp function 2014-04-22 15:07:03 +04:00
Alexander Alekhin 580559e1e6 Merge pull request #2618 from vbystricky:ipp_Scharr 2014-04-22 15:02:13 +04:00
Ilya Lavrenov 640c9667c7 fix for IPP ICV 2014-04-22 14:55:28 +04:00
Ilya Lavrenov 51e2a8ec96 fixes 2014-04-22 14:51:39 +04:00
vbystricky e68a55cca2 Fix error in ipp function call 2014-04-22 14:35:27 +04:00
Ilya Lavrenov 46e40343f2 cv::remap 2014-04-22 14:33:55 +04:00
Alexander Alekhin caf3ed284d Merge pull request #2645 from vbystricky:ipp_Convert 2014-04-22 13:45:31 +04:00
vbystricky 9cdb330452 Change test conditions 2014-04-22 13:27:20 +04:00
Roman Donchenko cccdcac0c8 Merge pull request #2640 from a-wi:2.4 2014-04-22 12:01:47 +04:00
Roman Donchenko 4211d8fbd9 Merge pull request #2641 from SpecLad:merge-2.4 2014-04-22 12:01:03 +04:00
Andrey Pavlenko 6b986489ec Merge pull request #2643 from vbystricky:ipp_GaussianBorder 2014-04-22 11:55:06 +04:00
Andrey Pavlenko 34afc72c23 Merge pull request #2642 from vbystricky:ipp_resize 2014-04-22 11:53:26 +04:00
Andrey Pavlenko 6823b36974 Merge pull request #2624 from ElenaGvozdeva:ipp_DistanceTransform 2014-04-22 11:48:25 +04:00
vbystricky f5c729396d Fix call of ippiConvert. 2014-04-22 10:50:35 +04:00
Andrey Pavlenko 7c3d5b056a Merge pull request #2612 from grkutty:pullreq/140319-bilateral-b 2014-04-22 09:32:39 +04:00
Artur Wieczorek f27a886314 Fix for issue #3645 (http://code.opencv.org/issues/3645).
Implement missing features in CvCaptureCAM_VFW class.

Implemented missing CvCaptureCAM_VFW::setProperty() member function (handling CV_CAP_PROP_FRAME_WIDTH, CV_CAP_PROP_FRAME_HEIGHT, CV_CAP_PROP_FPS properties).
Extended CvCaptureCAM_VFW::setProperty()/getProperty() functions to handle also CV_CAP_PROP_FPS property.
Minor refactoring of CvCaptureCAM_VFW class.
2014-04-21 17:10:58 +02:00
vbystricky bb12293251 Convert opencv border type to ipp border. Check supported border before call ipp function 2014-04-21 18:32:53 +04:00
vbystricky 42079b899c Fix error in call of ippResize 2014-04-21 17:26:03 +04:00
Elena Gvozdeva 3d7872b904 fixed 2014-04-21 16:59:55 +04:00
Roman Donchenko 4db12032dc Merge remote-tracking branch 'origin/2.4' into merge-2.4
No conflicts! Amazing!
2014-04-21 16:47:35 +04:00
Elena Gvozdeva b4830d896c added ippiTrueDistanceTransform_8u32f_C1R 2014-04-21 15:17:56 +04:00
Elena Gvozdeva 0265247504 Added ippiDistanceTransform for cv::distanceTransform, maskSize=3,5 2014-04-21 15:17:55 +04:00
vbystricky d9ef5bb5a7 Fix compile warnings 2014-04-21 15:02:38 +04:00
vbystricky f52126725f Disable scharr in icv only configuration 2014-04-21 14:43:56 +04:00
vbystricky d97f7da7a9 Fix setIppErrorStatus placement 2014-04-21 14:19:25 +04:00
Ilya Lavrenov fe644ede19 cv::multiply 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 9cc80a68db fixed warnings 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 76c415ff49 cv::filterSpeckles 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 04abffeb16 cv::cornerHarris 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 8603c58f37 Mat::setTo(with mask) 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 0b678c2451 Mat::setTo(Scalar::all(0)) 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 3bd8211a72 Mat::copyTo 2014-04-21 13:14:55 +04:00
Ilya Lavrenov f7ec4a5c47 Mat::copyTo with mask 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 8d24a83c9c cv::flip inplace 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 5ca3d855a2 cv::transpose inplace 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 8da0e2b707 cv::accumulate 2014-04-21 13:14:55 +04:00
Ilya Lavrenov d453a598f8 cv::min/cv::max CV_64F 2014-04-21 13:14:55 +04:00
Ilya Lavrenov 3e173b701e cv::Laplacian 2014-04-21 13:14:54 +04:00
Ernest Galbrun 6a6f24b170 adding new ali's feature 2014-04-18 16:36:34 +02:00
Alessandro Trebbi 3d25d70627 fix for compiling 2.4 opencv with xcode 5.1 2014-04-18 13:42:47 +02:00
vbystricky 650762419c Add setIppErrorStatus() 2014-04-18 15:13:34 +04:00
vbystricky d17f40dc1f Fix error in code 2014-04-18 15:04:46 +04:00
vbystricky 32394df42d Add constant border fix call ipp function 2014-04-18 15:04:46 +04:00
vbystricky 79384beb60 Fix warning 2014-04-18 15:04:45 +04:00
vbystricky 160c964e4b Fix error 2014-04-18 15:04:45 +04:00
vbystricky baa6ab1967 Change Scharr filter to new ipp functions 2014-04-18 15:04:45 +04:00
Andrey Pavlenko 82c67abbfa Merge pull request #2622 from ilya-lavrenov:ipp_sort 2014-04-18 14:47:06 +04:00
Andrey Pavlenko 39b852f51d Merge pull request #2625 from ilya-lavrenov:ipp_reduce 2014-04-18 14:46:37 +04:00
Ilya Lavrenov 9a109440df cv::reduce sum/avg 2014-04-18 14:44:12 +04:00
Ilya Lavrenov aa5767421a cv::reduce (min/max to single column) 2014-04-18 14:39:33 +04:00
Ilya Lavrenov 1f6b719776 added ippisFlip to cv::sort 2014-04-18 14:37:46 +04:00
Ilya Lavrenov 26e8c6216f cv:;sortIdx 2014-04-18 14:31:27 +04:00
Ilya Lavrenov d5513f522b cv::sort 2014-04-18 14:31:27 +04:00
Andrey Pavlenko cb8743f9aa Merge pull request #2628 from ilya-lavrenov:ipp_error_handling 2014-04-18 13:37:35 +04:00
Alexander Karsakov 4f4a95299a Added setIppErrorStatus 2014-04-18 09:04:25 +04:00
Alexander Karsakov 6202f54a18 Fixed sanity check for integer type 2014-04-17 19:02:56 +04:00
Ilya Lavrenov 05a47d9014 cmd option 2014-04-17 18:06:14 +04:00
Ilya Lavrenov 87eb1b8fcc fixes in imgproc 2014-04-17 14:51:59 +04:00
Roman Donchenko da58425fbc Merge pull request #2629 from maksqwe:unused_fix 2014-04-17 13:02:36 +04:00
Ilya Lavrenov 6f9ca3d77c fixed some errors 2014-04-17 11:08:02 +04:00
Ilya Lavrenov ce0941160e added status check 2014-04-17 11:08:02 +04:00
Ilya Lavrenov 2cd7a913ed verbose errors 2014-04-17 11:07:01 +04:00
Ilya Lavrenov f3c56f8310 first attemp 2014-04-17 11:07:01 +04:00
Istvan Sarandi e18224110c Removed emptiness check from cv::hconcat and cv::vconcat. Sometimes you want to concatenate with an empty matrix. 2014-04-17 02:41:52 +02:00
Maks Naumov 3e5a69d8ba remove unused variables in OCL_PERF_TEST_P() 2014-04-17 00:19:04 +03:00
Maks Naumov dba0f9fc8f remove unused variable in erGrouping() 2014-04-17 00:16:07 +03:00
Maks Naumov 9e10c09f2d remove unused variable in LineSegmentDetectorImpl::compareSegments() 2014-04-17 00:14:13 +03:00
Alexander Karsakov a7d12aabab Added epsilon for tests with float data type 2014-04-16 18:07:24 +04:00
Alexander Karsakov 793e980876 Added IPP Pyramid API functions to cv::buildPyramid 2014-04-16 17:10:20 +04:00
Andrey Pavlenko e11d998cfb Merge pull request #2623 from alalek:icv_fix_color 2014-04-16 15:56:09 +04:00
Alexander Karsakov ef2f5999ed Added perf test for cv::buildPyramid 2014-04-16 13:01:49 +04:00
Alexander Karsakov 8230f1fd68 Added ippiPyrUp_Gauss5x5 to cv::pyrUp 2014-04-16 11:59:32 +04:00
Alexander Karsakov f218dffce6 Added ippiPyrDown_Gauss5x5 to cv::pyrDown 2014-04-16 11:39:10 +04:00
Alexander Karsakov 10cb660240 Fixed condition 2014-04-16 10:28:24 +04:00
KayKwon e13e3be16e Merge branch 'master' into matlab_formatter 2014-04-16 11:13:02 +09:00
KayKwon 84257b57d0 Fix for (Bug #2789)
Add MatlabFormatter for matlab style output.
See http://code.opencv.org/issues/2789
2014-04-16 10:56:27 +09:00
unknown c2f540d090 White space fixes 2014-04-15 09:32:34 -07:00
Andrey Pavlenko 80ef1f6753 Merge pull request #2621 from arkunze:pullreq/140319-resize-b 2014-04-15 19:56:56 +04:00
Andrey Pavlenko a26bed16e6 Merge pull request #2617 from ElenaGvozdeva:ipp_matchTemplate 2014-04-15 19:56:38 +04:00
Andrey Pavlenko dab8e920b0 Merge pull request #2565 from apavlenko:tapi_stitching 2014-04-15 19:56:11 +04:00
Andrey Pavlenko 7ba4212529 Merge pull request #2544 from alalek:perf_report_regressions 2014-04-15 16:17:39 +04:00
Alexander Alekhin 3bb6db522d ICV: mark missed functions 2014-04-15 15:55:44 +04:00
GregoryMorse aa3c36f545 Update cap_msmf.cpp
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

Update cap_msmf.cpp

Successful test - samples are grabbed

Update ppltasks_winrt.h

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

Support VS 2013 and consistency cleanup and C++/CX object creation fixed
2014-04-15 18:32:23 +08:00
Vadim Pisarevsky 6a5a0fe803 Merge pull request #2016 from pemmanuelviel:kmeansppSquareDist 2014-04-15 13:31:48 +04:00
Vadim Pisarevsky 7942494fb6 Merge pull request #2233 from palindromoroz:BGSubtract_KNN_new_code 2014-04-15 13:22:43 +04:00
Vadim Pisarevsky 20aaa8fe77 Merge pull request #2560 from akarsakov:gaussianblur_integer 2014-04-15 13:21:25 +04:00
Vadim Pisarevsky 92db6786a9 Merge pull request #2578 from akrynski:patch-1 2014-04-15 13:21:08 +04:00
Vadim Pisarevsky 4eede18027 Merge pull request #2606 from alalek:icv_downloader 2014-04-15 13:20:04 +04:00
Vadim Pisarevsky 9cdd15e141 Merge pull request #2615 from krodyush:pullreq/140319-PyrLKOpticalFlow-fix 2014-04-15 13:19:45 +04:00
Roman Donchenko 534f9623f2 Merge pull request #2616 from SpecLad:merge-2.4 2014-04-15 12:06:13 +04:00
Elena Gvozdeva 3553e9379b fixed 2014-04-15 11:41:33 +04:00
unknown 36d33dd6c2 Review comments 2014-04-14 16:10:11 -07:00
Aaron Kunze ebbac3c66d Optimizes OpenCL resize and optical flow to use image extension. 2014-04-14 16:09:17 -07:00
Andrey Pavlenko 8176e893c0 Merge pull request #2609 from alalek:tests_fixes 2014-04-14 18:54:01 +04:00
Andrey Pavlenko 5ff59af09d Merge pull request #2610 from ilya-lavrenov:ipp_cvtcolor 2014-04-14 18:52:07 +04:00
Andrey Pavlenko f4c5679db8 Merge pull request #2614 from ilya-lavrenov:ipp_laplacian 2014-04-14 18:51:31 +04:00
Alexander Karsakov 53bc93730c Added suppressing deprecation for ippiMulC_32f_C1IR 2014-04-14 16:38:59 +04:00
Roman Donchenko 799d2dabd6 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/core/test/test_arithm.cpp
	modules/cuda/src/cascadeclassifier.cpp
	modules/imgproc/doc/geometric_transformations.rst
	modules/objdetect/src/hog.cpp
	modules/ocl/perf/perf_imgproc.cpp
	modules/ocl/src/gftt.cpp
	modules/ocl/src/moments.cpp
2014-04-14 16:08:02 +04:00
Ilya Lavrenov 884b706b3a fixed warning 2014-04-14 14:40:40 +04:00
Ilya Lavrenov ad7f2311c0 cv::Laplacian 2014-04-14 14:34:28 +04:00
Ilya Lavrenov 2a051a124f cvtColor 2014-04-14 14:29:36 +04:00
Andrey Pavlenko 5522c14efc Merge pull request #2607 from ilya-lavrenov:warn_sup 2014-04-14 14:15:12 +04:00
krodyush 57992e0169 replace IPatchLocal[][] into *IPatchLocal to fix compilation error on some devices. 2014-04-14 13:23:12 +04:00
Tony fd5e180657 Rebase branch gtk3 2014-04-13 15:52:22 +01:00
Tony 265148b974 Correction to enable compilation on platform with only GTK2 libs
modified:   CMakeLists.txt
	modified:   cmake/OpenCVFindLibsGUI.cmake
2014-04-13 11:11:05 +01:00
Tony cb4fffc72a Fix logic error in OpenCVFindLibsGUI.cmake
When with_gtk is selected but GTK3 is not present the current logic
fails to check for GTK2. This edit corrects this.
2014-04-13 11:08:32 +01:00
Tony c0dbc083ea Correct error with GTK3 not found selection
When GTK3 is not found, HAVE_GTK was being set to TRUE. This edit
ensures that HAVE_GTK is only set if GTK3 or GTK2 (meeting minimum
version requirements) is present.
Selection logic for printing 'GTK: No' when the libraries are not found
has also been removed so the message is printed when GTK is not found or
selected in common with other libraries.

Changes committed:
	modified:   CMakeLists.txt
	modified:   cmake/OpenCVFindLibsGUI.cmake
2014-04-13 11:08:31 +01:00
Tony 65f63421fa Change quotes around GTK headers for angle brackets
The linux buildbots have started to fail compilation due to not
finding the gtk headers. The quotes have been changed to angle brackets
to indicate to the compiler that these are system includes.
2014-04-13 11:07:38 +01:00
Tony a28ad40c2a Fix bug in GTK+3 logic introduced by previous merge
During merging of conflicting versions of this file, I erroneously
deleted several lines in the GUI reporting section. This is repaired
in this commit.
2014-04-13 11:07:38 +01:00
Tony f318b5bc9d Improve GTK+ library selection logic.
The new logic will select GTK+3 by default if WITH_GTK is selected. If
the GTK+3 libraries are not found, then GTK+2 libraries will be selected
if found.
This can be overridden by using WITH_GTK_2_X to force selection of GTK+2
(if found).
2014-04-13 11:04:56 +01:00
Tony 1638341270 Use GTK_VERSION_MAJOR to switch between GTK+ version two and three
specific code. As a result of this, HAVE_GTK3 no longer needs to be
exposed.

The use of HAVE_GTK, and HAVE_ GTK3 have been changed to mirror the
method used by HAVE_QT and HAVE_QT5.
 On branch gtk3
 Changes to be committed:
        modified:   CMakeLists.txt
        modified:   cmake/OpenCVFindLibsGUI.cmake
        modified:   cmake/templates/cvconfig.h.in
        modified:   modules/highgui/src/window.cpp
        modified:   modules/highgui/src/window_gtk.cpp
2014-04-13 11:04:56 +01:00
Tony befdef9685 Merge remote-tracking branch 'upstream/master'
Rebase to lates upstream
2014-04-13 10:39:32 +01:00
Tony 512cb4fced Correction to enable compilation on platform with only GTK2 libs
modified:   CMakeLists.txt
	modified:   cmake/OpenCVFindLibsGUI.cmake
2014-04-12 22:43:42 +01:00
unknown d2b4ee1e9b More intendation fixes 2014-04-11 21:44:12 -07:00
unknown 06df383675 Indent fixes 2014-04-11 19:14:01 -07:00
Alexander Alekhin 3a1a3da782 fix tests 2014-04-11 16:11:05 +04:00
Andrey Pavlenko f104d5be8c Merge pull request #2600 from ilya-lavrenov:ipp_calc_hist 2014-04-11 15:18:04 +04:00
Andrey Pavlenko fd90efc9dd Merge pull request #2593 from arkunze:pullreq/140319-color 2014-04-11 15:16:33 +04:00
Alexander Alekhin 047d285b7d ICV: added package downloader 2014-04-11 14:19:18 +04:00
Roman Donchenko df8e28283f Merge pull request #2571 from MartinChodakowski:fix-old-python-doc-typos 2014-04-11 14:15:26 +04:00
Roman Donchenko 4c2db3d6e7 Merge pull request #2579 from maksqwe:test_operations_fix 2014-04-11 14:14:33 +04:00
Roman Donchenko 8ab224746b Merge pull request #2603 from maksqwe:unused_fix_2.4 2014-04-11 14:14:04 +04:00
Ilya Lavrenov 19d470749b added macro for denoting region for suppression of "Wdeprecated-declarations" 2014-04-11 13:45:20 +04:00
Andrey Pavlenko 925178749a removing SuppressWarning and CV_OPENCL_RUN 2014-04-11 13:09:19 +04:00
Alexander Alekhin 3578f0afe9 ocl: workaround for synchronization issue in ::map() 2014-04-11 13:09:18 +04:00
Alexander Alekhin 588658d1a3 tapi: stitching: fix documentation 2014-04-11 13:09:17 +04:00
Alexander Alekhin 026b13b3db TAPI: stitching: blender: fix OpenCL path & adjust test condition 2014-04-11 13:09:16 +04:00
Alexander Alekhin e6cc1be7e8 stitching: allow to use dynamic DescriptorMatcher 2014-04-11 13:01:13 +04:00
Alexander Alekhin 06738468af TAPI: stiching: add custom OpenCL kernels for MultiBandBlender 2014-04-11 13:01:12 +04:00
Alexander Alekhin c22d92c1cb stitching: extend logging 2014-04-11 13:01:11 +04:00
Alexander Alekhin a7f69a37e3 stitching: use BORDER_CONSTANT in warp 2014-04-11 13:01:10 +04:00
Alexander Alekhin c4a31a1ab1 TAPI: stitching: optimize compare operation 2014-04-11 13:01:10 +04:00
Alexander Alekhin 7a5c1babde TAPI: stitching: optimize exposure 2014-04-11 13:01:09 +04:00
Alexander Alekhin 2737e3c99b TAPI: stitching: workaround for problem getUMat() call 2014-04-11 13:01:08 +04:00
Alexander Alekhin c1ea6f3c42 TAPI: stitching: improve warpers 2014-04-11 13:01:07 +04:00
Alexander Alekhin 89e3e448f5 features2d: workaround for 'utrainDescCollection' issue (PR #2142) 2014-04-11 13:01:07 +04:00
Alexander Alekhin 1d9808e5d5 TAPI: stitching, replaced Mat->UMat/_Array 2014-04-11 13:01:06 +04:00
Alexander Alekhin 8b6c5ade0e TAPI: added perf test for stitching 2014-04-11 13:01:05 +04:00
Andrey Pavlenko 6bfbcf02cb Merge pull request #2587 from ElenaGvozdeva:ipp_matchTemplate 2014-04-11 12:47:25 +04:00
Andrey Pavlenko f7f4593936 Merge pull request #2581 from vbystricky:ipp_moments 2014-04-11 12:45:13 +04:00
Andrey Pavlenko 7ae547a208 Merge pull request #2597 from ilya-lavrenov:ipp_countnonzero 2014-04-11 12:43:24 +04:00
Andrey Pavlenko b56dce3965 Merge pull request #2604 from alalek:binary_package_fix 2014-04-11 12:34:23 +04:00
Tony 8fd11f477b Fix logic error in OpenCVFindLibsGUI.cmake
When with_gtk is selected but GTK3 is not present the current logic
fails to check for GTK2. This edit corrects this.
2014-04-10 23:28:23 +01:00
unknown e032b5f5d5 Resolving conflicts after rebasing from public 2014-04-10 12:28:37 -07:00
Aaron Kunze b59c517f98 Optimizations to OpenCL bilateral filter. 2014-04-10 12:15:13 -07:00
Tony 47d4f8cd61 Merge remote-tracking branch 'upstream/master' into gtk3
Conflicts:
	CMakeLists.txt
2014-04-10 20:10:28 +01:00
Ilya Lavrenov b970ec7dae parallel version 2014-04-10 19:39:00 +04:00
Elena Gvozdeva 43c29a6751 fixed 2014-04-10 17:26:38 +04:00
Alexander Karsakov 7369cfd9ec Added perf test for cornerMinEigenVal 2014-04-10 16:09:48 +04:00
Vadim Pisarevsky f417c79d16 Merge pull request #1932 from seth-planet:master 2014-04-10 13:36:14 +04:00
Vadim Pisarevsky 604a64b206 Merge pull request #2390 from nicolasmartin3d:master_bug3546 2014-04-10 13:33:43 +04:00
Vadim Pisarevsky a0bf7f82ba Merge pull request #2067 from pemmanuelviel:groupWiseCenterChooser 2014-04-10 13:33:29 +04:00
Vadim Pisarevsky dae04aacc3 Merge pull request #2575 from rold2007:Bugfix_1437 2014-04-10 13:31:33 +04:00
Vadim Pisarevsky b66adc81a4 Merge pull request #2599 from maksqwe:test_calibration_2.4 2014-04-10 13:30:37 +04:00
Vadim Pisarevsky b5755b1228 Merge pull request #2588 from vpisarev:fix_samples_n_unused 2014-04-10 13:30:20 +04:00
Vadim Pisarevsky 211d44cfc5 Merge pull request #2591 from Nerei:viz_cloud_shading_support 2014-04-10 13:29:58 +04:00
Ilya Lavrenov b2379b51b5 cv::countNonZero 2014-04-10 13:21:52 +04:00
Tony 34984328fd Merge remote-tracking branch 'upstream/master'
Conflicts:
	CMakeLists.txt
2014-04-10 08:07:02 +01:00
Alexander Karsakov d9556a998f Added ippiMinEigenVal_ to cv::cornerMinEigenVal 2014-04-10 11:00:08 +04:00
Tony 2f9dad5ce8 Correct error with GTK3 not found selection
When GTK3 is not found, HAVE_GTK was being set to TRUE. This edit
ensures that HAVE_GTK is only set if GTK3 or GTK2 (meeting minimum
version requirements) is present.
Selection logic for printing 'GTK: No' when the libraries are not found
has also been removed so the message is printed when GTK is not found or
selected in common with other libraries.

Changes committed:
	modified:   CMakeLists.txt
	modified:   cmake/OpenCVFindLibsGUI.cmake
2014-04-09 22:07:59 +01:00
Maks Naumov eb89f5207c remove unused variables in CV_KDTreeTest_CPP::findNeighbors() 2014-04-09 23:07:48 +03:00
Maks Naumov 29d1bce85f remove unused variable in TEST_P() 2014-04-09 23:06:06 +03:00
Maks Naumov 79eb3c5cde remove unused variable in OCL_PERF_TEST_P() 2014-04-09 23:04:29 +03:00
Maks Naumov befbe89bdf remove unused variable in ocl_moments() 2014-04-09 23:01:49 +03:00
Maks Naumov eb45cf0c93 remove unused variable in findCorners_caller() 2014-04-09 22:59:52 +03:00
Maks Naumov 9b52b61451 remove unused variable in HOGDescriptor::groupRectangles() 2014-04-09 22:56:19 +03:00
Maks Naumov a01659825c remove unused variable in loadFromXML() 2014-04-09 22:53:36 +03:00
Maks Naumov c098c18942 Merge pull request #1 from Itseez/2.4
2.4
2014-04-09 22:48:19 +03:00
Ilya Lavrenov 18ef25ec30 cv::calcHist 2014-04-09 21:46:09 +04:00
Aaron Kunze 785acc1834 Fixes global size issue, adds #pragma unroll to loops 2014-04-09 08:42:55 -07:00
Alexander Alekhin 03773cb117 remove ippasync samples from build without IPP-A 2014-04-09 18:58:53 +04:00
Andrey Pavlenko 7b366df822 Merge pull request #2589 from alalek:icv_update 2014-04-09 18:23:35 +04:00
Andrey Pavlenko cd02a7002b Merge pull request #2596 from ilya-lavrenov:tapi_setto 2014-04-09 18:23:15 +04:00
Alexander Alekhin ab691a4a24 ipp: some functions are not available in the ICV package #2 2014-04-09 18:20:49 +04:00
Alexander Alekhin 0d477ffea1 ipp: some functions are not available in the ICV package 2014-04-09 18:20:49 +04:00
Alexander Alekhin 1461ab41bc ipp: added support for updated ICV package 2014-04-09 18:20:49 +04:00
Maks Naumov b033a63e63 fix typo in test_cameracalibration 2014-04-09 14:41:16 +03:00
vbystricky b6d58d1d3b Fix ipp ifdef 2014-04-09 14:53:59 +04:00
vbystricky d9013a85f1 Fix IPP version ifdef 2014-04-09 14:49:37 +04:00
vbystricky 8899ec1586 Add IPP version of Moments calculattion of image 2014-04-09 14:49:36 +04:00
Andrey Pavlenko ced81b9121 Merge pull request #2594 from arkunze:pullreq/140319-dll-shutdown-fix-b 2014-04-09 14:25:12 +04:00
Andrey Pavlenko e9bc737485 Merge pull request #2584 from akarsakov:ipp_threshold 2014-04-09 14:17:48 +04:00
Andrey Pavlenko e6d6a3a85b Merge pull request #2586 from ilya-lavrenov:ipp_disable 2014-04-09 14:16:25 +04:00
Ilya Lavrenov bcd7151867 added UMat::setTo accuracy test 2014-04-09 14:15:22 +04:00
Andrey Pavlenko e013f04669 Merge pull request #2583 from ilya-lavrenov:ippicv 2014-04-09 14:14:14 +04:00
Andrey Pavlenko 96484e1ad7 Merge pull request #2592 from ilya-lavrenov:tests 2014-04-09 14:06:14 +04:00
Ilya Lavrenov 4a63b3dd90 cv2cvtest part2 2014-04-09 13:08:51 +04:00
Alexander Karsakov a66db67b83 Attempt to improve performance 2014-04-09 11:54:09 +04:00
Alexander Karsakov 35494f81ef Added ippiThreshold to cv::threshold 2014-04-09 11:41:35 +04:00
Elena Gvozdeva 6119ae0ea9 fixed 2014-04-09 11:09:51 +04:00
David Rolland cb8ddb1179 Corrected bug #1437. Corrected the cast of two short values from an lParam. lParam contains two signed-short, the position can be negative when another mouse event happens with a mouse_move (mouse_click, etc.)
The Microsoft documentation specifies NOT to use LOWORD and HIWORD macros to extract the x/y positions as it won't work correctly with multiple monitors. See http://msdn.microsoft.com/en-us/library/windows/desktop/ms645607(v=vs.85).aspx.
2014-04-09 18:24:21 +12:00
Aaron Kunze 629ddf0bf8 Resolves bug #3450 (Improperly cleaning up resources in DllMain) 2014-04-08 16:21:33 -07:00
Aaron Kunze bea2515f0e Optimizations for OpenCL color conversion. 2014-04-08 15:58:04 -07:00
Tony 8592022bd8 Change quotes around GTK headers for angle brackets
The linux buildbots have started to fail compilation due to not
finding the gtk headers. The quotes have been changed to angle brackets
to indicate to the compiler that these are system includes.
2014-04-08 23:13:27 +01:00
Tony 838bb4bdeb Fix bug in GTK+3 logic introduced by previous merge
During merging of conflicting versions of this file, I erroneously
deleted several lines in the GUI reporting section. This is repaired
in this commit.
2014-04-08 21:21:40 +01:00
Ilya Lavrenov 444ab0ef0d fixed (IppiSize&)sz 2014-04-09 00:19:56 +04:00
Ilya Lavrenov c735594178 cv::scaleAdd 2014-04-09 00:12:48 +04:00
Ilya Lavrenov fd3a6f0db7 cv::blur 2014-04-09 00:11:28 +04:00
Ilya Lavrenov a624ec167d cv::Mat::convertTo 2014-04-09 00:11:28 +04:00
Ilya Lavrenov b72b256fda cv::pow (added ippiSqr_32f_C1R for power=2) 2014-04-09 00:11:28 +04:00
Ilya Lavrenov b56b9c43dc cv::updateMotionHistory 2014-04-09 00:11:28 +04:00
Ilya Lavrenov 77723db034 cv::flip 2014-04-09 00:11:28 +04:00
Ilya Lavrenov f2a35d6388 cv::boxFilter 2014-04-09 00:11:28 +04:00
Ilya Lavrenov c6f208e1c8 cv::medianBlur 2014-04-09 00:11:27 +04:00
Ilya Lavrenov ed1ca00bf6 cv::magnitude 2014-04-09 00:11:27 +04:00
Ilya Lavrenov bf860dbb31 cv::pow 2014-04-09 00:11:27 +04:00
Ilya Lavrenov 49d1691a3e cv::sqrt 2014-04-09 00:11:27 +04:00
Ilya Lavrenov c224cfa628 cv::accumulateSquare && cv::acumulateProduct 2014-04-09 00:11:27 +04:00
Ilya Lavrenov 2c0c887f70 cv::accumulateWeighted 2014-04-09 00:11:27 +04:00
Ilya Lavrenov 5ddff235bb cv::polarToCart 2014-04-09 00:11:27 +04:00
Ilya Lavrenov 46cb4e0cbc cv::transpose 2014-04-09 00:11:26 +04:00
Ilya Lavrenov f1b38c4198 cv::warpPerspective and cv::warpAffine 2014-04-09 00:11:26 +04:00
Ilya Lavrenov e090aa07db disabled some IPP funcs 2014-04-08 22:30:18 +04:00
Tony d60be58a92 Merge remote-tracking branch 'upstream/master' into gtk3
Conflicts:
	CMakeLists.txt
2014-04-08 19:25:51 +01:00
Tony 3cd50739ef Merge remote-tracking branch 'upstream/master' 2014-04-08 19:14:05 +01:00
Anatoly Baksheev 3f95818252 Added cloud shading support - additional normals array is used 2014-04-08 20:31:28 +04:00
Andrey Pavlenko 5600bc54f4 Merge pull request #2585 from ilya-lavrenov:norm 2014-04-08 18:01:24 +04:00
Andrey Pavlenko ac92d4c701 Merge pull request #2566 from krodyush:pullreq/140319-PyrLKOpticalFlow 2014-04-08 17:58:16 +04:00
Vadim Pisarevsky 1b339eb0d4 fixed slow down in getRectSubPix (original patch by Markus JR Mueller); removed some unused variables and functions 2014-04-08 17:54:08 +04:00
Firat Kalaycilar 990295644e made a performance improvement.
changed the way the mean value for each pixel is assigned in the output image.
2014-04-08 16:10:32 +03:00
Elena Gvozdeva 42d45e0b02 Added ippiSqrDistanceNorm and ippiCrossCorrNorm to cv::matchTemplate 2014-04-08 16:51:15 +04:00
Firat Kalaycilar 9eb0e7d99b Merge branch '2.4' of git://github.com/Itseez/opencv into mog2_bgimg_gray 2014-04-08 14:58:32 +03:00
Ilya Lavrenov aa5326c231 cv::norm -> cvtest::norm in tests
Conflicts:

	modules/core/src/stat.cpp
2014-04-08 14:49:20 +04:00
Andrey Pavlenko a6ef45aa13 Merge pull request #2582 from vbystricky:ipp_fix 2014-04-08 14:30:48 +04:00
vbystricky 9828cd6086 Remove defined(HAVE_IPP) 2014-04-08 13:05:23 +04:00
vbystricky f23134ce01 Add IPP_VERSION_X100 define 2014-04-08 12:43:57 +04:00
Andrey Pavlenko 9ec823d800 Merge pull request #2538 from ElenaGvozdeva:ipp_async_convert 2014-04-08 11:05:30 +04:00
Martin Chodakowski 267241b889 Fix typos in old python wrapper documentation(Bug #3628)
Fixed spelling of CV_INTER_LINEAR flag in geometric_transformations.rst
2014-04-08 00:55:08 -04:00
Elena Gvozdeva f9c5289483 fixed 2014-04-07 18:53:07 +04:00
Roman Donchenko 6f055d7a76 Merge pull request #2580 from SpecLad:merge-2.4 2014-04-07 18:29:51 +04:00
krodyush 616ec74beb fix previous merge error 2014-04-07 17:32:39 +04:00
vbystricky 7badc85b60 Fix for pullrequest comment 2014-04-07 17:06:02 +04:00
vbystricky 2d54581971 Fix ifdef for IPP version greater 8.1 2014-04-07 16:45:35 +04:00
Andrey Pavlenko f690440533 Merge pull request #2568 from vbystricky:ippicv 2014-04-07 15:52:32 +04:00
Roman Donchenko 4f2b126b7b Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/core/include/opencv2/core/version.hpp
	modules/core/src/out.cpp
	modules/cudaimgproc/test/test_hough.cpp
	modules/gpu/doc/introduction.rst
	modules/gpu/perf/perf_imgproc.cpp
	modules/gpu/src/generalized_hough.cpp
	modules/nonfree/perf/perf_main.cpp
2014-04-07 14:59:34 +04:00
vbystricky 268c0caa7a Fix problems in CMakeLists.txt 2014-04-07 14:53:30 +04:00
vbystricky e8f79d6e1f Fix rebase errors 2014-04-07 14:44:01 +04:00
vbystricky dbdc476b79 Check results of ipp function 2014-04-07 14:31:34 +04:00
vbystricky 38913bf5f6 Change all 'ippStsNoErr==' to '0<=', and all 'ippStsNoErr!=' to '0>' 2014-04-07 14:31:34 +04:00
vbystricky 67484e027b Fix function names (log, exp) 2014-04-07 14:31:33 +04:00
vbystricky 566f783968 Fix errors 2014-04-07 14:31:33 +04:00
vbystricky 23e1b50837 Check 8.1 ipp version for color convertion functions, which not exists in versions before this. 2014-04-07 14:31:33 +04:00
vbystricky 06acb8b0ee Check 8.1 ipp version for gaussian functions, which not exists in versions before this. 2014-04-07 14:31:32 +04:00
vbystricky be29d628d3 Check 8.1 ipp version for morphology functions, which not exists in versions before this. 2014-04-07 14:31:32 +04:00
vbystricky 4512d06484 Fix const src matrix in IPPresizeInvoker 2014-04-07 14:31:31 +04:00
vbystricky 824ed8a3ae Fix errors 2014-04-07 14:31:31 +04:00
vbystricky 1b3651d8ee Undo changes ipp to ippicv prefix of function names 2014-04-07 14:30:03 +04:00
vbystricky eb8c531791 Add preprocessor check for IPP version greater 8.1 on some code 2014-04-07 14:26:51 +04:00
vbystricky 188c506237 Uncomment ippiNormDiff_Inf_16s_C3R, ippiNormDiff_Inf_16s_C4R 2014-04-07 14:26:51 +04:00
vbystricky ec6f977783 Uncomment ippicviNorm_Inf_16s_C3R, ippicviNorm_Inf_16s_C4R functions 2014-04-07 14:26:50 +04:00
vbystricky a9a0ea3706 Fix error not initialized IppStatus before ipp functions call 2014-04-07 14:26:50 +04:00
vbystricky c321330777 Comment ipp version of CV_BGR2GRAY color convertion, by problems in BRIEF accuracy test and Path_Idx_Cn_NPoints_WSize perfomance test 2014-04-07 14:26:50 +04:00
vbystricky ad23ef2a42 Remove unused #include "ippverdion.h" 2014-04-07 14:26:49 +04:00
vbystricky 9d138b2bbe Enable ipp MeanStdDev calculation for 32F_C1 images. Decrease accuracy sanity check of the perfomance test 2014-04-07 14:26:49 +04:00
vbystricky c29583eacc Change Canny input image description, we can use multichannel image now 2014-04-07 14:26:48 +04:00
vbystricky ee2df645f4 Canny uncommented, prefix of ipp function changed. Ipp version of Canny called only for images with one channels 2014-04-07 14:26:48 +04:00
vbystricky 9b6feee1a5 Change sanity check for perfomance test of dft 2014-04-07 14:26:47 +04:00
vbystricky a6b53489e6 Change sanity check for perfomance test of bilateral filter 2014-04-07 14:26:47 +04:00
vbystricky aece433b15 Check ippStsNoErr as result of ipp function instead >=0 2014-04-07 14:26:47 +04:00
vbystricky c65e5a1e7b Fix error BGRA2RGBA color convertion by ipp. Uncomment ipp color converstion, which pass tests 2014-04-07 14:26:46 +04:00
vbystricky b3db990daa Remove unused code 2014-04-07 14:26:46 +04:00
vbystricky 07e84c635a Remove unused code 2014-04-07 14:26:45 +04:00
vbystricky 06434bedfd Change deprecated function ippicviMulC_32f_C1IR to ippicviMulC_32f_C1R. Check results of ipp function, if error was return run opencv branch of code 2014-04-07 14:26:45 +04:00
vbystricky 3b03044047 Fix warning 2014-04-07 14:26:44 +04:00
vbystricky 58de8bc917 Change deprecated functions to valid 2014-04-07 14:24:06 +04:00
vbystricky 01a66a2938 Prepare codes for ippicv library 2014-04-07 14:24:05 +04:00
Andrey Pavlenko c2f859569c Merge pull request #2563 from alalek:ipp_builds 2014-04-07 13:03:11 +04:00
Maks Naumov 8271bd5f14 fix condition in CV_OperationsTest::operations1() 2014-04-07 11:24:27 +03:00
Roman Donchenko 1cee868e88 Merge pull request #2572 from jet47:gpu-generalized-hough 2014-04-07 11:57:52 +04:00
Andrey Pavlenko def4f5e2a3 Merge pull request #2499 from mlyashko:back_proj_fix1 2014-04-07 10:57:21 +04:00
Vladislav Vinogradov d822d6f101 disable GeneralizedHough tests on gcc 4.7 2014-04-07 09:49:17 +04:00
akrynski 1dba47b77b Update crop_face.py
I propose some changes, to automate file cropping
2014-04-06 18:48:38 +02:00
Tony 572e4f5255 Merge remote-tracking branch 'upstream/master' 2014-04-06 11:49:23 +01:00
Ievgen Khvedchenia 5848e75168 Clean-up from unused utils.h/utils/cpp 2014-04-05 15:25:59 +03:00
Ievgen Khvedchenia 17f305140b Added unit-tests for KAZE and AKAZE features 2014-04-05 10:25:59 +03:00
Ievgen Khvedchenia 137ff7eccb Added KAZE and AKAZE wrappers 2014-04-05 10:25:46 +03:00
Ievgen Khvedchenia 703e012a5b Prepare KAZE and AKAZE sources for integration 2014-04-05 10:24:27 +03:00
Ievgen Khvedchenia 7a59435490 KAZE and AKAZE integration initial commit 2014-04-04 14:25:38 +03:00
Andrey Pavlenko d1710a8547 Merge pull request #2562 from akarsakov:gftt_fix 2014-04-04 13:34:31 +04:00
krodyush 4ca695cab0 Merge remote-tracking branch 'github/master' into pullreq/140319-PyrLKOpticalFlow
Conflicts:
	modules/video/src/opencl/pyrlk.cl
2014-04-04 11:26:08 +04:00
Vladislav Vinogradov f8d922ad3e disable gpu::GeneralizedHough compilation on gcc 4.7 2014-04-04 10:31:33 +04:00
Andrey Pavlenko 5a3200d513 Merge pull request #2567 from apavlenko:fix_compare_scalar 2014-04-03 22:08:18 +04:00
Andrey Pavlenko 9a3895d842 Merge pull request #2556 from DeanF:master 2014-04-03 17:07:06 +04:00
Alexander Karsakov c747426fc1 Enabled integer arithmetic for filterSepSinglePass 2014-04-03 16:53:57 +04:00
Andrey Pavlenko 271f60ba7a fixing OCL run condition (build program failure for comparison 64F Mat with Scalar) 2014-04-03 16:21:04 +04:00
Alexander Alekhin bfc546d23c enable IPP ICV support 2014-04-03 15:05:38 +04:00
Elena Gvozdeva 037ac27ec8 Added SharedMatrix 2014-04-03 14:53:27 +04:00
Alexander Karsakov fc10ffefb8 Enabled integer arithmetic for row_filter_C1_D0 2014-04-03 13:31:06 +04:00
Alexander Karsakov 2cf3a6e26c Fixed error in case corners not found 2014-04-03 10:30:55 +04:00
Alexander Karsakov a3825acee4 Small refactoring 2014-04-02 16:38:32 +04:00
Andrey Pavlenko 2aab7b2926 Merge pull request #2557 from ilya-lavrenov:tapi_fnlm_fix 2014-04-02 13:01:08 +04:00
Roman Donchenko c165f07319 Merge pull request #2550 from SpecLad:merge-2.4 2014-04-02 12:00:01 +04:00
Tony 7daec9e9a8 Improve GTK+ library selection logic.
The new logic will select GTK+3 by default if WITH_GTK is selected. If
the GTK+3 libraries are not found, then GTK+2 libraries will be selected
if found.
This can be overridden by using WITH_GTK_2_X to force selection of GTK+2
(if found).
2014-04-01 23:01:18 +01:00
Ilya Lavrenov 2cd51c04e4 fixed condition in cv::FNLM 2014-04-01 23:18:07 +04:00
DeanF 48df67a9c5 Fixed trailing whitespace 2014-04-01 22:04:58 +03:00
DeanF bdc91c66c9 Fixed problem with compilation without HAVE_OPENCL
When compiling without OpenCL, some classes from its namespace are still used in code.
2014-04-01 21:20:13 +03:00
Elena Gvozdeva fa2d79a15b Added IPP Async converters, doc and sample 2014-04-01 16:47:29 +04:00
Andrey Pavlenko 6ef94b52ad Merge pull request #2536 from ilya-lavrenov:tapi_resize_linear 2014-04-01 12:54:07 +04:00
Roman Donchenko a8cb5c3983 Merge pull request #2554 from asmorkalov:ocv_249_version 2014-04-01 12:16:25 +04:00
Alexander Smorkalov e23f7303a6 OpenCV version++. OpenCV Manager version++. 2014-03-31 15:00:25 -07:00
Tony 7f671406db Use GTK_VERSION_MAJOR to switch between GTK+ version two and three
specific code. As a result of this, HAVE_GTK3 no longer needs to be
exposed.

The use of HAVE_GTK, and HAVE_ GTK3 have been changed to mirror the
method used by HAVE_QT and HAVE_QT5.
 On branch gtk3
 Changes to be committed:
        modified:   CMakeLists.txt
        modified:   cmake/OpenCVFindLibsGUI.cmake
        modified:   cmake/templates/cvconfig.h.in
        modified:   modules/highgui/src/window.cpp
        modified:   modules/highgui/src/window_gtk.cpp
2014-03-31 22:05:09 +01:00
Andrey Pavlenko 0d5ffec521 Merge pull request #2553 from ilya-lavrenov:typo 2014-03-31 23:21:07 +04:00
Andrey Pavlenko aa3c4ae5d2 Merge pull request #2552 from ilya-lavrenov:tapi_compare 2014-03-31 21:22:00 +04:00
Andrey Pavlenko 97eac3f394 Merge pull request #2551 from ilya-lavrenov:ocl_nonfree 2014-03-31 21:21:27 +04:00
Ilya Lavrenov 31f864a22b integer cv::resize (INTER_LINEAR && CV_8UC(cn)) 2014-03-31 20:25:53 +04:00
Andrey Pavlenko bb3c0c066c Merge pull request #2548 from jet47:gpu_mog2_test 2014-03-31 20:19:21 +04:00
Ilya Lavrenov 9b9769169f doc typos 2014-03-31 19:57:05 +04:00
Andrey Pavlenko d170faeb5c Merge pull request #2549 from ilya-lavrenov:tapi_laplacian 2014-03-31 19:36:44 +04:00
Andrey Pavlenko 6c2d77079f Merge pull request #2487 from ilya-lavrenov:tapi_perf_orb 2014-03-31 18:17:50 +04:00
Ilya Lavrenov 322b15a459 compare with scalar (cn > 1) 2014-03-31 17:50:16 +04:00
Ilya Lavrenov 7df92bbb77 fixed C4505 2014-03-31 17:30:15 +04:00
Alexander Karsakov 10a52220f0 Added integer arithmetic to sepFilter2D 2014-03-31 16:45:15 +04:00
Alexander Alekhin eeed9ce247 perf report: summary.py: added custom --regressions map 2014-03-31 16:04:18 +04:00
Andrey Pavlenko 1f4586f3dd Merge pull request #2541 from JinoBetti:2.4 2014-03-31 15:48:45 +04:00
Ilya Lavrenov c53398a438 performance tests for FAST 2014-03-31 15:03:00 +04:00
mlyashko 5acd178790 copyright fix 2014-03-31 14:57:03 +04:00
Roman Donchenko f77c68e0fa Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/imgproc/src/opencl/integral_sqrsum.cl
	modules/nonfree/doc/feature_detection.rst
	modules/nonfree/include/opencv2/nonfree/ocl.hpp
	modules/nonfree/src/surf_ocl.cpp
	modules/nonfree/test/test_features2d.cpp
	modules/ocl/doc/image_processing.rst
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/perf/perf_imgproc.cpp
	modules/ocl/perf/perf_match_template.cpp
	modules/ocl/src/haar.cpp
	modules/ocl/src/imgproc.cpp
	modules/ocl/src/match_template.cpp
	modules/ocl/src/opencl/haarobjectdetect.cl
	modules/ocl/src/opencl/haarobjectdetect_scaled2.cl
	modules/ocl/test/test_imgproc.cpp
2014-03-31 14:42:00 +04:00
Ilya Lavrenov e1efed1914 added support of ksize >= 5 to cv::Laplacian 2014-03-31 13:17:58 +04:00
mlyashko 4c5de04efb bug fix 2014-03-31 10:58:15 +04:00
Vladislav Vinogradov 6d368dc1e7 increase epsilon for MOG2::getBackgroundImage test:
it uses float arithmetics
2014-03-30 18:02:03 -07:00
Andrey Pavlenko 51530d4d8e Merge pull request #2543 from apavlenko:24_haar_revert 2014-03-28 23:17:08 +04:00
Alexander Karsakov d17142b83d Prototype OCL version of gaussian blur with integer arithmetic 2014-03-28 21:46:03 +04:00
Roman Donchenko 8541b7bf92 Merge pull request #2534 from asmorkalov:opencv_config_cut_cuda_abs_path 2014-03-28 19:37:04 +04:00
Alexander Smorkalov b852108262 OpenCVConfig.cmake fix after cutting absolute CUDA libraries path. 2014-03-28 18:57:21 +04:00
unknown 75534a4828 Python typdef fixed. Reverted the example to MOG2. Not time to make the command line switch for now. 2014-03-28 14:23:10 +01:00
Andrey Pavlenko 3747d2643f Revert pull request #1929 from @alalek "ocl: added workaround into Haar kernels"
This reverts commit 3dcddad88a.

Conflicts:
	modules/ocl/src/opencl/haarobjectdetect.cl
2014-03-28 16:08:11 +04:00
Andrey Pavlenko 7d82171af4 - fix test 2014-03-28 16:06:39 +04:00
Andrey Pavlenko e6e817e613 Revert "Merge pull request #1779 from perping:integral_2.4"
This reverts commit 54ea5bbac7, reversing
changes made to 28e0d3d771.
2014-03-28 16:05:04 +04:00
Roman Donchenko 0469c18726 Merge pull request #2542 from asmorkalov:android_javacam_cvtcolor_fix 2014-03-28 12:45:39 +04:00
Roman Donchenko d6b54ff9d1 Merge pull request #2476 from minkless:3.0-bugfix-core-filestorage 2014-03-28 12:17:16 +04:00
Roman Donchenko e055b68ceb Merge pull request #2403 from hbristow:issue-3451 2014-03-28 12:13:14 +04:00
Roman Donchenko 0b4534d4c9 Merge pull request #2379 from ngryman:optimize_jpeg 2014-03-28 12:08:55 +04:00
Roman Donchenko 0c1ab50643 Merge pull request #2533 from kenaniah:master 2014-03-28 12:08:23 +04:00
Roman Donchenko f5fecc7e9a Merge pull request #2539 from mjul:fixtypos 2014-03-28 11:58:23 +04:00
Roman Donchenko 4382970739 Merge pull request #2540 from mjul:fixtypos_2.4 2014-03-28 11:58:11 +04:00
Koji Miyazato 1ab8060b62 corrected some style errors found by review. 2014-03-28 10:45:33 +09:00
Alexander Smorkalov d17740ec87 Bug #3553 JavaCameraView frame format and cvtColor format inconsistency fixed. 2014-03-28 04:56:31 +04:00
Tony 41b8ab086b Merge remote-tracking branch 'upstream/master' 2014-03-27 19:32:05 +00:00
Nicolas Gryman da34f1d58c added jpeg with optimized coding support. 2014-03-27 13:34:33 -04:00
JinoBetti 91511c1521 Update out.cpp
Fixed a bug with the cv::format(cv::Mat, ...) method for matrices with only one row

see http://answers.opencv.org/question/21201/cvformat-does-not-format-the-way-it-should/?answer=23945#post-id-23945 for details
2014-03-27 16:28:40 +01:00
Roman Donchenko 2e3e106676 Merge pull request #2537 from ilya-lavrenov:doc_fix 2014-03-27 17:43:02 +04:00
mlyashko 4b71921526 both tests by picture and rand mat 2014-03-27 17:08:05 +04:00
Martin Jul a1798cb28e Fixed typo in BFMatcher in docs. 2014-03-27 13:52:49 +01:00
Ilya Lavrenov 80df44bd75 doc fix 2014-03-27 16:30:29 +04:00
Martin Jul bb05af8ece Merge branch '2.4' into fixtypos 2014-03-27 13:20:48 +01:00
Andrey Pavlenko e34a7caabc Merge pull request #2535 from akarsakov:stereobm_fix 2014-03-27 15:22:45 +04:00
Alexander Karsakov 4ceaf44fa0 Fixed incorrect calculation of best_disp 2014-03-27 11:21:32 +04:00
Andrey Pavlenko 6f5800e7df Merge pull request #2286 from alalek:umat_unmap_issue 2014-03-27 11:05:21 +04:00
Kenaniah Cerny 5005f5e88e Fixed type gPython -> Python 2014-03-26 23:15:42 -07:00
Kenaniah Cerny c764e0f114 Added link to main GitHub repo 2014-03-26 23:12:43 -07:00
Kenaniah Cerny 9f1b20a794 Grammar 2014-03-26 23:11:03 -07:00
Hilton Bristow 61c22d5899 removed experimental slots 2014-03-27 14:58:53 +10:00
Hilton Bristow fc696a9ff3 Improved standalone importing behaviour and creation of nested directories 2014-03-27 14:52:23 +10:00
Hilton Bristow 6f190bb907 Generalized todict implementation 2014-03-27 14:51:17 +10:00
Hilton Bristow 068b1bc3d0 More generic todict 2014-03-27 11:34:20 +10:00
Martin Jul 73042b32e1 Fixed typos in "matching" 2014-03-26 23:29:48 +01:00
Alexander Alekhin 3488fdcb43 disable failed tests 2014-03-26 19:29:59 +04:00
Alexander Alekhin 569e1346f2 UMat: issue in OpenCLAllocator::unmap() 2014-03-26 19:29:41 +04:00
Andrey Pavlenko 04c857a4e8 Merge pull request #2505 from alalek:umat_unmap_synchronization_test 2014-03-26 19:08:15 +04:00
Andrey Pavlenko a2f8a93bf5 Merge pull request #2529 from ilya-lavrenov:tapi_filter2D 2014-03-26 19:04:57 +04:00
Andrey Pavlenko 6c12f20395 Merge pull request #2528 from mlyashko:back_proj_fix 2014-03-26 19:04:39 +04:00
Andrey Pavlenko a1d151924d Merge pull request #2527 from apavlenko:ocl_surf_24 2014-03-26 19:03:44 +04:00
Andrey Pavlenko fa5705613d splitting plain and OCL tests for SURF. 2014-03-26 17:18:05 +04:00
Ilya Lavrenov f7d6d3cff5 improved cv::filter2D 2014-03-26 14:19:59 +04:00
Roman Donchenko 491b84d463 Merge pull request #2478 from clemenscorny:master 2014-03-26 12:19:54 +04:00
Roman Donchenko a7f9677378 Merge pull request #2404 from yashdv:old_basic_structures_doc_fix 2014-03-26 12:18:39 +04:00
Roman Donchenko d67b450741 Merge pull request #2378 from ngryman:progressive_jpeg 2014-03-26 12:12:02 +04:00
Alexander Karsakov 8c39b4e8b6 Fixed stereoBM for Intel CPU. 2014-03-26 11:53:36 +04:00
Tony 46ba9d30b9 Merge remote-tracking branch 'upstream/master' 2014-03-25 20:44:06 +00:00
Nicolas Gryman b211e1d989 added jpeg progressive support. 2014-03-25 15:27:24 -04:00
mlyashko 70fdfa0bdb changed type of sanity check 2014-03-25 16:43:20 +04:00
Andrey Pavlenko d63a8ba018 Merge pull request #2523 from ilya-lavrenov:tapi_filters 2014-03-25 16:23:02 +04:00
Alexander Alekhin 6bd7a444bc UMat map-unmap synchronization test 2014-03-25 16:19:52 +04:00
Clemens Korner f1c8b4b965 FEATURES2D: add DenseFeatureDetector Python wrapper 2014-03-25 12:07:01 +01:00
mlyashko 953aafbd3d Merge branch 'master' of https://github.com/Itseez/opencv into back_proj_fix 2014-03-25 14:52:39 +04:00
mlyashko f38fe76025 added perf test for CalcBackProj 2014-03-25 14:50:37 +04:00
Roman Donchenko da7a605224 Merge pull request #2123 from white-pony:vkysenko/fix-mertens 2014-03-25 14:37:56 +04:00
Andrey Pavlenko c1acbb02bc disabling calls to SURF_OCL causing tests failures 2014-03-25 14:09:49 +04:00
Andrey Pavlenko 63a746c6ea fixing conditional compilation 2014-03-25 13:16:42 +04:00
Andrey Pavlenko 7e03a8b279 fixing check_docs2.py issue 2014-03-25 13:15:56 +04:00
Andrey Pavlenko c6199fc3c1 Merge pull request #2526 from KonstantinMatskevich:ocl_morph_fix 2014-03-25 12:59:10 +04:00
Roman Donchenko 5effebb5f5 Merge pull request #2498 from dreamworld:fix_tutorial_mat_the_basic_image_container 2014-03-25 12:14:44 +04:00
Roman Donchenko 85cf2d9671 Merge pull request #2524 from SpecLad:merge-2.4 2014-03-25 12:13:04 +04:00
Konstantin Matskevich 67926fa028 ocl morphology fix 2014-03-25 10:39:50 +04:00
Aaron Kunze ede6d4482b Optimizations to OpenCL bilateral filter. 2014-03-24 13:35:56 -07:00
Andrey Pavlenko 9e1124d24a Merge pull request #2525 from ilya-lavrenov:tapi_sep 2014-03-24 22:43:34 +04:00
Andrey Pavlenko ba2eee9cbd Merge pull request #2522 from ilya-lavrenov:tapi_canny 2014-03-24 19:31:26 +04:00
Roman Donchenko cc05493730 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	cmake/OpenCVDetectAndroidSDK.cmake
	cmake/OpenCVGenAndroidMK.cmake
	cmake/OpenCVModule.cmake
	cmake/templates/OpenCV.mk.in
	cmake/templates/OpenCVConfig.cmake.in
	doc/tutorials/imgproc/histograms/histogram_comparison/histogram_comparison.rst
	modules/cudabgsegm/src/cuda/mog.cu
	modules/imgproc/perf/opencl/perf_filters.cpp
	modules/imgproc/src/opencl/filterSep_singlePass.cl
	modules/nonfree/CMakeLists.txt
	modules/nonfree/perf/perf_precomp.hpp
	modules/ocl/perf/perf_haar.cpp
	modules/ocl/src/filtering.cpp
	modules/ocl/src/opencl/bgfg_mog.cl
	modules/superres/CMakeLists.txt
	modules/superres/src/btv_l1_cuda.cpp
	modules/superres/src/cuda/btv_l1_gpu.cu
	modules/superres/src/frame_source.cpp
	modules/superres/src/input_array_utility.cpp
	modules/superres/src/optical_flow.cpp
	modules/superres/src/precomp.hpp
	samples/gpu/CMakeLists.txt
	samples/gpu/brox_optical_flow.cpp
	samples/gpu/super_resolution.cpp
2014-03-24 19:02:16 +04:00
Roman Donchenko 8af175b81b Merge pull request #2521 from atrebbi:#3620 2014-03-24 18:54:00 +04:00
Roman Donchenko 4d3f9228aa Merge pull request #2516 from Daniil-Osokin:fix_docs 2014-03-24 18:52:49 +04:00
Andrey Pavlenko 9c5745383f Merge pull request #2512 from KonstantinMatskevich:ocl_gpu_type_parser 2014-03-24 18:46:01 +04:00
Daniil Osokin ac19420907 Removed obsolete list from docs 2014-03-24 14:50:20 +01:00
Ilya Lavrenov 061a25447e eliminated restriction delta == 0 from cv::sepFilter2D 2014-03-24 17:39:07 +04:00
Konstantin Matskevich c2355d3a12 case-insensitivity 2014-03-24 15:20:00 +04:00
Ilya Lavrenov e2c6ab0166 refactored filter2D; eliminated restrictions sdepth == ddepth, delta == 0 2014-03-24 14:42:51 +04:00
Ilya Lavrenov b6833fdde7 added 3-channels support to cv::medianBlur 2014-03-24 14:32:31 +04:00
Ilya Lavrenov a51ab99a79 added 3-channels support to cv::filter2D, cv::Laplacian 2014-03-24 14:32:31 +04:00
Ilya Lavrenov e19c42dded added 3-channels support to cv::boxFilter, cv::blur, cv::sqrBoxFilter 2014-03-24 14:31:42 +04:00
Ilya Lavrenov 8f5fd44fb2 added 3 channels support to cv::bilateralFilter
Conflicts:
	modules/imgproc/test/ocl/test_filters.cpp
2014-03-24 14:31:41 +04:00
Roman Donchenko f8a100f3e0 Merge pull request #2520 from vlkolesnikov:misprint_fix 2014-03-24 14:05:18 +04:00
Ilya Lavrenov 6ba60a1e22 added 3-channels support to cv::Canny 2014-03-24 13:02:54 +04:00
Daniil Osokin 04b1822cff Fixed "Mat mask operations" tutorial. Thanks @RJ2 for pointing this. 2014-03-24 12:53:30 +04:00
Roman Donchenko bcb0ee3e4b Merge pull request #2514 from asmorkalov:android_two_libs_cuda 2014-03-24 12:26:57 +04:00
Roman Donchenko 9aa6528fd7 Merge pull request #2504 from asmorkalov:android_camera_locks_24 2014-03-24 12:06:51 +04:00
Roman Donchenko 7efb09fb8f Merge pull request #2513 from asmorkalov:ocv_cuda_link_revert 2014-03-24 12:03:27 +04:00
Roman Donchenko 623b1db8d1 Merge pull request #2515 from apavlenko:perf_default_strategy 2014-03-24 12:02:30 +04:00
Vladimir Kolesnikov 60803afe8f Misprint fixed in table formatter 2014-03-24 11:04:49 +04:00
Andrey Pavlenko d8c018289a Merge pull request #2491 from ilya-lavrenov:tapi_sep_filter 2014-03-24 10:37:15 +04:00
Andrey Pavlenko 157f35ef29 Merge pull request #2503 from mlyashko:optflow_dualtvl1 2014-03-24 10:35:51 +04:00
Andrey Pavlenko ae89787984 Merge pull request #2511 from apavlenko:2.4_fix_perf_nonfree 2014-03-24 10:25:47 +04:00
Andrey Pavlenko cf3a2e30cd Merge pull request #2517 from ilya-lavrenov:fix 2014-03-24 10:25:04 +04:00
Andrey Pavlenko 259b9e093c disabling failing tests 2014-03-24 10:12:02 +04:00
Andrey Pavlenko 5421d741bc making OCL tests conform to the comon style 2014-03-24 10:08:44 +04:00
Alessandro Trebbi c4a63f6a86 - 2014-03-23 22:00:16 +01:00
Ilya Lavrenov 20b6191842 doc fix 2014-03-23 16:20:00 +04:00
Alexander Smorkalov 64d679ecb4 Added guard to prevent from gpu module redefinition in OpenCV.mk 2014-03-22 05:41:29 +04:00
Kang Liu 9dc51a1aa4 Keep definitions of link aliases consistent 2014-03-21 22:28:48 +01:00
Daniil Osokin 2d3aa3861c Fixed Load, Modify, and Save an Image tutorial 2014-03-21 16:58:50 +01:00
Koji Miyazato 0a5d6e10b9 Added test code for I/O of user-defined types. 2014-03-22 00:32:44 +09:00
Andrey Pavlenko 244f126ff6 Merge pull request #2454 from apavlenko:2.4_haar_extend 2014-03-21 18:45:58 +04:00
Andrey Pavlenko f368b27f0a Merge pull request #2489 from vbystricky:iocl_pyrlk 2014-03-21 18:33:32 +04:00
Andrey Pavlenko a3668f1369 changing default perf strategy from BASIC (old) to SIMPLE (new, faster) 2014-03-21 18:29:06 +04:00
Andrey Pavlenko 8ac93f9b6b Merge pull request #2508 from akarsakov:fix_erode_intel 2014-03-21 18:25:12 +04:00
Andrey Pavlenko ef9669ba1a Merge pull request #2506 from apavlenko:lbp_ocl_use_any_device 2014-03-21 18:24:36 +04:00
Alexander Smorkalov 3b65b710b6 Implicit linkage with CUDA runtime reverted. 2014-03-21 17:58:59 +04:00
Alexander Smorkalov 0dba5bdc4a Multiple fixes in camera.
Fixed constant value for focus mode FOCUS_MODE_CONTINUES_PHOTO;
Add setters and getters for exposure lock and white balance lock flags;
Excluded camera restart for all setters except frame size.
2014-03-21 17:26:05 +04:00
Konstantin Matskevich 79fc3a6203 added gpu type selection in OPENCV_OPENCL_DEVICE parser 2014-03-21 17:01:37 +04:00
Roman Donchenko 46d39aff68 Merge pull request #2501 from asmorkalov:android_native_camera_qualcomm 2014-03-21 16:28:48 +04:00
Andrey Pavlenko 7193762d2d Merge pull request #2495 from ilya-lavrenov:tapi_flip 2014-03-21 16:08:46 +04:00
Andrey Pavlenko d18ebfa8e8 Merge pull request #2500 from akarsakov:hog_intel_fix 2014-03-21 16:02:49 +04:00
Ilya Lavrenov 2875ce60ea added 3-channels support to optimized version 2014-03-21 16:02:47 +04:00
Roman Donchenko 6bf4a7ce01 Merge pull request #2510 from asmorkalov:android_cuda_filter_fix 2014-03-21 16:00:29 +04:00
Kang Liu dc21e2cc0e remove highlighting in some function links
1. Remove whole-document highlighting in some function links
2. fix the function alias `readwriteimagevideo`
2014-03-21 11:54:35 +01:00
Andrey Pavlenko fe5eaae102 adding missing include (fixing 'no ocl implementation' error) 2014-03-21 14:30:49 +04:00
Alexander Smorkalov 846266fde4 Native camera fix for some deivices with Qualcomm SoC like Samsung Galaxy S4. 2014-03-21 14:16:03 +04:00
Roman Donchenko 3572ee278e Merge pull request #2396 from m3d:patch-1 2014-03-21 14:00:12 +04:00
Roman Donchenko 49efc250d3 Merge pull request #2400 from RJ2:Bugfix_2 2014-03-21 13:58:06 +04:00
Roman Donchenko 722c0fea41 Merge pull request #2414 from yashdv:meanshift_tutorial_error 2014-03-21 13:55:35 +04:00
Roman Donchenko a66018d14d Merge pull request #2423 from RJ2:bugfix_5 2014-03-21 13:54:52 +04:00
Alexander Smorkalov b0ad84cfa2 Libraries filter update after abs path cut. 2014-03-21 12:48:38 +04:00
Andrey Pavlenko 4e851f5050 Merge pull request #2507 from apavlenko:haar_perf_test_cleanup 2014-03-21 12:20:32 +04:00
Firat Kalaycilar c9f51d5eed modified BackgroundSubtractorMOG2::getBackgroundImage so that it can now work with gray-level images. 2014-03-21 09:44:11 +02:00
Alexander Karsakov 0bd4fd3a87 Workaround for Intel platform: replace min() with ternary operator 2014-03-21 09:33:00 +04:00
Andrey Pavlenko b7198ccf1c dropping legacy modes testing 2014-03-20 22:30:16 +04:00
Andrey Pavlenko 640e180efe switching to CV_HAAR_SCALE_IMAGE mode, enabling test 2014-03-20 22:22:55 +04:00
Andrey Pavlenko d060d30fa0 enabling OCL LBP branch for all devices 2014-03-20 21:57:34 +04:00
Andrey Pavlenko bdfd29a0b8 Merge pull request #2496 from ilya-lavrenov:tapi_imgproc 2014-03-20 19:20:15 +04:00
Roman Donchenko 034ef02409 Merge pull request #2449 from asmorkalov:cuda_abs_path_fix 2014-03-20 17:49:41 +04:00
mlyashko 80a40ae3d7 changed epsilon for test pass on Win32 2014-03-20 16:15:43 +04:00
Andrey Pavlenko 9c7ba6db90 Merge pull request #2490 from ilya-lavrenov:ocl_sep_filters 2014-03-20 13:54:27 +04:00
Andrey Pavlenko 2299e2ed1b Merge pull request #2494 from ilya-lavrenov:tapi_merge 2014-03-20 13:39:39 +04:00
Andrey Pavlenko 87ae0f9990 Merge pull request #2492 from KonstantinMatskevich:ocl_fix_wrongdevice 2014-03-20 13:39:17 +04:00
Ilya Lavrenov 63d8a61b9b enabled 3-channels support for cv::createSuperResolution_BTVL1 2014-03-20 13:31:20 +04:00
Alexander Karsakov b14c314fc3 Fixed incorrect thread synchronizations 2014-03-20 13:03:03 +04:00
Roman Donchenko 68c57a1e82 Merge pull request #2473 from euphrat:mog2_weight_bugfix 2014-03-20 12:40:23 +04:00
Ilya Lavrenov eb8b4c58c7 fixed bug in cv::ocl::predictOptimalVectorWidth 2014-03-20 00:28:21 +04:00
krodyush 65d64af2a8 ocl_calcOpticalFlowPyrLK optimizations
1. decrease branch number in CL code by replacing them into weights
2. decrease local mem pressure in reduce operation by using private variables
3. decrease image sampler pressure by caching data into local memory
4. remove unnecessary sync point on the HOST side.
2014-03-19 19:31:14 +04:00
Ilya Lavrenov 291458a859 generalized OpenCL version of cv::sepFilter2D; removed some restrictions and added 3-channels support 2014-03-19 18:56:16 +04:00
Alexander Smorkalov 284b2fc1e7 Cut path to CUDA libraries to prevent generation of OpenCVModules.cmake with abs path. 2014-03-19 18:47:32 +04:00
Alexander Karsakov 30a8308f8e Enabled Intel-specific optimizations for HOG detector. 2014-03-19 17:30:13 +04:00
Kang Liu 17713f6831 1. fix an error in sample code
2. change an external link to maintain consistency with the previous tutorial
2014-03-19 13:05:38 +01:00
Ilya Lavrenov b449b0bf71 simplified cv::sepFilter2D OpenCL part 2014-03-19 15:59:00 +04:00
Roman Donchenko a1e5bd71f1 Merge pull request #2446 from asmorkalov:ocv_implicit_cuda_control 2014-03-19 14:49:22 +04:00
Ilya Lavrenov b73490f86c eliminated restriction src[i].channels() == 1 in cv::merge 2014-03-19 13:56:31 +04:00
Andrey Pavlenko a2dec6c34e Merge pull request #2493 from ilya-lavrenov:tapi_fnlm 2014-03-19 12:56:11 +04:00
Konstantin Matskevich f9f730c426 update error message 2014-03-19 12:14:48 +04:00
Ilya Lavrenov 04884ebf45 added 3-channels support to cv::setIdentity 2014-03-19 01:53:53 +04:00
Ilya Lavrenov d1cfcfcafd added 3-channels support to morphology operations 2014-03-18 20:15:11 +04:00
Ilya Lavrenov 8d97d0d631 added 3-channels support to cv::flip 2014-03-18 19:31:37 +04:00
Firat Kalaycilar 0a16d93e1d Fixed an issue with weight assignment causing the resulting GMM weights to be unsorted in the CUDA and OCL versions of BackgroundSubtractorMOG2 2014-03-18 17:26:24 +02:00
Koji Miyazato a43ef9a6cd WriteStructContext treats state of fs 2014-03-18 23:29:30 +09:00
Alexander Smorkalov b4e4f13f9e Superres module enabled for Android. GPU samples build fixed for Android. 2014-03-18 17:07:19 +04:00
Roman Donchenko b70332d806 Merge pull request #1986 from GregoryMorse:patch-3 2014-03-18 16:18:33 +04:00
Firat Kalaycilar 4d9698a4cf Merge branch '2.4' of git://github.com/Itseez/opencv into mog2_weight_bugfix 2014-03-18 14:00:30 +02:00
Andrey Pavlenko 6e44f05e6f Merge pull request #2464 from KonstantinMatskevich:ocl_stereobm_experiment 2014-03-18 15:53:09 +04:00
Konstantin Matskevich eebf92ba58 fix for incorrect opencl device selection 2014-03-18 15:47:35 +04:00
Roman Donchenko bff92da970 Merge pull request #2488 from Nerei:minor_doc 2014-03-18 15:41:20 +04:00
Roman Donchenko d76226e21b Merge pull request #2456 from kurodash:pr_use_cvAlloc 2014-03-18 14:39:40 +04:00
Ilya Lavrenov 6fe71bd27c added 4 channels support to fnlm 2014-03-18 14:29:02 +04:00
Roman Donchenko ae2b0b0098 Merge pull request #2486 from SpecLad:merge-2.4 2014-03-18 13:55:57 +04:00
Roman Donchenko bfb1ba371c Merge pull request #2026 from pemmanuelviel:giveFurthestPoint 2014-03-18 13:40:44 +04:00
RJ2 0470bb0e29 I have changed one sentence in tutorial, making it more understandable 2014-03-18 08:59:53 +01:00
RJ2 16869225ff It's will be better 2014-03-18 08:01:18 +01:00
yash b9cdde6991 edited sample code for mean/cam sihft and fixed an error 2014-03-18 08:44:33 +05:30
Ilya Lavrenov 82e6edfba2 optimized sep filter 2014-03-18 00:16:38 +04:00
Ilya Lavrenov 3940b6163b remove intel guard since the code is 2 times faster on AMD too 2014-03-17 19:11:21 +04:00
yash 51cb6998ea made the example consistent with the fuction definition and improved doc
made the example consistent with the fuction definition and improved doc
2014-03-17 18:44:02 +05:30
Anatoly Baksheev 0c02e5de25 minor doc fix 2014-03-17 17:02:49 +04:00
vbystricky 6890aa0033 Fix problems on Intel HD graphics 2014-03-17 16:03:15 +04:00
Roman Donchenko a489d86e5f Merge pull request #2460 from berak:b_3598_24 2014-03-17 15:52:56 +04:00
Roman Donchenko ae036838dd Merge pull request #2458 from asmorkalov:android_cmake_opencv_modules_suffix 2014-03-17 14:43:15 +04:00
Alexander Smorkalov 6b8de222d7 OpenCV_MODULES_SUFFIX variable added to OpenCVConfig.cmake to enable custom module configurations. 2014-03-17 14:32:32 +04:00
Roman Donchenko 40a740ff88 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/imgproc/src/opencl/precornerdetect.cl
	modules/nonfree/perf/perf_main.cpp
	modules/nonfree/perf/perf_surf.ocl.cpp
	modules/ocl/src/arithm.cpp
	modules/ocl/src/gftt.cpp
	modules/ocl/src/opencl/arithm_bitwise.cl
	modules/ocl/src/opencl/arithm_bitwise_binary_scalar_mask.cl
	modules/ocl/src/opencl/arithm_minMax.cl
	modules/ocl/src/opencl/arithm_nonzero.cl
	modules/ocl/src/opencl/arithm_sum.cl
	modules/ocl/test/test_arithm.cpp
	modules/viz/src/precomp.hpp
	modules/viz/src/vizcore.cpp
	modules/viz/src/vtk/vtkCloudMatSink.h
	modules/viz/src/vtk/vtkXYZReader.cpp
	modules/viz/src/vtk/vtkXYZReader.h
	modules/viz/test/test_precomp.hpp
2014-03-17 14:14:07 +04:00
Andrey Pavlenko dc28451b8a Merge pull request #2479 from alalek:ocl_compare_scalar 2014-03-17 14:04:22 +04:00
berak 5f94a205d1 fixed h / s ranges in histogram_calculation tutorial
literalinclude

literalinclude, dropped :lines:
2014-03-17 11:01:02 +01:00
Andrey Pavlenko 2a1d5c6d43 Merge pull request #2428 from alalek:ocl_copyMakeBorder_3channels 2014-03-17 13:10:34 +04:00
Alexander Alekhin af062b7c42 ocl: compare: remove useless perf tests 2014-03-17 12:33:12 +04:00
Roman Donchenko 882971151d Merge pull request #2485 from Nerei:viz_correct_viewer_pose 2014-03-17 11:59:14 +04:00
Roman Donchenko 136e5eb804 Merge pull request #2484 from berak:mat_doc_24 2014-03-17 11:57:10 +04:00
Konstantin Matskevich 1a43ed9893 finalizing 2014-03-17 10:42:19 +04:00
Anatoly Baksheev 24d8cbf940 Viz::setViewerPose() - changed up-vector to down (common for Computer Vision & Odometry) 2014-03-16 20:07:05 +04:00
berak 80708008a4 missing () on Mat::type() 2014-03-16 14:04:05 +01:00
Alexander Alekhin 7ce2ca2e0c ocl: workaround for Pow accuracy test failure 2014-03-14 19:51:19 +04:00
Alexander Alekhin 9cafd50160 ocl: fixes 2014-03-14 19:51:19 +04:00
Alexander Alekhin 755ca4b7cf ocl: compare with scalar 2014-03-14 19:51:19 +04:00
Andrey Pavlenko dd6cf15a39 Merge pull request #2481 from akarsakov:fix_hog_intel 2014-03-14 19:17:03 +04:00
Andrey Pavlenko bcb938efbb Merge pull request #2483 from ilya-lavrenov:tapi_3_vs_4 2014-03-14 19:14:35 +04:00
Andrey Pavlenko c72a0a1295 Merge pull request #2482 from ilya-lavrenov:tapi_fix 2014-03-14 19:08:07 +04:00
Andrey Pavlenko 5726e80f77 Merge pull request #2475 from ilya-lavrenov:ocl_2.4_fix 2014-03-14 19:05:55 +04:00
Andrey Pavlenko 6b434befc9 Merge pull request #2480 from vpisarev:ocl_orb 2014-03-14 19:04:19 +04:00
Konstantin Matskevich af1084eb58 speedUp 2014-03-14 18:00:13 +04:00
Konstantin Matskevich 91e4334227 temp 2014-03-14 18:00:12 +04:00
Konstantin Matskevich 18a59b48ba fixes 2014-03-14 18:00:12 +04:00
Konstantin Matskevich ddc235172e new approach 2014-03-14 18:00:11 +04:00
Konstantin Matskevich a5d989f346 new attempt 2014-03-14 18:00:11 +04:00
Konstantin Matskevich 799d7e7a50 bad experiment =( 2014-03-14 18:00:10 +04:00
Konstantin Matskevich 0904f10ab5 optimizations 2014-03-14 18:00:10 +04:00
Konstantin Matskevich bfc843a5f5 added optimization 2014-03-14 18:00:09 +04:00
Konstantin Matskevich b5f717b6b3 stereoBM 2014-03-14 18:00:09 +04:00
Ilya Lavrenov 6f12f1b3b5 added 3 vs 4 channels performance tests 2014-03-14 17:30:14 +04:00
Ilya Lavrenov 6be7869ae8 fix for unsupported doubles 2014-03-14 16:54:52 +04:00
Roman Donchenko 4a4151ec97 Merge pull request #2474 from akarsakov:fix_getpolicy 2014-03-14 15:17:45 +04:00
Alexander Karsakov 4698d62125 Removed workaround for Intel platform. 2014-03-14 14:18:52 +04:00
Alexander Karsakov 8910508b83 Fixed getPolicy() method to make it thread-safe. 2014-03-14 13:50:33 +04:00
kuroda sho f9484bae8a fix: use "cvAlloc" wrapper function for malloc. 2014-03-14 17:09:08 +09:00
Ilya Lavrenov b47bec2ed0 performance tests for ORB 2014-03-13 23:30:02 +04:00
Vadim Pisarevsky 4fafab3786 fixed extra whitespace 2014-03-13 23:18:41 +04:00
Vadim Pisarevsky 42e604abea fixed bug in FAST 2014-03-13 23:17:28 +04:00
Vadim Pisarevsky 3e854fa6e5 finished OpenCL port of ORB 2014-03-13 22:56:53 +04:00
Ilya Lavrenov 61c347fb76 typos 2014-03-13 22:56:46 +04:00
Ilya Lavrenov 357a856cf6 nonfree perf tests 2014-03-13 22:35:08 +04:00
Ilya Lavrenov 6f76e7b42d improved performance of bitwise ops 2014-03-13 19:42:13 +04:00
Andrey Pavlenko 0ce8f1d5dd Merge pull request #2477 from alalek:ocl_cleanup_workarounds 2014-03-13 18:55:28 +04:00
Andrey Pavlenko c5bf1c108c Merge pull request #2470 from ilya-lavrenov:tapi_reduction 2014-03-13 18:42:01 +04:00
Andrey Pavlenko 4233539617 Merge pull request #2469 from alalek:ocl_pyrUp_pyrDown_3channels 2014-03-13 18:37:05 +04:00
Ilya Lavrenov adc15c2bba improved performance of cv::ocl::sum 2014-03-13 17:33:18 +04:00
Andrey Pavlenko a6c40abfb2 Merge pull request #2466 from ilya-lavrenov:tapi_transpose_3cn 2014-03-13 16:56:01 +04:00
Andrey Pavlenko 0764a23eb2 Merge pull request #2459 from ilya-lavrenov:tapi_experiments 2014-03-13 16:49:57 +04:00
Andrey Pavlenko 6b6cfa893d Merge pull request #2382 from ilya-lavrenov:tapi_nlmeans 2014-03-13 16:48:38 +04:00
Alexander Alekhin 48196ad10b ocl: cleanup workarounds 2014-03-13 15:46:38 +04:00
Ilya Lavrenov 3ebfe60008 improved performance of cv::ocl::countNonZero 2014-03-13 15:35:53 +04:00
Ilya Lavrenov 8e79de35a8 changes for GFTT 2014-03-13 14:57:13 +04:00
Koji Miyazato b96762a48f Fix for bug #3599: cv::FileStorage does not work for std::vector of user-defined struct. 2014-03-13 19:41:13 +09:00
Ilya Lavrenov a5afcd9f11 improved performance of cv::ocl::minMax 2014-03-13 14:35:12 +04:00
Roman Donchenko 553673eeed Merge pull request #2468 from mlyashko:back_proj_fix 2014-03-13 13:42:20 +04:00
Roman Donchenko fd8f2c8d23 Merge pull request #2463 from ziyangli:master 2014-03-12 18:51:41 +04:00
Firat Kalaycilar a87607e3ef Fixed an issue with weight assignment causing the resulting GMM weights to be unsorted in BackgroundSubtractorMOG2 2014-03-12 16:14:59 +02:00
Roman Donchenko 290b93422c Merge pull request #2465 from SpecLad:merge-2.4 2014-03-12 17:08:43 +04:00
Roman Donchenko 836635d2d5 Merge pull request #2434 from Nerei:viz_continue 2014-03-12 16:53:42 +04:00
Anatoly Baksheev 4d7a593c25 minor cmake fix fo macos 2014-03-12 16:22:22 +04:00
Ilya Lavrenov 9932cf41a4 3-channel reduction operations 2014-03-12 15:07:39 +04:00
Alexander Alekhin dca401d4cc ocl: pyrUp/pyrDown 3-channel 2014-03-12 14:39:55 +04:00
ziyangli bbe8654c3d cleanup 2014-03-12 18:16:54 +08:00
Ziyang LI 4f5896493e remove a whitepace 2014-03-12 18:14:43 +08:00
Ilya Lavrenov f138b613b7 cv::compare 2014-03-12 13:16:33 +04:00
mlyashko 5252aa8fdd added data type check for back projection fix 2014-03-12 11:30:28 +04:00
Ilya Lavrenov 89b7c0dd93 3 channel support to cv::transpose 2014-03-12 00:17:11 +04:00
Ilya Lavrenov 2755ae5df9 experiments 2014-03-11 23:03:55 +04:00
Roman Donchenko 1bb0c5747c Merge pull request #2462 from ibtaylor:fix_deblurring_calcBlurriness_var_name_typo 2014-03-11 17:41:18 +04:00
Roman Donchenko 95a55453df Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/calib3d/perf/perf_pnp.cpp
	modules/contrib/src/imagelogpolprojection.cpp
	modules/contrib/src/templatebuffer.hpp
	modules/core/perf/opencl/perf_gemm.cpp
	modules/cudafeatures2d/doc/feature_detection_and_description.rst
	modules/cudafeatures2d/perf/perf_features2d.cpp
	modules/cudafeatures2d/src/fast.cpp
	modules/cudafeatures2d/test/test_features2d.cpp
	modules/features2d/doc/feature_detection_and_description.rst
	modules/features2d/include/opencv2/features2d/features2d.hpp
	modules/features2d/perf/opencl/perf_brute_force_matcher.cpp
	modules/gpu/include/opencv2/gpu/gpu.hpp
	modules/gpu/perf/perf_imgproc.cpp
	modules/gpu/perf4au/main.cpp
	modules/imgproc/perf/opencl/perf_blend.cpp
	modules/imgproc/perf/opencl/perf_color.cpp
	modules/imgproc/perf/opencl/perf_moments.cpp
	modules/imgproc/perf/opencl/perf_pyramid.cpp
	modules/objdetect/perf/opencl/perf_hogdetect.cpp
	modules/ocl/perf/perf_arithm.cpp
	modules/ocl/perf/perf_bgfg.cpp
	modules/ocl/perf/perf_blend.cpp
	modules/ocl/perf/perf_brute_force_matcher.cpp
	modules/ocl/perf/perf_canny.cpp
	modules/ocl/perf/perf_filters.cpp
	modules/ocl/perf/perf_gftt.cpp
	modules/ocl/perf/perf_haar.cpp
	modules/ocl/perf/perf_imgproc.cpp
	modules/ocl/perf/perf_imgwarp.cpp
	modules/ocl/perf/perf_match_template.cpp
	modules/ocl/perf/perf_matrix_operation.cpp
	modules/ocl/perf/perf_ml.cpp
	modules/ocl/perf/perf_moments.cpp
	modules/ocl/perf/perf_opticalflow.cpp
	modules/ocl/perf/perf_precomp.hpp
	modules/ocl/src/cl_context.cpp
	modules/ocl/src/opencl/haarobjectdetect.cl
	modules/video/src/lkpyramid.cpp
	modules/video/src/precomp.hpp
	samples/gpu/morphology.cpp
2014-03-11 17:20:01 +04:00
Andrey Pavlenko 702a2a6ff6 Merge pull request #2373 from mlyashko:optflow_dualtvl1 2014-03-11 16:00:22 +04:00
Andrey Pavlenko 5261fbe217 Merge pull request #2387 from alalek:ocl_remap_3cn 2014-03-11 15:59:12 +04:00
Andrey Pavlenko 90c5dde887 Merge pull request #2455 from ilya-lavrenov:tapi_fix 2014-03-11 15:58:32 +04:00
Ilya Lavrenov 9b31e6cd44 changes according to reviewer's suggestions 2014-03-11 15:40:31 +04:00
Andrey Pavlenko 0084dee05b Merge pull request #2448 from akarsakov:ocl_cxt_termination 2014-03-11 12:57:29 +04:00
Andrey Pavlenko fd0ab8eba1 Merge pull request #2461 from ilya-lavrenov:tapi_calc_hist 2014-03-11 12:44:33 +04:00
Andrey Pavlenko 1f8df38dba Merge pull request #2457 from ilya-lavrenov:ocl_calc_hist 2014-03-11 12:37:11 +04:00
Ilya Lavrenov 3eff05e3eb added performance tests for cv::ocl::calcHist 2014-03-11 12:34:27 +04:00
Alexander Alekhin e7475bff68 TAPI: remap 3-channel 2014-03-10 20:35:10 +04:00
Alexander Alekhin e4608229f0 ocl: copyMakeBorder 3-channel 2014-03-10 17:22:49 +04:00
Ziyang LI 786e3b9eee Moved x = 0 into the parenthesis
Easier to understand
2014-03-10 17:33:13 +08:00
Ian Taylor 45969bb3ae fix variable name typo in calcBlurriness 2014-03-10 03:02:06 -04:00
Ilya Lavrenov 208831eb5d optimized cv::calcHist 2014-03-08 12:24:31 +04:00
Vadim Pisarevsky efdfca7a11 do not use the large "score" buffer; now without non-max suppression OpenCL FAST is pretty efficient 2014-03-07 18:55:45 +04:00
Roman Donchenko 70e22b682d Merge pull request #2397 from vbystricky:intelperc 2014-03-07 18:19:00 +04:00
Vadim Pisarevsky 06c138bd64 make the correctness test pass 2014-03-07 18:18:10 +04:00
vbystricky 193e97a34a Move declaration of IVideoCapture class into precomp.hpp, make some methods of IVideoCapture pure virtual 2014-03-07 16:25:15 +04:00
kurodash 0eaeff0641 fix: use "cvAlloc" wrapper function for malloc. 2014-03-07 19:02:37 +09:00
Andrey Pavlenko 2879ff2098 Merge pull request #2437 from ilya-lavrenov:tapi_morph 2014-03-07 14:00:09 +04:00
Andrey Pavlenko 5dbe73f94d Merge pull request #2438 from ilya-lavrenov:tapi_flip 2014-03-07 13:54:34 +04:00
Andrey Pavlenko 182d74d33f Merge pull request #2441 from akarsakov:ocl_platform_vendor 2014-03-07 13:54:13 +04:00
Andrey Pavlenko 451be9ed53 Merge pull request #2444 from ilya-lavrenov:tapi_gftt 2014-03-07 13:53:43 +04:00
Andrey Pavlenko 3cb49eac49 Merge pull request #2451 from ilya-lavrenov:tapi_fast_covar_data 2014-03-07 13:52:47 +04:00
Andrey Pavlenko 8f3492851e Merge pull request #2453 from ilya-lavrenov:tapi_sobel 2014-03-07 13:51:37 +04:00
Alexander Karsakov 8660588fe9 Pass vendor macro to opencl kernel 2014-03-07 12:57:29 +04:00
mlyashko eb2e8a11fa changed kernel.set to support unsuccssful set 2014-03-07 11:15:54 +04:00
sprice 75ed2f52f1 Merge branch 'master' of https://github.com/Itseez/opencv
Conflicts:
	modules/features2d/include/opencv2/features2d.hpp
	modules/features2d/src/freak.cpp
	modules/features2d/src/stardetector.cpp
2014-03-06 15:39:06 -08:00
Ilya Lavrenov 0e2cc5ef63 fix bitwise ops and mask support 2014-03-06 23:39:05 +04:00
Andrey Pavlenko d1d451c952 Merge pull request #2431 from ilya-lavrenov:tapi_perf 2014-03-06 22:17:44 +04:00
Andrey Pavlenko 229aa62300 Merge pull request #2445 from ilya-lavrenov:ocl_perf 2014-03-06 22:03:01 +04:00
Andrey Pavlenko 2f0fe5b87b Merge pull request #2450 from ilya-lavrenov:tapi_test 2014-03-06 21:55:50 +04:00
Andrey Pavlenko f21a94880e Merge pull request #2452 from ilya-lavrenov:tapi_disable_surf 2014-03-06 21:51:25 +04:00
Vadim Pisarevsky 8e1918e86e added OpenCL-accelerated(?) FAST; for now the tests fail :( 2014-03-06 18:04:04 +04:00
Ilya Lavrenov dc76e6b4a1 added new dtypes to cv::Sobel 2014-03-06 17:57:13 +04:00
Roman Donchenko f351540eda Merge pull request #2443 from waveform80:issue-3554 2014-03-06 17:53:31 +04:00
Ilya Lavrenov 4a7289b22f improved cv::preCornerDetect 2014-03-06 17:40:02 +04:00
Ilya Lavrenov d9c5fbc9ba disable SURF 2014-03-06 16:49:22 +04:00
Alexander Karsakov 806e9241a6 Clarifying comments 2014-03-06 16:44:46 +04:00
Ilya Lavrenov 1291bd1c4a ported fast calculation of covar data 2014-03-06 15:40:27 +04:00
Ilya Lavrenov f404315368 test for clEnqueueReadBufferRect 2014-03-06 12:11:46 +04:00
mlyashko 66ed6a8a50 macro for normal return from thriveless kernel.set 2014-03-06 11:43:01 +04:00
Alexander Smorkalov b3e18d23a3 Implicit CUDA and OpenCL control for module definition added.
Feature allows to exclude CUDA or OpenCL optimizations at all even CUDA is used
on build. Exclusion of CUDA or OpenCL cut unwanted dependencies.
2014-03-06 10:31:33 +04:00
Ilya Lavrenov f7a474180b tuned some tests 2014-03-06 09:24:02 +04:00
Ilya Lavrenov 86a3ed4162 improved performance of GFTT 2014-03-06 09:19:40 +04:00
Anatoly Baksheev fde0185a77 iteractor work 2014-03-06 03:26:21 +04:00
Vadim Pisarevsky 22f42a639f fixed doc builder warnings; make sure the tests give reasonable results when OpenCL is not available 2014-03-05 18:48:19 +04:00
Alexander Karsakov 4aa891e773 Remove clReleaseDevice call (workaround for pure virtual call on Windows) 2014-03-05 17:57:06 +04:00
Roman Donchenko 42f9ee3f3e Merge pull request #2440 from codyrigney92:Master_LKOptFlow_NEON 2014-03-05 17:28:09 +04:00
Vadim Pisarevsky 60ce2b2e9f modified SURF's performance test to test OpenCL version as well 2014-03-05 17:10:51 +04:00
Vadim Pisarevsky da70b04262 made SURF_OCL default constructor parameters the same as SURF 2014-03-05 17:04:49 +04:00
Vadim Pisarevsky 3c1917771b modified OpenCL SURF API and the tests in 2.4.x to prove that it gives different from CPU results 2014-03-05 16:31:41 +04:00
Alexander Karsakov c1dad2178c Added Device:: isAMD,isIntel,isNvidia methods. 2014-03-05 14:43:11 +04:00
vbystricky d4a1df85be Change text of copyright 2014-03-05 13:06:36 +04:00
vbystricky f9e942f9ef Change text of license and copyright 2014-03-05 11:03:57 +04:00
Dave Hughes b184d7f27b Fix for #3554
v4l2_scan_controls_enumerate_menu is unused and causes ioctl error on
RaspberryPi and possibly other Video4Linux variants. See
http://www.raspberrypi.org/forum/viewtopic.php?f=43&t=65026 for more
detail.
2014-03-05 02:44:40 +00:00
Cody Rigney a80ebfe28d Master Version: Added NEON Optimizations for LK Optical Flow. 2014-03-04 14:47:12 -05:00
Andrey Pavlenko 0a3aca230c Merge pull request #2436 from ilya-lavrenov:tapi_dft_fix 2014-03-04 19:21:15 +04:00
Andrey Pavlenko ba4513503e Merge pull request #2429 from ilya-lavrenov:master_compatible_tests 2014-03-04 19:18:13 +04:00
Andrey Pavlenko c9d8025fab Merge pull request #2391 from ilya-lavrenov:tapi_match_template 2014-03-04 18:50:14 +04:00
Andrey Pavlenko c00f0faf24 Merge pull request #2408 from ilya-lavrenov:tapi_core_opt 2014-03-04 18:37:26 +04:00
Roman Donchenko 5527f2872d Merge pull request #2409 from juanmanpr:master 2014-03-04 15:32:13 +04:00
Roman Donchenko b5248dbf3f Merge pull request #2407 from codyrigney92:LKOptFlow_NEON 2014-03-04 15:30:26 +04:00
Roman Donchenko fa3f29f2b5 Merge pull request #2439 from ilya-lavrenov:typo 2014-03-04 13:51:31 +04:00
Ilya Lavrenov 099ea91823 typos 2014-03-04 12:47:40 +04:00
Roman Donchenko 0692a674d1 Merge pull request #2381 from ElenaGvozdeva:ipp_resize 2014-03-04 11:49:02 +04:00
Roman Donchenko a600267b9f Merge pull request #2432 from ilya-lavrenov:summary_py 2014-03-04 11:46:29 +04:00
mlyashko 5c867463d2 changed localsize to NULL (reviewers comment) 2014-03-04 11:36:47 +04:00
Hilton Bristow 72d5609a36 Merged upstream master 2014-03-04 11:14:03 +10:00
GregoryMorse 90920c2376 Update cap_msmf.cpp
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 cap_msmf.cpp

Create cap_msmf.h

Update cap_msmf.cpp

Update cap_msmf.h

Update cap_msmf.cpp

Update cap_msmf.h

Update and rename cap_msmf.h to cap_msmf.hpp

Update cap_msmf.cpp

Update CMakeLists.txt

Update cap_msmf.hpp

Update cap_msmf.cpp

Update cap_msmf.cpp

Update cap_msmf.cpp

Update cap_msmf.hpp

Update cap_msmf.hpp

Update cap_msmf.cpp

Successful test - samples are grabbed

Update cap_msmf.cpp

Update cap_msmf.hpp

Update cap_msmf.cpp

Update cap_msmf.hpp

Update cap_msmf.hpp

Update cap_msmf.cpp

Update cap_msmf.hpp

Update cap_msmf.cpp

Update cap_msmf.hpp

Update cap_msmf.cpp

Update cap_msmf.hpp

Create ppltasks_winrt.h

Update cap_msmf.hpp

Update cap_msmf.hpp

Update cap_msmf.cpp

Update ppltasks_winrt.h

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

Update ppltasks_winrt.h

Fixed trailing whitespace
2014-03-04 01:52:17 +08:00
Ilya Lavrenov 050cca0422 improved performance of cv::flip (flip cols) 2014-03-03 19:04:32 +04:00
Roman Donchenko 7ecbf45751 Merge pull request #2435 from SpecLad:merge-2.4 2014-03-03 15:41:06 +04:00
Ilya Lavrenov 4376de7698 fixed morphology operations 2014-03-03 15:29:48 +04:00
Ilya Lavrenov be5b5a0471 fixed cv::dft 2014-03-03 14:32:38 +04:00
Roman Donchenko db85c35e69 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/contrib/src/basicretinafilter.hpp
	modules/contrib/src/magnoretinafilter.hpp
	modules/contrib/src/parvoretinafilter.hpp
	modules/contrib/src/retinacolor.hpp
	modules/gpu/include/opencv2/gpu/gpu.hpp
	modules/highgui/src/cap_tyzx.cpp
	modules/ocl/perf/perf_filters.cpp
	modules/ocl/src/haar.cpp
	modules/ocl/src/opencl/haarobjectdetect.cl
	modules/ocl/test/test_filters.cpp
	modules/ocl/test/test_objdetect.cpp
2014-03-03 13:45:22 +04:00
Ilya Lavrenov 29deff8707 ability to merge logs with intersections only 2014-03-03 13:27:07 +04:00
Roman Donchenko af8aa8a2fa Merge pull request #2433 from ilya-lavrenov:typos 2014-03-03 12:20:35 +04:00
Anatoly Baksheev fb7e74c511 iteractor work 2014-03-02 23:15:53 +04:00
Ilya Lavrenov eedf86402d typos 2014-03-02 21:04:17 +04:00
Ilya Lavrenov 68957b2757 added some new performance tests 2014-03-02 10:29:50 +04:00
Ilya Lavrenov 767b28f2e3 tests 2014-03-01 18:47:44 +04:00
Cody Rigney fbc69e444b Added NEON optimizations for LK optical flow (Intrinsics). 2014-02-28 16:48:04 -05:00
Ilya Lavrenov c1c3139368 master-like performance tests 2014-02-28 22:40:24 +04:00
Andrey Pavlenko 409bd162ff Merge pull request #2421 from akarsakov:fix_ocl_haar_intel 2014-02-28 18:22:03 +04:00
Andrey Pavlenko 37580687e6 Merge pull request #2427 from alalek:ocl_build_log 2014-02-28 18:21:38 +04:00
Elena Gvozdeva 68edda3350 fixed 2014-02-28 11:56:23 +04:00
Alexander Alekhin b9d68ef061 core/ocl: OpenCL build log improvements 2014-02-27 13:16:07 +04:00
Andrey Pavlenko 57b6850d74 Merge pull request #2415 from vpisarev:fix_stereobm_sse 2014-02-27 09:37:04 +04:00
Alexander Karsakov e6f6707558 OCL: Fix for Haar classifier (thanks to Konstantin Rodyushkin). 2014-02-26 18:11:11 +04:00
Roman Donchenko 7dc22b4ea6 Merge pull request #2419 from linquize:tgit.icon 2014-02-26 17:34:49 +04:00
Linquize a228633d31 Add tgit.icon project config 2014-02-26 17:46:52 +08:00
Roman Donchenko bd5d8404c9 Merge pull request #2393 from ilya-lavrenov:coverity 2014-02-26 12:16:36 +04:00
mlyashko ba5ebaa758 changed file name to case-sensitve to support linux 2014-02-26 10:55:18 +04:00
juanmanpr 7a68e3d207 CV_Assert for photo module corrected 2014-02-25 19:58:08 +01:00
Roman Donchenko 693129902d Merge pull request #2399 from SpecLad:merge-2.4 2014-02-25 19:42:54 +04:00
Vadim Pisarevsky a3aced20c1 fixed difference between SSE2 and C branches of StereoBM; they should now produce absolutely the same results 2014-02-25 18:13:51 +04:00
Roman Donchenko c9a4a82667 Merge pull request #2358 from rohitgirdhar:rotatedRect 2014-02-25 17:43:48 +04:00
Ilya Lavrenov ce0557ebb8 fixed defects from Xcode 2014-02-25 17:33:12 +04:00
Elena Gvozdeva 45cc8a5300 fixed 2014-02-25 16:43:52 +04:00
Roman Donchenko 1db1a83410 Merge pull request #2410 from asmorkalov:android_tiff_lowmem_fix 2014-02-25 15:04:24 +04:00
Roman Donchenko 48432502b6 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	cmake/OpenCVDetectCUDA.cmake
	doc/tutorials/introduction/linux_gcc_cmake/linux_gcc_cmake.rst
	modules/core/CMakeLists.txt
	modules/features2d/perf/opencl/perf_brute_force_matcher.cpp
	modules/highgui/src/grfmt_tiff.cpp
	modules/imgproc/src/clahe.cpp
	modules/imgproc/src/moments.cpp
	modules/nonfree/CMakeLists.txt
	modules/ocl/perf/perf_ml.cpp
	modules/superres/CMakeLists.txt
2014-02-25 15:02:24 +04:00
Roman Donchenko 3693facd9e Merge pull request #2412 from arunjvs:master 2014-02-25 14:21:12 +04:00
Ilya Lavrenov fe38aab84a core tapi optimization 2014-02-25 14:14:42 +04:00
Arun JVS 31fb7c4fec Fixed Bug #3568: Build fails with WITH_OPENGL=ON 2014-02-25 14:34:32 +05:30
Elena Gvozdeva 48e7bc6b30 fixed 2014-02-25 12:59:33 +04:00
Roman Donchenko 7dc549f166 Merge pull request #2411 from asmorkalov:android_mat_leak_fix 2014-02-25 12:37:01 +04:00
Alexander Smorkalov c78142acb0 Bug #3391 org.opencv.android.NativeCameraView crashes after latest OpenCV Manager update fixed.
The crash was cased by massive Mat objects leak in NativeCameraView class.
2014-02-25 11:54:03 +04:00
vbystricky ff8b8ef24c Remove implementation of CvCapture interface for Intel PerC camera. Add IVideoCapture interface and implementation of this one for Intel PerC camera 2014-02-25 10:59:35 +04:00
Alexander Smorkalov dbb7aa7856 Highgui_Tiff.decode_tile16384x16384 disabled for Android.
Last changes in test leads to SIGKILL on Android.
SIGKILL is called by out of memory killer.
2014-02-25 10:36:20 +04:00
Andrey Pavlenko d695d4a0bf Merge pull request #2406 from ilya-lavrenov:abf 2014-02-25 09:12:32 +04:00
juanmanpr 540a60fca7 Replaced calls to cout from photo module, by CV_Assert 2014-02-25 00:29:07 +01:00
Ilya Lavrenov 653b99c9bd new scheme of sqrSum 2014-02-25 00:38:44 +04:00
Ilya Lavrenov e1a598c5b3 disabled ABF tests 2014-02-24 23:26:01 +04:00
Nicolas Martin 67cf0dabea Do not build apple objective-c codes if using gcc 2014-02-24 09:44:49 -05:00
mlyashko e75a257f92 changed epsilon for test passing 2014-02-24 17:47:56 +04:00
Andrey Pavlenko 73dfc4cb8c Merge pull request #2402 from ilya-lavrenov:amd_libs 2014-02-24 16:56:40 +04:00
Andrey Pavlenko 3845b96f6c Merge pull request #2388 from alalek:coverity_bug_fix 2014-02-24 16:54:44 +04:00
Andrey Pavlenko 52a339cba5 Merge pull request #2401 from akarsakov:fix_elem_size 2014-02-24 16:22:28 +04:00
Andrey Pavlenko 0f43345f9e Merge pull request #2394 from ilya-lavrenov:tapi_memop_fix 2014-02-24 16:21:41 +04:00
Ilya Lavrenov 16bfdbd22a dump AMD Blas/Fft 2014-02-24 15:12:42 +04:00
Alexander Karsakov 6d83048ec3 Fixed incorrect calculation of element size in OCL.(Mul/Div).Mat_Scalar_Scale. 2014-02-24 15:10:00 +04:00
Roman Donchenko 681a8c6e18 Merge pull request #2398 from nghiaho12:integral_doc 2014-02-24 14:26:41 +04:00
Nghia Ho ced8e7a813 Typo 2014-02-24 20:06:20 +11:00
Roman Donchenko 2b0c3eb170 Merge pull request #2389 from SpecLad:ios-big-endian 2014-02-24 12:44:36 +04:00
Roman Donchenko 1cf75c0cab Hardcode iOS's endianness, since the TestBigEndian module doesn't work there 2014-02-24 12:13:35 +04:00
Martin Dlouhy 8f6ebc2427 fixed rotated rectangle (center instead of corner) 2014-02-24 07:54:08 +01:00
Ilya Lavrenov 32eb38ec98 fixed defects from coverity.com 2014-02-23 20:21:08 +04:00
Ilya Lavrenov 0406898b9a int2 -> ulong; to work properly with 3 channels 2014-02-23 15:12:38 +04:00
Ilya Lavrenov 0ef16125ae improved cv::matchTemplate OpenCL part 2014-02-22 14:30:19 +04:00
Rohit Girdhar fd4461d543 addressed issues 2014-02-22 09:54:16 +05:30
Roman Donchenko 0a90d6dde6 Merge pull request #2266 from vpisarev:ipp_norm_fix 2014-02-21 19:11:57 +04:00
Vadim Pisarevsky 51dafc780b fixed hint type declaration 2014-02-21 18:07:01 +04:00
Roman Donchenko 51421098dd Merge pull request #2201 from mattip:2.4 2014-02-21 17:57:36 +04:00
Matti Picus dc50dc7254 fix merge 2014-02-21 13:54:58 +02:00
Andrey Pavlenko 3e5890694e Merge pull request #2384 from ilya-lavrenov:perf_match 2014-02-21 15:14:12 +04:00
Alexander Alekhin 9b3c76a3db TAPI: coverity bug fix 2014-02-21 14:04:01 +04:00
Matti Picus f5330a44e8 merge with origin 2014-02-21 11:59:49 +02:00
Ilya Lavrenov c7857e8c13 small fixes 2014-02-21 12:19:08 +04:00
Rohit Girdhar 347a3dc520 added randomized test 2014-02-21 12:47:01 +05:30
Matti Picus 31c8f2ec57 fix code, it turns out only TIFFReadRGBATile needs buffer pointer mangling 2014-02-20 22:12:22 +02:00
Matti Picus 46d128e073 add test (needs updated opencv_extra repo) 2014-02-20 22:10:22 +02:00
Andrey Pavlenko 9c5bd85247 Merge pull request #2375 from akarsakov:fix_getGradient 2014-02-20 21:41:43 +04:00
Andrey Pavlenko b96923d5fa Merge pull request #2377 from alalek:tapi_warpers_perf_test 2014-02-20 21:40:28 +04:00
Andrey Pavlenko f04a158268 Merge pull request #2383 from ilya-lavrenov:perf_match_template 2014-02-20 21:36:30 +04:00
Ilya Lavrenov aa5311ea9f backport of master-based perf tests for matchTemplate to 2.4 2014-02-20 18:58:32 +04:00
Ilya Lavrenov 804b70b72f ported 2.4 perf tests for matchTemplate 2014-02-20 18:11:56 +04:00
Elena Gvozdeva 7b552c0493 fixed 2014-02-20 17:34:51 +04:00
Rohit Girdhar ea7b1bb3d2 added test, doc 2014-02-20 17:51:48 +05:30
Elena Gvozdeva cd68cd43a2 Fixed 2014-02-20 16:13:05 +04:00
mlyashko 10f2a038c2 Optical flow dualt tvl1 ocl-based implementation and tests 2014-02-20 14:23:10 +04:00
Elena Gvozdeva e013d31715 Added IPP function for resize() 2014-02-20 14:01:22 +04:00
Alexander Karsakov 7e4dea968c Fixed typo with indexes in getGradient(x/y) functions. 2014-02-20 13:58:31 +04:00
Roman Donchenko ad66233774 Merge pull request #2376 from GrinIara:master 2014-02-20 13:43:22 +04:00
Roman Donchenko efafd4a9e5 Merge pull request #2380 from jet47:fix-3562 2014-02-20 13:41:45 +04:00
Roman Donchenko 61976b8461 Merge pull request #2325 from alalek:perf_fix 2014-02-20 13:39:54 +04:00
Alexander Alekhin 79eba54a4f some fixes in perf tests 2014-02-20 13:29:11 +04:00
Alexander Alekhin ddd3c062b5 TAPI: fix perf test for warpers 2014-02-20 13:09:06 +04:00
Vladislav Vinogradov 7fd21d217a fix bug #3562:
add missing __syncthreads to edgesHysteresisLocalKernel
2014-02-20 10:24:52 +04:00
GrinIara fa0599448d Fixed compilation error due to missing std::. 2014-02-19 17:06:33 +01:00
Rohit Girdhar b939b4ae3b removed inline, changed interface 2014-02-19 20:58:40 +05:30
Ilya Lavrenov 8bf616e4c7 added color image support via L*a*b* 2014-02-19 18:35:37 +04:00
Ilya Lavrenov 634e8d37cc fixed for 2 channels 2014-02-19 18:18:22 +04:00
Alexander Alekhin bf4f15fb5f TAPI: fix OpenCL warpers and test 2014-02-19 15:30:43 +04:00
Ilya Lavrenov 7faf1f6277 some improvements 2014-02-19 15:01:34 +04:00
Roman Donchenko ccbceb56c4 Merge pull request #2144 from nickdademo:pvapi_framestarttriggermode 2014-02-19 14:48:57 +04:00
Roman Donchenko cfc4621587 Merge pull request #2291 from xgvargas:extra-note-for-waitKey 2014-02-19 14:33:58 +04:00
Roman Donchenko ce42593fe6 Merge pull request #2368 from asmorkalov:ocv_gcc48_warning_fix 2014-02-19 12:03:06 +04:00
Roman Donchenko 7cbc4e88de Merge pull request #2357 from akarsakov:fix_ipp_compilation_linux 2014-02-19 12:02:41 +04:00
Alexander Smorkalov 4c1ed13846 Warning fixes for GCC 4.8. 2014-02-18 23:53:35 +04:00
Ilya Lavrenov 72c327fef8 hope it finally works 2014-02-18 19:23:38 +04:00
Roman Donchenko 8754adc021 Merge pull request #2371 from ilya-lavrenov:typo 2014-02-18 18:00:14 +04:00
Roman Donchenko af9368d35f Merge pull request #2370 from ilya-lavrenov:cuda_nlm_typo 2014-02-18 17:00:54 +04:00
Roman Donchenko c35dab9046 Merge pull request #2359 from SpecLad:moments-no-vectorize 2014-02-18 17:00:32 +04:00
Roman Donchenko 3782c324c4 Merge pull request #2098 from pxli168:patch-1 2014-02-18 15:49:19 +04:00
Roman Donchenko 6f19ef8631 Merge pull request #2361 from alekcac:ios_camera_changes 2014-02-18 15:44:56 +04:00
Ilya Lavrenov 38cbe9873a small fixes 2014-02-18 14:56:13 +04:00
Ilya Lavrenov 9db28f332a more fixes 2014-02-18 14:32:03 +04:00
Ilya Lavrenov 891dbeabba implemented OpenCL version of cv::fastNlMeansDenoising 2014-02-18 14:32:03 +04:00
Ilya Lavrenov d27068f79a some more refactoring 2014-02-18 14:32:03 +04:00
Ilya Lavrenov e16d89e8d6 some refactoring 2014-02-18 14:32:03 +04:00
Roman Donchenko 5cb2d1c20d Merge pull request #2338 from asmorkalov:ocv_gcov 2014-02-18 14:25:16 +04:00
Ilya Lavrenov e460a29cab typo 2014-02-18 14:24:17 +04:00
Ilya Lavrenov da9bdf9c15 fixes typo and unused variables 2014-02-18 14:16:54 +04:00
Alexander Shishkov 77df5948e7 removed trailing spaces 2014-02-18 13:56:26 +04:00
Roman Donchenko e35d98e566 Worked around an apparent GCC bug in moments. 2014-02-18 13:51:27 +04:00
Roman Donchenko b7659c62f3 Merge pull request #2366 from yashdv:mat_copyto_doc_bug 2014-02-18 13:47:46 +04:00
Roman Donchenko edbff68843 Merge pull request #2355 from alekcac:hough_circles_fix 2014-02-18 13:36:33 +04:00
yash 394c74b349 edited the doc for mat::copyto and clarified the part regarding reallocation by .create 2014-02-18 15:04:27 +05:30
Andrey Pavlenko e6420c523d Merge pull request #2235 from alalek:ocl_svm_perf_test 2014-02-18 13:33:16 +04:00
Andrey Pavlenko b3cfe6b446 Merge pull request #2341 from alalek:ocl_fix_error_processing 2014-02-18 13:27:38 +04:00
Andrey Pavlenko ff9a0815b9 Merge pull request #2352 from ilya-lavrenov:flann 2014-02-18 13:24:41 +04:00
Alexander Smorkalov de6d13088f gcov tool support added. 2014-02-18 12:59:41 +04:00
Roman Donchenko 2409812803 Merge pull request #2347 from Chechli:master 2014-02-18 12:57:26 +04:00
Roman Donchenko 139a262072 Merge pull request #2367 from jet47:fix-3544 2014-02-18 12:15:49 +04:00
Roman Donchenko bcf4307345 Merge pull request #2356 from SpecLad:merge-2.4 2014-02-18 12:14:57 +04:00
Roman Donchenko 689589ebaa Merge pull request #2365 from yashdv:image_tutorial_doc_bug 2014-02-18 11:58:11 +04:00
Roman Donchenko 95d7ecb33f Merge pull request #2364 from ilya-lavrenov:unused_field 2014-02-18 11:57:36 +04:00
Roman Donchenko 13182da945 Merge pull request #2363 from alekcac:introduction_tut_fix 2014-02-18 11:56:57 +04:00
Roman Donchenko a0a4f6c23d Merge pull request #2362 from alekcac:docs_style_change 2014-02-18 11:56:36 +04:00
Roman Donchenko 224124b69e Merge pull request #2360 from Evgenij-Gr:XLSreport 2014-02-18 11:56:21 +04:00
Chechli 768da4d95a Update hough_circles.cpp 2014-02-18 08:50:33 +01:00
Vladislav Vinogradov afd99c9c81 fix bug #3544:
add "opencv2/core/utility.hpp" header to precomp.hpp
2014-02-18 10:45:47 +04:00
yash 38ef8894b7 Made a sentence in the doc for Mat::copyTo more clearer 2014-02-18 10:51:05 +05:30
yash 017a282c7a Minor error in the documentation Load and Save Image 2014-02-18 10:34:58 +05:30
Gustavo Vargas 0d199b4048 Update py_image_display.rst 2014-02-17 23:22:18 -03:00
pxli168 44ecb727c5 Change again.
Opps.
2014-02-18 10:13:30 +08:00
Ilya Lavrenov 6ad7b64912 some more changes 2014-02-17 21:57:33 +04:00
Ilya Lavrenov 01527c44fd removed unused field 2014-02-17 21:50:00 +04:00
Alexander Shishkov a8eab26bae fixed incorrect code in introduction tutorial 2014-02-17 18:10:08 +04:00
Alexander Shishkov 63235f51f0 fixed year in copyright 2014-02-17 17:56:12 +04:00
Andrey Pavlenko 9885a671ee Merge pull request #2346 from ilya-lavrenov:umat_tests_cleanup 2014-02-17 17:53:05 +04:00
Andrey Pavlenko 47d9b933f6 Merge pull request #2345 from ilya-lavrenov:tapi_3cn_perf 2014-02-17 17:38:26 +04:00
Alexander Shishkov cc529d971b removed tabs 2014-02-17 17:37:02 +04:00
Andrey Pavlenko aeeb9f9e25 Merge pull request #2334 from alalek:umat_usage_flags_2 2014-02-17 17:34:19 +04:00
Rohit Girdhar a879e1fcd6 fixed warnings 2014-02-17 19:00:36 +05:30
Evgeniy 8236181c62 Added more colorizing options to XLS generating script 2014-02-17 17:01:23 +04:00
Alexander Karsakov 01a980aa9e Fixed compilation with IPP on Linux. Added linking with Intel compiler runtime libraries. 2014-02-17 16:56:02 +04:00
Andrey Pavlenko 01b225acb0 Merge pull request #2340 from ilya-lavrenov:tapi_lab 2014-02-17 16:45:40 +04:00
Rohit Girdhar 613a17355d rotRect using points 2014-02-17 17:39:13 +05:30
Roman Donchenko 029ffb7c2d Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/core/src/gl_core_3_1.cpp
	modules/core/src/opencl/convert.cl
	modules/cudaimgproc/src/cuda/canny.cu
	modules/cudastereo/perf/perf_stereo.cpp
	modules/gpu/perf/perf_imgproc.cpp
	modules/gpu/test/test_denoising.cpp
	modules/ocl/src/opencl/imgproc_resize.cl
	samples/cpp/Qt_sample/main.cpp
2014-02-17 15:24:05 +04:00
Roman Donchenko a6d64e254f Merge pull request #2354 from gleb-sternharz:Branch_2.4.8 2014-02-17 15:00:47 +04:00
Roman Donchenko e8d26b02ac Merge pull request #2339 from jet47:gpu-warnings 2014-02-17 13:35:15 +04:00
Roman Donchenko 7358b44222 Merge pull request #2343 from yashdv:template_matching_doc_fix 2014-02-17 13:33:29 +04:00
Marijan Vukcevich 9a98cd6e65 Update cap_ios_abstract_camera.mm
AVCaptureVideoPreviewLayer setOrientation is depricated. This fixes the warning and provides backward compatibility.
2014-02-17 13:23:25 +04:00
Alexander Shishkov f60913ddd3 small changes in hough circles tutorial 2014-02-17 12:55:19 +04:00
Chechli 9211d1ac2d Update hough_circles.cpp 2014-02-17 09:50:32 +01:00
Chechli 640a45d359 Update precomp.hpp 2014-02-17 09:48:51 +01:00
Roman Donchenko a0bb74a086 Merge pull request #2337 from pmoulon:master 2014-02-17 12:24:48 +04:00
Roman Donchenko cfcf07acfa Merge pull request #2328 from rohitgirdhar:bugfix_blobdetector_kpt_radius 2014-02-17 12:23:59 +04:00
Roman Donchenko 947fb74c18 Merge pull request #2330 from rohitgirdhar:linux_tutorial_make_j8 2014-02-17 12:22:11 +04:00
Roman Donchenko b6dafed5ba Merge pull request #2342 from yashdv:android_doc_fix 2014-02-17 12:21:20 +04:00
Roman Donchenko 8cbb284b7b Merge pull request #2348 from ilya-lavrenov:typo 2014-02-17 12:02:59 +04:00
Roman Donchenko f252687eae Merge pull request #2351 from yashdv:BOW_assert_error 2014-02-17 11:58:03 +04:00
Roman Donchenko 9fcb0b2201 Merge pull request #2349 from jet47:fix-bug-3552 2014-02-17 11:52:01 +04:00
Roman Donchenko aad289a3a2 Merge pull request #2344 from kirill-kornyakov:replace-gittip-button 2014-02-17 11:48:03 +04:00
gleb.sternharz f85aa929f1 fix dev by 0 in KL-Divergence 2014-02-17 04:08:30 +01:00
pxli168 70d462b352 Simplify the code
Simplify the code as @SpecLad suggested.
2014-02-17 10:21:18 +08:00
Ilya Lavrenov f74ef644bc changed the signature of add method according to the base class 2014-02-17 02:39:38 +04:00
yash 1a89a03c7c Fixed CV_ASSERT condition in the code for bag of words 2014-02-16 22:33:30 +05:30
Chechli 10465c546a Update hough_circles.cpp 2014-02-16 13:26:00 +01:00
Ilya Lavrenov c8e22c04c8 extended performance test 2014-02-16 13:42:25 +04:00
Vladislav Vinogradov 150e522bee fix bug #3552:
replace std::swap with own code
2014-02-16 12:17:17 +04:00
Ilya Lavrenov 510680a5df typo 2014-02-16 01:42:02 +04:00
Ilya Lavrenov 7629bb78a4 extended performance tests to test 3 channels 2014-02-16 01:31:33 +04:00
Anatoly Baksheev 03bd82796d source compatibility with master 2014-02-15 23:40:09 +04:00
Chechli 72e4f72a75 Update hough_circles.cpp 2014-02-15 17:31:14 +01:00
Ilya Lavrenov 9b627a5e9f disabled 'reshape', 'copyTo' test 2014-02-15 20:17:42 +04:00
Anatoly Baksheev 56754e907d fixed crash for windows if console widow is closed or CTRL_C/CTRL_BRAK keys in console are pressed. 2014-02-15 20:08:04 +04:00
Anatoly Baksheev 1a5dfe421d Added WidgetMerger, Polyline - colors support for each point independently, simple widgets now compute color array instead of setting global color 2014-02-15 17:02:17 +04:00
Ilya Lavrenov 7ce2c3574a restored lost in PR #1735 umat tests 2014-02-15 16:09:55 +04:00
Ilya Lavrenov 4f36bc29d9 cleaned-up UMat tests 2014-02-15 15:51:52 +04:00
Kirill Kornyakov ed1aa73dd3 Replaced Gittip button 2014-02-15 13:10:09 +04:00
yash cce225f6e9 fixed doc/tutorials/imgproc/histograms/template_matching/template_matching.rst 2014-02-15 12:48:42 +05:30
yash e2f5001b11 fixed doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.rst 2014-02-14 23:04:03 +05:30
Alexander Alekhin 915fb632fd core/ocl: change error processing for missed function 2014-02-14 19:50:58 +04:00
Ilya Lavrenov 8150c1b7e4 added [s|l]rgb <-> lab conversion 2014-02-14 18:45:56 +04:00
Vladislav Vinogradov 8b8c368148 fixed two warnings in gpu sources (-Wshadow, -Wno-sign-promo) 2014-02-14 17:56:03 +04:00
Alexander Alekhin d1606b4aa3 ocl: added SVM perf test 2014-02-14 16:36:46 +04:00
Roman Donchenko 3542da7167 Merge pull request #2336 from SpecLad:useOclChanged 2014-02-14 16:21:01 +04:00
Roman Donchenko e0d991cf46 Merge pull request #2335 from jet47:gpu-alphacomp-test 2014-02-14 16:20:45 +04:00
Andrey Pavlenko 0fc248fb70 Merge pull request #2326 from vpisarev:ocl_ch3 2014-02-14 15:49:36 +04:00
Alexander Alekhin 95e38e457f core/umat: usage flags (with proposals from PR #2195) 2014-02-14 15:40:16 +04:00
Roman Donchenko fa272c43c2 Merge pull request #2323 from stuart8c:issue2601_2.4_fix_16bit_tiff_reading_on_big_endian_host 2014-02-14 15:37:09 +04:00
Pierre Moulon 8829e9f6c8 Fix a typo error 2014-02-14 12:22:53 +01:00
Pierre Moulon f3f8b843b6 Fix a typo error 2014-02-14 12:21:35 +01:00
Roman Donchenko a1de9e9ad5 Merge pull request #2329 from ilya-lavrenov:macosx_ogl 2014-02-14 14:38:37 +04:00
Roman Donchenko 88f993dbda Deleted an assignment to a variable that doesn't exist. 2014-02-14 14:37:56 +04:00
Vladislav Vinogradov 1ce5165cb7 temporary disable performance test for alphaComp function 2014-02-14 14:27:43 +04:00
Andrey Pavlenko 534bec3a90 Merge pull request #2315 from ilya-lavrenov:nlmeans_perf 2014-02-14 13:24:12 +04:00
Andrey Pavlenko d68c688f22 Merge pull request #1735 from KonstantinMatskevich:umat_tests 2014-02-14 12:37:47 +04:00
Roman Donchenko 3def7778dc Merge pull request #2062 from cook:bug3440 2014-02-14 12:09:03 +04:00
Stuart Cunningham 1454843b81 Fix build of libtiff on big endian host due to defined but empty WORDS_BIGENDIAN macro 2014-02-14 16:16:17 +11:00
Ilya Lavrenov b92a46c130 some more fixes 2014-02-13 23:47:18 +04:00
Yantao Xie 6b00c4e337 Use CMAKE_CFG_INTDIR meta-variable to get the library output directory of the opencv_matlab. 2014-02-13 23:53:58 +08:00
Roman Donchenko ecbe843061 Merge pull request #2333 from asmorkalov:java_dead_code_fix 2014-02-13 19:21:56 +04:00
Roman Donchenko b4a535272c Merge pull request #2332 from jet47:gpu-fixes 2014-02-13 19:21:45 +04:00
Alexander Smorkalov dbe7634286 Dead code removed as this cannot be null in Java. 2014-02-13 18:17:47 +04:00
Roman Donchenko b8d8b0568c Merge pull request #2331 from asmorkalov:android_native_activity_finish 2014-02-13 17:57:46 +04:00
Vadim Pisarevsky 630bdbf42f fixed OpenCL kernel flag in resize (thanks to Ilya L) 2014-02-13 17:37:42 +04:00
Vladislav Vinogradov eb247d826f temporary disable perf test for StereoBeliefPropagation 2014-02-13 17:25:59 +04:00
Vladislav Vinogradov 9e69e2a07a increase epsilon for AlphaComp sanity test for integer input 2014-02-13 17:16:43 +04:00
Alexander Smorkalov 7da3e98dfd Application pause/resume fix for Android sample NativeActivity. 2014-02-13 16:47:02 +04:00
Stuart Cunningham 55b9c0374c Fix cmake detection of build platform endianness
Improve comments to indicate actual usage of WORDS_BIGENDIAN where
it is tested with #ifdef rather than #if
2014-02-13 22:59:30 +11:00
Konstantin Matskevich 5f76072c62 update 2014-02-13 13:29:53 +04:00
Roman Donchenko f297ec55ae Merge pull request #2304 from mattvenn:master 2014-02-13 12:30:20 +04:00
Rohit Girdhar 01b624e359 -j8 in linux_installation tutorial 2014-02-13 13:52:00 +05:30
Roman Donchenko 91ab92c349 Merge pull request #2318 from gongzg:2.4 2014-02-13 12:16:19 +04:00
Roman Donchenko 935e36bc72 Merge pull request #2319 from m3d:patch-1 2014-02-13 12:12:00 +04:00
Andrey Pavlenko 0ee5c34f40 Merge pull request #2324 from vpisarev:fix_facedetect 2014-02-13 11:46:24 +04:00
Matt Venn 7acd28fbea added imgpoints back 2014-02-13 07:44:29 +00:00
Konstantin Matskevich a0a3b8b56d Some tests for UMat 2014-02-13 09:59:05 +04:00
Ilya Lavrenov 879c0196d4 enabled OpenGL on MacOSX 2014-02-13 00:17:15 +04:00
Rohit Girdhar a4b5641836 bugfix: blobdetector was putting incorrect diameter value in keypoints 2014-02-12 22:29:04 +05:30
Vadim Pisarevsky 91587059ad tab => spaces 2014-02-12 20:28:55 +04:00
Vadim Pisarevsky 290fbc0121 3-channel support in OpenCL kernels for setTo, resize, warpAffine and warpPerspective 2014-02-12 19:29:18 +04:00
Vadim Pisarevsky a18bc9651d fixed bug reported by Irina K. Also tried to fix LBP detector regression in quality (probably it did not help but still ...) 2014-02-12 17:42:09 +04:00
Stuart Cunningham 5d43d3ca88 Fix Windows build of grfmt_tiff.cpp by using libtiff's integer types. 2014-02-12 23:41:38 +11:00
Roman Donchenko 863e9c699a Merge pull request #2322 from berak:b_cc_read 2014-02-12 16:32:29 +04:00
Roman Donchenko e55679079f Merge pull request #2320 from asmorkalov:ocv_readme_license_install 2014-02-12 16:27:24 +04:00
Roman Donchenko 3994cfbc59 Merge pull request #2321 from asmorkalov:android_run_all_tests 2014-02-12 15:41:29 +04:00
Roman Donchenko fa38ea6d50 Merge pull request #2317 from blueskymonster:master 2014-02-12 15:14:26 +04:00
Martin Dlouhy d9a322f606 undo changes of cv2.cv.* functions/constants 2014-02-12 11:25:03 +01:00
Alexander Smorkalov d02c291160 opencv_run_all_tests.sh implemented for Android SDK. 2014-02-12 14:21:58 +04:00
Stuart Cunningham 8bbce0a2a2 Fix reading of 16-bit TIFF images on big endian host.
Use correct integer types for arguments to TIFFGetField to avoid corruption
of values and failed loads of TIFF file when using cv::imread().

Added test where both big and little endian TIFF files are read using imread().

Fixed build of 3rdparty libtiff on big endian hosts.

Reduced memory required during decode_tile16384x16384 test by not converting
large grayscale test image to color image during read.
2014-02-12 21:21:06 +11:00
Alexander Smorkalov e55f2b2602 LICENSE and README files installation rules added. 2014-02-12 14:06:41 +04:00
Vadim Pisarevsky f7620dc7d1 added 3-channel support to arithmetic operations 2014-02-12 12:18:55 +04:00
Martin Dlouhy bbefc101de removed return images and fixed cv2 names 2014-02-12 07:06:05 +01:00
Elliot Godzich 2806679781 Updated DisplayImage.cpp program to compile
CV_WINDOW_AUTOSIZE -> WINDOW_AUTOSIZE
2014-02-11 21:46:14 -08:00
Zhigang Gong 9aef26e2ad Workaround a LLVM/Clang 3.3 bug.
The LLVM/Clang 3.3 has a bug when compile a cl kernel with
assignment of a scalar to a vector data type. This patch
could work around this bug.

Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
2014-02-12 13:14:43 +08:00
Anatoly Baksheev 261546f6f6 casting Vec3b operator for viz::Color 2014-02-11 23:27:19 +04:00
Ilya Lavrenov 4f2cdc9bac added performance tests for NLMeans 2014-02-11 18:21:53 +04:00
Roman Donchenko 511e79aef7 Merge pull request #2311 from SvenWe:master 2014-02-11 17:11:06 +04:00
Roman Donchenko 1cef6f9fb1 Merge pull request #2313 from m3d:patch-1 2014-02-11 17:10:23 +04:00
Roman Donchenko bb4199b177 Merge pull request #2314 from ilya-lavrenov:typo 2014-02-11 17:06:38 +04:00
Roman Donchenko dad536f490 Merge pull request #1851 from dneelyep:patch-1 2014-02-11 16:46:35 +04:00
Ilya Lavrenov 281666887e typo 2014-02-11 14:25:37 +04:00
Roman Donchenko 7a35f4593e Merge pull request #2310 from SpecLad:merge-2.4 2014-02-11 13:44:51 +04:00
Roman Donchenko 72aabb8a84 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	CMakeLists.txt
	cmake/OpenCVGenAndroidMK.cmake
	cmake/templates/OpenCV.mk.in
	doc/tutorials/viz/creating_widgets/creating_widgets.rst
	doc/tutorials/viz/launching_viz/launching_viz.rst
	doc/tutorials/viz/table_of_content_viz/images/image_effects.png
	doc/tutorials/viz/transformations/transformations.rst
	doc/tutorials/viz/widget_pose/widget_pose.rst
	modules/core/include/opencv2/core/affine.hpp
	modules/core/include/opencv2/core/core.hpp
	modules/gpu/perf/perf_imgproc.cpp
	modules/gpu/src/cuda/canny.cu
	modules/gpu/src/cuda/generalized_hough.cu
	modules/gpu/src/generalized_hough.cpp
	modules/gpu/src/imgproc.cpp
	modules/gpu/test/test_color.cpp
	modules/gpu/test/test_core.cpp
	modules/gpu/test/test_gpumat.cpp
	modules/gpu/test/test_hough.cpp
	modules/nonfree/CMakeLists.txt
	modules/nonfree/include/opencv2/nonfree/gpu.hpp
	modules/nonfree/perf/perf_gpu.cpp
	modules/nonfree/src/cuda/surf.cu
	modules/nonfree/src/precomp.hpp
	modules/nonfree/src/surf_gpu.cpp
	modules/nonfree/test/test_gpu.cpp
	modules/ocl/perf/perf_haar.cpp
	modules/stitching/CMakeLists.txt
	modules/stitching/include/opencv2/stitching/detail/matchers.hpp
	modules/stitching/include/opencv2/stitching/detail/seam_finders.hpp
	modules/stitching/include/opencv2/stitching/detail/warpers.hpp
	modules/stitching/include/opencv2/stitching/warpers.hpp
	modules/stitching/src/blenders.cpp
	modules/stitching/src/matchers.cpp
	modules/stitching/src/precomp.hpp
	modules/stitching/src/seam_finders.cpp
	modules/stitching/src/stitcher.cpp
	modules/stitching/src/warpers.cpp
	modules/viz/doc/widget.rst
	modules/viz/include/opencv2/viz/types.hpp
	modules/viz/include/opencv2/viz/viz3d.hpp
	modules/viz/include/opencv2/viz/widget_accessor.hpp
	modules/viz/src/precomp.hpp
	modules/viz/src/shapes.cpp
	modules/viz/src/vizcore.cpp
	modules/viz/src/vtk/vtkCloudMatSink.h
	modules/viz/src/vtk/vtkCloudMatSource.h
	modules/viz/test/test_precomp.hpp
	modules/viz/test/tests_simple.cpp
	samples/android/tutorial-4-cuda/CMakeLists.txt
	samples/android/tutorial-4-cuda/jni/Android.mk
	samples/android/tutorial-4-cuda/src/org/opencv/samples/tutorial4/Tutorial4Activity.java
	samples/cpp/stitching_detailed.cpp
	samples/cpp/tutorial_code/viz/creating_widgets.cpp
	samples/cpp/tutorial_code/viz/launching_viz.cpp
	samples/cpp/tutorial_code/viz/transformations.cpp
	samples/cpp/tutorial_code/viz/widget_pose.cpp
2014-02-11 12:05:01 +04:00
Martin Dlouhy 47a41449e3 fixed spelling and removed return images 2014-02-10 20:32:54 +01:00
Sven Wehner f7041bacc0 grabcut.py sample: Allow drawing rect from bottom/right
The grabcut sample script isn't able to create rectangles correctly that are
drawn from e.g. bottom-right to top-left.
This small commit uses four min() calls to determine the correct
top-left point of the rectangle.
It also removes some unnecessary white spaces before colons.
2014-02-10 16:53:17 +01:00
Matt Venn 2d33063a59 removed whitespace at end of line 96 2014-02-10 14:51:29 +00:00
Anatoly Baksheev f1c062c30a cloud collection finalize 2014-02-10 15:45:46 +04:00
Anatoly Baksheev 5dc17f5d58 Fixed all OpenGL issues for Macos (via objective-C++ layer) 2014-02-10 15:45:46 +04:00
Anatoly Baksheev 069dd8a068 default meshlab background 2014-02-10 15:45:45 +04:00
Anatoly Baksheev f8ccc115ef proper render call order (fixes some issues with VTK6.1) 2014-02-10 15:45:45 +04:00
Anatoly Baksheev 17fea0dd0a fixed size_t/int conversion warnings 2014-02-10 15:45:45 +04:00
Anatoly Baksheev 998aefd1d1 cloud collection merges data only on rendering 2014-02-10 15:45:44 +04:00
Anatoly Baksheev 975a6299fa More proper OpneCv+Qt+Vtk issues handling (http://code.opencv.org/issues/3492) 2014-02-10 15:45:44 +04:00
Anatoly Baksheev eb8728d727 Updated cloud io functionality - removed dependency from VTK legacy 2014-02-10 15:45:44 +04:00
Roman Donchenko 63dbe66b41 Merge pull request #2308 from jet47:gpu-tests-timeout 2014-02-10 15:10:31 +04:00
Roman Donchenko 3cc27c769c Merge pull request #2309 from Nerei:fixed_cl_exe_hang_with_eigen 2014-02-10 14:59:05 +04:00
Anatoly Baksheev becbfa6281 Fixed Cl.exe hang for VS2008 x64 with Eigen::exp() function 2014-02-10 13:41:27 +04:00
Vladislav Vinogradov 8b44a42a40 decrease input size for several gpu tests to fix "timed out" error:
* BruteForceNonLocalMeans
* OpticalFlowBM
2014-02-10 11:50:14 +04:00
berak 3959329ef4 proper initialization for ccimpl in bool CascadeClassifier::read(const FileNode 2014-02-08 14:42:09 +01:00
Matt Venn 3170414ca8 fixed whitespace 2014-02-07 22:18:59 +00:00
Matt Venn a0bfdb9bf1 fixed examples for opencv 2.4.8 2014-02-07 20:53:57 +00:00
Roman Donchenko 1d68a89947 Merge pull request #2303 from jet47:gpu-canny-fix 2014-02-07 19:03:14 +04:00
Andrey Pavlenko 86b6c48712 Merge pull request #2295 from alalek:opencl_align_rw_buffers 2014-02-07 17:45:15 +04:00
Roman Donchenko 48f95d92ae Merge pull request #2294 from jet47:fix-gpu-issues 2014-02-07 16:54:49 +04:00
Roman Donchenko 8b16b8b657 Merge pull request #2296 from apavlenko:fix_coverity_scan 2014-02-07 16:54:30 +04:00
Vladislav Vinogradov 5dbdadb769 fixed several bugs in CUDA Canny implementation:
* out of border access in edgesHysteresisLocalKernel
* incorrect usage of atomicAdd
2014-02-07 16:04:29 +04:00
Roman Donchenko 5a8363a44e Merge pull request #2301 from jet47:fix-nonfree-build 2014-02-07 15:34:46 +04:00
Roman Donchenko d534d04f25 Merge pull request #2297 from asmorkalov:ocv_testdata_install_perms_fix 2014-02-07 15:33:59 +04:00
Vladislav Vinogradov bfc27271e2 Revert "disable gpu Canny and HoughCircles perf tests:"
This reverts commit dbce90692a.
2014-02-07 14:55:06 +04:00
Alexander Alekhin ce992c8269 ocl: update gftt 2014-02-07 14:51:59 +04:00
Alexander Alekhin e371901dd9 ocl: workaround for failures with misaligned host buffers 2014-02-07 14:51:58 +04:00
Alexander Smorkalov b86088b89c Implicit testdata directory permissions setup added. 2014-02-07 14:42:35 +04:00
Roman Donchenko c1b6bf21d5 Merge pull request #2300 from asmorkalov:android_no_cuda_not_armeabiv7a 2014-02-07 14:39:09 +04:00
Vladislav Vinogradov 3e1f74f2ca fix nonfree module compilation without CUDA 2014-02-07 13:40:37 +04:00
Alexander Smorkalov b10d4b05ed dynamicuda module disabled in OpenCv.mk for all arches except armeabi-v7a. 2014-02-07 12:46:24 +04:00
Andrey Pavlenko 4b31b9cb8c Merge pull request #2251 from ilya-lavrenov:tapi_sqrboxfilter 2014-02-07 11:33:49 +04:00
Gustavo Vargas 44cc51dfb1 Update py_image_display.rst
OS information removed.
2014-02-06 18:21:19 -02:00
Andrey Pavlenko 710d51bb41 Merge pull request #2287 from ilya-lavrenov:mat_step 2014-02-06 21:38:22 +04:00
Andrey Pavlenko 9ff5a24f92 Merge pull request #2289 from ilya-lavrenov:umat_expr 2014-02-06 21:37:57 +04:00
Andrey Pavlenko 38f46eb3b4 fixing issues from coverity scan 1167937, 1167938, 1167939, 1127248 (http://scan.coverity.com/projects/169?tab=Overview) 2014-02-06 21:33:44 +04:00
Ilya Lavrenov 412468e0ae added cv::sqrBoxFilter to T-API 2014-02-06 19:19:18 +04:00
Vladislav Vinogradov 5d099df578 Revert "disable CUDA generalized Hough Transform"
This reverts commit 33d42b740c.
2014-02-06 18:02:14 +04:00
Vladislav Vinogradov 3e4bb371c8 fix epsilons for several gpu tests 2014-02-06 18:02:14 +04:00
Vladislav Vinogradov b6ba1f226c Revert "disable gpu CvtColor.*2HSV tests:"
This reverts commit 952027a853.
2014-02-06 18:02:14 +04:00
Vladislav Vinogradov da44a2fac1 Revert "disable gpu Subtract_Array test:"
This reverts commit e91bf95d58.
2014-02-06 18:02:14 +04:00
Roman Donchenko 7daf26d398 Merge pull request #2269 from Nerei:qt5_vtk_guards 2014-02-06 16:47:15 +04:00
Roman Donchenko 34b02f6437 Merge pull request #2276 from asmorkalov:android_install_cuda 2014-02-06 16:45:49 +04:00
Ilya Lavrenov af0040eab0 condition for Mat step 2014-02-06 15:44:27 +04:00
Alexander Smorkalov 6ae4a9b09b 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.
2014-02-06 15:32:57 +04:00
Roman Donchenko e91b818e3e Merge pull request #2292 from asmorkalov:ocv_deb_tests_script_path_fix 2014-02-06 14:59:31 +04:00
Andrey Pavlenko b6675ee2a8 Merge pull request #2278 from KonstantinMatskevich:ocl_toinputarray 2014-02-06 12:55:04 +04:00
Andrey Pavlenko a078653ab4 Merge pull request #2285 from KonstantinMatskevich:ocl_test_cascade2.4 2014-02-06 12:52:28 +04:00
Alexander Smorkalov 530702c5f2 Absolute path to tests in opencv_run_app_tests.sh fixed. 2014-02-06 12:35:14 +04:00
Roman Donchenko feed2c074d Merge pull request #2288 from asmorkalov:android_project_properties_generation_fix 2014-02-06 12:20:08 +04:00
Gustavo Vargas 390fa14a2a Update py_image_display.rst 2014-02-05 21:25:16 -02:00
Ilya Lavrenov e190d3fd36 added perf test 2014-02-05 20:24:30 +04:00
Ilya Lavrenov 563dc5aa38 implemented umat expressions 2014-02-05 19:23:42 +04:00
Roman Donchenko 721d0145e0 Merge pull request #2002 from abak:stereo_calibrate 2014-02-05 17:47:27 +04:00
Alexander Smorkalov 65b4d77959 project.properties file generation fixed for per-component installation. 2014-02-05 17:34:19 +04:00
Roman Donchenko 9493a4ec4e Merge tag '3.0-ocl-tp2' (-s ours)
OpenCV 3.0 OpenCL Technical Preview 2
2014-02-05 14:00:20 +04:00
Roman Donchenko 9f8de69505 Set status to -tp2. 2014-02-05 13:57:04 +04:00
Konstantin Matskevich bdfa9fa14a fixes2 2014-02-05 13:51:14 +04:00
Andrey Pavlenko 02bf4984cb Merge pull request #2284 from KonstantinMatskevich:ocl_test_cascade 2014-02-05 13:37:06 +04:00
Roman Donchenko 4ab891e9e5 Merge pull request #2277 from asmorkalov:android_test_path_fix 2014-02-05 12:36:37 +04:00
Konstantin Matskevich 435615ba2e update test CascadeClassifier 2014-02-05 12:23:36 +04:00
Konstantin Matskevich 84fa60abb8 update test for cascade 2014-02-05 12:06:48 +04:00
Konstantin Matskevich 1aa83d324b fixed docs2 2014-02-05 11:32:35 +04:00
Andrey Pavlenko e6f3c9b0bf Merge pull request #2281 from vpisarev:ocl_surf 2014-02-05 11:07:19 +04:00
Konstantin Matskevich eb4c2cd59f removed CV_IN/OUT 2014-02-05 10:55:26 +04:00
Konstantin Matskevich a0ccb46a7f fixed docs 2014-02-05 10:49:56 +04:00
Konstantin Matskevich b0f617bc01 fixes 2014-02-05 09:59:04 +04:00
Andrey Pavlenko 055f41c92a Merge pull request #2250 from ilya-lavrenov:tapi_renaming 2014-02-05 09:27:06 +04:00
Ilya Lavrenov 2e8579fe9b cleaned up super_resolution sample from old OCL 2014-02-05 00:28:10 +04:00
Vadim Pisarevsky 3e0c72a8f7 fixed warnings/errors from GCC 2014-02-04 21:50:04 +04:00
Andrey Pavlenko 564f5fcca3 Merge pull request #2280 from ilya-lavrenov:attempt_pvc 2014-02-04 21:22:49 +04:00
Vadim Pisarevsky 092d058d06 fixed warnings from OCL and DOC builders 2014-02-04 21:19:31 +04:00
Andrey Pavlenko b7ffed7b46 Merge pull request #2279 from alalek:fix_memory_leak_getumat 2014-02-04 20:45:27 +04:00
Vadim Pisarevsky 38f5c7140c undone change in ocl.hpp (explicit Image2D constructor) 2014-02-04 20:41:11 +04:00
Vadim Pisarevsky c18d1ee2a9 SURF kind of works (let's see if the tests pass) 2014-02-04 20:00:51 +04:00
Ilya Lavrenov c7fe162829 renamed **2 -> ** 2014-02-04 19:55:11 +04:00
Ilya Lavrenov d957e8e40d attempt to fix pure virtual call in Mat::deallocate 2014-02-04 19:50:37 +04:00
Andrey Pavlenko 42ac3123ec Merge pull request #2192 from alalek:buffer_pool 2014-02-04 19:13:08 +04:00
Roman Donchenko ccda4bf008 Merge pull request #2274 from jet47:android-mk-fix 2014-02-04 18:59:14 +04:00
Alexander Alekhin 83a2b566a3 fix memory leak for Mat::getUMat() operation 2014-02-04 17:25:09 +04:00
Konstantin Matskevich f44334285b features2d 2014-02-04 16:55:07 +04:00
Alexander Alekhin 485635310c core/ocl: OpenCLBufferPool 2014-02-04 16:48:35 +04:00
Andrey Pavlenko 22146e4b18 Merge pull request #2234 from KonstantinMatskevich:ocl_tapi_hog 2014-02-04 16:35:12 +04:00
Andrey Pavlenko bd6620fa87 Merge pull request #2252 from ilya-lavrenov:ocl_ref 2014-02-04 16:34:28 +04:00
Andrey Pavlenko 49db511882 Merge pull request #2268 from ilya-lavrenov:tapi_pow 2014-02-04 16:32:43 +04:00
Andrey Pavlenko 5968b8816e Merge pull request #2275 from ElenaGvozdeva:ocl_matchTemplate 2014-02-04 16:32:11 +04:00
Alexander Smorkalov 0cd0e4749b Tests install path fix for Android SDK. 2014-02-04 16:23:01 +04:00
Konstantin Matskevich c684da3549 drawing 2014-02-04 11:09:29 +04:00
Elena Gvozdeva 85d519b6c3 fixed 2014-02-04 10:54:02 +04:00
Vladislav Vinogradov 286fe261d0 save previous values of LOCAL_* variables and restore them at the end 2014-02-04 10:29:43 +04:00
Vladislav Vinogradov a098fb1803 fix path to CUDA libraries (use targets/armv7-linux-androideabi/lib) 2014-02-04 10:29:15 +04:00
Vadim Pisarevsky 8d5e952263 very preliminary port of SURF to T-API (compiles but certainly does not work) 2014-02-04 03:21:03 +04:00
Ilya Lavrenov da5b316b4e minor ocl.cpp refactoring
fix for cv::LUT and cv::transpose
2014-02-04 01:52:48 +04:00
Andrey Pavlenko 92c8b94ba9 Merge pull request #2265 from vpisarev:ocl_facedetect_amd3 2014-02-04 00:39:09 +04:00
Ilya Lavrenov 98b72ff389 optimized cv::pow for integer power 2014-02-03 22:36:57 +04:00
Andrey Pavlenko 9dede73d9f Merge pull request #2153 from scottbreyfogle:constrained-hough-lines 2014-02-03 17:35:15 +04:00
Andrey Pavlenko 810dc262ad Merge pull request #2196 from KonstantinMatskevich:ocl_bugcautching 2014-02-03 17:32:20 +04:00
Andrey Pavlenko b3a48e1eed Merge pull request #2264 from alalek:bug_fix_3470 2014-02-03 17:31:57 +04:00
Roman Donchenko 109e71e4ef Merge pull request #2263 from ilya-lavrenov:include_fix 2014-02-03 17:25:12 +04:00
Vadim Pisarevsky b5d8f4d5e5 Merge pull request #2031 from berak:b_flann_timer_30 2014-02-03 17:00:21 +04:00
Vadim Pisarevsky 7cfb7bc8cd Merge pull request #2120 from prclibo:master 2014-02-03 16:59:04 +04:00
Konstantin Matskevich 3495c5953c fixes 2014-02-03 16:38:06 +04:00
Vadim Pisarevsky de4b1c668d hopefully fixed compile warnings and the doc builder warnings 2014-02-03 16:36:36 +04:00
Vadim Pisarevsky b8c6adc569 Merge pull request #2178 from Nerei:viz_backport 2014-02-03 16:16:51 +04:00
Roman Donchenko cd1ffd169c Merge pull request #2261 from jet47:stitching-cuda-android 2014-02-03 15:35:55 +04:00
Roman Donchenko 652a0bd5ce Merge pull request #2262 from SpecLad:merge-2.4 2014-02-03 15:33:41 +04:00
Vadim Pisarevsky 11926dafb2 eliminate crash in ipp-accelerated norm and mean functions (thanks to Matt Curfman and Aaron Kunze for the patch) 2014-02-03 15:31:32 +04:00
Vadim Pisarevsky 30593ee55e 3rd attempt to prepare patch with improved OpenCL kernels of CascadeClassifier. 2014-02-03 15:12:27 +04:00
Ilya Lavrenov 9a1e461450 fix for PR 2166 2014-02-03 14:47:32 +04:00
Konstantin Matskevich 5c38519c65 some changes 2014-02-03 14:46:53 +04:00
Konstantin Matskevich 3ea32b87bb perf test 2014-02-03 14:46:52 +04:00
Konstantin Matskevich 9a62df1650 HOG 2014-02-03 14:46:52 +04:00
Alexander Alekhin 91ca834be9 bug fix for issue 3470 2014-02-03 14:46:22 +04:00
Andrey Pavlenko 0fef7f8b96 Merge pull request #2217 from ilya-lavrenov:tapi_superres 2014-02-03 14:38:59 +04:00
Konstantin Matskevich ffeb223150 test for failure 2014-02-03 14:34:02 +04:00
Ilya Lavrenov cc47edb850 more strict checks and reseting state 2014-02-03 14:32:25 +04:00
Konstantin Matskevich aa23a842a1 test for failure 2014-02-03 14:32:25 +04:00
Andrey Pavlenko 13875b5fbc Merge pull request #2257 from ilya-lavrenov:tapi_opencl_game2 2014-02-03 14:26:05 +04:00
Andrey Pavlenko a1ad1f0800 Merge pull request #2259 from ilya-lavrenov:ocl_surf 2014-02-03 14:24:36 +04:00
Andrey Pavlenko a2fcaccf8b Merge pull request #2258 from ilya-lavrenov:tapi_video 2014-02-03 14:17:49 +04:00
Andrey Pavlenko cb1e4b2ede Merge pull request #2256 from ilya-lavrenov:tapi_matchTempl 2014-02-03 14:10:21 +04:00
Roman Donchenko 2bbda9d225 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/cudaimgproc/test/test_color.cpp
	modules/dynamicuda/include/opencv2/dynamicuda/dynamicuda.hpp
	modules/gpu/perf/perf_imgproc.cpp
	modules/gpu/src/imgproc.cpp
	modules/gpu/test/test_core.cpp
	modules/gpu/test/test_imgproc.cpp
	modules/java/generator/src/cpp/VideoCapture.cpp
	samples/gpu/performance/CMakeLists.txt
	samples/tapi/CMakeLists.txt
2014-02-03 13:23:59 +04:00
Vladislav Vinogradov 214cbabc40 update stitching sample 2014-02-03 12:55:03 +04:00
Vladislav Vinogradov a138e5a6a5 turn on CUDA part of stitching module on Android for non-dynamic build 2014-02-03 12:35:24 +04:00
Roman Donchenko 206df7fdb1 Merge pull request #2255 from ilya-lavrenov:ocl_doc 2014-02-03 12:14:14 +04:00
Roman Donchenko 82330a51bd Merge pull request #2253 from ilya-lavrenov:cuda 2014-02-03 12:12:12 +04:00
Roman Donchenko c967069922 Merge pull request #2254 from ilya-lavrenov:opengl 2014-02-03 12:11:28 +04:00
Vladislav Vinogradov d8f7377122 turn on CUDA part of nonfree module on Android for non-dynamic build 2014-02-03 11:52:43 +04:00
Ilya Lavrenov ede5b23753 rewrote perf tests for SURF 2014-02-03 02:00:29 +04:00
Ilya Lavrenov e844c08203 some fixes and improvements in cv::matchTemplate 2014-02-02 19:20:37 +04:00
Ilya Lavrenov 31b7cdc695 implemented OpenCL version of cv::updateMotionHistory 2014-02-02 17:52:57 +04:00
Anatoly Baksheev 1f5007f106 modified viz module header layout for 2.4 compatibility 2014-02-02 16:23:34 +04:00
Anatoly Baksheev 0a870faf28 added guard against linking qt5 and VTK together 2014-02-02 16:23:33 +04:00
Ilya Lavrenov 19f799ba1e fix2 for OpenCL on/off 2014-02-02 15:35:13 +04:00
Ilya Lavrenov 02692f9ac0 fix MACRO 2014-02-01 22:43:41 +04:00
Andrey Pavlenko 75dde49b64 Merge pull request #2230 from ilya-lavrenov:tapi_openc_on-off_game 2014-02-01 22:32:39 +04:00
Ilya Lavrenov f8dd9960af one more ocl deletion 2014-02-01 21:50:14 +04:00
Ilya Lavrenov 66b2acc8ee removed ocl from allmodules list 2014-02-01 20:55:50 +04:00
Ilya Lavrenov ec3eb14138 unused function in case of unavailable OpenGL 2014-02-01 18:14:10 +04:00
Ilya Lavrenov a6104bd025 fixed unused function in case of unavailable CUDA 2014-02-01 18:11:45 +04:00
Ilya Lavrenov 6ad4823f0c ported superres to T-API 2014-02-01 17:20:18 +04:00
Scott Breyfogle aaa9be7c65 Merge remote-tracking branch 'original/master' into constrained-hough-lines 2014-01-31 14:27:51 -08:00
Scott Breyfogle b074c67a56 Add static cast to hough lines 2014-01-31 14:26:45 -08:00
Roman Donchenko 2bef73c968 Merge pull request #2249 from jet47:gpu-tests-disable 2014-01-31 20:49:05 +04:00
Roman Donchenko a518d7a1cb Merge pull request #2248 from jet47:gpu-npp-disable 2014-01-31 20:48:52 +04:00
Roman Donchenko 9ef8aeadd3 Merge pull request #2247 from jet47:gpu-test-cufft 2014-01-31 20:48:38 +04:00
Andrey Pavlenko 983799d398 Merge pull request #2219 from ilya-lavrenov:createHanningWindow 2014-01-31 19:38:57 +04:00
Ilya Lavrenov 0ebb3ab0ea optimized createHanningWindow 2014-01-31 19:35:12 +04:00
Andrey Pavlenko c909a21035 Merge pull request #2219 from ilya-lavrenov:createHanningWindow 2014-01-31 19:25:29 +04:00
Andrey Pavlenko 25d2ab8a68 Merge pull request #2218 from alalek:fix_defects_code_coverity 2014-01-31 19:23:02 +04:00
Andrey Pavlenko 6925dbd9f9 Merge pull request #2216 from ElenaGvozdeva:ocl_MOG2 2014-01-31 19:22:38 +04:00
Andrey Pavlenko 5894f82f14 Merge pull request #2202 from ilya-lavrenov:tapi_GFTTDetector 2014-01-31 19:22:18 +04:00
Andrey Pavlenko b0befeb1b3 Merge pull request #2232 from ilya-lavrenov:ABF_drop 2014-01-31 19:17:16 +04:00
Ilya Lavrenov c01e8e9361 removed ABF 2014-01-31 19:15:40 +04:00
Andrey Pavlenko 2c35438771 Merge pull request #2228 from ilya-lavrenov:tapi_experiments 2014-01-31 19:14:19 +04:00
Andrey Pavlenko 09b55a77c8 Merge pull request #2243 from ilya-lavrenov:ocl2trash 2014-01-31 19:08:27 +04:00
Andrey Pavlenko 82bab2b03b Merge pull request #2236 from ilya-lavrenov:tapi_boxfilter 2014-01-31 19:04:49 +04:00
Andrey Pavlenko 0b57d3717f Merge pull request #2244 from ilya-lavrenov:tapi_device_cache 2014-01-31 19:04:30 +04:00
Andrey Pavlenko b104b04d53 Merge pull request #2245 from ilya-lavrenov:redundant_sync 2014-01-31 19:04:07 +04:00
Andrey Pavlenko e8d66f5cb7 Merge pull request #2246 from alalek:intersection_loop_bug 2014-01-31 18:58:01 +04:00
Roman Donchenko e2db68f822 Merge pull request #2242 from jet47:gpu-test-fix 2014-01-31 17:24:21 +04:00
Vladislav Vinogradov 952027a853 disable gpu CvtColor.*2HSV tests:
possible bug in CPU version
2014-01-31 16:20:45 +04:00
Vladislav Vinogradov e91bf95d58 disable gpu Subtract_Array test:
possible bug in CPU version
2014-01-31 16:15:11 +04:00
Vladislav Vinogradov dbce90692a disable gpu Canny and HoughCircles perf tests:
it fails because driver terminates CUDA kernels after time out
2014-01-31 16:14:07 +04:00
Vladislav Vinogradov e630be3890 disable NPP for GpuMat methods and for copyMakeBorder 2014-01-31 15:52:06 +04:00
Vladislav Vinogradov 8401ed9395 disable some gpu tests if library was built without CUFFT 2014-01-31 15:40:59 +04:00
Roman Donchenko 7161b5bbad Merge pull request #2241 from asmorkalov:ocv_highgui_test_output_fix 2014-01-31 14:56:10 +04:00
Alexander Alekhin 9300af90cd imgproc/intersection: fix loop index 2014-01-31 14:42:38 +04:00
Ilya Lavrenov d15bf6261a redundant clFinish in upload since clEnqueueWriteBuffer above is already blocked 2014-01-31 14:39:03 +04:00
Roman Donchenko 7e6293d9ec Merge pull request #2240 from jet47:gpu-generalized-hough 2014-01-31 14:24:04 +04:00
Ilya Lavrenov 50cf152977 cached commonly used device properties 2014-01-31 14:00:05 +04:00
Roman Donchenko b13d4bafa8 Merge pull request #2238 from asmorkalov:ocv_test_package_reports 2014-01-31 13:56:48 +04:00
Ilya Lavrenov 0f168936a0 OCL module 2 trash 2014-01-31 13:19:16 +04:00
Vladislav Vinogradov 49731ad530 gpu test output files moved from cwd to temp folder 2014-01-31 13:19:15 +04:00
Alexander Smorkalov 3d261e8a01 Reports path fix for opencv_run_all_tests.sh.in script. 2014-01-31 13:17:12 +04:00
Roman Donchenko 9041c31813 Merge pull request #2223 from cosminBoaca:add_prob_result_bayes_classifier 2014-01-31 12:49:19 +04:00
Alexander Smorkalov 87935f3560 Highgui test output fixes.
Useless output to console fixed;
Test output files moved from cwd to temp folder.
2014-01-31 12:49:10 +04:00
Vladislav Vinogradov 063d8b4211 disable performance test for gpu generalized hough 2014-01-31 12:40:40 +04:00
Roman Donchenko 1f3206af70 Merge pull request #2237 from ivylee:lbph_chi_square_alt 2014-01-31 12:22:24 +04:00
Elena Gvozdeva 69630ee9d9 fixed test 2014-01-31 10:46:29 +04:00
Ilya Lavrenov 68f5dd4170 simplified cv::boxFilter OpenCL impl 2014-01-31 01:53:38 +04:00
Ivy Lee b7f2b671a2 Fixed Bug #3514 Incorrect Chi-Square distance used in LBPH FaceRecognizer 2014-01-30 21:53:05 +00:00
Cosmin Boaca f756171f7b Fixed alignment 2014-01-30 16:43:56 +02:00
Cosmin Boaca 8782eb8657 Fixed alignment 2014-01-30 16:41:38 +02:00
Cosmin Boaca b90f82e61f Merge branch 'add_prob_result_bayes_classifier', remote-tracking branch 'upstream/master' into add_prob_result_bayes_classifier 2014-01-30 16:38:15 +02:00
U-WBI\nlv20442 be7eb72051 some fixes 2014-01-30 14:50:35 +01:00
Andrey Pavlenko 77bbd65fa6 Merge pull request #2220 from ilya-lavrenov:tapi_accumulate 2014-01-30 17:33:06 +04:00
Andrey Pavlenko 66cc440c82 Merge pull request #2226 from ilya-lavrenov:tapi_calcHist 2014-01-30 17:28:43 +04:00
Ilya Lavrenov 1ab1594d00 workaround 2014-01-30 17:26:56 +04:00
Cosmin Boaca 2cd22a3ca3 Fixed broken alignment 2014-01-30 13:37:53 +02:00
Cosmin Boaca e6f86ea39d Merge branch 'add_prob_result_bayes_classifier', remote-tracking branch 'upstream/master' into add_prob_result_bayes_classifier 2014-01-30 13:32:32 +02:00
Ilya Lavrenov 372cdac07c moved kernelToStr to ocl.hpp 2014-01-30 15:23:11 +04:00
U-WBI\nlv20442 d950adc0d2 function code 2014-01-30 10:51:12 +01:00
unknown 14b1e8c7f1 New KNN code -should compile now 2014-01-30 10:47:12 +01:00
Roman Donchenko d14e007fdb Merge pull request #2231 from asmorkalov:android_toolchain_update 2014-01-30 13:22:11 +04:00
Ilya Lavrenov 231bc17de7 added conditional compilation 2014-01-30 13:07:13 +04:00
Roman Donchenko 40f6f679b8 Merge pull request #2224 from SpecLad:obsolete-immediate 2014-01-30 12:43:51 +04:00
Roman Donchenko 2b3013fd20 Merge pull request #2229 from ilya-lavrenov:possible_memory_leak 2014-01-30 12:23:20 +04:00
Alexander Smorkalov c815043607 Android toolchain file sync with original project.
Original project: https://github.com/taka-no-me/android-cmake/
Revision: 5db45cfb87fec180b74963d3680dd60d4d8d8c3a
2014-01-30 11:08:49 +04:00
Ilya Lavrenov 1862dbc5ab fixed fp problem 2014-01-30 05:48:15 +04:00
Ilya Lavrenov 0d19cbcc7a added performance test 2014-01-30 02:01:38 +04:00
Ilya Lavrenov 86353eb541 fix for PR 2196 2014-01-30 01:47:25 +04:00
Ilya Lavrenov e7e63fac6c eliminated possible memory leak 2014-01-30 01:21:04 +04:00
Ilya Lavrenov 6d64907f18 async 2014-01-30 00:19:18 +04:00
Ilya Lavrenov 6fa41c5a64 some experiments 2014-01-30 00:12:59 +04:00
Ilya Lavrenov faa6074f3d added performance test 2014-01-29 20:34:37 +04:00
Ilya Lavrenov 384a28622d added cv::calcHist to T-API (only for CV_8UC1 with 256 bins) 2014-01-29 20:19:15 +04:00
Alexander Alekhin 6fa49f6e80 fix unintialized fields 2014-01-29 19:59:03 +04:00
Alexander Alekhin f91f55927e fix memory management problem 2014-01-29 19:59:01 +04:00
Roman Donchenko 0dad2876e2 Removed all use of the obsolete IMMEDIATE parameter to configure_file.
It's not documented, and it does nothing unless CMake 2.0 compatibility
is enabled (and it isn't):

https://github.com/Kitware/CMake/blob/v2.6.0/Source/cmConfigureFileCommand.cxx
2014-01-29 19:34:02 +04:00
Roman Donchenko afa62c4161 Merge pull request #2212 from SpecLad:hog-sample-const-mat 2014-01-29 17:20:25 +04:00
Roman Donchenko 9b9eadc941 Merge pull request #2214 from cosminBoaca:add_returnDFVal_parallel_predict 2014-01-29 17:12:48 +04:00
Roman Donchenko 5ae9add102 Merge pull request #2221 from asmorkalov:ocv_test_install_custom 2014-01-29 17:09:28 +04:00
Alexander Smorkalov d45350a06a opencv_run_all_tests.sh script added to -tests package. 2014-01-29 16:31:24 +04:00
Cosmin Boaca 97092e31bc Added result_probabilities parameter to CvNormalBayesClassifier::predict method. Issue #3401 2014-01-29 13:57:51 +02:00
Elena Gvozdeva 96b6f338e1 fixed 2014-01-29 14:27:29 +04:00
Ilya Lavrenov 7c96d98a24 implemented OpenCL version of cv::accumulate**** 2014-01-29 11:42:46 +04:00
Elena Gvozdeva 17c6b4d306 fixed warnings 2014-01-29 11:05:05 +04:00
Ilya Lavrenov 41bc5808c0 optimized createHanningWindow 2014-01-28 23:37:20 +04:00
Alexander Alekhin 5474935a81 fixes for defects from code coverity 2014-01-28 20:24:10 +04:00
Roman Donchenko 3e59ddbace Merge pull request #2215 from asmorkalov:ocv_testpack_fix 2014-01-28 17:51:07 +04:00
Alexander Smorkalov d9dc5ffa91 Multiple fixes for tests deb package build.
Added opencv_testing.sh.in file;
opencv_testing.sh installation guarded by OS check.
2014-01-28 16:32:26 +04:00
Andrey Pavlenko fff5a6c058 Merge pull request #2213 from ilya-lavrenov:tapi_buildPyramid 2014-01-28 16:31:30 +04:00
Elena Gvozdeva 0edd0aaf69 fixed 2014-01-28 16:23:39 +04:00
Elena Gvozdeva 1391ca1da5 Added ocl_Mog2 2014-01-28 16:23:38 +04:00
Cosmin Boaca 3985980b2f Added returnDFVal parameter to parallel CvSVM::predict function 2014-01-28 11:54:39 +02:00
Roman Donchenko 84c29745f2 Merge pull request #2211 from SpecLad:merge-2.4 2014-01-28 12:44:29 +04:00
Roman Donchenko 7a0a9d010b Merge pull request #2205 from jet47:bug-3477-fix 2014-01-28 12:23:32 +04:00
Andrey Pavlenko 51aa649499 Merge pull request #2097 from pclove1:blur_border_isolated 2014-01-28 10:51:11 +04:00
Vladislav Vinogradov c41e8006c7 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.
2014-01-28 10:28:00 +04:00
Seunghoon Park eb9d7c4dd5 fixing bug #3345. use norm to make sure two matrices are the same. 2014-01-27 20:57:40 -05:00
Seunghoon Park 73389b2b9c Merge branch '2.4' into blur_border_isolated 2014-01-27 20:44:03 -05:00
Roman Donchenko 452ea4c15f Merge pull request #2209 from asmorkalov:ocv_test_install 2014-01-27 20:59:53 +04:00
Andrey Pavlenko 6deda99f07 Merge pull request #2207 from ilya-lavrenov:tapi_macro 2014-01-27 18:56:06 +04:00
Ilya Lavrenov 78c2b3ca2a refactored imgproc 2014-01-27 18:47:16 +04:00
Alexander Smorkalov 39201e68e2 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.
2014-01-27 18:47:09 +04:00
Ilya Lavrenov 48a084c236 OpenCL version of cv::buildPyramid 2014-01-27 18:42:44 +04:00
Andrey Pavlenko d9b24457fa Merge pull request #2208 from alalek:ocl_dynload_warn 2014-01-27 18:24:14 +04:00
Roman Donchenko 6a511755b2 Fixed build for samples/cpp/train_HOG.cpp.
get_hogdescriptor_visu is passed img->clone(), which is not usable
as a non-const reference (and it doesn't modify the argument, anyway).
2014-01-27 17:39:33 +04:00
Andrey Pavlenko ce48b6afde Merge pull request #2203 from ilya-lavrenov:tapi_umat_vectors 2014-01-27 16:06:12 +04:00
Andrey Pavlenko 4dd805b7a9 Merge pull request #2206 from ilya-lavrenov:ocl_warn_fix 2014-01-27 16:05:54 +04:00
Alexander Smorkalov f332cba14b OpenCV C/C++/OCL/CUDA samples install path fixed. Install rools for tests added. 2014-01-27 15:49:24 +04:00
Roman Donchenko bbc35d609d Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	cmake/OpenCVDetectPython.cmake
	cmake/OpenCVModule.cmake
	modules/core/src/gpumat.cpp
	modules/cudaimgproc/test/test_hough.cpp
	modules/gpu/CMakeLists.txt
	modules/gpu/src/cuda/generalized_hough.cu
	modules/gpu/src/generalized_hough.cpp
	modules/python/CMakeLists.txt
2014-01-27 15:28:14 +04:00
Alexander Alekhin 1ff9a8ef52 core/ocl: added warning about incompatible configuration 2014-01-27 13:52:52 +04:00
Ilya Lavrenov c8f2050cc2 warn fix 2014-01-27 12:34:30 +04:00
Ilya Lavrenov 321782b9b7 added macro with ability of returning values 2014-01-27 12:32:26 +04:00
Ilya Lavrenov f767077a41 fixed condition 2014-01-27 12:00:53 +04:00
Ilya Lavrenov 2dd294cc84 fixed cv::split; enabled test 2014-01-27 12:00:53 +04:00
Ilya Lavrenov fa5492343a added STD_VECTOR_UMAT support to _OutputArray::create 2014-01-27 11:59:59 +04:00
Andrey Pavlenko 06acf7090c Merge pull request #2027 from AD-530:brief_cl 2014-01-27 09:49:46 +04:00
Anatoly Baksheev 3dc2dbc17e VTK off by default 2014-01-26 14:48:29 +04:00
Andrey Pavlenko a64d3c1744 Merge pull request #2155 from vbystricky:ocl_calcOpticalFlowPyrLK 2014-01-25 17:08:07 +04:00
Andrey Pavlenko 1db8aa8628 Merge pull request #2204 from ilya-lavrenov:tapi_stitch_perf_fix 2014-01-25 16:54:00 +04:00
Andrey Pavlenko 3f61007563 Merge pull request #2191 from ilya-lavrenov:tapi_macro 2014-01-25 16:32:54 +04:00
Ilya Lavrenov 9968197ebf doc fix 2014-01-25 14:44:28 +04:00
Ilya Lavrenov 7184925105 fix 2014-01-25 11:50:28 +04:00
Ilya Lavrenov e559256719 added cv::GFTTDetector 2014-01-25 00:23:59 +04:00
Ilya Lavrenov 7f785e0a11 refactored core using new macro 2014-01-24 23:59:00 +04:00
vbystricky bb09d44e0a Unused code removed 2014-01-24 17:37:54 +04:00
vbystricky 27fb7e1802 Change type of result vector of ocl version from row to column 2014-01-24 17:37:53 +04:00
vbystricky 094bc92318 Fix build error 2014-01-24 17:37:53 +04:00
vbystricky a7e5a488a8 Change method of setting arguments to kernel to safe one 2014-01-24 17:37:52 +04:00
vbystricky e96ba8140c Grow up epsilon for sanity checks 2014-01-24 17:37:52 +04:00
vbystricky 3a798a27e5 Add perfomance test 2014-01-24 17:37:52 +04:00
vbystricky ece635bf3c Fix builds errors 2014-01-24 17:37:51 +04:00
vbystricky 3ba6636651 Fix builds errors 2014-01-24 17:37:51 +04:00
vbystricky 33fc46cdec Validate parameters for using OpenCL version, before upload UMat 2014-01-24 17:37:50 +04:00
vbystricky 4152135e63 Fix error with some opencl functions on the build WITH_OPENCL=OFF 2014-01-24 17:37:50 +04:00
vbystricky c57e427fba Move OpticalFlowPyrLK from ocl module to video module 2014-01-24 17:37:50 +04:00
Andrey Pavlenko ac3f06bc7f Merge pull request #2149 from ElenaGvozdeva:ocl_matchTemplate 2014-01-24 17:33:06 +04:00
Ilya Lavrenov cc514ac7a9 added new macros useful for tracking whether OpenCL impl run or not 2014-01-24 17:16:40 +04:00
Andrey Pavlenko 22c804d97c Merge pull request #2182 from KonstantinMatskevich:ocl_tapi_samples 2014-01-24 17:03:42 +04:00
Andrey Pavlenko 5424c55565 Merge pull request #2142 from KonstantinMatskevich:ocl_tapi_bfmatcher 2014-01-24 16:50:03 +04:00
Andrey Pavlenko b0caa588ec Merge pull request #2190 from KonstantinMatskevich:ocl_dumpinfo 2014-01-24 16:44:19 +04:00
Konstantin Matskevich c7a6537b83 add brackets 2014-01-24 16:35:51 +04:00
Andrey Pavlenko d093cb54d5 Merge pull request #2194 from apavlenko:2.4_perf_haar_iter 2014-01-24 16:13:19 +04:00
Matti Picus 64fd54ffb4 fix tiled read for reading tiles into partial blocks in image 2014-01-24 13:03:47 +02:00
Roman Donchenko 24caa80143 Merge pull request #2197 from asmorkalov:ocv_packaging2 2014-01-24 14:27:44 +04:00
Konstantin Matskevich ae827a638c fixes 2014-01-24 14:01:31 +04:00
Konstantin Matskevich 07778e1760 fixes 2014-01-24 13:37:19 +04:00
Konstantin Matskevich 450ea3131f samples 2014-01-24 12:59:19 +04:00
Alexander Smorkalov 086792ec06 Improvements in package build. 2014-01-24 12:00:44 +04:00
Elena Gvozdeva 07a88d48e9 fixed 2014-01-24 11:41:23 +04:00
Andrey Pavlenko 0a4a1d7526 temporary disabling hanging test 2014-01-24 10:07:21 +04:00
Roman Donchenko 078d49609e Merge pull request #2193 from apavlenko:2.4_lic_remove 2014-01-23 17:13:52 +04:00
Andrey Pavlenko dca5684145 removing duplicated legacy license, the actual instance is in 'opencv/LICENSE' 2014-01-23 17:05:20 +04:00
Anatoly Baksheev 9145985ff4 added guard to prevent linking VTK with Qt5 2014-01-23 16:40:24 +04:00
Elena Gvozdeva 4d86804f11 Fixed merge conflicts 2014-01-23 15:31:32 +04:00
Elena Gvozdeva 7bd8f9294d fixed 2014-01-23 14:50:30 +04:00
Elena Gvozdeva 8c5e19c270 fixed pref test 2014-01-23 14:50:29 +04:00
Elena Gvozdeva b4652e2cb3 Added perf test for ocl_matchTemplate 2014-01-23 14:50:29 +04:00
Elena Gvozdeva 2c0765b4d1 fixed trailing whitespace 2014-01-23 14:50:29 +04:00
Elena Gvozdeva 7e2bdb590f fixed 2014-01-23 14:50:29 +04:00
Elena Gvozdeva 4da1ba56b3 fixed 2014-01-23 14:50:29 +04:00
Elena Gvozdeva 47b572f99f fixed 2014-01-23 14:50:28 +04:00
Elena Gvozdeva da4d33ec26 Fixed test_match_template 2014-01-23 14:50:28 +04:00
Elena Gvozdeva 9de70c9a00 Fixed trailing whitespace 2014-01-23 14:50:28 +04:00
Elena Gvozdeva ba5d480f80 Fixed warnings 2014-01-23 14:50:28 +04:00
Elena Gvozdeva 86636dc265 Added ocl_matchTemplate( without dft) 2014-01-23 14:50:28 +04:00
Andrey Pavlenko ee88cc2c52 Merge pull request #2110 from hmax:master 2014-01-23 14:37:34 +04:00
Roman Donchenko 7ff9d7eb2d Merge pull request #2188 from jet47:gpumat-copyto-fix 2014-01-23 13:28:12 +04:00
Roman Donchenko 3715f71aaf Merge pull request #2175 from vrabaud:2.4 2014-01-23 13:27:38 +04:00
Konstantin Matskevich 133f91f3f2 added perf test 2014-01-23 07:51:19 +04:00
Andrey Pavlenko ba77719914 Merge pull request #2189 from ilya-lavrenov:tapi_sepFilter2D_fix 2014-01-22 19:13:05 +04:00
Andrey Pavlenko 7ce6c28bb4 Merge pull request #2186 from ilya-lavrenov:tapi_precornerdetect 2014-01-22 19:09:34 +04:00
Andrey Pavlenko 9aa4410509 Merge pull request #2134 from vbystricky:ocl_calcOpticalFlowFarneback 2014-01-22 18:57:34 +04:00
Vincent Rabaud 167a26642e fix message sent to user during cross_compilation 2014-01-22 15:26:14 +01:00
Konstantin Matskevich f90e41d54e dumpinfo 2014-01-22 17:04:44 +04:00
Konstantin Matskevich 2f8c29a1f0 removed unnecessary functions and variables 2014-01-22 15:31:27 +04:00
Konstantin Matskevich 3b7683e72f fixed docs 2014-01-22 15:31:26 +04:00
Konstantin Matskevich ca5689e0db BFMatcher
match

radiusMatch
2014-01-22 15:31:26 +04:00
Ilya Lavrenov d2ffd8ed21 implemented OpenCL version of cv::preCornerDetect 2014-01-22 13:46:26 +04:00
Ilya Lavrenov 059e6e4305 fixed cv::sepFilter2D 2014-01-22 13:40:48 +04:00
Roman Donchenko ee331001f5 Merge pull request #2161 from SpecLad:doc-req 2014-01-22 12:04:48 +04:00
Roman Donchenko a4b34e7ae1 Merge pull request #2181 from asmorkalov:ocv_packaging 2014-01-22 11:54:07 +04:00
Vladislav Vinogradov dda999545c fix GpuMat::copyTo method with mask:
fill destination matrix with zeros if it was reallocated
2014-01-22 10:40:14 +04:00
vbystricky e0c6377d58 Change the sanity checking type to ERROR_RELATIVE 2014-01-22 10:34:27 +04:00
Andrey Pavlenko 069bb9a929 Merge pull request #2185 from ilya-lavrenov:tapi_corners 2014-01-22 10:25:41 +04:00
Andrey Pavlenko 665d9cb29c Merge pull request #2168 from ilya-lavrenov:tapi_perf_stitching 2014-01-22 10:14:38 +04:00
Andrey Pavlenko 5d818c010e Merge pull request #2156 from ilya-lavrenov:tapi_reduce 2014-01-22 10:12:08 +04:00
Andrey Pavlenko 1400f53436 Merge pull request #2184 from ilya-lavrenov:bioinspired2contrib 2014-01-21 23:27:16 +04:00
Andrey Pavlenko 99942e8043 Merge pull request #2166 from ilya-lavrenov:tapi_gftt 2014-01-21 22:29:41 +04:00
Alexander Smorkalov 7821fe2bde Initial Linux packages build rools for CPack. 2014-01-21 20:34:36 +04:00
Alexander Smorkalov b75cbfde45 All installed files marked with component names for install customization. 2014-01-21 20:34:36 +04:00
Ilya Lavrenov 3177a683e9 ported corners to T-API 2014-01-21 20:13:55 +04:00
Roman Donchenko a548a08129 Merge pull request #2183 from jet47:cuda-hough-fix 2014-01-21 19:27:54 +04:00
Andrey Pavlenko c8afe7efc6 Merge pull request #1320 from mbarnach:svm_hog 2014-01-21 19:23:04 +04:00
Andrey Pavlenko 4fbd2ef87a Merge pull request #1290 from mbarnach:bow_desc 2014-01-21 19:22:47 +04:00
Andrey Pavlenko 32bc89f094 Merge pull request #2107 from nghiaho12:nn_doc 2014-01-21 19:11:12 +04:00
Ilya Lavrenov 303c37a175 removed TOC 2014-01-21 18:47:22 +04:00
vbystricky c1172b83dd Change epsilon value to 0.01 2014-01-21 18:46:26 +04:00
Ilya Lavrenov 5d206059a8 moved bioinspired to opencv_contrib 2014-01-21 18:02:53 +04:00
Andrey Pavlenko 9eca3ec8f6 Merge pull request #2177 from ilya-lavrenov:ocl_superres 2014-01-21 17:05:50 +04:00
Vladislav Vinogradov 33d42b740c disable CUDA generalized Hough Transform 2014-01-21 15:07:47 +04:00
Vladislav Vinogradov d847387694 split CUDA Hough sources 2014-01-21 15:07:47 +04:00
Ilya Lavrenov bfa382cf9d fixed copying UMat -> std::vector 2014-01-21 14:37:22 +04:00
Ilya Lavrenov ae4be413c3 added perf tests for cv::reduce 2014-01-21 14:18:38 +04:00
Vincent Rabaud eabcfa5652 reorder the if's for clarity 2014-01-21 10:27:37 +01:00
Ilya Lavrenov ac2e613975 skip OCL tests if OpenCL isn't available 2014-01-21 13:09:39 +04:00
Vincent Rabaud 6cb90c0e97 fix cross-compilation issue with Numpy 2014-01-21 10:07:19 +01:00
Anatoly Baksheev 130914d9f4 fixed documentation warnings 2014-01-21 02:15:37 +04:00
Andrey Pavlenko 494f7e3657 Merge pull request #2158 from KonstantinMatskevich:testdata_path_calib3d 2014-01-20 23:35:06 +04:00
Andrey Pavlenko 801d2d0a32 Merge pull request #2167 from ilya-lavrenov:tapi_kern_warn 2014-01-20 23:33:55 +04:00
Anatoly Baksheev 02ebc4368c Viz initial backport, compilation fixes, moved viz/viz.hpp header according to 2.4 style 2014-01-20 22:51:33 +04:00
Roman Donchenko 64244e160b Merge pull request #2171 from djetter99:fix_static_init_order 2014-01-20 19:30:29 +04:00
Roman Donchenko a509819b21 Merge pull request #2163 from ilya-lavrenov:tapi_channels 2014-01-20 18:48:52 +04:00
Ilya Lavrenov e5130cf83f enabled tests 2014-01-20 18:09:43 +04:00
Roman Donchenko 9710b25c7d Merge pull request #2173 from Nerei:viz 2014-01-20 18:05:11 +04:00
Roman Donchenko 9dc93ce328 Merge pull request #2176 from SpecLad:merge-2.4 2014-01-20 18:04:56 +04:00
Anatoly Baksheev ac035b9b8e review comments 2014-01-20 15:22:58 +04:00
Andrey Pavlenko 69ba0c53ad Merge pull request #2165 from ilya-lavrenov:tapi_upload 2014-01-20 15:18:56 +04:00
Roman Donchenko e45fd939c2 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/ocl/src/cl_runtime/cl_runtime.cpp
	modules/ocl/src/cl_runtime/clamdblas_runtime.cpp
	modules/ocl/src/cl_runtime/clamdfft_runtime.cpp
	modules/ocl/src/cl_runtime/generator/template/clamdblas_runtime.cpp.in
	modules/ocl/src/cl_runtime/generator/template/clamdfft_runtime.cpp.in
2014-01-20 15:10:19 +04:00
Roman Donchenko 087371c021 Merge pull request #2164 from ilya-lavrenov:excess_commas_semicolons_v2 2014-01-20 14:15:05 +04:00
Ilya Lavrenov 5abfd40989 added perf test for cv::goodFeaturesToTrack 2014-01-20 13:57:53 +04:00
Ilya Lavrenov 52ed6d0d27 ported cv::goodFeaturesToTrack to T-API 2014-01-20 13:57:53 +04:00
Ilya Lavrenov 5d18cf9989 added cv::[extract|insert]Channel to T-API 2014-01-20 13:52:07 +04:00
Roman Donchenko 8386ce2b2f Merge pull request #2160 from SpecLad:norm-assert 2014-01-20 12:20:21 +04:00
Roman Donchenko d47f32581c Merge pull request #2174 from Nerei:yet_another_fix_for_pr2172 2014-01-20 12:06:44 +04:00
Anatoly Baksheev 4cc8f7012b closing window 2014-01-19 18:39:01 +04:00
Anatoly Baksheev 4e18007066 fixed white spaces 2014-01-19 18:39:01 +04:00
Anatoly Baksheev d29c3d2f0d fixed documentation warnings 2014-01-19 18:39:00 +04:00
Anatoly Baksheev 8f15a8abdb disabled Ubuntu workaround code for Windows 2014-01-19 18:39:00 +04:00
Anatoly Baksheev 0d12fb0346 implemented workaround of a problem with x-server for ubuntu 2014-01-19 18:39:00 +04:00
Anatoly Baksheev 7410593d55 fixed warnigns and compiler errors for Ubuntu 2014-01-19 18:39:00 +04:00
Anatoly Baksheev d7ca0bb757 merged background color with background gradient methods, updated tests to show description of scene 2014-01-19 18:38:59 +04:00
Anatoly Baksheev 16281027af resolved problem with multiple spin()/spinOnce() 2014-01-19 18:38:59 +04:00
Anatoly Baksheev 57d5ad5131 minor iteractor refactoring 2014-01-19 18:38:59 +04:00
Anatoly Baksheev ffad7b699c added test for textured mesh 2014-01-19 18:38:59 +04:00
Anatoly Baksheev 8d327fa497 updated for compatibility with VTK6.0 2014-01-19 18:38:58 +04:00
Anatoly Baksheev e472d45d99 updated mesh reading (texture support) 2014-01-19 18:38:58 +04:00
Anatoly Baksheev 625c35a9f9 added support of texture for mesh 2014-01-19 18:38:58 +04:00
Anatoly Baksheev 74206e0159 added painted cloud widget 2014-01-19 18:38:57 +04:00
Anatoly Baksheev 3086095837 improved background gradient 2014-01-19 18:38:57 +04:00
Anatoly Baksheev b0ca93b22c by default enabled tests vtk 2014-01-19 18:38:57 +04:00
Anatoly Baksheev d7c30281a5 set background texture method 2014-01-19 18:38:57 +04:00
Anatoly Baksheev e2ef558c8a refactored WGrid 2014-01-19 18:38:56 +04:00
Anatoly Baksheev 658f4a7d38 refactoed plane 2014-01-19 18:38:56 +04:00
Anatoly Baksheev 53b8218652 addeed test for text 2d/3d 2014-01-19 18:38:56 +04:00
Anatoly Baksheev bb891f0570 added cone implementation 2014-01-19 18:38:56 +04:00
Anatoly Baksheev 08f50314cb updated cylinder and cube 2014-01-19 18:38:55 +04:00
Anatoly Baksheev c0cc551228 refactored circle 2014-01-19 18:38:55 +04:00
Anatoly Baksheev dac27c9913 refactored arrow 2014-01-19 18:38:55 +04:00
Anatoly Baksheev 1449823bcd implemented showImage 2014-01-19 18:38:55 +04:00
Anatoly Baksheev d90a068e0e fixed bug with setImage 2014-01-19 18:38:54 +04:00
Anatoly Baksheev cad9a786c4 optimized Mat to vtkImageData conversion 2014-01-19 18:38:54 +04:00
Anatoly Baksheev e21f2a81ff factored camera postions with image 2014-01-19 18:38:54 +04:00
Anatoly Baksheev a23f1447a8 minor 2014-01-19 18:38:53 +04:00
Anatoly Baksheev f930f2f19d simplification of cloud collection 2014-01-19 18:38:53 +04:00
Anatoly Baksheev e3ff28dacc refactored WImage3D 2014-01-19 18:38:53 +04:00
Anatoly Baksheev f37c31742a created tests for images, created vtk/vtkImageMatSource, and switched all images to that class 2014-01-19 18:38:53 +04:00
Anatoly Baksheev 462d516743 added test for camera positions, slightly refactored the widgets 2014-01-19 18:38:52 +04:00
Anatoly Baksheev 8309d19f31 renamed Mesh3d -> Mesh 2014-01-19 18:38:52 +04:00
Anatoly Baksheev d591bd875b fixed crash in enabling shading for polydata widgets 2014-01-19 18:38:52 +04:00
Anatoly Baksheev e478d6b1e9 renamed cv::viz::get() to getWindowByName() 2014-01-19 18:38:52 +04:00
Anatoly Baksheev 25b417e8b2 added test for trajectories and fixed bug with float type 2014-01-19 18:38:51 +04:00
Anatoly Baksheev 64566e6178 minor 2014-01-19 18:38:51 +04:00
Anatoly Baksheev 0d702b83f4 updated code to use mapper->SetInput instead of SetInputConnection. All widgets except plane, images ans texts 2014-01-19 18:38:51 +04:00
Anatoly Baksheev a3b1f29d23 refactored spheres trajectory 2014-01-19 18:38:51 +04:00
Anatoly Baksheev 38c9fa4a92 more refactoring 2014-01-19 18:38:50 +04:00
Anatoly Baksheev 4833976a0c refactored frustum trajectory to use glyphs 2014-01-19 18:38:50 +04:00
Anatoly Baksheev 42dc90295d refactored camera position - simplified frustum creation 2014-01-19 18:38:50 +04:00
Anatoly Baksheev 45879fb9db more refactoring 2014-01-19 18:38:50 +04:00
Anatoly Baksheev a8556134ae refactored simple trajectory to use TensorGlyph 2014-01-19 18:38:49 +04:00
Anatoly Baksheev 771d9509a8 polyline now uses scalars for color data (for reuse by other widgets) 2014-01-19 18:38:49 +04:00
Anatoly Baksheev e94ee94be3 refactored WCoordinateSystem widget 2014-01-19 18:38:49 +04:00
Anatoly Baksheev 56819eaf19 switched completer API to doubles, updated docs 2014-01-19 18:38:48 +04:00
Anatoly Baksheev d264465422 more refactoring 2014-01-19 18:38:48 +04:00
Anatoly Baksheev 406444037d refactored polyline 2014-01-19 18:38:48 +04:00
Anatoly Baksheev b100299644 code beatification 2014-01-19 18:38:48 +04:00
Anatoly Baksheev e26b7e1e4f ported some trajectories functionality to InputArray style 2014-01-19 18:38:47 +04:00
Anatoly Baksheev 7b28f730f4 traits for Affine3 2014-01-19 18:38:47 +04:00
Anatoly Baksheev cd57c4e189 refactored CloudNormals and added test for it 2014-01-19 18:38:47 +04:00
Anatoly Baksheev b7cb3fe8e0 switched more to doubles 2014-01-19 18:38:47 +04:00
Anatoly Baksheev a76a34d28e added Affine3: 3x4 input Mat support 2014-01-19 18:38:46 +04:00
Anatoly Baksheev 3e071491c9 added Affine3 ctor from array 2014-01-19 18:38:46 +04:00
Anatoly Baksheev baee8c3aa5 refactored Mesh, added tests, added failing "twice spin()" test 2014-01-19 18:38:46 +04:00
Anatoly Baksheev 70a81db567 fixed bugs in cloud collection and added test 2014-01-19 18:38:46 +04:00
Anatoly Baksheev cb58061649 getViewerPose implementation simplified (and error seems to be fixed) 2014-01-19 18:38:45 +04:00
Anatoly Baksheev 186853a50f mass switch from Affine3f to Affine3d 2014-01-19 18:38:45 +04:00
Anatoly Baksheev b1c0bf1fee Affine::rotate(rvec) method 2014-01-19 18:38:45 +04:00
Anatoly Baksheev 1615527426 switched source to InputArrays 2014-01-19 18:38:45 +04:00
Anatoly Baksheev f610c295f2 more tests 2014-01-19 18:38:44 +04:00
Anatoly Baksheev e7791e1590 colors minor 2014-01-19 18:38:44 +04:00
Anatoly Baksheev c1b41caa7c added vtkCloudMatSink, reworked cloud IO functions, added normals support 2014-01-19 18:38:44 +04:00
Anatoly Baksheev 1c4cfd8eaf normals support for CloudMatSource 2014-01-19 18:38:43 +04:00
Anatoly Baksheev 7e952e2f10 removed incorrect and unnecessarily methods from Affine3f 2014-01-19 18:38:43 +04:00
Anatoly Baksheev bf30c33e6e getting data from opencv_extra 2014-01-19 18:38:43 +04:00
Anatoly Baksheev b131faa8f9 export scene to vrml and obj formats 2014-01-19 18:38:43 +04:00
Anatoly Baksheev b2cd526e6a removed extra code 2014-01-19 18:38:42 +04:00
Anatoly Baksheev 84d6fe397d reading/writing clouds functionality 2014-01-19 18:38:42 +04:00
Anatoly Baksheev 80ab6e889f refactoring 2014-01-19 18:38:42 +04:00
Anatoly Baksheev 7dbf6bc8df rewrote cloud widget in vtk filters style
Conflicts:
	modules/viz/src/clouds.cpp
2014-01-19 18:38:42 +04:00
Anatoly Baksheev 159de9cc47 fixed potential crash 2014-01-19 18:38:41 +04:00
Anatoly Baksheev 2705068290 refactored Keyboard and Mouse Events 2014-01-19 18:38:41 +04:00
Anatoly Baksheev cad2f98007 removed vizActor (since unnecessarily in new design concept with simplified widgets) 2014-01-19 18:38:41 +04:00
Anatoly Baksheev 45aeecb043 renaming 2014-01-19 18:38:41 +04:00
Anatoly Baksheev abc9465798 kinect camera CAD parameters 2014-01-19 18:38:40 +04:00
Anatoly Baksheev e990d5b999 reading/writing trajectories 2014-01-19 18:38:40 +04:00
Anatoly Baksheev e048df51ce for shapes switched vtkDataSetMapper to more efficient vtkPolyDataMapper 2014-01-19 18:38:40 +04:00
Anatoly Baksheev 4979f44cfa minor 2014-01-19 18:38:40 +04:00
Anatoly Baksheev 31d42ce18f refactored Trajectory: split into Trajectory and TrajectoryFrustums) 2014-01-19 18:38:39 +04:00
Anatoly Baksheev 54fa69cab2 renamed Spheres Trajectory, minor changes in Trajectory 2014-01-19 18:38:39 +04:00
Anatoly Baksheev c7ff13873d minor 2014-01-19 18:38:39 +04:00
Anatoly Baksheev f6e9b81188 reduced exported interface names (to make IntelliSense hints less littered) 2014-01-19 18:38:38 +04:00
Anatoly Baksheev 44c1d4dfdc allow fast switch between actors (except mesh, cloud, cloud collection) 2014-01-19 18:38:38 +04:00
Anatoly Baksheev 2d63f60d43 minor changes, opencv cross-branch code 2014-01-19 18:38:38 +04:00
Anatoly Baksheev 15fd3faa40 support gray color clouds 2014-01-19 18:38:38 +04:00
Anatoly Baksheev 2cbfb04144 viz: rich set of named colors 2014-01-19 18:38:37 +04:00
Anatoly Baksheev 5ea3ecdc3b horisontal mwhell support 2014-01-19 18:32:22 +04:00
Ilya Lavrenov 3db33979e1 added perf tests for stitching warpers 2014-01-19 12:01:01 +04:00
Ilya Lavrenov 5af2e6f1c9 removed useless CRC calculation 2014-01-19 11:57:50 +04:00
Andrey Pavlenko f60f8a7346 Merge pull request #2172 from Nerei:compilation_and_warnings 2014-01-19 11:44:37 +04:00
Drew Jetter 6bf599b1bc 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. 2014-01-18 23:04:16 -07:00
Anatoly Baksheev 4e20e06ee7 warnings 2014-01-19 04:07:24 +04:00
Anatoly Baksheev 0fc4ac4f1f warnings and compilation with installed Windows 8.1 SDK 2014-01-19 04:07:17 +04:00
Ilya Lavrenov 6b8bee6e0b fixed kernel compilation warnings 2014-01-18 22:37:47 +04:00
Matthias Bady d270c9e8b6 Type conversions to fix warnings 2014-01-18 11:12:13 +01:00
Matthias Bady 67e2d7ec43 Merge branch 'master' of https://github.com/Itseez/opencv into brief_cl 2014-01-18 10:38:07 +01:00
Ilya Lavrenov 37789f015a deleted excess semicolons, commas 2014-01-18 01:31:33 +04:00
Roman Donchenko e965f3d3d4 Merge pull request #2157 from k0da:master 2014-01-17 19:00:19 +04:00
Roman Donchenko 0de799b3b0 Removed some duplicate assertions. 2014-01-17 18:25:28 +04:00
Roman Donchenko 088535fa56 Merge pull request #2159 from SpecLad:1xN 2014-01-17 18:23:53 +04:00
Roman Donchenko 79fcc06a4b Merge pull request #2146 from SpecLad:merge-2.4 2014-01-17 16:28:30 +04:00
vbystricky f1541b5287 Add perfomance test 2014-01-17 16:15:39 +04:00
vbystricky fc8b385ff6 Return false if ocl version not properly worked 2014-01-17 16:15:38 +04:00
vbystricky 3762036b08 Fix compiler warnings. Add additional test case for UseInitFlow 2014-01-17 16:15:38 +04:00
vbystricky 3b0fa68a97 Move OpticalFlowFarneback from ocl module to video module 2014-01-17 16:15:38 +04:00
Roman Donchenko 659c5345d9 Merge pull request #2122 from adishavit:feature-HandleMouseWheel 2014-01-17 14:58:28 +04:00
Roman Donchenko 58afe5dd17 Merge pull request #2140 from Daniil-Osokin:fix_saving_untrained_svm_model 2014-01-17 14:57:57 +04:00
Andrey Pavlenko 664c9b15cf Merge pull request #2152 from ilya-lavrenov:tapi_canny 2014-01-17 14:52:17 +04:00
Roman Donchenko a502ffbd2c Updated required CMake version in docs to match reality. 2014-01-17 14:50:40 +04:00
Roman Donchenko e9805e444f Fixed an overly-narrow assertion in cv::norm.
size() requires that the matrix is two-dimensional, and norm()
works on higher dimensions.
2014-01-17 14:49:42 +04:00
Roman Donchenko 5f8d8c0069 Added a test for matrix-to-vector copy and convert. 2014-01-17 14:18:31 +04:00
Roman Donchenko 4e4a7d0353 Removed an unnecessary workaround for matrix-to-vector copyTo. 2014-01-17 14:16:22 +04:00
Roman Donchenko ee97a5e757 Re-fix bug #3319 with less side effects. 2014-01-17 14:13:21 +04:00
Roman Donchenko f02204847a Revert "fixed bug #3319"
See 092f916 for explanation.

This reverts commit 4f9c081dc3.
2014-01-17 13:43:00 +04:00
Konstantin Matskevich e9e9e00d45 replaced sprintf with cv::format 2014-01-17 13:01:12 +04:00
Roman Donchenko 092f916db9 Revert 4f9c081
That commit introduces problems, as it breaks certain use cases of
OpenCV functions; for example, convertTo of an Nx1 matrix to an
std::vector.

Since vectors can't store separate width and height values, OpenCV
considers them to always be 1xN. So even though the vector is created with
.create(N, 1), the Mat passed to getContinousSize has dimensions 1xN,
and the size comparison fails, even though the operation itself is safe.

This is a use case we probably don't want to break, at the very least
for backwards compatibility. So I'm reverting the commit. This will also
unfix bug #3319; I'll submit a less intrusive solution as a PR to 2.4, which
will also revert 4f9c081 there.
2014-01-17 12:51:52 +04:00
Ilya Lavrenov 93a818684c ported cv::Canny to T-API 2014-01-17 11:13:28 +04:00
Andrey Pavlenko 8dbc96fed8 Merge pull request #2143 from Daniil-Osokin:fix_docs_cvt_color_alpha_channel 2014-01-17 10:43:40 +04:00
Dinar Valeev 711f07a34c Use __vector instead of vector as suggests Eigen
This fixes build on PowerPC where Eigen unsets vector, bool and pixel

Signed-off-by: Dinar Valeev <dvaleev@suse.com>
2014-01-16 21:53:49 +01:00
Ilya Lavrenov 63a5e39e2c added cv::reduce to T-API 2014-01-17 00:41:18 +04:00
Daniil Osokin 8ce691e679 Fixed cvtColor alpha channel docs 2014-01-16 18:36:06 +04:00
Adi Shavit 8fd0fd538d Doc fix. 2014-01-16 16:30:54 +02:00
Roman Donchenko 07e08f7a3d Merge pull request #2141 from ilya-lavrenov:perf_warp 2014-01-16 18:03:21 +04:00
Roman Donchenko 63c61b4b98 Revert "replaced sprintf with cv::format"
Fixing build breakage.

This reverts commit b83eff7ecf.
2014-01-16 17:58:26 +04:00
Roman Donchenko ddfd1854a7 Merge pull request #2151 from KonstantinMatskevich:testdata_path_calib3d 2014-01-16 16:44:24 +04:00
Konstantin Matskevich b83eff7ecf replaced sprintf with cv::format 2014-01-16 16:18:02 +04:00
Adi Shavit 46f06d82c9 Update docs. 2014-01-16 12:51:14 +02:00
Adi Shavit 8802d62cc5 Updated docs. 2014-01-16 11:25:57 +02:00
Nick D'Ademo 75b80e5d7d Added missing comma in enum. 2014-01-16 20:17:49 +11:00
Adi Shavit 24333569aa Small fixes: typo, spacing and using ::ScreenToClient() instead of ::GetWindowRect() 2014-01-16 11:09:25 +02:00
Roman Donchenko b0af6a2b58 Merge pull request #2127 from apavlenko:perf_cascades 2014-01-16 12:37:02 +04:00
Scott Breyfogle 0ea454301f Added optional constraints to non-probablistic hough lines functions 2014-01-15 13:22:56 -08:00
Ilya Lavrenov 82d3efc6c0 added perf test for cv::Canny 2014-01-15 20:06:24 +04:00
Konstantin Matskevich ab18c2d132 changed testdata path for calib3d 2014-01-15 15:08:09 +04:00
Andrey Pavlenko a164381cc6 Merge pull request #2150 from ilya-lavrenov:tapi_cvtcolor 2014-01-15 13:45:28 +04:00
Seunghoon Park 2272a58769 fixing bug #3345. don't use BORDER_ISOLATED alone. it should be combined with some border type 2014-01-14 20:47:23 -05:00
Adi Shavit e45cf2173f [HighGUI] Updated mouse wheel delta to reside within the 'flags' variable. Updated C++ API. 2014-01-14 21:33:32 +02:00
Adi Shavit fecd5c994b Added support for mouse-wheel events on Windows.
To be used in the mouse callback like this:
    if (CV_EVENT_MOUSEWHEEL == CV_GET_MOUSEWHEEL_EVENT(event))
    {
       int delta= CV_GET_WHEEL_DELTA(event);
       // use delta...
    }
2014-01-14 21:20:05 +02:00
Adi Shavit 9dc0bfc755 Small fix for extracting mouse coordinates on Windows, in a way that will always work with multiple monitors.
This is the way recommended by Microsoft.
2014-01-14 21:20:04 +02:00
Andrey Pavlenko c7d90c8b32 adding old cascade 2014-01-14 23:15:50 +04:00
Andrey Pavlenko 9b7b360bf7 fixing compilation if WITH_OPENCL=OFF 2014-01-14 17:50:00 +04:00
Ilya Lavrenov 7ed692bf92 fixed cv::cvtColor 2014-01-14 16:16:35 +04:00
Nick D'Ademo 25870fa66b Added PVAPI enums to highgui.hpp
Added "PVAPI_" prefix to FrameStartTriggerMode definition
2014-01-14 21:38:57 +11:00
Roman Donchenko 2fde4d8a94 Merge pull request #2145 from andreasBihlmaier:2.4 2014-01-14 11:55:29 +04:00
Roman Donchenko fee2ed37fc Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/contrib/src/retina.cpp
	modules/core/include/opencv2/core/mat.hpp
	modules/core/src/algorithm.cpp
	modules/core/src/arithm.cpp
	modules/features2d/src/features2d_init.cpp
	modules/gpu/include/opencv2/gpu/gpu.hpp
	modules/gpu/perf/perf_imgproc.cpp
	modules/imgproc/src/generalized_hough.cpp
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/video/src/tvl1flow.cpp
	modules/video/src/video_init.cpp
2014-01-14 11:53:59 +04:00
Andrey Pavlenko fdb1019b9e Merge pull request #2147 from ilya-lavrenov:tapi_sqrt 2014-01-14 11:34:03 +04:00
Matthias Bady 06fb073b8b Merge branch 'master' of https://github.com/Itseez/opencv into brief_cl 2014-01-13 18:14:56 +01:00
Ilya Lavrenov 09bff78d63 deleted extra arg in case of power=0.5 2014-01-13 19:59:10 +04:00
Roman Donchenko 2443e8090e Merge pull request #2133 from apavlenko:2.4-perf_haar 2014-01-13 19:28:09 +04:00
ahb 49dfa5a17f Fix the following error for ocl::getOpenCLPlatforms() on Ubuntu 12.04 with gcc 4.8
OpenCV Error: Unknown error code -6 (OpenCL function is not available: [clGetPlatformIDs]) in opencl_check_fn, file /home/ahb/software/opencv/modules/ocl/src/cl_runtime/cl_runtime.cpp, line 83

The issue results from modules/ocl/src/cl_runtime/cl_runtime.cpp checking for
"linux" instead of "__linux__" (cp.  http://sourceforge.net/p/predef/wiki/OperatingSystems/)

Adjust all other occurrences of "defined(linux)" as well.
2014-01-13 16:09:42 +01:00
Ilya Lavrenov 30b5234e9a added perf test for cv::sqrBoxFilter 2014-01-13 18:51:49 +04:00
Ilya Lavrenov 8702fceb4b fixed cv::integral perf test 2014-01-13 18:36:52 +04:00
Roman Donchenko c3bfe3f33e Merge pull request #2136 from SpecLad:python-ver 2014-01-13 18:17:00 +04:00
Andrey Pavlenko 4c99196399 adding finish() to flush CL queue, renaming the test to match 'master' branch 2014-01-13 18:12:30 +04:00
Ilya Lavrenov a7a7b80ff8 added perf test for cv::Moments 2014-01-13 17:50:14 +04:00
Andrey Pavlenko 520a692fda switching to CL_PERF_TEST_P, adding safeFinish() to flush CL queue 2014-01-13 16:58:36 +04:00
Roman Donchenko 9628abc786 Merge pull request #2137 from ilya-lavrenov:gitignore 2014-01-13 16:33:16 +04:00
Roman Donchenko 85c713b59e Merge pull request #2138 from alekcac:python_tutorial_fix 2014-01-13 16:32:42 +04:00
Roman Donchenko af9cd79e16 Merge pull request #2121 from ilya-lavrenov:tapi_perf 2014-01-13 16:30:33 +04:00
Roman Donchenko 87e0c26129 Merge pull request #2108 from pemmanuelviel:flannMemoryLeak 2014-01-13 16:26:02 +04:00
Ilya Lavrenov 6fb878a65f added perf tests for cv::medianBlur 2014-01-13 15:59:24 +04:00
Max Khardin d8e5f1611b Rewrite definition/declaration of variables to be more compact 2014-01-13 15:55:49 +04:00
Ilya Lavrenov 5e7fd8bd7e added perf tests for cv::morphologyEx 2014-01-13 15:43:09 +04:00
Ilya Lavrenov 5a2a0b326a added perf tests for cv::dilate 2014-01-13 15:30:35 +04:00
Ilya Lavrenov f61597dce8 added perf tests for filters 2014-01-13 15:26:50 +04:00
Ilya Lavrenov 04ae46e21c added perf tests to some imgproc functions 2014-01-13 15:01:52 +04:00
Nick D'Ademo 3cf5c0b991 Added get and set for extra PVAPI property: CV_CAP_PROP_FRAMESTARTTRIGGERMODE 2014-01-13 22:01:09 +11:00
Ilya Lavrenov e76d51511e added perf test for cv::cvtColor, pyr operations 2014-01-13 14:40:42 +04:00
Ilya Lavrenov 4bd4c8d12a added perf tests for cv::blendLinear 2014-01-13 14:06:15 +04:00
Daniil Osokin 5d2edced26 Added throwing exception when saving untrained SVM model 2014-01-13 13:50:30 +04:00
Ilya Lavrenov 6fbaff6d83 added perf tests for T-API warp operations 2014-01-13 13:10:26 +04:00
Andrey Pavlenko a7821c60e5 refactoring the test as it should be in 2.4 2014-01-13 11:20:17 +04:00
Andrey Pavlenko 6071671bda Merge pull request #2135 from alalek:ocl_runtime_cleanup_2 2014-01-11 17:15:22 +04:00
Andrey Pavlenko d64f05cd59 Merge pull request #2112 from ilya-lavrenov:tapi_stitching 2014-01-11 16:39:22 +04:00
Alexander Shishkov e90d0b6e4c changed code in python tutorial, these functions don’t return image 2014-01-11 16:35:41 +04:00
Ilya Lavrenov f197d8b91c updated .gitignore 2014-01-10 18:59:06 +04:00
Ilya Lavrenov da2790249e added NORM_L2SQR type to cv::norm 2014-01-10 18:45:52 +04:00
Ilya Lavrenov 2e5e278271 added cv::PSNR performance test 2014-01-10 18:45:40 +04:00
Ilya Lavrenov a01e81c8f7 added some performance tests 2014-01-10 18:45:40 +04:00
Ilya Lavrenov 1592234f1a added mask support to cv::norm, cv::meanStdDev 2014-01-10 18:45:40 +04:00
Roman Donchenko 9e3673ef53 Don't use PYTHON_VERSION_STRING when searching for Python libraries
It may be an arbitrary string, and, for example, in Ubuntu 13.10
it's set to "2.7.5+", which breaks the find script.
2014-01-10 18:40:47 +04:00
Ilya Lavrenov 7852b2f155 updated docs according to the last changes 2014-01-10 18:19:26 +04:00
Ilya Lavrenov 8f9ccc099b replaced Mat by Input/Output arrays 2014-01-10 18:16:56 +04:00
Ilya Lavrenov 118709fd9f added OpenCL accelerated warpers 2014-01-10 18:16:56 +04:00
Roman Donchenko 5a9900481a Merge pull request #2105 from ilya-lavrenov:norm 2014-01-10 18:12:08 +04:00
Roman Donchenko 890f1baff0 Merge pull request #2132 from ComFreek:patch-2 2014-01-10 11:44:46 +04:00
Alexander Alekhin f7b0940d44 core/ocl: runtime, remove unused declarations 2014-01-10 11:42:02 +04:00
Volodymyr Kysenko 89dd828e3c added test for correct handling of uniforma areas in the MergeMertens 2014-01-09 14:10:00 -08:00
Andrey Pavlenko 4d28e8243c 'master'-like Haar perf test 2014-01-10 00:14:48 +04:00
Andrey Pavlenko 2c0e24e948 adding Haar & LBP cascades perf test using UMat, removing old incomplete test 2014-01-10 00:08:15 +04:00
ComFreek ae795e5797 Corrected package name in tutorial
See also #2101
2014-01-09 17:24:20 +01:00
Ilya Lavrenov dd302158e0 fixed case with zero mask 2014-01-09 19:26:09 +04:00
Andrey Pavlenko a75cfe13e7 Merge pull request #2128 from alalek:ocl_cleanup_runtime 2014-01-09 17:08:48 +04:00
Roman Donchenko 560cfa5672 Merge pull request #2129 from ilya-lavrenov:mix_fix 2014-01-09 17:04:03 +04:00
Roman Donchenko a13e32f5ab Merge pull request #2115 from nghiaho12:kmeans_sample 2014-01-09 16:58:29 +04:00
Roman Donchenko d509165d96 Merge pull request #2118 from ilya-lavrenov:semicolons 2014-01-09 16:21:49 +04:00
Roman Donchenko dfeba1e8dd Merge pull request #2119 from d-schmidt:patch-1 2014-01-09 14:44:07 +04:00
Ilya Lavrenov 9899cf7519 fixed cv::mixChannels perf test 2014-01-09 14:26:44 +04:00
Nghia Ho bf4994554d Removed unecessary initialisation of Mat centers. 2014-01-09 21:04:17 +11:00
Roman Donchenko b45bb60c8b Merge pull request #2126 from yinghau76:master 2014-01-09 14:00:53 +04:00
Ilya Lavrenov 6ee0b6eb56 added mask support to cv::norm, cv::meanStdDev 2014-01-09 13:49:42 +04:00
Alexander Alekhin 70a0327004 core/ocl: cleanup unused files 2014-01-09 13:47:04 +04:00
Roman Donchenko 7acea48788 Merge pull request #2106 from robbertkl:patch-2 2014-01-09 13:25:59 +04:00
Roman Donchenko 58882e5c22 Merge pull request #2114 from kazuki-ma:SparseMat_convertTo_typofix_24 2014-01-09 13:24:20 +04:00
Roman Donchenko cab67cd9ac Merge tag '3.0-ocl-tech-preview' (-s ours) 2014-01-09 12:42:58 +04:00
Roman Donchenko 6d84671e8b Merge pull request #2116 from ilya-lavrenov:tapi_mixchannels_fix 2014-01-09 12:41:57 +04:00
Roman Donchenko ea3dd9d5e7 Merge pull request #2103 from ilya-lavrenov:typo 2014-01-09 12:38:55 +04:00
Roman Donchenko 4e35ebb52f Merge pull request #2102 from Nerei:compilatin_for_windows 2014-01-09 12:35:30 +04:00
Patrick Tsai b24f7ee57c Fix compiler error with Android NDK r8e
Original error without the fix:

opencv/modules/objdetect/src/cascadedetect.cpp: In member function 'bool cv::CascadeClassifierImpl::ocl_detectSingleScale(const cv::_InputArray&, cv::Size, int, double, cv::Size)':
/opencv/modules/objdetect/src/cascadedetect.cpp:1215:
error: no matching function for call to 'cv::ocl::Kernel::args(cv::ocl::KernelArg, cv::ocl::KernelArg, cv::ocl::KernelArg, int, cv::ocl::KernelArg, cv::ocl::KernelArg, cv::ocl::KernelArg, cv::Size&, int&, float, cv::Rect&, cv::Size&, cv::CascadeClassifierImpl::<anonymous enum>)'
2014-01-09 14:49:20 +08:00
Volodymyr Kysenko aa36898024 added epsilon value to weights in the MergeMertens in order to avoid zero weights for pixels from uniformly filled areas of image 2014-01-07 19:38:57 -08:00
Bo Li d155639db5 grammar fix 2014-01-07 09:57:40 +08:00
Bo Li d444af5bb2 updated decomposeEssentialMat doc 2014-01-07 09:54:12 +08:00
David Schmidt ef61964768 Update py_face_detection.rst
bug in example
2014-01-07 00:11:33 +01:00
Ilya Lavrenov 6b9ebcbf3d deleted extra semicolons 2014-01-07 02:52:30 +04:00
Ilya Lavrenov 0119e8553c fixed cv::mixChannels OpenCL version 2014-01-06 14:41:57 +04:00
Nghia Ho 601b7d1dd3 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. 2014-01-06 20:19:07 +11:00
Matthias Bady e17da9a843 merge with upstream 2014-01-05 19:00:25 +01:00
Kazuki Matsuda 2ae20c74a2 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
2014-01-06 02:24:14 +09:00
Max Khardin 699eda46b6 Remove three sneaky tabs 2014-01-04 20:09:30 +08:00
Ilya Lavrenov 3a4d4080f4 fixed overflow for cv::norm NORM_L2 2014-01-04 15:20:50 +04:00
Max Khardin 34b05794d6 Fix source code indents 2014-01-04 19:01:32 +08:00
Max Khardin 214e9d4b12 Add performance tests for elementwise multiplication 2014-01-04 18:56:32 +08:00
Pierre-Emmanuel Viel 3f458c6eb1 Fix: freeing previous elements has to be done before loading new parameters to avoid trying to delete unexisting objects if arrays size was modified 2014-01-03 13:16:36 +01:00
Nghia Ho d3e24f3cbf Improved documentation for neural network 2014-01-03 14:18:07 +11:00
Robbert Klarenbeek e21c6e19db Fix algorithm setter argument validation for uchar 2014-01-02 21:17:55 +01:00
Ilya Lavrenov 0c49360318 fixed typo 2014-01-01 19:41:14 +04:00
Anatoly Baksheev c2dd7fd762 compilation for windows 2014-01-01 15:39:21 +04:00
Roman Donchenko 5327482b46 Merge pull request #2084 from ilya-lavrenov:cont 2013-12-31 16:51:30 +04:00
Vadim Pisarevsky 1c3bfae212 Merge pull request #1957 from Nerei:format_declaration_by_default 2013-12-31 15:55:00 +04:00
Roman Donchenko 984c4d200f Set the version status to "-tp", for "technical preview". 2013-12-31 15:37:47 +04:00
Ilya Lavrenov 4f9c081dc3 fixed bug #3319 2013-12-31 13:56:59 +04:00
Roman Donchenko cd576c7364 Merge pull request #2096 from kamjagin:master 2013-12-31 11:53:25 +04:00
Roman Donchenko 157202fc8d Merge pull request #2094 from SpecLad:multimon-be-gone 2013-12-31 11:40:44 +04:00
pxli168 203a9acdbc Add support to bool type
Add the bool support to the get function
2013-12-31 12:53:31 +08:00
Seunghoon Park b036fc756a fixing bug #3345 2013-12-30 21:10:06 -05:00
Andrey Pavlenko 2d5723ccca Merge pull request #2095 from ilya-lavrenov:tapi_mixchannels_fix 2013-12-31 00:35:39 +04:00
Andrey Pavlenko 967703c3ac Merge pull request #2093 from SpecLad:merge-2.4 2013-12-31 00:26:22 +04:00
Andrey Pavlenko 8a456c5a6b Merge pull request #2073 from KonstantinMatskevich:ocl_tapi_clahe 2013-12-31 00:17:33 +04:00
Miroslav Kobetski 3f07655231 Fix for bug #3469 CV_XADD failing in clang+nvcc combination 2013-12-30 17:00:17 +01:00
Andrey Pavlenko 8151571dd6 Merge pull request #2091 from ilya-lavrenov:tapi_convertScaleAbs 2013-12-30 19:54:27 +04:00
Ilya Lavrenov 3e1bec5248 added OpenCL version of cv::patchNaNs 2013-12-30 19:53:03 +04:00
Ilya Lavrenov a2e683d133 fixed umat access 2013-12-30 19:37:20 +04:00
Roman Donchenko 4ce684e61c Merge pull request #2087 from ilya-lavrenov:remap_sse2_cond 2013-12-30 18:18:42 +04:00
Roman Donchenko 795c108f2b 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.
2013-12-30 18:13:42 +04:00
Roman Donchenko 6811d2ab24 Merge pull request #2086 from ilya-lavrenov:mul_fix 2013-12-30 17:57:43 +04:00
Roman Donchenko 5f9c117d78 Merge pull request #2085 from severin-lemaignan:emscripten 2013-12-30 17:57:00 +04:00
Roman Donchenko 6d4c80083e Merge pull request #2089 from ilya-lavrenov:tapi_examples 2013-12-30 17:42:50 +04:00
Roman Donchenko cdc10defa3 Merge commit '05b9c991dd' into merge-2.4
Conflicts:
	modules/cuda/test/test_objdetect.cpp
	modules/gpu/perf/perf_core.cpp
	modules/gpu/perf/perf_video.cpp
	modules/gpu/test/test_core.cpp
2013-12-30 17:30:59 +04:00
Ilya Lavrenov 5db1754d49 SSE2 optimization of cv::remap doesn't work with big images 2013-12-30 17:13:40 +04:00
Séverin Lemaignan 9e13e3a5a4 [emscripten] Do not link to system libraries
This is not meaningful when compiling to javascript, and causes warning
at linking stage.
2013-12-30 14:04:36 +01:00
Roman Donchenko e33759b358 Merge commit '46be47cb4b8' into merge-2.4 (-s ours) 2013-12-30 16:52:16 +04:00
Roman Donchenko 1312eca220 Merge commit '0566ab4d3d' into merge-2.4
Conflicts:
	modules/core/src/system.cpp
2013-12-30 16:51:46 +04:00
Roman Donchenko 82e2e6dbc3 Merge commit '719149877e' into merge-2.4 (-s ours) 2013-12-30 16:50:09 +04:00
Roman Donchenko 7f795e964f Merge commit 'ee36717d' into merge-2.4 2013-12-30 16:49:39 +04:00
Roman Donchenko 9dfb96389c Merge commit '4b885e206' into merge-2.4 2013-12-30 16:48:45 +04:00
Roman Donchenko d611509842 Merge commit '709e8e8e0' into merge-2.4 2013-12-30 16:48:30 +04:00
Ilya Lavrenov 09d25e11c6 fixed bug #3341 2013-12-30 16:47:54 +04:00
Roman Donchenko 09e154d214 Merge commit '60906d917' into merge-2.4
Conflicts:
	modules/ts/src/cuda_perf.cpp
2013-12-30 16:47:05 +04:00
Roman Donchenko 2cdbf6c0b6 Merge commit '8fe79738c' into merge-2.4 2013-12-30 16:41:10 +04:00
Roman Donchenko 39fb8e03d7 Merge commit 'b94963d38' into merge-2.4
Conflicts:
	cmake/OpenCVGenAndroidMK.cmake
2013-12-30 16:39:51 +04:00
Roman Donchenko ce7a2f7edc Merge commit '24be7b26c' into merge-2.4 (-s ours) 2013-12-30 16:38:52 +04:00
Roman Donchenko 0e552ea6e2 Merge commit '1acc1085d' into merge-2.4 2013-12-30 16:37:39 +04:00
Roman Donchenko 2de4ad0598 Merge commit 'edce617a5' into merge-2.4 (-s ours) 2013-12-30 16:37:26 +04:00
Roman Donchenko 9b7e77ccda Merge commit '83cdd43a' into merge-2.4
Conflicts:
	modules/core/include/opencv2/core/version.hpp
2013-12-30 16:36:35 +04:00
Roman Donchenko 8c589438d1 Merge commit 'f22d9a23' into merge-2.4 (-s ours) 2013-12-30 16:34:59 +04:00
Roman Donchenko a0c98dcefa Merge pull request #2092 from alalek:fix_mingw_warn 2013-12-30 15:34:16 +04:00
Konstantin Matskevich 55634c1f52 fix 2013-12-30 13:06:32 +04:00
Alexander Alekhin 44970ddf56 eliminate MINGW pragma warning 2013-12-30 12:31:00 +04:00
Ilya Lavrenov c4c913ff13 converted CPU-based example to T-API (Mat 2 UMat, etc) 2013-12-30 03:19:17 +04:00
Ilya Lavrenov 6b64257c81 added OpenCL version of cv::scaleAdd 2013-12-29 18:46:25 +04:00
Ilya Lavrenov abcf8d9e61 implemented OpenCL version of cv::convertScaleAbs 2013-12-29 18:01:19 +04:00
Ilya Lavrenov 63e4af8536 added the first T-API example - CamShift tracking 2013-12-29 14:36:59 +04:00
Hilton Bristow 483061e802 explicit string encoding when writing to file in python3 2013-12-29 17:10:52 +10:00
Hilton Bristow 7cad2c6788 fixed relative imports in Jinja for python3 2013-12-29 17:10:52 +10:00
Hilton Bristow 2f45942adc converted necessary files for python3 compatibility using 2to3 2013-12-29 17:10:44 +10:00
Andrey Pavlenko 4a6c2ce378 Merge pull request #2081 from ilya-lavrenov:tapi_perf 2013-12-28 22:06:12 +04:00
Andrey Pavlenko dbaf125fcd Merge pull request #2075 from ilya-lavrenov:tapi_mixchannels 2013-12-28 22:05:49 +04:00
Andrey Pavlenko 0913dd7ffa Merge pull request #2055 from vbystricky:ocl_sepFilter2D 2013-12-27 22:38:08 +04:00
Ilya Lavrenov bb7e96311e disabled cv::split perf test 2013-12-27 21:57:20 +04:00
Roman Donchenko 2d2312d742 Merge pull request #2077 from ilya-lavrenov:tapi_context 2013-12-27 20:23:57 +04:00
Ilya Lavrenov 31e6251793 added new perf tests to core 2013-12-27 20:02:12 +04:00
vbystricky 26d53c7435 Change threshold from 2.0 to 1.0 in the test 2013-12-27 16:26:34 +04:00
vbystricky b719ed79c2 Change sprintf to cv::format, and EXPECT_MAT_NEAR to OCL_EXPECT_MATS_NEAR 2013-12-27 16:21:32 +04:00
Andrey Pavlenko 80816f68f3 Merge pull request #2034 from pentschev:ocl_features2d_orb_master 2013-12-27 15:49:28 +04:00
Andrey Pavlenko 5c25d821b1 Merge pull request #2063 from vpisarev:ocl_moments 2013-12-27 15:44:12 +04:00
Andrey Pavlenko 01cd957495 Merge pull request #2076 from ilya-lavrenov:tapi_dft 2013-12-27 15:38:51 +04:00
Ilya Lavrenov f221f57c7c this commit prevents segfaults in case of opencl disabled 2013-12-27 14:02:03 +04:00
Ilya Lavrenov 73c96cbd50 some fixes of cv::mixChannels 2013-12-27 13:59:55 +04:00
Ilya Lavrenov 2eab07f0a4 disabled cv::dft opencl impl for CPU devices 2013-12-27 13:39:29 +04:00
Ilya Lavrenov 52b8bb6761 fixed getUMatIndex 2013-12-27 13:18:31 +04:00
Ilya Lavrenov a7d2830d3f added cv::mixChannels to T-API 2013-12-27 13:14:37 +04:00
Konstantin Matskevich a70a8e8680 CLAHE 2013-12-27 10:12:22 +04:00
Peter Andreas Entschev 07c5e33023 OCL: included ORB featured detector/descriptor extractor. 2013-12-26 22:36:24 -02:00
Pierre-Emmanuel Viel 9cb48606ba Merge remote-tracking branch 'upstream/2.4' into LshOrthogonalSubvectors 2013-12-27 00:19:37 +01:00
Pierre-Emmanuel Viel 8e93c19de3 Fix a heap issue with static on Windows 2013-12-26 23:46:52 +01:00
Vadim Pisarevsky 48c7378c8f improved performance of moments (on 720p or larger images) 2013-12-26 23:29:04 +04:00
Pierre-Emmanuel Viel e85bacff7b Avoid obtaining several identical dimensions between two LSH sub-vectors by choosing orthogonal sub-vectors. 2013-12-26 19:44:23 +01:00
Vadim Pisarevsky e97dd57dc7 hopefully fixed test failures and complains from the doc builder 2013-12-26 22:00:29 +04:00
Andrey Pavlenko 4644a864a5 Merge pull request #2065 from ilya-lavrenov:tapi_calcBackProject 2013-12-26 20:37:34 +04:00
Andrey Pavlenko fd6a74496b Merge pull request #2066 from ilya-lavrenov:tapi_ocl 2013-12-26 19:38:01 +04:00
Andrey Pavlenko a981295524 Merge pull request #2028 from KonstantinMatskevich:ocl_tapi_morphology 2013-12-26 19:20:12 +04:00
Ilya Lavrenov b23edc34e9 added cv::calcBackProject for 2-dimensional histograms 2013-12-26 19:17:32 +04:00
Pierre-Emmanuel Viel 112d63ae96 Add a new method for initializing KMeans centers that leads to better clusters and thus better retrieval when final centers have to be existing keypoints instead of clusters barycenters. 2013-12-26 16:15:35 +01:00
Andrey Pavlenko c8a52daafd Merge pull request #2054 from alalek:ocl_tapi_dev_selection 2013-12-26 17:27:06 +04:00
Konstantin Matskevich ca9810e8aa hope last fix 2013-12-26 17:16:55 +04:00
Ilya Lavrenov 5b3520fa46 fixed warning [ -Wreorder ] 2013-12-26 17:14:20 +04:00
Ilya Lavrenov fc1f9ab236 removed unnecessary data copying 2013-12-26 17:13:26 +04:00
Ilya Lavrenov d64bea00b2 ported cv::calcBackProject to T-API 2013-12-26 14:58:50 +04:00
ytxie 3d3b310ae1 Fix the bug 3440. 2013-12-26 17:54:05 +08:00
Vadim Pisarevsky a760c454dd tuned the speed for OpenCL-based moments (still slower than the single-thread SSE2 CPU code :( ) 2013-12-26 13:25:00 +04:00
Konstantin Matskevich 52df2b346b not synchronous kernel's run 2013-12-26 10:45:09 +04:00
Konstantin Matskevich 7a186c72e1 some fixes 2013-12-26 09:55:18 +04:00
Konstantin Matskevich f55c85fed3 morphology 2013-12-26 09:55:17 +04:00
Alexander Alekhin 217b2282b8 fixes 2013-12-26 03:06:58 +04:00
Vadim Pisarevsky 83f749afd2 moments work now and work more or less fast 2013-12-26 02:57:08 +04:00
Andrey Pavlenko 65b020f0d3 Merge pull request #2046 from ilya-lavrenov:tapi_inrange 2013-12-26 00:14:23 +04:00
Andrey Pavlenko 6e8386f705 Merge pull request #1984 from ilya-lavrenov:tapi_perf 2013-12-26 00:13:28 +04:00
Andrey Pavlenko 1aaeea9941 Merge pull request #2053 from KonstantinMatskevich:ocl_bugfix_eqhist 2013-12-26 00:05:13 +04:00
Vadim Pisarevsky 6035925f41 experimental moments implementation (does not work yet) 2013-12-25 21:09:23 +04:00
Andrey Pavlenko 512ddcc804 Merge pull request #2043 from ilya-lavrenov:tapi_hack 2013-12-25 19:00:26 +04:00
Andrey Pavlenko 9ec4c20280 Merge pull request #2042 from vpisarev:ocl_facedetect8 2013-12-25 19:00:06 +04:00
Ilya Lavrenov 4c23059209 added cv::inRange to T-API 2013-12-25 18:22:41 +04:00
Ilya Lavrenov d7c22343aa added perf tests for T-API core functions 2013-12-25 18:19:40 +04:00
vbystricky 9e05d18d42 Fix compilation warnings 2013-12-25 18:05:07 +04:00
vbystricky 35dc26e0b9 Add ocl implementation of the sepFilter2D into img_proc module. 2013-12-25 16:48:32 +04:00
Roman Donchenko faddd5b97f Merge pull request #2045 from SpecLad:merge-2.4 2013-12-25 16:18:00 +04:00
Alexander Alekhin e49065b1dc core/ocl: temporary move device selection from ocl module 2013-12-25 16:17:40 +04:00
Konstantin Matskevich 9d04a7aba9 bugfix in equalizeHist 2013-12-25 15:16:26 +04:00
Matthias Bady 928924d248 Merge branch 'master' of https://github.com/Itseez/opencv into brief_cl 2013-12-23 19:47:06 +01:00
Ilya Lavrenov a70467d7a2 removed unnecessary assert 2013-12-23 21:51:25 +04:00
Vadim Pisarevsky bc730292bb workaround for some strange bug on old Mac. 2013-12-23 21:29:31 +04:00
Andrey Pavlenko 0966e5ffa1 Merge pull request #2033 from ilya-lavrenov:tapi_normalize 2013-12-23 19:19:00 +04:00
Ilya Lavrenov e3d23918fa added cv::normalize to T-API; implemented missed UMat::copyTo with mask 2013-12-23 19:17:35 +04:00
Andrey Pavlenko 6a2fb8e5d1 Merge pull request #2041 from ilya-lavrenov:tapi_mul_div 2013-12-23 19:09:59 +04:00
Roman Donchenko 3c4b24d531 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	CMakeLists.txt
	modules/highgui/src/cap.cpp
	modules/nonfree/src/surf.ocl.cpp
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/src/color.cpp
	modules/ocl/src/gftt.cpp
	modules/ocl/src/imgproc.cpp
	samples/ocl/facedetect.cpp
2013-12-23 18:50:17 +04:00
Vadim Pisarevsky 8998186ce4 removed extra whitespaces and hopefully fixed the test failures 2013-12-23 18:41:54 +04:00
Vadim Pisarevsky d084d19779 added OpenCL optimization for LBP-based face detector 2013-12-23 15:28:50 +04:00
Andrey Pavlenko 06e981f1ce Merge pull request #2035 from ilya-lavrenov:tapi_CamShift 2013-12-23 13:00:22 +04:00
Ilya Lavrenov febb200eee fixed cv::multuply, cv::divide 2013-12-22 15:49:36 +04:00
Ilya Lavrenov 6083efc111 refactored cv::CamShift and cv::meanShift 2013-12-21 14:40:59 +04:00
Andrey Pavlenko b29835a8f8 Merge pull request #2030 from LeszekSwirski:fix-imgproc-ipp 2013-12-20 21:39:10 +04:00
Andrey Pavlenko a49211a77e Merge pull request #2032 from ilya-lavrenov:tapi_mulSpectrums 2013-12-20 21:38:14 +04:00
Ilya Lavrenov c33a7cd7bf added cv::mulSpectrums to T-API 2013-12-20 18:41:20 +04:00
Vadim Pisarevsky 1540910542 started adding OpenCL acceleration of LBP-based object detectors 2013-12-20 18:39:35 +04:00
berak 2bb3de5aa0 core/utility.hpp missing in flann/timer.h 2013-12-20 14:58:21 +01:00
Andrey Pavlenko 14782194f4 Merge pull request #1995 from akarsakov:ocl_pyramids 2013-12-20 17:57:09 +04:00
Roman Donchenko b0ec7dafd8 Merge pull request #1950 from GregoryMorse:patch-2 2013-12-20 17:54:02 +04:00
Leszek Swirski 9c22d4887c imgproc: IPP compilation fix and minor cleanup 2013-12-20 12:40:40 +00:00
Matthias Bady a032d947b4 Fixed doc 2013-12-20 11:45:07 +01:00
Matthias Bady 9b0a9f2a24 moved documentation of BriefDescriptorExtractor to correct place 2013-12-20 10:57:48 +01:00
Matthias Bady 6e4715309b added documentation 2013-12-20 10:53:21 +01:00
Roman Donchenko b4bd5bab6d Merge pull request #2021 from vpisarev:ocl_facedetect7 2013-12-20 12:30:49 +04:00
Pierre-Emmanuel Viel d3ac1bc314 When a cluster is empty for KMeans, it's better to give it the point from another cluster j that is the furthest one from center j. 2013-12-20 01:00:55 +01:00
Matthias Bady 74dfa668e2 added tests 2013-12-20 00:05:50 +01:00
Andrey Pavlenko cdffa05c27 Merge pull request #2019 from ilya-lavrenov:tapi_repeat 2013-12-19 19:28:58 +04:00
Alexander Karsakov febe528363 Added ocl::pyrUp to T-API 2013-12-19 17:21:50 +04:00
Vadim Pisarevsky 242a3d1f19 2 more fixes to calm down the doc builder 2013-12-19 16:57:02 +04:00
Andrey Pavlenko dde1d6b636 Merge pull request #2018 from ilya-lavrenov:tapi_dft 2013-12-19 16:47:19 +04:00
Vadim Pisarevsky f41f633d2d fixed various warnings from the “doc” and other builders 2013-12-19 16:31:30 +04:00
Vadim Pisarevsky a1784b7320 converted old haar cascades to the new format; added the conversion function; added OpenCL optimization into CascadeClassfier; optimized the data structures and CPU code for the stump case. 2013-12-19 14:48:42 +04:00
Vadim Pisarevsky ec3f22cee2 renamed OpenCL kernel filename; made some final changes 2013-12-19 14:29:28 +04:00
Ilya Lavrenov b3af0e3154 added cv::repeat to T-API 2013-12-19 14:28:09 +04:00
Vadim Pisarevsky b7553d4e2e some attempts to tune the performance 2013-12-19 14:09:44 +04:00
Alexander Karsakov ac230cd2ae Added ocl::pyrDown to T-API 2013-12-19 13:56:42 +04:00
Ilya Lavrenov c8cbfe5382 added cv::dft T-API test 2013-12-19 13:42:16 +04:00
Matthias Bady 545f02679a Optimized version. Faster than CPU 2013-12-19 01:54:57 +01:00
Matthias Bady 69d034ecdf Naive impl. Slower than CPU 2013-12-19 00:15:53 +01:00
Pierre-Emmanuel Viel 0d19685f95 Move templates in dist.h in order to share them between KMeansIndex and HierarchicalClusteringIndex classes. 2013-12-18 20:48:34 +01:00
Pierre-Emmanuel Viel fa749de0dc As some processed distances are already ^2, use template to select whether or not we have to ^2 in KMeanspp 2013-12-18 20:48:25 +01:00
Pierre-Emmanuel Viel 5aeeaa6fce Apply to KMeansIndex KMeanspp the same modification as in HierarchicalClusteringIndex 2013-12-18 20:48:15 +01:00
Pierre-Emmanuel Viel 45e0e5f8e9 Pick centers in KMeans++ with a probability proportional to their distance^2, instead of simple distance, to previous centers 2013-12-18 20:48:02 +01:00
Andrey Pavlenko 2431c72d1d Merge pull request #2000 from apavlenko:license_copyright 2013-12-18 19:35:04 +04:00
Andrey Pavlenko 96f8ff2ab8 adding LICENSE file and a sample of its reference in ocl.hpp 2013-12-18 19:33:25 +04:00
Andrey Pavlenko 59cab94fc7 Merge pull request #1997 from alalek:tapi_fix_memleaks 2013-12-18 13:53:17 +04:00
Andrey Pavlenko 388d0ef182 Merge pull request #2004 from ilya-lavrenov:tapi_umat_copyto 2013-12-18 13:46:14 +04:00
Vadim Pisarevsky 02fb3f0a77 it finally works!!! 2013-12-17 20:55:49 +04:00
Andrey Pavlenko bd91b39593 Merge pull request #1917 from alalek:ocl_d3d 2013-12-17 16:44:27 +04:00
Andrey Pavlenko 586a5cb6db Merge pull request #1969 from KonstantinMatskevich:ocl_tapi_minmaxloc 2013-12-17 16:42:44 +04:00
Andrey Pavlenko 6a0fb2c7da Merge pull request #1992 from ElenaGvozdeva:ocl_medianFilter 2013-12-17 16:42:16 +04:00
Andrey Pavlenko d3fa2bfe8c Merge pull request #1998 from ilya-lavrenov:tapi_gemm 2013-12-17 16:41:59 +04:00
Ilya Lavrenov ac030c16f1 fixed UMat::copyTo(UMat) 2013-12-17 15:23:39 +04:00
Vadim Pisarevsky ef509ace43 trying to debug the new cascade 2013-12-17 14:51:22 +04:00
Vadim Pisarevsky 9d3e7e027a almost finished opencl-ization of cascade classifier 2013-12-17 14:29:30 +04:00
Roman Donchenko 6d77cbee7e Merge pull request #1934 from vbystricky:ocl_boxFilter 2013-12-17 14:11:51 +04:00
Roman Donchenko e49b8dee40 Merge pull request #1881 from pentschev:defaultNorm_master 2013-12-17 13:53:59 +04:00
Roman Donchenko 52a785e95a Merge pull request #1996 from SpecLad:merge-2.4 2013-12-17 13:21:48 +04:00
Roman Donchenko 0cf7607338 Merge pull request #1993 from StevenPuttemans:feature_2862 2013-12-17 13:19:59 +04:00
Konstantin Matskevich 5cf4166801 some fixes 2013-12-17 12:43:21 +04:00
Konstantin Matskevich 904dac7670 minMaxLoc 2013-12-17 12:43:21 +04:00
Adrien BAK 6ae16ebec3 update doc accordingly 2013-12-17 16:51:33 +09:00
Elena Gvozdeva d9d4678599 Fixed condition for channels 2013-12-17 11:15:48 +04:00
Elena Gvozdeva 125d67130b Fixed medianFilter 2013-12-17 11:04:54 +04:00
Adrien BAK c5c3fd4443 modify signature of stereoCalibrate for consistency 2013-12-17 14:53:44 +09:00
Ilya Lavrenov 2f34bb9aa0 added cv::gemm to T-API 2013-12-16 19:12:27 +04:00
Roman Donchenko f2befa01f4 Fixed build for the TLS-related stuff. 2013-12-16 18:45:41 +04:00
Elena Gvozdeva 8fe4e98b8a Fixed trailing whitespace 2013-12-16 18:06:11 +04:00
Alexander Alekhin 9cb31e86ae umat: fix memory leaks 2013-12-16 16:46:36 +04:00
Roman Donchenko 9d8d70d6ca Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	doc/tutorials/definitions/tocDefinitions.rst
	modules/core/include/opencv2/core/core.hpp
	modules/core/src/system.cpp
	modules/features2d/src/freak.cpp
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/src/cl_context.cpp
	modules/ocl/test/test_api.cpp
2013-12-16 15:02:12 +04:00
StevenPuttemans e4b41d38f1 Fixed descripotorsCount to descriptorsCount
See feature 2862
2013-12-16 10:47:24 +01:00
Elena Gvozdeva b2d8b491c0 Added ocl_medianFilter using Transparent API 2013-12-16 13:20:05 +04:00
Andrey Pavlenko 11071dd241 Merge pull request #1988 from ilya-lavrenov:tapi_umat_convertTo 2013-12-16 13:04:21 +04:00
Ilya Lavrenov 558c4a2b1d implemented UMat::convertTo 2013-12-15 14:15:30 +04:00
Andrey Pavlenko 172a5d42a9 Merge pull request #1974 from ilya-lavrenov:tapi_equalizehist 2013-12-13 19:47:34 +04:00
Ilya Lavrenov 5c0dabf1ea added cv::equalizeHist to T-API 2013-12-13 19:46:20 +04:00
Andrey Pavlenko c9ed05c3bd Merge pull request #1981 from ilya-lavrenov:tapi_sqrt 2013-12-13 19:34:28 +04:00
Andrey Pavlenko 8e15a6f98d Merge pull request #1983 from ilya-lavrenov:tapi_umat 2013-12-13 19:29:49 +04:00
Alexander Alekhin 11b9d5bf4d core: added DirectX interop implementation (OpenCL) with samples 2013-12-13 19:02:41 +04:00
Ilya Lavrenov e30875bcef fixed UMat sync problems 2013-12-13 18:38:12 +04:00
Alexander Alekhin cc69d4631a cmake: detect Direct 3D 11 2013-12-13 15:57:31 +04:00
Vadim Pisarevsky d8513d627d continue adding OpenCL optimization to cascade classifier 2013-12-12 21:58:42 +04:00
Ilya Lavrenov 1d6715e58a added cv::sqrt to T-API (using built-in sqrt OpenCL function) 2013-12-12 18:12:30 +04:00
Andrey Pavlenko b43d6b6858 Merge pull request #1954 from pentschev:ocl_features2d_fast_master 2013-12-12 17:37:09 +04:00
Andrey Pavlenko 5299b13434 Merge pull request #1979 from pentschev:ocl_arithm_sqrt_master 2013-12-12 17:35:01 +04:00
Andrey Pavlenko b0a9220de8 Merge pull request #1889 from alalek:ocl_core_dynamic_runtime 2013-12-12 17:27:34 +04:00
Peter Andreas Entschev 5bc9f15dda OCL: included sqrt matrix operation. 2013-12-12 08:57:27 -02:00
Andrey Pavlenko ac1c6dac93 Merge pull request #1978 from ilya-lavrenov:ocl_min_max 2013-12-12 09:55:50 +04:00
Peter Andreas Entschev 41bec1b112 OCL: including FAST feature detector. 2013-12-11 21:23:27 -02:00
Ilya Lavrenov b20714a8a8 fixed kernel compilation of cv::min, cv::max for CV_64F 2013-12-12 02:42:24 +04:00
sprice 1c15776cf5 Merge branch 'master' of https://github.com/Itseez/opencv
Conflicts:
	modules/imgproc/src/sumpixels.cpp
2013-12-11 14:35:51 -08:00
Andrey Pavlenko f3e2bfea79 Merge pull request #1970 from ilya-lavrenov:tapi_checks 2013-12-11 21:37:10 +04:00
Andrey Pavlenko eeb16a5d01 Merge pull request #1971 from ilya-lavrenov:tapi_laplacian 2013-12-11 21:25:54 +04:00
Andrey Pavlenko 9b29b127c5 Merge pull request #1973 from ilya-lavrenov:ocl_haar_sample 2013-12-11 17:51:36 +04:00
Vladimir Bystricky 268d814d18 Fix problems with border extrapolation in kernel. Add Isolated/Nonisolated borders. 2013-12-11 16:57:47 +04:00
Alexander Alekhin 3bbf51fbfb ocl: disabled test for Split (there are problems with OutputArray and getMatRef) 2013-12-11 16:46:08 +04:00
Andrey Pavlenko 129b715e3d Merge pull request #1958 from vbystricky:ocl_filter2D 2013-12-11 16:41:12 +04:00
Alexander Alekhin 91fc0c3bc3 bioinspired: fix ocl test, skip them if OpenCL is not available 2013-12-11 15:56:54 +04:00
Alexander Alekhin d0114b24e0 core/ocl: replace dynamic runtime 2013-12-11 15:56:54 +04:00
Alexander Alekhin 9f388a2be7 core/ocl: autogenerated files for dynamic runtime 2013-12-11 15:56:54 +04:00
Alexander Alekhin 5ecf759742 core/ocl: update dynamic runtime 2013-12-11 15:56:54 +04:00
Alexander Alekhin 381d7851b7 core/ocl: move opencl dynamic runtime from ocl module 2013-12-11 15:56:54 +04:00
Ilya Lavrenov 1015c5c24d fixed facedetect sample 2013-12-11 15:08:49 +04:00
Vladimir Bystricky f76bf8b425 Fix error in test 2013-12-11 14:33:22 +04:00
Vladimir Bystricky e7227d3e4b Fix problems with border extrapolation in kernel. Add Isolated/Nonisolated borders. 2013-12-11 14:26:33 +04:00
Andrey Pavlenko b5cdc03b81 Merge pull request #1972 from alalek:ocl_queue_cleanup_hung 2013-12-11 14:06:49 +04:00
Alexander Alekhin bdbd3eb2bf ocl: process termination hung workaround 2013-12-11 00:31:34 +04:00
Ilya Lavrenov 8fa8b36b42 added cv::Laplacian, cv::Sobel, cv::Scharr, cv::GaussianBlur to T-API 2013-12-10 23:20:28 +04:00
Vadim Pisarevsky 302a5adcc2 converted Haar cascades to the new format; now they are handled with C++ code. 2013-12-10 22:54:37 +04:00
Ilya Lavrenov 5566d31468 more strict checks outside ROI 2013-12-10 19:30:14 +04:00
Andrey Pavlenko d802b4d143 Merge pull request #1967 from ilya-lavrenov:tapi_blendLinear 2013-12-10 18:49:42 +04:00
Roman Donchenko 90c28d254f Merge pull request #1961 from SpecLad:merge-2.4 2013-12-10 14:39:35 +04:00
Ilya Lavrenov c9e6ed7a29 added cv::blendLinear 2013-12-10 13:07:52 +04:00
Roman Donchenko 464a010f53 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/core/include/opencv2/core/operations.hpp
	modules/core/include/opencv2/core/version.hpp
	modules/core/src/gpumat.cpp
	modules/cudaimgproc/src/color.cpp
	modules/features2d/src/orb.cpp
	modules/imgproc/src/samplers.cpp
	modules/ocl/include/opencv2/ocl/matrix_operations.hpp
	modules/ocl/include/opencv2/ocl/ocl.hpp
	samples/ocl/facedetect.cpp
2013-12-10 12:51:00 +04:00
Roman Donchenko 5c72c74b09 Merge pull request #1960 from ilya-lavrenov:tapi_bilateral 2013-12-10 12:13:15 +04:00
Roman Donchenko 9d87f9c974 Merge pull request #1956 from ilya-lavrenov:tapi_split_merge 2013-12-09 16:56:06 +04:00
Roman Donchenko f3ba1a361e Merge pull request #1930 from alalek:cmake_msvs_subfolders 2013-12-09 16:21:16 +04:00
Ilya Lavrenov 93c6fe66ce added cv::bilateralFilter to T-API 2013-12-09 16:03:25 +04:00
Peter Andreas Entschev 6f3163f62d DescriptorExtractor: added defaultNorm() to return default norm type.
Added the defaultNorm() method to the DescriptorExtractor class. This method returns the default norm type for each descriptor type. The tests and C/C++ samples were updated to get the norm type directly from the DescriptorExtractor inherited classes.

This was reported in feature report #2182 (http://code.opencv.org/issues/2182). It will make it possible to get the norm type usually applied matching method for each descriptor, instead of passing it manually.
2013-12-09 09:54:42 -02:00
Roman Donchenko 24465bbd05 Merge pull request #1855 from Nerei:master 2013-12-09 14:13:40 +04:00
Roman Donchenko 8db53c1760 Merge pull request #1883 from philippefoubert:branch_matx_inv 2013-12-09 14:07:10 +04:00
Andrey Pavlenko 0dfa188ca5 Merge pull request #1948 from ilya-lavrenov:tapi_norm 2013-12-09 13:25:41 +04:00
Andrey Pavlenko 041ad1f4cd Merge pull request #1944 from ilya-lavrenov:minor_commits 2013-12-09 12:44:26 +04:00
Vladimir Bystricky 8d8f5665f1 Fix build errors on Linux system 2013-12-09 11:31:55 +04:00
Vladimir Bystricky 179a43ef63 Fix build errors on Linux system 2013-12-09 11:10:48 +04:00
Vladimir Bystricky 29ba7730ed Add ocl version of filter2D to the module img_proc 2013-12-09 10:45:23 +04:00
Anatoly Baksheev 262f70f3ab cv::format declaration in default headers 2013-12-08 19:00:53 +04:00
Ilya Lavrenov c16c9a2e8e added cv::split to T-API 2013-12-08 16:30:17 +04:00
Ilya Lavrenov b6c33bf86b added cv::norm to T-API 2013-12-08 15:27:48 +04:00
Ilya Lavrenov cd3f7fbf05 added cv::merge to T-API 2013-12-08 13:49:28 +04:00
Anatoly Baksheev 4c66b87698 fixed -Wshadow and other warnings, added rvec test 2013-12-07 20:33:50 +04:00
Anatoly Baksheev f62ffa2aea compilation 2013-12-07 18:58:29 +04:00
Anatoly Baksheev f9ca6cfd22 fixed ocv_module_disable() 2013-12-07 18:58:28 +04:00
Anatoly Baksheev a54ef70c04 minor insignificant corrections 2013-12-07 18:58:28 +04:00
Anatoly Baksheev 546c084fe6 fixed shadow error and added ocv_disable_module 2013-12-07 18:58:27 +04:00
Anatoly Baksheev 0e88733b13 updating Viz cmake (switched to WITH_VTK option) 2013-12-07 18:58:27 +04:00
Anatoly Baksheev 3830a0b5b2 fixed bug with deletion from std::map 2013-12-07 18:50:47 +04:00
Anatoly Baksheev a6ab9be5a6 removed VizAccessor from docs 2013-12-07 18:50:47 +04:00
Anatoly Baksheev fb62a66b69 removed unused code 2013-12-07 18:50:46 +04:00
Anatoly Baksheev b88fdc73d6 VizAccessor is now private and renamed to VizStorage 2013-12-07 18:50:46 +04:00
Anatoly Baksheev d970d58308 added Viz::tutorial2 test 2013-12-07 18:50:45 +04:00
Anatoly Baksheev ace71cef3f Added Affine3<T>::rvec() 2013-12-07 18:50:45 +04:00
Anatoly Baksheev 9f1f5aed53 compilation 2013-12-07 18:50:44 +04:00
Anatoly Baksheev a9c7aa92d9 removed CV_EXPORTS from cv::Afiine 2013-12-07 18:50:44 +04:00
Anatoly Baksheev 177f7eb339 fixed warning 2013-12-07 18:50:43 +04:00
Anatoly Baksheev 0895616576 switched from unnecessarily 'dobule' to 'float' in some places (commonly for widget scale) 2013-12-07 18:50:43 +04:00
Anatoly Baksheev b560cc35d9 removed Ptr typedef from Viz3d. It is deprecated since Viz3d itseez is a shared pointer 2013-12-07 18:50:42 +04:00
Alexander Alekhin 0eb2be762a cmake: allow source_group to preserve file-system tree (for MSVS) 2013-12-07 14:38:59 +04:00
GregoryMorse 68d8f6410f Update system.cpp
Cleaned up to use the preferred namespace code.  This can be further simplified by using the HString/HStringReference classes from wrl\wrappers\corewrappers.h
2013-12-07 15:40:30 +08:00
Vadim Pisarevsky fdf1996e2e added old=>new cascade conversion function 2013-12-07 01:51:35 +04:00
Ilya Lavrenov 73aa43d2ca fixed warnings 2013-12-07 01:05:07 +04:00
Roman Donchenko d368bf5210 Merge pull request #1941 from vhdirk:gst1x_default 2013-12-06 17:50:44 +04:00
Andrey Pavlenko a0c296fcdb Merge pull request #1936 from ElenaGvozdeva:ocl_flip 2013-12-06 16:40:30 +04:00
Elena Gvozdeva f5a01f15a5 Fixed test for ocl_flip 2013-12-06 15:53:00 +04:00
Andrey Pavlenko f36858b3a0 Merge pull request #1942 from ilya-lavrenov:warn_fix 2013-12-06 15:26:43 +04:00
Andrey Pavlenko f0049fa2ed Merge pull request #1937 from ilya-lavrenov:tapi_integral 2013-12-06 15:25:56 +04:00
Ilya Lavrenov 926cab2baa fixed warnings 2013-12-06 15:20:29 +04:00
Vladimir Bystricky 44126e350a Change while(true) to for(;;) for fix compiler warning. 2013-12-06 15:11:26 +04:00
Vladimir Bystricky 591b1a7e70 Another fix for disable "conditional expression is constant" 2013-12-06 14:42:06 +04:00
Vladimir Bystricky 3013b469fe Add check for depths of destination and source image. Fix warning C4127. 2013-12-06 14:21:51 +04:00
Dirk Van Haerenborgh 8a48802dec Enable GStreamer 1.x support by default.
GStreamer 1.x is universally available, and with 0.10 being deprecated,
there should be no reason to default to 0.10 stil.
2013-12-06 10:20:29 +01:00
Ilya Lavrenov 3eaa8f149b added cv::intergal to T-API 2013-12-06 13:18:25 +04:00
Elena Gvozdeva b930028727 Added cv::flip using Transparent API 2013-12-05 17:54:05 +04:00
Andrey Pavlenko b16f0a25af Merge pull request #1925 from vpisarev:ocl_facedetect2 2013-12-05 17:02:37 +04:00
Vladimir Bystricky af6134b4b6 Fix issue in boxFilter with destination depth not equal to source depth. 2013-12-05 14:25:15 +04:00
Roman Donchenko bee4dff89d Merge pull request #1447 from Siddharthk:master 2013-12-05 12:38:12 +04:00
Vladimir Bystricky 968a898a1b Add ocl version of boxFilter to the module img_proc 2013-12-05 11:47:17 +04:00
sprice 73b0827ec1 Don't automatically convert to grayscale (keep previous behavior.) 2013-12-04 18:21:56 -08:00
sprice 2cc11e2c6a Updating STAR detector and FREAK descriptor to work with large and/or 16-bit images 2013-12-04 18:13:34 -08:00
Vadim Pisarevsky 828b0b151b another attempt to fix compile errors 2013-12-04 22:22:36 +04:00
Vadim Pisarevsky fe11ca886a trying to eliminate compile problems 2013-12-04 21:56:35 +04:00
Andrey Pavlenko 458ac2592b Merge pull request #1908 from ilya-lavrenov:tapi_imgproc 2013-12-04 21:41:44 +04:00
Vadim Pisarevsky ff87385201 refactored CascadeClassifier to hide implementation details (take 2) 2013-12-04 19:00:39 +04:00
siddharth 778edff9e1 Added comment in demo file 2013-12-04 19:18:00 +05:30
siddharth c48ad880f3 Errors resolved 2013-12-04 19:18:00 +05:30
Anna Kogan 944f7bac42 After-merge corrections 2013-12-04 19:18:00 +05:30
siddharth 573e818415 New changes done and removed opencv_extra folder
Removed opencv_extra folder inside opencv folder

New changes done

Removed test images
2013-12-04 19:18:00 +05:30
siddharth 33e6c07485 Removed build errors and removed test images
Removed conflict

Error fix 1

Error fix 2

Error fix 3

Error fix 3

Error fix 4

Error fix 5

Error fix 6

Error fix 7

Error fix 8

Error fix 9

Error fix 10

Error fix 11

Error fix 12

Errors fixed

Removed opencv_extra folder inside opencv folder
2013-12-04 19:18:00 +05:30
siddharth 2f65a0d4ba Changes done in npr module 2013-12-04 19:18:00 +05:30
siddharth 35d9ca6483 Changes done in cloning module 2013-12-04 19:18:00 +05:30
siddharth daa9694cab Changes done in decolorization module 2013-12-04 19:17:59 +05:30
siddharth 94eab9babe Revert Back 2013-12-04 19:17:59 +05:30
siddharth 6c7272bde1 Update to remove Android error 2013-12-04 19:17:59 +05:30
siddharth 3b239561c6 Changed STL in contrast_preserve file 2013-12-04 19:17:59 +05:30
siddharth f85a615f3f whitespaces removed and other minor changes to fix build error
Update 1

update 2

Update 3

Update 4

Update 5

update 6

Update 7

Update 8

Update 9

Update 10

Update 11

Update 12

Update 13

Update 14

Update 15

Update 16

Update 17

Update 18

Update 19

Update 20

Update 21

Update 22

Removed Headers

Update 23

Update 24

Update 25

Update 26

Update 27

Update 28
2013-12-04 19:17:59 +05:30
siddharth 05c7c9325a cloning_gui.cpp updated 2013-12-04 19:17:59 +05:30
siddharth 75b76554bf errors in samples/cpp removed 2013-12-04 19:17:59 +05:30
siddharth 01e1ccfa88 cloning_demo error removed 2013-12-04 19:17:59 +05:30
siddharth f8b00e5269 renamed 2013-12-04 19:17:59 +05:30
siddharth 7ab43585aa remove cloning_example.cpp 2013-12-04 19:17:58 +05:30
siddharth 50c19423f9 cloning demo added 2013-12-04 19:17:58 +05:30
siddharth 56ab1c18e6 new filters added and all the 3 modules updated
All 3 modules Updated
2013-12-04 19:17:58 +05:30
siddharth ae9b4003ae edge preserve filters added and windows warning removed
update1
2013-12-04 19:17:58 +05:30
siddharth 1ed0e44090 added keyboard control 2013-12-04 19:17:58 +05:30
siddharth e170115ad0 new interface added. decolor and cloning module added.
Both modules added
2013-12-04 19:17:58 +05:30
siddharth 5b0ee9e085 decolor module updated 2013-12-04 19:17:58 +05:30
siddharth 0802c06571 seamless cloning added
update1

update1

update4
2013-12-04 19:17:58 +05:30
siddharth a1b3ba02a7 add color_boost + doc 2013-12-04 19:17:58 +05:30
siddharth 88aa4a9902 decolor module updated
update3

update4

update4

update5

added test data
2013-12-04 19:17:58 +05:30
siddharth 95db69f6b9 added new files 2013-12-04 19:17:58 +05:30
Roman Donchenko 0736ede7e5 Merge pull request #1914 from SpecLad:merge-2.4 2013-12-04 16:30:57 +04:00
Ilya Lavrenov e2b99a32b2 added cv::threshold to T-API 2013-12-04 13:45:44 +04:00
Ilya Lavrenov 474fc887a6 added cv::copyMakeBorder to T-API 2013-12-04 13:41:35 +04:00
Ilya Lavrenov 5b5f5878ce added tests to imgproc 2013-12-04 13:41:34 +04:00
Andrey Pavlenko f9190cc662 Merge pull request #1909 from alalek:ocl_tapi_perf 2013-12-04 11:35:11 +04:00
Andrey Pavlenko e585f145f6 Merge pull request #1903 from ilya-lavrenov:tapi_warp 2013-12-04 11:34:52 +04:00
Andrey Pavlenko 001aa70556 Merge pull request #1902 from ilya-lavrenov:tapi_arithm 2013-12-04 11:34:35 +04:00
Ilya Lavrenov 49474903cb refactoring 2013-12-04 00:51:55 +04:00
Ilya Lavrenov 49e729f89d ability to use cv::PSNR with transparent cv::norm 2013-12-04 00:51:55 +04:00
Ilya Lavrenov 88bceb5060 added cv::meanStdDev to T-API 2013-12-04 00:51:55 +04:00
Ilya Lavrenov b8edc2cc4d added cv::sum to T-API 2013-12-04 00:51:43 +04:00
Ilya Lavrenov 28575c1969 added cv::countNonZero to T-API 2013-12-04 00:51:32 +04:00
Ilya Lavrenov fed7e61879 added cv::repeat to T-API (fix for copyTo -> UMat is needed) 2013-12-04 00:50:03 +04:00
Ilya Lavrenov e17107e864 added cv::compare to T-API 2013-12-04 00:50:03 +04:00
Ilya Lavrenov a180cebb2d added cv::polarToCart to T-API 2013-12-04 00:50:03 +04:00
Ilya Lavrenov ba850f0b64 added cv::cartToPolar to T-API 2013-12-04 00:50:03 +04:00
Ilya Lavrenov 435028ccee added cv::transpose to T-API 2013-12-04 00:50:03 +04:00
Ilya Lavrenov 6ab297718d added setIdentity to T-API 2013-12-04 00:50:03 +04:00
Ilya Lavrenov 3e586f42a0 added cv::pow to T-API 2013-12-04 00:50:02 +04:00
Ilya Lavrenov 997ec60839 added OCL-TAPI arithm tests 2013-12-04 00:50:02 +04:00
Ilya Lavrenov 803672feea added cv::remap to T-API 2013-12-04 00:43:43 +04:00
Ilya Lavrenov dcce9d7088 added cv::warpAffine to T-API 2013-12-04 00:43:43 +04:00
Ilya Lavrenov 55af7857b9 added cv::warpPerspective to T-API 2013-12-04 00:43:42 +04:00
Alexander Alekhin 7d9150460a core/ocl: added perf test infra + "Add" perf test 2013-12-03 18:43:50 +04:00
Alexander Alekhin fe01bc21c0 perf: test-based metrics collection strategy 2013-12-03 18:43:50 +04:00
Roman Donchenko 90c230678e Merge pull request #1912 from KonstantinMatskevich:ocl_tapi_math 2013-12-03 18:02:44 +04:00
Roman Donchenko d58cd9851f Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	CMakeLists.txt
	cmake/OpenCVDetectCUDA.cmake
	doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.rst
	modules/core/src/cmdparser.cpp
	modules/gpu/CMakeLists.txt
	modules/gpu/doc/introduction.rst
	modules/gpu/perf/perf_video.cpp
	modules/highgui/doc/reading_and_writing_images_and_video.rst
	modules/ocl/src/cl_context.cpp
	modules/video/include/opencv2/video/background_segm.hpp
	samples/cpp/image_sequence.cpp
	samples/cpp/tutorial_code/ImgTrans/HoughCircle_Demo.cpp
	samples/python/chessboard.py
	samples/python/cvutils.py
	samples/python/demhist.py
	samples/python/dft.py
	samples/python/distrans.py
	samples/python/edge.py
	samples/python/ffilldemo.py
	samples/python/fitellipse.py
	samples/python/houghlines.py
	samples/python/inpaint.py
	samples/python/logpolar.py
	samples/python/morphology.py
	samples/python/numpy_array.py
	samples/python/watershed.py
2013-12-03 17:35:21 +04:00
Konstantin Matskevich eaf620ddde small fix 2013-12-03 14:57:13 +04:00
Konstantin Matskevich 14dccdf23d T-API cv::log, cv::exp, cv::magnitude, cv::phase 2013-12-03 14:07:00 +04:00
Roman Donchenko 35ea600c54 Merge pull request #1891 from alalek:cv_error_noreturn 2013-12-03 13:57:35 +04:00
Roman Donchenko d2b46d421f Merge pull request #1910 from alalek:ts_perf_warmuptype 2013-12-03 13:08:44 +04:00
Alexander Alekhin cb4267cb38 ts/perf: int -> enum WarmUpType 2013-12-03 12:40:31 +04:00
Roman Donchenko 17f53bc301 Merge pull request #1904 from severin-lemaignan:emscripten 2013-12-03 12:14:09 +04:00
Roman Donchenko 6e9a7706ce Merge pull request #1890 from alalek:ts_fix_seh_exceptions_handling 2013-12-03 11:56:49 +04:00
Andrey Pavlenko 0a624ee67d Merge pull request #1901 from vpisarev:ocl_svm3 2013-12-03 11:20:26 +04:00
Alexander Alekhin 206b56ed39 ts: catch & append general exceptions into log 2013-12-03 03:40:56 +04:00
Vadim Pisarevsky cd97d789b6 dummy commit to rerun pre-commit tests 2013-12-02 22:15:07 +04:00
Roman Donchenko aed69cc458 Merge pull request #1882 from philippefoubert:branch_ocl_instrumentation 2013-12-02 18:55:47 +04:00
Vadim Pisarevsky 161c3b71e6 hopefully, now opencv_test_imgproc should pass 2013-12-02 18:27:08 +04:00
Séverin Lemaignan efe564e3b3 Ensure compilation to Javascript with Emscripten 2013-12-02 14:06:24 +01:00
Vadim Pisarevsky 5fea17ff0d still trying to fix failure in opencv_test_imgproc 2013-12-02 13:46:54 +04:00
Roman Donchenko b27d7d2a61 Merge pull request #1886 from ilya-lavrenov:tapi_lut 2013-12-02 12:28:18 +04:00
Vadim Pisarevsky 7626a8e8de try to eliminate failure in opencv_imgproc_test 2013-12-02 12:13:50 +04:00
Vadim Pisarevsky 82b852c13c yet another attempt to make Core_UMat.getUMat test work 2013-12-02 00:12:20 +04:00
Vadim Pisarevsky 9be727b1ea another attempt to fix Core_UMat.getUMat test 2013-12-01 23:14:45 +04:00
Vadim Pisarevsky f263fe145a trying to guess and fix strange failure in core test 2013-12-01 22:14:15 +04:00
Vadim Pisarevsky d7f4a223cf fixed several compile errors/warnings; reacted on the PR comments 2013-12-01 20:58:30 +04:00
Philippe FOUBERT ec6f2e1c4d Using cv::String instead of std::string. 2013-12-01 16:41:17 +01:00
Vadim Pisarevsky 6da5d21331 fixed many bugs related to Mat::getUMat(), asynchronous kernel execution etc. Also, played a bit with ocl::cvtColor vs cv::cvtColor performance 2013-12-01 03:12:19 +04:00
Alexander Alekhin c1cfb4d422 core: added cv::error with CV_NORETURN attr 2013-11-30 03:43:31 +04:00
Andrey Pavlenko daefe6983f Merge pull request #1878 from ilya-lavrenov:ocl_resize_area_master 2013-11-29 19:21:38 +04:00
Ilya Lavrenov 09795e3265 added cv::resize INTER_AREA to T-API 2013-11-29 17:57:37 +04:00
Andrey Pavlenko d83094b412 Merge pull request #1880 from ilya-lavrenov:tapi_cvtColor 2013-11-29 12:59:09 +04:00
Roman Donchenko 9ca80961fd Merge pull request #1874 from SpecLad:merge-2.4 2013-11-28 16:43:00 +04:00
Ilya Lavrenov 4eba74ee19 added cv::LUT to T-API 2013-11-28 12:31:04 +04:00
Philippe FOUBERT 22ad487328 Comment correction 2013-11-28 00:45:58 +01:00
Philippe FOUBERT 735f704b3e Add on optional parameter to the matx invert function to know if this operation is successfull without having to analyse the matrix (it may fail in case of bad preconditioning or inappropriate decomposition method) 2013-11-28 00:42:19 +01:00
Philippe FOUBERT c056e7fc61 Correction to be able to compile using the directive PRINT_KERNEL_RUN_TIME 2013-11-28 00:26:37 +01:00
Ilya Lavrenov 41d046a2db restored ocl_cvtcolor.cl 2013-11-27 23:46:30 +04:00
Ilya Lavrenov d2e1318341 RGBA <-> mRGBA 2013-11-27 23:42:10 +04:00
Ilya Lavrenov f771a0ba81 RGB[A] <-> HLS 2013-11-27 23:37:58 +04:00
Ilya Lavrenov 0b900b54e5 RGB[A] <-> HSV 2013-11-27 23:30:29 +04:00
Ilya Lavrenov 727a5e6df4 BGR5x5 <-> Gray 2013-11-27 22:19:44 +04:00
Mathieu Barnachon fb9c59dd8d Fix default argument. 2013-11-27 18:14:37 +01:00
Ilya Lavrenov 8a23646897 RGB[A] <- RGB5x5 2013-11-27 20:00:35 +04:00
Ilya Lavrenov 81b9c9c104 RGB[A] -> RGB5x5 2013-11-27 19:52:42 +04:00
Ilya Lavrenov af367c4f85 RGB[A] <-> BGR[A] 2013-11-27 19:44:37 +04:00
Ilya Lavrenov ab9b883c69 RGB[A] <-> XYZ 2013-11-27 19:37:27 +04:00
Ilya Lavrenov 65ee06eb2b RGB[A] <-> XYZ 2013-11-27 19:25:26 +04:00
Ilya Lavrenov 506c19616d YCrCb -> RGB[A] 2013-11-27 19:24:27 +04:00
Andrey Pavlenko 41ae5d5f66 Merge pull request #1867 from ilya-lavrenov:ocl_resize_master 2013-11-27 18:08:11 +04:00
Roman Donchenko 28242f09d0 Merge pull request #1869 from ilya-lavrenov:ocl_cvtColor_master 2013-11-27 17:58:54 +04:00
Ilya Lavrenov 90d62cacc9 fixed cv::cvtColor 2013-11-27 16:43:31 +04:00
Mathieu Barnachon b413bcbba4 Fix shadow parameter. 2013-11-27 11:36:34 +01:00
Mathieu Barnachon 99c8b8c016 Fix parameter name to fit documentation. 2013-11-27 11:06:52 +01:00
Roman Donchenko 2fed668390 Fixed build errors. 2013-11-27 12:59:19 +04:00
Ilya Lavrenov 6679aed61e fixed ocl::resize (INTER_LINEAR) and added an accuracy test 2013-11-27 02:52:02 +04:00
Mathieu Barnachon 4f74e2509b Fix the documentation names. 2013-11-26 22:50:26 +01:00
Tony 69dc840583 mprove Gtk2/3 options in cmake
Update to cmake files for to include minimum versions, and tidy up gtk operation.

Files updated:
CMakeLists.txt:
  WITH_GTK now uses Gtk3 by default. If not found then Gtk2 is used.
  WITH_GTK_2_X forces Gtk2.x use

cmake/OpenCVFindLibsGUI.cmake
  Updated selection logic to implement methodology described above.
  Implemented warning if Gtk3 not found (and not overridden)
  Implemented error if Gtk does not meet minimum required version

cmake/OpenCVMinDepVersions.cmake
  Added minimum Gtk version of 2.18.0
2013-11-26 21:35:03 +00:00
Andrey Pavlenko 96a228fd7e Merge pull request #1866 from ilya-lavrenov:ocl_fix2 2013-11-26 23:27:49 +04:00
Andrey Pavlenko 736097a462 Merge pull request #1868 from KonstantinMatskevich:umat_bugfix 2013-11-26 23:24:51 +04:00
Roman Donchenko 920fd48228 Merge remote-tracking branch 'origin/master' into merge-2.4
Conflicts:
	modules/ocl/src/arithm.cpp
2013-11-26 15:32:44 +04:00
Roman Donchenko 9c2272d520 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	.gitignore
	CMakeLists.txt
	doc/CMakeLists.txt
	modules/calib3d/src/stereosgbm.cpp
	modules/core/include/opencv2/core/mat.hpp
	modules/highgui/src/cap_openni.cpp
	modules/ml/include/opencv2/ml/ml.hpp
	modules/objdetect/src/hog.cpp
	modules/ocl/perf/perf_color.cpp
	modules/ocl/src/arithm.cpp
	modules/ocl/src/filtering.cpp
	modules/ocl/src/imgproc.cpp
	modules/ocl/src/optical_flow_farneback.cpp
	platforms/scripts/camera_build.conf
	platforms/scripts/cmake_android_all_cameras.py
	samples/cpp/Qt_sample/main.cpp
	samples/cpp/tutorial_code/introduction/windows_visual_studio_Opencv/Test.cpp
2013-11-26 15:05:26 +04:00
Roman Donchenko aaf97c4548 Merge pull request #1863 from nevion:master 2013-11-26 13:53:48 +04:00
Roman Donchenko e7339ac11a Merge pull request #1818 from GregoryMorse:patch-2 2013-11-26 13:00:56 +04:00
Roman Donchenko e20f7014cf Merge pull request #1835 from SpecLad:windows-xadd 2013-11-26 11:43:34 +04:00
Roman Donchenko 05e22ee8c9 Merge pull request #1859 from SpecLad:string-plus-equals 2013-11-26 11:40:37 +04:00
GregoryMorse e4793e3d5e Update system.cpp
Fixed to use native C++ instead of C++/CX although it does require significantly more code, it goes along with the spirit of keeping the project in native C++

Update system.cpp

Cleaned up whitespace, removed redundant code and added edge cases for string cleanup

Update system.cpp

Fixed compiler warning over comma operator clause

Update system.cpp

NULL initialization

Update system.cpp

Fixed use of WindowsGetStringRawBuffer which returns internal pointer to buffer

Update system.cpp

Support C++/CX and native C++ through conditional compilation.  Fixed style - long lines, comma operators, long conditional.  Optimized string usage to use reference.

Update system.cpp

Fixed conditional compilation around include and library

Update system.cpp

Fixed trailing space

Update system.cpp

Cleaned up whitespace, removed redundant code and added edge cases for string cleanup

Update system.cpp

Fixed compiler warning over comma operator clause

Update system.cpp

NULL initialization

Update system.cpp

Fixed use of WindowsGetStringRawBuffer which returns internal pointer to buffer

Update system.cpp

Support C++/CX and native C++ through conditional compilation.  Fixed style - long lines, comma operators, long conditional.  Optimized string usage to use reference.

Update system.cpp

Fixed conditional compilation around include and library

Update system.cpp

Fixed trailing space
2013-11-26 00:22:14 +08:00
Ilya Lavrenov 16a3067afc cp test_colot.cpp to imgproc ocl tests 2013-11-25 19:19:17 +04:00
Konstantin Matskevich 145855767c bugfix in deallocate 2013-11-25 17:16:22 +04:00
Ilya Lavrenov 9d23a0cb81 fixed ocl_arithm_op; fix for 3-channel images is needed 2013-11-25 14:21:12 +04:00
Roman Donchenko 684ff70308 Merge pull request #1864 from berak:mouse_and_match 2013-11-25 12:15:52 +04:00
Roman Donchenko 52e810ed33 Merge pull request #1850 from ilya-lavrenov:pthread_mutex 2013-11-25 12:04:17 +04:00
Mathieu Barnachon c90fe65f22 Fix compilation issue related to previous commit. 2013-11-24 17:16:45 +01:00
Mathieu Barnachon e8b86c8663 Fix name of one parameter to fit the documentation. 2013-11-24 17:14:23 +01:00
Mathieu Barnachon 089b8e2f4a Suppress a space! 2013-11-24 17:10:06 +01:00
berak 10639d63f5 mouse_and_match.py missing import cv2 2013-11-24 15:58:13 +01:00
Mathieu Barnachon 9dc713eaba Fix name of parameter to have proper documentation. 2013-11-24 15:45:05 +01:00
Mathieu Barnachon bf84d476fc Fix useless space... 2013-11-24 15:38:48 +01:00
Mathieu Barnachon e015691b41 Fix warnings as errors. 2013-11-24 15:32:52 +01:00
Mathieu Barnachon 0c4da123e9 Remove duplicate functions. 2013-11-24 14:33:41 +01:00
Mathieu Barnachon 67525627db Merge remote-tracking branch 'upstream/master' into bow_desc
Conflicts:
	modules/features2d/src/bagofwords.cpp
2013-11-24 14:21:44 +01:00
Mathieu Barnachon 63c23cce65 Merge remote-tracking branch 'upstream/master' into svm_hog 2013-11-24 13:24:39 +01:00
Mathieu Barnachon e1955759af Fix some warning.
Adding missing credit for a function.
2013-11-24 13:22:10 +01:00
Jason Newton 88b2fe9dbb correct upper bound for maximum number of labels for 8-way connectivity 2013-11-24 01:20:07 -08:00
Andrey Pavlenko 3ab47300ce Merge pull request #1862 from alalek:ocl_disable_tests 2013-11-23 18:54:52 +04:00
Alexander Alekhin fd4a7e7d1f ocl: disable tests 2013-11-23 18:13:32 +04:00
Andrey Pavlenko b157cc17e9 Merge pull request #1857 from alalek:ocl_ta_tests_infra 2013-11-23 16:44:58 +04:00
Andrey Pavlenko b82c55de12 Merge pull request #1861 from ilya-lavrenov:ocl_args_fix 2013-11-23 16:44:38 +04:00
Ilya Lavrenov 1af95ea12c fixed error in setting kernel arguments 2013-11-22 18:56:03 +04:00
Alexander Alekhin 881e837520 ocl/core: added prototype for tests 2013-11-22 18:37:44 +04:00
Roman Donchenko dd817857b4 Replaced most of the instances of "s = s +" with "s +=".
This resynchronizes master code with 2.4. I say "most", because I might
have missed some due to different spacing; I'll deal with those
instances later if I find them.
2013-11-22 17:59:56 +04:00
Roman Donchenko fc49d33c8d Gave cv::String appropriate += operators.
Note that since String is a reference to an immutable string,
this doesn't actually change the string; it just replaces *this
with a reference to the concatenated string.
2013-11-22 17:58:40 +04:00
Ilya Lavrenov c8abb6124f recursive mutex for linux 2013-11-22 17:30:32 +04:00
Andrey Pavlenko c1f59c4c76 Merge pull request #1852 from ilya-lavrenov:ocl_retina 2013-11-22 13:57:22 +04:00
Ilya Lavrenov 8834d5e57b changed eps in Retina_OCL test 2013-11-22 12:35:46 +04:00
Daniel Neel 67a2c4ecd5 Re-phrased some odd wording. 2013-11-21 22:36:31 -05:00
Andrey Pavlenko c33cb94d66 Merge pull request #1847 from ilya-lavrenov:ocl_imgproc_fix 2013-11-21 21:29:26 +04:00
Andrey Pavlenko ca8c129c57 Merge pull request #1848 from ilya-lavrenov:warn 2013-11-21 21:29:09 +04:00
Ilya Lavrenov 650f92f9cc eliminated warning C4267 2013-11-21 18:27:07 +04:00
Ilya Lavrenov 561a7f5782 fixed kernel compilation in imgproc module 2013-11-21 18:23:57 +04:00
Andrey Pavlenko 9bf2516eb1 Merge pull request #1841 from ilya-lavrenov:ocl_kernel_compilation 2013-11-21 17:32:37 +04:00
Ilya Lavrenov 65b7e2018c fixed kernel compilation 2013-11-21 14:22:24 +04:00
Andrey Pavlenko 8d1a8df1a9 Merge pull request #1824 from vpisarev:ocl_experiments5 2013-11-20 19:14:40 +04:00
Roman Donchenko 3703c7040a Merge pull request #1828 from SpecLad:merge-2.4 2013-11-20 16:08:53 +04:00
Roman Donchenko 4cfbee70bd Simplified the Windows implementation of CV_XADD.
_InterlockedExchangeAdd is a Visual Studio intrinsic that's available
for all architectures and in all VS versions that we care about. It's also
faster than the underscore-less function, since it's an intrinsic.
We also don't need to declare it ourselves.

It is, however, a Visual Studio-specific intrinsic, so I changed the
preprocessing condition accordingly.

Fixes <http://code.opencv.org/issues/3365>.
2013-11-20 13:47:35 +04:00
Roman Donchenko 95006af170 Merge pull request #1816 from SpecLad:no-more-epoch 2013-11-20 11:52:54 +04:00
Roman Donchenko 63b3db53d7 Merge pull request #1830 from SpecLad:config-includes 2013-11-20 11:52:30 +04:00
Vadim Pisarevsky ae8b2cbd68 fixed bug with cl_long size on Win32 (thanks to Aaron Kunze) 2013-11-19 20:51:31 -05:00
Vadim Pisarevsky 677c7f27cb fixed failure in Tonemap test 2013-11-19 19:20:24 -05:00
Roman Donchenko ef27ac3782 In the example in OpenCVConfig.cmake.in, explicitly add the include paths.
After #1801, the include directories are no longer added automatically,
so we should show the user how to do that.
2013-11-19 19:00:56 +04:00
Roman Donchenko 7f935717cb In OpenCVConfig.cmake.in, lowercased the commands in the example.
This is the preferred style nowadays, and more consistent with the
rest of the code.
2013-11-19 18:58:33 +04:00
Roman Donchenko aacf188e83 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/src/arithm.cpp
	modules/ocl/src/build_warps.cpp
	modules/ocl/src/color.cpp
	modules/ocl/src/haar.cpp
	modules/ocl/src/imgproc.cpp
	modules/ocl/src/split_merge.cpp
	modules/ocl/test/test_color.cpp
	samples/cpp/3calibration.cpp
	samples/cpp/OpenEXRimages_HDR_Retina_toneMapping.cpp
	samples/cpp/OpenEXRimages_HDR_Retina_toneMapping_video.cpp
	samples/cpp/Qt_sample/main.cpp
	samples/cpp/camshiftdemo.cpp
	samples/cpp/descriptor_extractor_matcher.cpp
	samples/cpp/distrans.cpp
	samples/cpp/generic_descriptor_match.cpp
	samples/cpp/grabcut.cpp
	samples/cpp/morphology2.cpp
	samples/cpp/segment_objects.cpp
	samples/cpp/stereo_calib.cpp
	samples/cpp/tutorial_code/Histograms_Matching/compareHist_Demo.cpp
	samples/cpp/tutorial_code/core/mat_mask_operations/mat_mask_operations.cpp
	samples/cpp/tutorial_code/introduction/display_image/display_image.cpp
	samples/cpp/tutorial_code/introduction/windows_visual_studio_Opencv/Test.cpp
	samples/cpp/tutorial_code/objectDetection/objectDetection.cpp
	samples/cpp/tutorial_code/objectDetection/objectDetection2.cpp
	samples/cpp/video_dmtx.cpp
2013-11-19 16:21:09 +04:00
Vadim Pisarevsky d0b3c7a518 added some diagnostic into Tonemap test 2013-11-18 23:14:44 -05:00
Vadim Pisarevsky 8c44995ea6 another attempt to fix compile errors 2013-11-18 22:15:04 -05:00
Vadim Pisarevsky 241002384c fixed some more compile errors 2013-11-18 14:26:19 -05:00
Vadim Pisarevsky e2bbe7597b fixed few compile errors and doc build errors 2013-11-18 13:48:04 -05:00
Vadim Pisarevsky 8762ee3f6f removed unnecessary opencl kernels 2013-11-18 12:02:10 -05:00
Vadim Pisarevsky d914f20a4c updated patch to bring in the first functions with "transparent API" 2013-11-18 11:48:00 -05:00
Roman Donchenko bb4bf7a1f9 Merge pull request #1811 from Nerei:fixed_some_build_errors 2013-11-18 18:09:44 +04:00
Anatoly Baksheev 9e3a29701e Viz code beautification 2013-11-17 19:33:55 +04:00
Anatoly Baksheev efcc341219 added viz tutorial 3 test 2013-11-17 15:18:15 +04:00
Anatoly Baksheev e154bce259 fixed compilation for vs2008 2013-11-17 14:13:13 +04:00
Anatoly Baksheev d8600d3d13 fixed all Viz warnings
moved some headers to precomp.hpp
2013-11-17 14:13:11 +04:00
Anatoly Baksheev 5c6248005a fixed warnings 2013-11-17 14:08:57 +04:00
Anatoly Baksheev dfef42f94e Fixed Viz compilation: removed CV_EXPORTS from cv::viz::Color. The macro forced instantiation of all Matx<double, 4, 1> constructors and triggered StaticAssert there. 2013-11-17 14:08:56 +04:00
Anatoly Baksheev 0dad070473 Fixed compilation errors: removed using namespace from hpp file. This led to pulling cv::ACCESS_MASK to global namespace where conflict with the same name in 'windows.h' 2013-11-17 14:08:56 +04:00
Anatoly Baksheev d275e29ea4 compilation & warnings 2013-11-17 14:08:55 +04:00
Roman Donchenko 615d6c22d1 Switched OpenCV to a 3-component version number.
Epoch is gone; now the version component names in C++ and CMake
are consistent (except REVISION corresponds to PATCH).
2013-11-15 19:41:53 +04:00
Roman Donchenko b8c46f4cce Merge pull request #1804 from alekcac:youtube_link_fix 2013-11-15 15:53:05 +04:00
Roman Donchenko bb0d88cf6f Merge pull request #1801 from vrabaud:master 2013-11-15 12:01:16 +04:00
Alexander Shishkov 4c9a6bd4ec Update widget_pose.rst
changed Youtube link to our channel
2013-11-15 04:36:22 +03:00
Vincent Rabaud 154d119e13 do not use include_directories when calling find_package(OpenCV)
This is something that should be left to the user, that's the whole
point of OpenCV_INCLUDE_DIRS.
2013-11-14 15:24:18 +01:00
Roman Donchenko a8e1d1f0b2 Merge pull request #1791 from prattmic:limit 2013-11-13 12:15:18 +04:00
Michael Pratt 73f1940b03 Add missing limits include
Without limits included, several CUDA related files fail to compile with
GCC on Ubuntu:

modules/cudaimgproc/src/hough_lines.cpp:136:9: error: ‘numeric_limits’ is not a member of ‘std’
2013-11-12 22:29:41 -05:00
Mathieu Barnachon a4ceb7b6ee Fix compilation issues. 2013-11-11 19:29:39 +01:00
Roman Donchenko f461930d07 Merge pull request #1781 from SpecLad:merge-2.4 2013-11-11 19:15:25 +04:00
Roman Donchenko ccbd7f8da9 Added a citation which used to be in the gpu module in 2.4. 2013-11-11 18:00:55 +04:00
Roman Donchenko bfa40e180f Removed another usage of __func__, following #1763. 2013-11-11 17:02:50 +04:00
Roman Donchenko 4f1aed98de Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	.gitignore
	modules/contrib/src/detection_based_tracker.cpp
	modules/core/include/opencv2/core/core.hpp
	modules/core/include/opencv2/core/internal.hpp
	modules/core/src/gpumat.cpp
	modules/core/src/opengl.cpp
	modules/gpu/src/cuda/safe_call.hpp
	modules/highgui/src/cap.cpp
	modules/imgproc/include/opencv2/imgproc/imgproc.hpp
	modules/ocl/doc/image_processing.rst
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/perf/perf_haar.cpp
	modules/ocl/src/haar.cpp
	modules/ocl/src/imgproc.cpp
	modules/ocl/src/kmeans.cpp
	modules/ocl/src/svm.cpp
	modules/ocl/test/test_objdetect.cpp
	samples/ocl/adaptive_bilateral_filter.cpp
2013-11-11 16:55:36 +04:00
Roman Donchenko 469d7eed72 Merge pull request #1767 from prattmic:python3_asstring 2013-11-11 14:01:07 +04:00
Roman Donchenko c970d4bf6e Merge pull request #1742 from pengx17:master_ocl_retina_sample 2013-11-08 17:17:20 +04:00
Michael Pratt 8aafd569c8 Support PyString_AsString() in Python 3 < 3.3
In Python 3, version 3.3+, PyUnicode_AsUTF8() provides similar
functionality to Python 2's PyString_AsString().

In older versions of Python 3, there is no public function to provide
the same functionality.  However, the "internal" _PyUnicode_AsString()
does provide that functionality, so use it to replace
PyString_AsString().

With this patch, cv2 should compile for Python 3.[0-2].
2013-11-07 23:47:33 -05:00
Roman Donchenko 254aece317 Merge pull request #1753 from abidrahmank:py_tutorials 2013-11-06 15:40:55 +04:00
Roman Donchenko b5777efee6 Merge pull request #1716 from ilya-lavrenov:resize_area_sse2_fix 2013-11-06 13:59:44 +04:00
Ilya Lavrenov e9b54ab844 fixed cv::resize (area fast mode) - it writes outside of array boundary in SSE2 version 2013-11-06 13:53:44 +04:00
Peng Xiao 7a2a810de5 Update retina_ocl.cpp 2013-11-06 17:00:27 +08:00
Roman Donchenko 8b19df3fec Merge pull request #1748 from SpecLad:merge-2.4 2013-11-06 12:55:05 +04:00
Roman Donchenko 65389e41db Revert commit 994e07db0 (PR #1715), because it's irrelevant for master.
Conflicts:
	modules/java/generator/src/cpp/VideoCapture.cpp
2013-11-06 12:32:03 +04:00
abidrahmank 8bba305487 small correction in Py tutorials 2013-11-06 10:22:08 +05:30
Roman Donchenko 8f5eaca354 Remove the explicit setting of CMP0017, partially undoing #1720.
In master, it's already set to NEW, since we declare the minimal CMake
version as 2.8.7, which is newer than the policy.
2013-11-05 16:44:09 +04:00
Roman Donchenko 9c83f6c4fb Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	cmake/OpenCVDetectCUDA.cmake
	modules/core/include/opencv2/core/version.hpp
	modules/cudacodec/src/ffmpeg_video_source.cpp
	modules/gpu/src/video_writer.cpp
	modules/highgui/test/test_ffmpeg.cpp
	modules/highgui/test/test_video_io.cpp
	modules/highgui/test/test_video_pos.cpp
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/include/opencv2/ocl/private/util.hpp
	modules/ocl/src/arithm.cpp
	modules/ocl/src/blend.cpp
	modules/ocl/src/canny.cpp
	modules/ocl/src/cl_operations.cpp
	modules/ocl/src/filtering.cpp
	modules/ocl/src/haar.cpp
	modules/ocl/src/imgproc.cpp
	modules/ocl/src/kmeans.cpp
	modules/ocl/src/moments.cpp
	modules/ocl/src/safe_call.hpp
	modules/ocl/src/split_merge.cpp
	modules/ocl/test/test_moments.cpp
	samples/ocl/squares.cpp
2013-11-05 16:38:23 +04:00
peng xiao 8adebcbc00 Add ocl retina sample. 2013-11-05 14:48:29 +08:00
Roman Donchenko 03bbee327b Merge pull request #1486 from nzjrs:cv2-logpolar 2013-10-29 16:15:57 +04:00
Roman Donchenko f68b73f831 Merge pull request #1521 from nailbiter:optimCG 2013-10-29 16:14:32 +04:00
Roman Donchenko 334292083e Merge pull request #1629 from lluisgomez:er_tree_clean_bug_fix 2013-10-29 16:03:51 +04:00
Roman Donchenko 75087580de Merge pull request #1704 from SpecLad:merge-2.4 2013-10-29 13:13:05 +04:00
Andrey Pavlenko 616db74e49 Merge pull request #1663 from vpisarev:ocl_experiments3 2013-10-29 11:14:16 +04:00
Roman Donchenko 78be4f66f7 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	CMakeLists.txt
	modules/calib3d/src/calibration.cpp
	modules/ocl/src/cl_programcache.cpp
	modules/ocl/src/filtering.cpp
	modules/ocl/src/imgproc.cpp
	samples/ocl/adaptive_bilateral_filter.cpp
	samples/ocl/bgfg_segm.cpp
	samples/ocl/clahe.cpp
	samples/ocl/facedetect.cpp
	samples/ocl/pyrlk_optical_flow.cpp
	samples/ocl/squares.cpp
	samples/ocl/surf_matcher.cpp
	samples/ocl/tvl1_optical_flow.cpp
2013-10-28 13:38:25 +04:00
Vadim Pisarevsky 485d36d3c0 changed InputArray's enumeration constant for UMat, since it may potentially conflict with existing OpenCL module. refactored Kernel's setArg API (now UMat is passed to a kernel as a structure, as Alexander A suggested). removed Kernel's cleanup callback from the external API; now each kernel keeps track of used matrices and they are dereferenced after it's complete. 2013-10-25 16:46:03 +04:00
Roman Donchenko 31f0ab6c80 Merge pull request #1681 from LeszekSwirski:fix-ninjabuild 2013-10-25 13:30:52 +04:00
Vadim Pisarevsky 6416c33020 fixed some bugs in OpenCL branch of UMat implementation; maybe now the tests will finally pass?! (please ;( ) 2013-10-25 11:19:40 +04:00
Vadim Pisarevsky ace0d4bad0 hopefully, the last test failures are fixed now 2013-10-24 23:31:00 +04:00
Vadim Pisarevsky 5920bd4f2e fixed whitespace errors 2013-10-24 23:18:05 +04:00
Vadim Pisarevsky caa33b2242 added first very simple test for UMat<=>Mat conversion 2013-10-24 22:33:41 +04:00
Leszek Swirski 6e4fb8f275 Replace $(Configuration) with $<CONFIGURATION> 2013-10-24 18:20:16 +01:00
Vadim Pisarevsky b1aa4a4913 yet another attempt to fix test failures 2013-10-24 18:00:15 +04:00
Vadim Pisarevsky e14171fd33 fixed crash in Python bindings 2013-10-24 17:37:33 +04:00
Roman Donchenko 7e1ded0ebd Merge pull request #1664 from SpecLad:merge-2.4 2013-10-24 17:27:30 +04:00
Vadim Pisarevsky a9065b7d0c trying to fix failures in tests 2013-10-24 17:23:48 +04:00
Vadim Pisarevsky 303df78cca removed refcount field from Mat; that helped to find and eliminate some memory leaks. perf tests should probably pass now 2013-10-24 16:08:15 +04:00
Roman Donchenko dfe07df87b Added stupid hacks to make the video tests pass with FFmpeg 2.0.2.
Need to go back at some point and fix this for real.
2013-10-24 14:09:08 +04:00
Roman Donchenko 424a7b0ab0 Changed MPEG-2 resolution in the FFmpeg test.
Newer FFmpeg prohibits 4096x4096 MPEG-2, presumably because it violates
the standard.

http://git.videolan.org/gitweb.cgi/ffmpeg.git/?p=ffmpeg.git;a=commit;h=7fb87bc5f24b1be13269109506c05e4c54695b5e
2013-10-23 17:42:00 +04:00
Roman Donchenko 3f3ae33327 Decoupled test_ffmpeg.cpp from ffmpeg_codecs.hpp.
This should actually remove the need for the workaround from
the previous commit.
2013-10-23 14:56:37 +04:00
Roman Donchenko eb86d37b26 Removed some dubious FFmpeg hack that no longer works. 2013-10-23 14:56:37 +04:00
Roman Donchenko 66beb44286 Applied a change from 555c505b to 3rdparty/tbb/CMakeLists.txt.
Odd that it wasn't merged automatically...
2013-10-23 14:56:37 +04:00
Vadim Pisarevsky 5a34272150 fixed build on Windows 2013-10-23 00:17:18 +04:00
Vadim Pisarevsky de521fc9fa fixed some more compile bugs (including Python bindings) 2013-10-22 23:34:16 +04:00
Vadim Pisarevsky d3076c5014 hopefully, fixed compile errors on Win & Linux; fixed getMatVector() so core & imgproc tests now pass; fixed doc builder errors 2013-10-22 17:41:28 +04:00
Roman Donchenko e384a7bb95 Merge pull request #1665 from SpecLad:cuda-min-ver 2013-10-22 16:44:09 +04:00
Roman Donchenko 779acfa715 Suppressed -Wundef in bioinspired, because of OpenCL headers. 2013-10-22 15:16:22 +04:00
Roman Donchenko 49c6533227 Move the minimal CUDA version into the minimal version list. 2013-10-22 14:32:13 +04:00
Roman Donchenko 4036f6a3d0 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	apps/CMakeLists.txt
	modules/contrib/CMakeLists.txt
	modules/core/include/opencv2/core/version.hpp
	modules/imgproc/include/opencv2/imgproc/imgproc.hpp
	modules/java/generator/gen_java.py
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/src/cl_runtime/cl_runtime.cpp
	modules/ocl/src/columnsum.cpp
	modules/ocl/src/filtering.cpp
	modules/ocl/src/imgproc.cpp
	modules/ocl/test/main.cpp
	modules/ocl/test/test_color.cpp
	modules/ocl/test/test_imgproc.cpp
	samples/gpu/CMakeLists.txt
2013-10-22 14:28:00 +04:00
Vadim Pisarevsky d8c8339bec the first draft of transparent API and new UMat class. more files 2013-10-22 14:05:15 +04:00
Vadim Pisarevsky 278fb617d2 the first draft of transparent API and new UMat class. 2013-10-22 14:04:49 +04:00
Roman Donchenko 6640846e95 Merge pull request #1653 from jlblancoc:master 2013-10-22 13:53:12 +04:00
Roman Donchenko 1e556e08dc Merge pull request #1661 from look4pritam:my-branch 2013-10-22 13:45:25 +04:00
look4pritam 8c121d372a Small OpenCV-CUDA bugs are fixed. 2013-10-22 12:08:43 +05:30
Jose-Luis Blanco-Claraco 80e667b647 Minimized the number of arguments required to workaround the MSVC2013 compiler bug. 2013-10-21 21:43:26 +02:00
Jose-Luis Blanco-Claraco 27b02921f3 Added patch file for fixing VS2013 in 3rd party lib OpenEXR 2013-10-21 21:41:27 +02:00
Jose-Luis Blanco-Claraco 77023e2366 Added comment to features2d_init.cpp explaining the reason for the extra parameters. 2013-10-21 21:17:15 +02:00
Jose-Luis Blanco-Claraco c33ca77838 Undo changing whitespace. 2013-10-21 15:59:26 +02:00
Jose-Luis Blanco-Claraco bec35eeddb Avoid duplicated variable declarations. 2013-10-21 15:57:11 +02:00
Roman Donchenko 29f37fc130 Merge pull request #1575 from jet47:gpu-buffer-pool 2013-10-21 16:35:14 +04:00
Roman Donchenko 21233656bd Merge pull request #1540 from jet47:gpuarithm-cudev 2013-10-21 16:34:45 +04:00
Roman Donchenko e290436a4c Merge pull request #1492 from jet47:gpucodec-cudev 2013-10-21 16:30:15 +04:00
Roman Donchenko f25b77ff1e Merge pull request #1534 from jet47:fix-cuda-5.0-build 2013-10-21 16:29:37 +04:00
Jose-Luis Blanco-Claraco 52a904e17b Fixed MSVC 2013 build errors and workaround for an internal compiler crash. 2013-10-20 17:28:45 +02:00
Roman Donchenko 4c102112dd Merge pull request #1631 from alalek:merge-2.4 2013-10-16 13:38:31 +04:00
Tony 5368f12b33 Rework gtk3 window resize and draw cleanup
The gtk3 resize functions fail to shrink the window after it has been
resized. This edit changes this and allows the window to be shrunk
back to its original size.

This edit also cleans up the draw/expose functions.
2013-10-15 21:49:20 +01:00
lluis b50185e160 Fix a bug in the er tree clean-up process (see discussion in https://github.com/Itseez/opencv/pull/1520). It's not necessary to walk the er tree in order to clean up the memory since it's possible to cleanup the regions in the stack just by iterating over the er_stack vector instead of walking the tree structure. This turns out to be safer because the tree structure of those regions may have been modified previously in er_save function. 2013-10-15 19:44:08 +02:00
Alexander Alekhin e845184843 Merge remote-tracking branch 'upstream/2.4' into merge-2.4
* #1538 from StevenPuttemans:bugfix_3283
* #1545 from alalek:ocl_test_fix_rng
* #1551 from alalek:cmake_install_win
* #1570 from ilya-lavrenov:ipp_warn_fix
* #1573 from alalek:perf_simple_strategy
* #1574 from alalek:svm_workaround
* #1576 from alalek:ocl_fix_cl_double
* #1577 from ilya-lavrenov:ocl_setto_opencl12
* #1578 from asmorkalov:android_fd_cp_fix
* #1579 from ilya-lavrenov:ocl_norm
* #1582 from sperrholz:ocl-arithm-additions
* #1586 from ilya-lavrenov:ocl_setto_win_fix
* #1589 from ilya-lavrenov:pr1582_fix
* #1591 from alalek:ocl_remove_cl_hpp_h
* #1592 from alalek:ocl_program_cache_update
* #1593 from ilya-lavrenov:ocl_war_on_double
* #1594 from ilya-lavrenov:ocl_perf
* #1595 from alalek:cl_code_cleanup
* #1596 from alalek:test_fix_run_py
* #1597 from alalek:ocl_fix_cleanup
* #1598 from alalek:ocl_fix_build_mac
* #1599 from ilya-lavrenov:ocl_mac_kernel_warnings
* #1601 from ilya-lavrenov:ocl_fix_tvl1_and_sparse
* #1602 from alalek:ocl_test_dump_info
* #1603 from ilya-lavrenov:ocl_disable_svm_noblas
* #1605 from alalek:ocl_fixes
* #1606 from ilya-lavrenov:ocl_imgproc
* #1607 from ilya-lavrenov:ocl_fft_cleanup
* #1608 from alalek:fix_warn_upd_haar
* #1609 from ilya-lavrenov:ocl_some_optimization
* #1610 from alalek:ocl_fix_perf_kalman
* #1612 from alalek:ocl_fix_string_info
* #1614 from ilya-lavrenov:ocl_svm_misprint
* #1616 from ilya-lavrenov:ocl_cvtColor
* #1617 from ilya-lavrenov:ocl_info
* #1622 from a0byte:2.4
* #1625 from ilya-lavrenov:to_string

Conflicts:
	cmake/OpenCVConfig.cmake
	cmake/OpenCVDetectPython.cmake
	cmake/OpenCVGenConfig.cmake
	modules/core/CMakeLists.txt
	modules/nonfree/src/surf.ocl.cpp
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/include/opencv2/ocl/private/util.hpp
	modules/ocl/perf/main.cpp
	modules/ocl/src/arithm.cpp
	modules/ocl/src/cl_operations.cpp
	modules/ocl/src/cl_programcache.cpp
	modules/ocl/src/color.cpp
	modules/ocl/src/fft.cpp
	modules/ocl/src/filtering.cpp
	modules/ocl/src/gemm.cpp
	modules/ocl/src/haar.cpp
	modules/ocl/src/imgproc.cpp
	modules/ocl/src/matrix_operations.cpp
	modules/ocl/src/pyrlk.cpp
	modules/ocl/src/split_merge.cpp
	modules/ocl/src/svm.cpp
	modules/ocl/test/main.cpp
	modules/ocl/test/test_fft.cpp
	modules/ocl/test/test_moments.cpp
	modules/ocl/test/test_objdetect.cpp
	modules/ocl/test/test_optflow.cpp
	modules/ocl/test/utility.hpp
	modules/python/CMakeLists.txt
	modules/ts/include/opencv2/ts.hpp
	modules/ts/src/ts_perf.cpp
	samples/android/face-detection/jni/DetectionBasedTracker_jni.cpp
2013-10-15 20:08:52 +04:00
Roman Donchenko 3f8db9d708 Merge pull request #1450 from adrians:neon-pull3 2013-10-14 15:08:37 +04:00
Andrey Pavlenko a239797271 Merge pull request #1611 from che-burashco:master 2013-10-12 16:32:39 +04:00
Kyrylo Shegeda d37d46d279 Fix a typo in kernel size 2013-10-11 23:31:31 -04:00
Adrian Stratulat 3561bc1bbc rename vBinOp64f to vBinOp64, minor fixups 2013-10-10 21:28:05 +03:00
Adrian Stratulat cb445d697c Refactor vectorized arithmetical operations 2013-10-10 15:52:48 +03:00
Tony d4df373999 Code cleanup
Remove redundent #if defs from code
2013-10-09 20:50:35 +01:00
Roman Donchenko 3d4ec7ad98 Merge pull request #1583 from SpecLad:name-enum-2 2013-10-09 13:45:40 +04:00
Roman Donchenko dfb698dc64 Merge pull request #1581 from SpecLad:merge-2.4 2013-10-09 12:33:50 +04:00
Alexander Alekhin 076eeffd4d ocl: fix CL_RUNTIME_EXPORT for master branch 2013-10-08 19:13:58 +04:00
Roman Donchenko cc7a13ea57 Named GraphCutSeamFinderBase to allow its usage in makePtr.
Sequel to bcb6f038.
2013-10-08 18:13:56 +04:00
Roman Donchenko f07769e9d8 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	cmake/OpenCVDetectOpenCL.cmake
	cmake/OpenCVModule.cmake
	modules/imgproc/src/floodfill.cpp
	modules/nonfree/src/surf.ocl.cpp
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/include/opencv2/ocl/private/util.hpp
	modules/ocl/perf/main.cpp
	modules/ocl/src/arithm.cpp
	modules/ocl/src/blend.cpp
	modules/ocl/src/build_warps.cpp
	modules/ocl/src/canny.cpp
	modules/ocl/src/cl_programcache.hpp
	modules/ocl/src/columnsum.cpp
	modules/ocl/src/haar.cpp
	modules/ocl/src/hog.cpp
	modules/ocl/src/imgproc.cpp
	modules/ocl/src/initialization.cpp
	modules/ocl/src/match_template.cpp
	modules/ocl/src/matrix_operations.cpp
	modules/ocl/src/mcwutil.cpp
	modules/ocl/src/moments.cpp
	modules/ocl/src/mssegmentation.cpp
	modules/ocl/src/precomp.hpp
	modules/ocl/src/pyrdown.cpp
	modules/ocl/src/pyrlk.cpp
	modules/ocl/src/pyrup.cpp
	modules/ocl/src/split_merge.cpp
	modules/ocl/src/stereo_csbp.cpp
	modules/ocl/src/stereobm.cpp
	modules/ocl/test/main.cpp
	samples/ocl/bgfg_segm.cpp
	samples/ocl/facedetect.cpp
	samples/ocl/pyrlk_optical_flow.cpp
	samples/ocl/squares.cpp
	samples/ocl/stereo_match.cpp
	samples/ocl/surf_matcher.cpp
	samples/ocl/tvl1_optical_flow.cpp
2013-10-08 17:57:23 +04:00
Vladislav Vinogradov 342e007dc6 now Allocator accepts GpuMat* instead of 3 pointers 2013-10-08 17:21:25 +04:00
Vladislav Vinogradov 3b412b51ac moved BufferPool management functions to public 2013-10-08 17:21:22 +04:00
Vladislav Vinogradov 5ea8085220 added BufferPool class 2013-10-08 17:20:29 +04:00
Vladislav Vinogradov 988ab79acb added BufferAllocator 2013-10-08 17:20:20 +04:00
Roman Donchenko 685eceb68a Merge pull request #1567 from ilya-lavrenov:warn_fix 2013-10-08 13:50:49 +04:00
Ilya Lavrenov 35d9ce0c0c fixed warnings 2013-10-08 12:46:43 +04:00
Roman Donchenko b08233a3ca Merge pull request #1569 from ilya-lavrenov:ocl_hough_circles 2013-10-07 17:47:41 +04:00
Roman Donchenko 920e15b41d Merge pull request #1572 from emchristiansen:includeLimits 2013-10-07 16:59:24 +04:00
Roman Donchenko f91f8663b6 Merge pull request #1568 from ilya-lavrenov:ocl_pyrlk 2013-10-07 15:53:20 +04:00
Vladislav Vinogradov e5188c7e94 added GpuMat::Allocator interface 2013-10-07 09:42:43 +04:00
emchristiansen 34f6b17c3f Merge pull request #1 from ImAlsoGreg/master
add include limits, for compilers that dont add it implicitly
2013-10-06 12:26:45 -07:00
Greg Hale 88b1847d09 add include limits, for compilers that dont add it implicitly 2013-10-06 01:21:43 -04:00
Eric Martin Christiansen c8a3a85e26 adds include to fix build 2013-10-05 15:52:19 -07:00
Tony c1cd70e25a Disable OpenGL when Gtk3 is selected
The OpenGL library is not supported on Gtk3 which uses the cairo
library for rendering. Cairo, in turn uses hardware acceleration when
supported by the underlying system. Some improvement to performance
may be gained by useing the cairo-gl and cairo-glx libraries included
on modern Gtk3 systems.

See the cairo documentation for further information. The following
link may also be of interest.

http://lists.cairographics.org/archives/cairo/2012-October/023609.html
2013-10-04 23:09:45 +01:00
Ilya Lavrenov 8c82decf5b added plain branch to HoughCircle perf test 2013-10-04 19:51:26 +04:00
Ilya Lavrenov 72c35d3a89 fixed mog2 2013-10-04 18:19:01 +04:00
Roman Donchenko 744f4b1609 Merge pull request #1565 from SpecLad:cmake-new-ptr 2013-10-04 18:14:34 +04:00
Ilya Lavrenov fb73e7b4bd fixed pyrlk optical flow 2013-10-04 17:56:02 +04:00
Roman Donchenko cca2e5d8b1 Merge pull request #1536 from asmorkalov:android_ndk_r9_master 2013-10-04 16:36:44 +04:00
Roman Donchenko f04cade607 Merge pull request #1559 from SpecLad:Wnull-conversion 2013-10-04 16:08:54 +04:00
Roman Donchenko b03c19a8ac Merge pull request #1554 from pablospe:fix_viz_module_compilation 2013-10-04 14:02:17 +04:00
Roman Donchenko 32630dbf61 Adapt cap_openni.cpp to the new Ptr. 2013-10-04 13:51:58 +04:00
Roman Donchenko ac36ae0498 Merge pull request #1553 from pablospe:doc_include_directories_cmake 2013-10-04 12:59:09 +04:00
Roman Donchenko 1817a07a5e Fixed a -Wnull-conversion Clang warning in cap_gstreamer.cpp. 2013-10-03 12:11:50 +04:00
Roman Donchenko a1e239d2bf Merge pull request #1527 from vpisarev:shape_module 2013-10-03 11:54:41 +04:00
Alexander Smorkalov ccb48ddee0 Android NDK r9 support. x64 NDK support fix for MacOS X. 2013-10-03 11:23:50 +04:00
Pablo Speciale f47afe5799 Fixed VIZ compilation module (Bug 3297: code.opencv.org/issues/3297) 2013-10-03 02:10:27 +02:00
Pablo Speciale 169ebae8c0 After commit c7bbd1a, 'include_directories()' is needed in the CMakeLists.txt (user side). This commit updates the documentation. 2013-10-03 00:43:12 +02:00
Tony 81d6842b8e These changes introduce Gtk3 support into the highgui module.
A new option WITH_GTK3 has been added to the cmake configure system to enable compilation under Gtk version 3.The flag HAVE_GTK3 is also introduced to select the new Gtk3 code in the source files. (Gtk2 is disbled when Gtk3 is selected).

window_gtk.cpp has been modified to remove obsolete (and deleted from libgtk 3) and introduce new Gtk3 code in its place when compiled for Gtk3.

To compile for Gtk2, disable WITH_GTK3 in cmake. To build for Gtk3 both WITH_GTK and WITH_GTK3 must be selected.
2013-10-02 21:16:40 +01:00
Roman Donchenko 447e03bc28 Merge pull request #1543 from SpecLad:name-enum 2013-10-02 19:22:35 +04:00
Roman Donchenko e389111b5b Merge pull request #1550 from SpecLad:flann-uninit-master 2013-10-02 18:52:38 +04:00
Roman Donchenko 58da54cb7a Cherry-picked mariusmuja/flann@8c8b0e0cb8.
Original author: me.
2013-10-02 16:09:45 +04:00
Roman Donchenko 4c19e0273a Cherry-picked mariusmuja/flann@b615f26947.
Original author: Alex Wilson.
2013-10-02 16:06:56 +04:00
Roman Donchenko 78c4ffec99 Revert "Fixed a bug in FLANN resulting in uninitialized accesses."
This reverts commit a9975b144a, to prepare
for cherry-picking upstream's solution.
2013-10-02 16:02:11 +04:00
Roman Donchenko 60bcc52c4f Merge pull request #1541 from SpecLad:merge-2.4 2013-10-02 14:47:30 +04:00
Roman Donchenko 30d7e1c33d Merge remote-tracking branch 'origin/master' into merge-2.4
Conflicts:
	doc/tutorials/bioinspired/retina_model/retina_model.rst~
2013-10-02 13:37:33 +04:00
Roman Donchenko 4c7ecf20d8 Merge pull request #1529 from vpisarev:polyfit_accuracy_2 2013-10-02 12:52:33 +04:00
Roman Donchenko a71a891b93 Merge pull request #1451 from adrians:neon-pull2 2013-10-02 12:51:30 +04:00
Roman Donchenko 1ac1b9ae35 Merge pull request #1474 from f-morozov:for_pr 2013-10-02 11:49:54 +04:00
Roman Donchenko 184ae873d4 Merge pull request #1526 from vpisarev:linedetector_python 2013-10-01 19:49:17 +04:00
Roman Donchenko bcb6f0386e Named FastFeatureDetector::Type to allow its use in makePtr.
It has actually worked before (likely because it's inside a class),
but C++03 does disallow unnamed types as template arguments,
and there's a report that at least in one version of GCC it's
enforced: <http://code.opencv.org/issues/3278>.
2013-10-01 18:22:03 +04:00
Roman Donchenko 6133aeede8 Merge branch 'master' into merge-2.4
Conflicts:
	doc/tutorials/definitions/tocDefinitions.rst
2013-10-01 17:37:05 +04:00
Roman Donchenko 8717281e0e Merge pull request #1209 from nghiaho12:master 2013-10-01 17:07:39 +04:00
Roman Donchenko aeedc7adec Emergency fix: rename a conflicting label in the tutorials. 2013-10-01 16:10:40 +04:00
Roman Donchenko 81eb4bd8be Merge remote-tracking branch 'origin/2.4'
Conflicts:
	doc/tutorials/features2d/feature_detection/feature_detection.rst
	modules/bioinspired/doc/retina/index.rst
	modules/core/include/opencv2/core/core.hpp
	modules/core/include/opencv2/core/mat.hpp
	modules/core/include/opencv2/core/operations.hpp
	modules/core/src/stat.cpp
	modules/features2d/include/opencv2/features2d/features2d.hpp
	modules/imgproc/src/filter.cpp
	modules/legacy/src/dpstereo.cpp
	modules/nonfree/src/surf.ocl.cpp
	modules/ocl/doc/image_processing.rst
	modules/ocl/doc/object_detection.rst
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/include/opencv2/ocl/private/util.hpp
	modules/ocl/src/arithm.cpp
	modules/ocl/src/canny.cpp
	modules/ocl/src/filtering.cpp
	modules/ocl/src/imgproc.cpp
	modules/ocl/src/initialization.cpp
	modules/ocl/src/matrix_operations.cpp
	modules/ocl/src/pyrdown.cpp
	modules/ocl/src/pyrup.cpp
	modules/ocl/src/split_merge.cpp
	modules/ocl/test/test_objdetect.cpp
	modules/ocl/test/utility.hpp
2013-10-01 15:57:33 +04:00
Roman Donchenko 4ec5c04504 Merge pull request #1315 from dbloisi:add_bs_tutorial 2013-10-01 15:29:38 +04:00
Vladislav Vinogradov 8ed47c01b7 used new device layer for cv::cuda::norm 2013-10-01 15:28:51 +04:00
Vladislav Vinogradov 23cc31e041 used new device layer for cv::cuda::LUT 2013-10-01 15:24:17 +04:00
Nghia Ho 61f5176bad Removed trailing whitespace 2013-10-01 21:03:54 +10:00
Nghia Ho d7bf71c24a Merge remote-tracking branch 'upstream/master' 2013-10-01 19:56:47 +10:00
Vladislav Vinogradov 06f07944c8 removed dependecy from cudalegacy 2013-10-01 12:18:40 +04:00
Vladislav Vinogradov 7839dbd2c4 used new device layer for cv::gpu::integral 2013-10-01 12:18:39 +04:00
Vladislav Vinogradov 224f18b06c bitwise operation optimization 2013-10-01 12:18:39 +04:00
Vladislav Vinogradov eb449968b6 removed unroll_detail.hpp 2013-10-01 12:18:39 +04:00
Vladislav Vinogradov 1ef211b889 used new device layer for cv::gpu::reduce 2013-10-01 12:18:39 +04:00
Vladislav Vinogradov 31a7814395 used new device layer for cv::gpu::countNonZero 2013-10-01 12:18:39 +04:00
Vladislav Vinogradov 020624c481 used new device layer for cv::gpu::minMaxLoc 2013-10-01 12:18:39 +04:00
Vladislav Vinogradov e1aa2fd06c added gridMinMaxLoc function 2013-10-01 12:18:39 +04:00
Vladislav Vinogradov 3fb9c52272 cast to reference 2013-10-01 12:18:38 +04:00
Vladislav Vinogradov bbd519be42 fixed warnings 2013-10-01 12:18:38 +04:00
Vladislav Vinogradov 045a856c24 used new device layer for cv::gpu::minMax 2013-10-01 12:18:38 +04:00
Vladislav Vinogradov b705e0d886 used new device layer for cv::gpu::sum 2013-10-01 12:18:38 +04:00
Vladislav Vinogradov 9fe92e2111 renamed grid/glob_reduce.hpp -> grid/reduce.hpp 2013-10-01 12:18:38 +04:00
Vladislav Vinogradov e820c5c65f used new device layer for cv::gpu::mulSpectrums 2013-10-01 12:18:38 +04:00
Vladislav Vinogradov 3f62e78592 used new device layer for cv::gpu::copyMakeBorder 2013-10-01 12:18:38 +04:00
Vladislav Vinogradov 7b3bbcea71 used new device layer for cv::gpu::transpose 2013-10-01 12:18:37 +04:00
Vladislav Vinogradov 6dbb32a05d switched to new device layer in split/merge 2013-10-01 12:18:37 +04:00
Vladislav Vinogradov 3ab7f4b26a removed arithm_func_traits.hpp 2013-10-01 12:18:37 +04:00
Vladislav Vinogradov 7c8c836a7b switched to new device layer in polar <-> cart 2013-10-01 12:18:37 +04:00
Vladislav Vinogradov 5522f43b18 used new device layer for cv::gpu::threshold 2013-10-01 12:18:37 +04:00
Vladislav Vinogradov e83be009a3 used new device layer for cv::gpu::addWeighted 2013-10-01 12:18:37 +04:00
Vladislav Vinogradov c7a3a7d4d9 switched to new device layer in min/max 2013-10-01 12:18:36 +04:00
Vladislav Vinogradov b11cccaaca switched to new device layer in bitwize operations 2013-10-01 12:18:36 +04:00
Vladislav Vinogradov fdfffa5291 fixed warnings 2013-10-01 12:18:36 +04:00
Vladislav Vinogradov ef9917ecf1 used new device layer for cv::gpu::compare 2013-10-01 12:18:36 +04:00
Vladislav Vinogradov 43e811118b fixed assertion 2013-10-01 12:18:36 +04:00
Vladislav Vinogradov 766d950ff3 used new device layer in math per element operations 2013-10-01 12:18:36 +04:00
Vladislav Vinogradov 7628e57fc6 used new device layer for cv::gpu::absdiff 2013-10-01 12:18:35 +04:00
Vladislav Vinogradov 574ff47146 used new device layer for cv::gpu::divide 2013-10-01 12:18:35 +04:00
Vladislav Vinogradov e7dba695b3 used new device layer for cv::gpu::multiply 2013-10-01 12:18:35 +04:00
Vladislav Vinogradov 156f86ea0b used new device layer for cv::gpu::subtract 2013-10-01 12:18:35 +04:00
Vladislav Vinogradov 9c5da2ea22 used new device layer for cv::gpu::add 2013-10-01 12:18:35 +04:00
Vladislav Vinogradov 32d578f5f0 fixed gridTransform overloads problems 2013-10-01 12:18:35 +04:00
Vladislav Vinogradov f4fb7fe1be fixed compilation error "ambiguous symbol" on CUDA 5.0:
disabled Texture Reference API for old CUDA toolkits
2013-10-01 12:15:30 +04:00
Roman Donchenko e0f5a2e532 Merge pull request #1512 from Exocoder:pre-gtk3 2013-10-01 12:09:17 +04:00
John Stowers 51341738ba Add cv::logPolar, cv::linearPolar, and a python example 2013-09-30 22:31:19 +02:00
Tony 0d06b1dced Change true for TRUE
The second parameter of gtk_widget_set_realized is of type gboolean
(gint). This is to ensure compatibility on alternative compilers and
platforms.
2013-09-30 21:04:43 +01:00
Vadim Pisarevsky c810d03d5c some more attempts to fix compile bug on Android 2013-09-30 19:28:11 +04:00
Roman Donchenko ada858e1c0 Merge pull request #1429 from nzjrs:fix-sketcher 2013-09-30 18:06:56 +04:00
Roman Donchenko a4b3aa9e1e Merge pull request #1477 from nzjrs:python-gethardwaresupport 2013-09-30 17:44:45 +04:00
Roman Donchenko f3f7f70588 Merge pull request #1488 from abidrahmank:py_tutorials 2013-09-30 17:39:45 +04:00
Nghia Ho c41a5b9c2c Merge remote-tracking branch 'upstream/master' 2013-09-30 22:59:29 +10:00
Roman Donchenko 4ce0a8a822 Merge pull request #1520 from lluisgomez:scene_text_erGrouping_classifier 2013-09-30 16:08:21 +04:00
Vadim Pisarevsky c3748a5f95 fixed the trailing whitespaces 2013-09-30 16:06:48 +04:00
Vadim Pisarevsky ca0956a7e2 this is rewrite of the github patch #674 by chouclee; the goal is to improve polyfit accuracy 2013-09-30 16:00:39 +04:00
Vadim Pisarevsky bc1f9d6268 fixed description of createLineSegmentDetector 2013-09-30 15:07:32 +04:00
Vadim Pisarevsky cd84742556 attempts to fix build errors on Android 2013-09-30 14:53:48 +04:00
Alex Leontiev 0324932fb3 Added the copyright statements
Added the copyrights missing in all files that required so.
2013-09-30 18:53:32 +08:00
Juan Manuel Perez f6fc39ce8f Putting definitions of SCD and SCDMatcher separated from sc_dis.cpp file 2013-09-30 14:39:17 +04:00
Juan Manuel Perez 4672a70c1f Replaced dynamic_cas with Ptr::dynamicCast<>, and & with && 2013-09-30 14:39:17 +04:00
Juan Manuel Perez 1bf4298251 Macro removal 2013-09-30 14:39:17 +04:00
Juan Manuel Perez aa73dafbbb 2 Compile error fix for Win 2013-09-30 14:39:17 +04:00
Juan Manuel Perez 752d88f5d2 Compile error fix for Win 2013-09-30 14:39:17 +04:00
Juan Manuel Perez 5a1e9876fc Corrected compilation errors Win 2013-09-30 14:39:17 +04:00
Juan Manuel Perez ead966709d Remove ~ file 2013-09-30 14:39:17 +04:00
Juan Manuel Perez fe7bab499f Corrections for compiling issues in Win, And and Doc 2013-09-30 14:39:17 +04:00
Juan Manuel Perez 61c27ac81e Shape module added 2013-09-30 14:39:17 +04:00
Vadim Pisarevsky 851a8a1cd0 fixed whitespace error 2013-09-30 14:31:39 +04:00
Alexander Mordvintsev 20fe614c2f createLineSegmentDetectorPtr -> createLineSegmentDetector in tests and samples 2013-09-30 14:30:01 +04:00
Alexander Mordvintsev 0a8d62e5fd createLineSegmentDetectorPtr -> createLineSegmentDetector 2013-09-30 14:30:01 +04:00
Alexander Mordvintsev f0b050fa88 exposed LineSegemntDetector to python 2013-09-30 14:30:00 +04:00
Alex Leontiev 3ac3ba0415 Minor fixes
Fix failed builds that opencv's buildbot has got.
2013-09-28 22:33:13 +08:00
Alex Leontiev 891bcd8491 Finish implementing the Nonlinear Conjugate Gradient
Now everything is prepared for the pull request.
2013-09-28 15:20:45 +08:00
lluis 047b568f6d erGrouping now uses a classifier for group validation instead of a set of heuristical ifos.
Updated documentation and sample to use the new function API
2013-09-27 19:19:45 +02:00
Tony 97fc1e10a7 Replace obsolete Gtk symbols
This update replaces depreciated Gtk1.x symbols with Gtk2.x symbols in
preparation for adding Gtk3 support. These edits aim to be fully
compatible with Gtk2.x, allowing backward compatibility.

The following symbols have been replaced in this commit:

Gtk symbols that have been moved to the Gdk library:
 - GtkType -> Gtype
 - GTK_CHECK_CAST -> G_TYPE_CHECK_INSTANCE_CAST
 - GTK_CHECK_TYPE -> G_TYPE_CHECK_INSTANCE_TYPE
 - gtk_signal_connect -> g_signal_connect
 - GTK_SIGNAL_FUNC -> G_CALLBACK
 - gtk_type_class -> g_type_class_peek
 - gtk_type_new-> g_object_new
 - GtkTypeInfo -> GtypeInfo (Not required for
   g_type_register_static_simple)
 - gtk_type_unique -> g_type_register_static_simple
 - gdk_draw_image_rgb -> replaced by gdk_cairo_source_pixbuf
   NB: This requires porting to use cairo contexts and GdkPixbufs.

The following gtk symbols are changed for their modern equivalent:
 - GTK_WIDGET_REALIZED -> gtk_widget_get_realized
 - GTK_OBJECT_FLAGS -> gtk_widget_set_realized

Symbols without replacement:
 - gtk_range_set_update_policy -> No replacement; as default policy is
   set to continuous we can delete this line.
2013-09-26 18:31:44 +01:00
Fedor Morozov c9ace38897 Docs updated, added InputArray, fixes for makePtr,... 2013-09-26 19:02:35 +04:00
Nghia Ho 5921c77613 Merge remote-tracking branch 'upstream/master' 2013-09-26 23:08:23 +10:00
Alexander Smorkalov 4b203f7b1a Merge pull request #1470 from IceRage:min_enclosing_triangle 2013-09-26 16:28:54 +04:00
Nghia Ho 357e5d55f6 Removed trailing whitespaces 2013-09-26 19:14:59 +10:00
Nghia Ho e6a9c22b9d Merge remote-tracking branch 'upstream/master' 2013-09-26 19:13:01 +10:00
Alexander Smorkalov 0d49206a98 Merge pull request #1485 from vpisarev:ipp_fixes 2013-09-26 11:09:59 +04:00
Alexander Smorkalov 241aa6e5a8 Merge pull request #1497 from jet47:fix-bug-3277 2013-09-26 09:31:06 +04:00
Alexander Smorkalov c6ab8cb6ee Merge pull request #1471 from ozantonkal:master 2013-09-25 17:19:39 +04:00
Alexander Smorkalov e1f55c3fcc Merge pull request #1496 from shawke:patch-1 2013-09-25 11:29:46 +04:00
Vladislav Vinogradov e675684c81 fix bug #3277 (findCirclesGrid failures):
findHomagraphy can return empty Mat in master branch
2013-09-24 14:45:13 +04:00
shawke 720241de87 Make similar default typedefs for Point_, Size_ and Rect_
Currently, there are different default typedefs for Point_, Size_, and Rect_. This pull request at least makes sure that default typedefs exist for int, float and double variants of each of these types.
2013-09-24 11:48:04 +02:00
Alexander Smorkalov c8b97271cc Merge pull request #1430 from nzjrs:add-brisk-to-demos 2013-09-23 16:34:19 +04:00
Nghia Ho b4ffb0878d Merge remote-tracking branch 'upstream/master' 2013-09-23 20:05:51 +10:00
Alexander Smorkalov b5f3709ab9 Merge pull request #1484 from lluisgomez:scene_text_detection_documentation 2013-09-23 14:00:08 +04:00
lluis 5670e4f6cd fixed typos 2013-09-23 10:17:47 +02:00
Vladislav Vinogradov 776c0cb08c switched to new device layer in gpucodec module 2013-09-23 12:16:57 +04:00
abidrahmank 899781b3d6 GSoC Python Tutorials
GSoC Python Tutorials

removed white spaces

removed blank lines at EOF

removed duplicate labels
2013-09-23 13:41:14 +05:30
Alexander Smorkalov 298a1d50d2 Merge pull request #1299 from jet47:gpu-cuda-rename 2013-09-23 10:31:51 +04:00
Alex Leontiev 581d454536 Refined interface for Conjugate Gradient
Some interface was refined (most notably, the method for returning
Hessian was removed and the method for getting gradient was added as
optional to base Solver::Function class) and basic code for
setters/getters was added. Now is the time for the real work on an
algorithm.
2013-09-22 00:27:00 +08:00
lluis 5556f051f1 added rst documentation for the Class-specific Extremal Regions for Scene Text Detection 2013-09-20 21:39:11 +02:00
John Stowers 4b19fda1d6 Add brisk features to python demos 2013-09-20 21:12:49 +02:00
John Stowers 42faaa8b39 Fix mouse handling in python demos 2013-09-20 21:04:07 +02:00
John Stowers 14d225134d Redefine CPU_xx constants in cv::namespace
This makes them visible from the python bindings
2013-09-20 20:04:33 +02:00
Nghia Ho 4171767d19 Merge remote-tracking branch 'upstream/master' 2013-09-21 02:20:25 +10:00
Vadim Pisarevsky 8e7eb79f6e fixed compile errors and warnings when building master branch with IPP enabled 2013-09-20 16:02:15 +04:00
Alex Leontiev eb1333d0a8 Initial commit for Conjugate Gradient method
Implementation is based on
http://www.cs.cmu.edu/~quake-papers/painless-conjugate-gradient.pdf

So far we only have basic interface and empty test. But it compiles at
least.
2013-09-20 15:12:48 +08:00
Alexander Smorkalov c0c575d68e Merge pull request #1481 from Human:master 2013-09-20 11:08:09 +04:00
Alexander Smorkalov 1445a29e1c Merge pull request #1469 from lluisgomez:scene_text_detection_erGrouping 2013-09-20 10:54:53 +04:00
Bob Igo 2eb5ca0024 fixed malformed XML 2013-09-19 16:32:32 -04:00
Ovidiu Parvu 2bf36c312f Removed static variables which were not read-only and used more function parameters instead. 2013-09-19 18:32:03 +01:00
Ovidiu Parvu e324446c70 Changed the signature of the minEnclosingTriangle function such that it returns the area automatically. Moreover, the overloaded function was no longer required so it was removed. Sample code, documentation and unit tests were updated correspondingly. 2013-09-19 16:22:30 +01:00
Ovidiu Parvu 52cdae6e2b Removed the cvMinEnclosingTriangle function since the C API will be deprecated starting with OpenCV 3.0 2013-09-19 15:37:10 +01:00
Ovidiu Parvu 21390d806f Removed non-ASCII characters from the comments 2013-09-19 15:12:07 +01:00
Nghia Ho 8e8ff4dd33 Merge remote-tracking branch 'upstream/master' 2013-09-19 23:58:19 +10:00
Alexander Smorkalov 0ecd7913f8 Merge pull request #1472 from alalek:master_fix_debug_builds_on_win 2013-09-19 14:41:55 +04:00
lluis 2837bfd9fa Added erGrouping function: Find groups of Extremal Regions that are organized as text blocks. Updated sample/cpp to use the complete text detection pipeline 2013-09-19 10:30:25 +02:00
Alexander Smorkalov c550e452f9 Merge pull request #1384 from hbristow:matlab_public 2013-09-19 10:25:02 +04:00
Fedor Morozov f99be6bda6 Mergin itseez 2013-09-18 18:55:12 +04:00
Ovidiu Parvu 73f476bd4b Added a namespace and prefixed global variables with "G_" in order to prevent variable shadowing problems. 2013-09-18 15:51:10 +01:00
Fedor Morozov 90b6af1496 Merge new changes 2013-09-18 18:21:45 +04:00
Fedor Morozov b1af5cc478 Remove ghost removal 2013-09-18 18:15:51 +04:00
Ozan Tonkal 5780b418c9 delete duplicate bunny.ply, remove tabs and extra lines 2013-09-18 13:46:43 +01:00
Ovidiu Parvu 737c5fe781 Updated the return type of the cvMinEnclosingTriangle function in the documentation 2013-09-18 13:09:55 +01:00
Alexander Alekhin 81ac97c6bd fix for broken debug builds (MSVS2010/2012) 2013-09-18 16:05:21 +04:00
Ozan Tonkal 8de46e1f81 removed trailing spaces 2013-09-18 12:50:55 +01:00
Ovidiu Parvu dc64dd7315 Made the following changes after code inspection (min_enclosing_triangle.cpp):
* Corrected minor typos in comments/function signatures
* Added new details to copyright statement
* Removed unreferenced macros
* Removed the assert statement which was checking the type of the OutputArray triangle
* When returning results using Mat::copyTo instead of Mat::convertTo
* Changed C-style casts to static_casts
* Added division by zero check to distanceFromPointToLine() function
* Updated reference webpages last access dates
* Moved the declaration of the gammaOfA variable outside the while loop in moveAIfLowAndBIfHigh() function for efficiency reasons
2013-09-18 12:21:24 +01:00
hbristow d84ab09ab7 Updated documentation 2013-09-18 18:52:23 +10:00
Ozan Tonkal 824c28a588 Merge remote-tracking branch 'itseez/master' 2013-09-18 08:44:37 +01:00
hbristow 1dd017e9d0 Fixed a memory leak in mxarray 2013-09-18 17:10:54 +10:00
Alexander Smorkalov 99a43257d5 Merge pull request #1465 from jet47:cudev-old-cc 2013-09-18 10:39:53 +04:00
Alexander Smorkalov 3fa3722641 Merge pull request #1458 from look4pritam:my-branch 2013-09-17 22:50:48 +04:00
Ozan Tonkal 223fb39d94 include viz tutorials in the main tutorials file. ignore viz samples 2013-09-17 20:17:13 +02:00
Ozan Tonkal a117400577 ignore viz tutorials when BUILD_opencv_viz is not set 2013-09-17 18:55:10 +02:00
Ozan Tonkal e3e5fd5baa Merge remote-tracking branch 'itseezstream/master' 2013-09-17 17:50:14 +02:00
Andrey Pavlenko ad404ef44f Merge pull request #1446 from lluisgomez:scene_text_detection_NM_fix2 2013-09-17 17:50:46 +04:00
Vladislav Vinogradov 20f636fcee fixed cudev compilation for old pre-Fermi archs 2013-09-17 17:43:12 +04:00
Fedor Morozov 89508bf7ab NO exr now 2013-09-17 00:46:15 +04:00
Fedor Morozov 76c6fa9348 No EXR in tests 2013-09-17 00:39:22 +04:00
look4pritam a430abd02e The thin prism distortion coefficient related small bug is fixed. 2013-09-16 13:39:11 +05:30
Ovidiu Parvu b570a4ac47 Added the C interface function signature and the overloaded minEnclosingTriangle Python function to the documentation. 2013-09-15 23:40:40 +01:00
Ovidiu Parvu 130b4d8e26 Changed the return type of cvMinEnclosingTriangle to CVAPI(void). Added the implementation of the function to the min_enclosing_triangle.cpp source file. 2013-09-15 23:25:36 +01:00
Ovidiu Parvu 7ac768651f Added the signature cvMinEnclosingTriangle (C version) to the imgproc_c.h header 2013-09-15 22:40:57 +01:00
Ovidiu Parvu 0117d77cd1 Added the tests for the minEnclosingTriangle function in the existing test_convhull.cpp file. 2013-09-15 22:25:58 +01:00
Ozan Tonkal 3165b526f2 merge with Itseez/opencv 2013-09-15 17:51:27 +02:00
hbristow eb3a83209c Added TODO for the future of Matlab version sorting 2013-09-16 00:48:07 +10:00
Ozan Tonkal c31fb8ffff rename widgets from *Widgets to W* 2013-09-15 16:26:53 +02:00
Ovidiu Parvu caaa9e0f2d - Wrote the documentation for the minEnclosingTriangle function (+1 extra picture depicting a sample output) 2013-09-15 15:07:17 +01:00
hbristow 31c58d23e0 Streamlined mexext detection, with removal of trailing whitespace/newlines handled by execute_process 2013-09-15 23:53:29 +10:00
Ozan Tonkal f570b3e18d cmake check if VTK version is lower than 5, and give fatal error if it is 2013-09-15 11:24:20 +02:00
hbristow 86b7e3d15d Moved Jinja2 into 3rdparty. Now using latest stable version from pypi (2.7.1) 2013-09-15 17:36:13 +10:00
Adrian Stratulat f9ea3772b0 Add compile option for enabling NEON 2013-09-14 13:32:20 +03:00
hbristow 224f44a255 Made changes to OpenCVFindMatlab suggested by SpecLad 2013-09-14 13:32:15 +10:00
lluis d25309f82e first parameter of createERFilterNM1/createERFilterNM2 is now mandatory. changed the sample program to use the new prototypes 2013-09-13 16:29:21 +02:00
lluis 75fdfba281 renamed getDefaultClassifierNM{1,2}() to loadClassifierNM{1,2}() and added "const std::string& filename" parameter (mandatory). 2013-09-13 16:19:52 +02:00
Roman Donchenko eff21788a8 Merge pull request #1445 from vpisarev:stereocalib_quick_fix 2013-09-13 15:01:14 +04:00
lluis 95d92c099c functions getDefaultClassifierNM1() and getDefaultClassifierNM2() allow to implicitly load the default classifiers when creating a ERFilter object 2013-09-13 12:54:23 +02:00
Roman Donchenko 160ab8415e Merge pull request #1330 from lenlen:plantuml 2013-09-13 14:31:01 +04:00
Vadim Pisarevsky 84022b0c19 fix thin-prism coefficients at 0's in the stereo calibration function unless the flag CALIB_THIN_PRISM_MODEL is explicitly set 2013-09-13 13:32:42 +04:00
Roman Donchenko c511d5d649 Merge pull request #1414 from lluisgomez:scene_text_detection_computeNMChannels 2013-09-13 13:31:14 +04:00
Roman Donchenko 0033d453f2 Merge pull request #1426 from nailbiter:optimPD 2013-09-13 13:27:02 +04:00
Roman Donchenko e3b92a9591 Merge pull request #1441 from look4pritam:prism-stereo 2013-09-13 13:17:06 +04:00
Roman Donchenko 4082a0c64e Merge pull request #1442 from SpecLad:version-status 2013-09-13 13:16:30 +04:00
hbristow 232f11e256 Updated OpenCVFindMatlab with changes suggested by SpecLad 2013-09-13 18:08:33 +10:00
hbristow 530ad447bc Added fixes to CMakeLists.txt 2013-09-13 17:22:12 +10:00
Ovidiu Parvu 8bada4c751 Overloaded the minEnclosingTriangle function such that there is an alternative function with the same name which does not require the output parameter ``area''.
Changed the sample source file minarea.cpp to use the overloaded version of the function.
Updated some comments in the min_enclosing_triangle.cpp source file.
2013-09-12 23:47:48 +01:00
Ozan Tonkal 3f27ba54e0 re-render the scene after changing camera properties 2013-09-12 19:23:05 +02:00
Mathieu Barnachon 0934344a3d Update sample and code with external computation of HOG detector. 2013-09-12 18:38:49 +02:00
Ovidiu Parvu 0ed2f6201d Optimised one assert statement in the min_enclosing_triangle.cpp file. Added the minEnclosingTriangle functionality to the existing minarea.cpp sample file. 2013-09-12 15:01:21 +01:00
Ovidiu Parvu 9902affae6 Added some assert statements to constrain the type of the input and output parameters. Convert the input set of points to vector<Point2f> before passing it to the findMinimumAreaEnclosingTriangle function. 2013-09-12 14:34:08 +01:00
Roman Donchenko d669559ec3 Bumped version to 3.0. 2013-09-12 16:40:14 +04:00
Roman Donchenko b525c28244 Updated the Java bindings and docs to support the version status. 2013-09-12 16:39:14 +04:00
Roman Donchenko 473bfb0019 Updated the build config files to deal with the version status.
I didn't make the status part of the version variables here, because
letters don't play too well with version comparison algorithms
(especially with CMake's, which only supports numbers).
2013-09-12 16:37:30 +04:00
Roman Donchenko cd8ff69637 Added version status support into the build system. 2013-09-12 16:37:05 +04:00
Ovidiu Parvu 4fce8e6b0e Changed the semantics of the minEnclosingTriangle function such that:
1. The function receives a set of points as input instead of a convex polygon with more than three vertices
2. The convex hull P is computed inside the function
3.1. If the number of vertices of P is greater than three then the algorithm which was implemented before executes
3.2. Otherwise the vertices of the triangle are picked from the vertices of the given polygon and the area computed
2013-09-12 13:29:10 +01:00
Roman Donchenko 887825e831 Added an additional version component - the development status.
This will allow us to distinguish between regular releases, prereleases
and development versions.
2013-09-12 16:20:09 +04:00
antonella 5b2d557502 Added plantuml extension
Aligned strings in CMakeList

Modified the check on plantuml extension

Some fixes

Moved find_host_program for plantuml script
2013-09-12 10:41:21 +00:00
look4pritam 7fd7bbc9f1 The prism distortion coefficients are added for the stereo calibration. 2013-09-12 15:17:11 +05:30
Ovidiu Parvu 510ad8e779 - Changed the type of the minEnclosingTriangle function parameters by using proxy classes InputArray/OutputArray instead of std::vector<T>
- Adapted the source code to accommodate this change
2013-09-12 10:11:38 +01:00
Ovidiu Parvu e6b58c4e79 - Added the minEnclosingTriangle function declaration to the imgproc header
- Added the source code for the function in the separate file min_enclosing_triangle.cpp
2013-09-11 18:07:19 +01:00
Roman Donchenko 4fe8e377ed Merge pull request #1436 from SpecLad:host-git 2013-09-11 19:06:50 +04:00
Roman Donchenko 03926fac20 Fixed finding Git when cross-compiling. 2013-09-11 17:54:34 +04:00
Ozan Tonkal 620d92824c hide VizMap and VizPair from public interface 2013-09-11 13:23:57 +02:00
Vladislav Vinogradov 6bbac2a7d9 Merge branch 'master' into gpu-cuda-rename 2013-09-11 09:41:23 +04:00
Roman Donchenko acc2ca484c Merge pull request #1425 from pengx17:master_retina_ocl_fix 2013-09-10 18:29:25 +04:00
Roman Donchenko 242e4254f3 Merge pull request #1427 from SpecLad:merge-2.4 2013-09-10 18:28:20 +04:00
Roman Donchenko 7238479813 Merge pull request #1415 from znah:sfm_py 2013-09-10 11:37:05 +04:00
Roman Donchenko 54c6830937 Merge pull request #1422 from SpecLad:nat-act-upd 2013-09-10 11:32:09 +04:00
Roman Donchenko 95c2e8b51f Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	.gitignore
	doc/tutorials/objdetect/cascade_classifier/cascade_classifier.rst
	modules/gpu/src/match_template.cpp
	modules/imgproc/include/opencv2/imgproc/imgproc.hpp
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/perf/perf_precomp.hpp
2013-09-10 11:30:19 +04:00
peng xiao 8767c47463 Fix whitespaces. 2013-09-10 15:13:53 +08:00
pengxiao a92721b569 Fix retina ocl on NV.
Previously we incorrectly assumed data was aligned in 16 bytes, which should be 32.
2013-09-10 14:33:23 +08:00
Alex Leontiev a29863ee7b Eliminate use of 32-bit floating pt type
Replace all "float" by "double" (64-bit) to avoid "lose precision"
warnings.
2013-09-10 13:53:26 +08:00
Alex Leontiev 1207cd132b Minor fixes
Fixed integer vs unsigned integer comparison in .cpp test source and
trailing whitespaces in source code
2013-09-10 13:53:26 +08:00
Alex Leontiev 11fa0651c6 Minor fixes
As the opencv's build-bot did not want to compile this revision, I had
to do some changes. In particular,
1) Removed unsigned int vs int comparisons, that were treated as errors
2) Removed unused variables and functions
3) Removed functions without previous declaration
4) Fixed whitespaces
2013-09-10 13:53:26 +08:00
Alex Leontiev ccc71ac190 Primal-dual algorithm
This is an implementation of primal-dual algorithm, based on the C++
source code by Vadim Pisarevsky. It was extended to handle the denoising
based on multiple observations. It also contains documentation and
tests.
2013-09-10 13:53:26 +08:00
lluis ad94628038 Using cv::magnitude instead of custom loop and Mat<float> instead of Mat<double> to compute gradient magnitude channel. 2013-09-09 18:37:55 +02:00
Roman Donchenko 4ee5599d4b Merge pull request #1381 from 23pointsNorth:master 2013-09-09 19:53:56 +04:00
Roman Donchenko 3609bb41a7 Updated the native activity sample to master's API. 2013-09-09 18:17:02 +04:00
Roman Donchenko 59dd5aea00 Reenabled adding native app glue for Android samples. 2013-09-09 18:16:20 +04:00
Roman Donchenko d5aaab745f Merge pull request #1282 from nailbiter:optimDS 2013-09-09 18:10:13 +04:00
Nghia Ho 0e06465a23 Merge remote-tracking branch 'upstream/master' 2013-09-09 23:23:12 +10:00
Alexander Mordvintsev 79d51c3398 expose findEssentialMat, decomposeEssentialMat and recoverPose to Python 2013-09-09 14:02:05 +04:00
lluis e8d3732aaf added computeNMChannels helper function to compute the diferent channels to be processed independently in the N&M algorithm. 2013-09-09 11:37:58 +02:00
Vladislav Vinogradov 1036ce807c Merge branch 'master' into gpu-cuda-rename
Conflicts:
	modules/core/include/opencv2/core/cuda.hpp
	modules/cudaimgproc/src/gftt.cpp
	modules/objdetect/include/opencv2/objdetect/erfilter.hpp
	modules/objdetect/src/erfilter.cpp
	modules/superres/perf/perf_superres.cpp
	modules/superres/src/btv_l1_cuda.cpp
	modules/superres/src/optical_flow.cpp
	modules/videostab/src/global_motion.cpp
	modules/videostab/src/inpainting.cpp
	samples/cpp/stitching_detailed.cpp
	samples/cpp/videostab.cpp
	samples/gpu/stereo_multi.cpp
2013-09-09 12:57:35 +04:00
Roman Donchenko 77a2529eb7 Merge pull request #1408 from jet47:new-ptr-fixes 2013-09-09 12:27:27 +04:00
Roman Donchenko 74578f56a9 Merge pull request #1403 from lluisgomez:scene_text_detection_NM_fix 2013-09-09 12:05:57 +04:00
Vladislav Vinogradov 6ad72bfcb4 removed detail:: prefix int video_reader
it conflicts with cv::detail
2013-09-09 10:57:51 +04:00
Vladislav Vinogradov a0771630b0 restored original behaviour or release functions for (Buffer and Texture) 2013-09-09 10:57:45 +04:00
Ozan Tonkal 9895093524 check if vtk 5.10.0 exists, if not require 6.0.0 2013-09-08 19:41:35 +02:00
Ozan Tonkal 56f9168ac1 support VTK 6.0.0: cmakelist.txt might need to be refactored 2013-09-08 19:07:15 +02:00
Ozan Tonkal 26005a19bd add license headers 2013-09-08 19:05:24 +02:00
Ozan Tonkal c773061457 updated documentation 2013-09-08 19:03:55 +02:00
Ozan Tonkal 3bdb55e1ef another constructor for CameraPositionWidget for displaying image by also using field of view instead of intrinsic matrix 2013-09-08 19:03:55 +02:00
Ozan Tonkal 2170559bed text3dwidget offers now users to decide whether it should face the camera or not 2013-09-08 19:03:54 +02:00
Ozan Tonkal 286f81f305 fix crucial bug in get method, hide add and remove methods from user 2013-09-08 19:03:54 +02:00
Ozan Tonkal 2969ec0274 transformations tutorial rst 2013-09-08 19:03:54 +02:00
Ozan Tonkal 5307339f85 tutorial code for makeTransformToGlobal, makeCameraPose, minor fixes in widget_pose tutorial 2013-09-08 19:03:54 +02:00
Ozan Tonkal 7116e22b52 some of the tutorials 2013-09-08 19:03:54 +02:00
Ozan Tonkal fcf437cf69 combine representation methods to one as setRepresentation 2013-09-08 19:03:54 +02:00
Ozan Tonkal 94ca5d65d0 remove VIZ prefix from rendering properties, fix setRenderingProperties and getRenderingProperties methods 2013-09-08 19:03:54 +02:00
Ozan Tonkal fdbf20c172 delete common.h, viz_types.hpp, rendering properties are public, setcolor in creating_widgets tutorial 2013-09-08 19:03:54 +02:00
lluis cd33ca0009 changed default parameters in CreateERFiltersNM{1,2} functions. They are not needed now in the sample example. 2013-09-06 19:10:53 +02:00
Anatoly Baksheev 9a91a12fb2 VIZ disabled by default, VTK search is performed iff BUILD_opencv_viz is enabled 2013-09-06 19:50:47 +04:00
Anatoly Baksheev 477ca067f0 compilation for macos 2013-09-06 19:32:35 +04:00
Anatoly Baksheev eed7bf6902 compilation for windows 2013-09-06 18:43:14 +04:00
Anatoly Baksheev 07d55b05b3 Merge pull request #20 from ozantonkal/low_order_tasks
Low order tasks
2013-09-06 07:39:23 -07:00
Fedor Morozov a7bcf63765 Robertson docs 2013-09-06 18:21:59 +04:00
Fedor Morozov c118f3c529 Robertson update 2013-09-06 17:30:43 +04:00
lluis 6ef1d456dd fixed rebase conflicts 2013-09-06 14:00:11 +02:00
Vladislav Vinogradov b7eff94137 fixed compilation issues with new Ptr 2013-09-06 15:52:07 +04:00
Vladislav Vinogradov 0c7663eb3b Merge branch 'master' into gpu-cuda-rename
Conflicts:
	modules/core/include/opencv2/core/cuda.hpp
	modules/cudacodec/src/thread.cpp
	modules/cudacodec/src/thread.hpp
	modules/superres/perf/perf_superres.cpp
	modules/superres/src/btv_l1_cuda.cpp
	modules/superres/src/optical_flow.cpp
	modules/videostab/src/global_motion.cpp
	modules/videostab/src/inpainting.cpp
	samples/cpp/stitching_detailed.cpp
	samples/cpp/videostab.cpp
	samples/gpu/stereo_multi.cpp
2013-09-06 15:44:44 +04:00
Roman Donchenko f88d8b9545 Merge pull request #1405 from SpecLad:retina-ocl-warn 2013-09-06 15:10:06 +04:00
Fedor Morozov deeaddb0a9 Doc update 2013-09-06 14:49:19 +04:00
Fedor Morozov f4792f8a44 Doc update 2013-09-06 14:43:04 +04:00
lluis 512111af9c removed blank line at EOF 2013-09-06 12:32:10 +02:00
lluis 1cc6502db3 removed unnecessary commented block 2013-09-06 12:32:10 +02:00
lluis 04913f5af7 removed trailing whitespaces 2013-09-06 12:32:10 +02:00
lluis b9a5e919e2 better parameter settings for the ERFilter sample 2013-09-06 12:31:49 +02:00
lluis 15511bff40 better classifiers performance by training them with a new dataset of "manually" selected regions 2013-09-06 12:31:49 +02:00
lluis f4d01175b8 fixed a bug in the calculation of the number of inflexion points feature 2013-09-06 12:31:49 +02:00
lluis 765921cc25 fixed a typo error in the default min_Probability param of CreateERFilterNM2 2013-09-06 12:30:22 +02:00
lluis dba336c0e3 fixed a bug in the non-max-suppression filter procedure 2013-09-06 12:27:19 +02:00
Roman Donchenko 439e90f4f4 retina_ocl.cpp: removed two unused arrays. 2013-09-06 12:34:37 +04:00
Roman Donchenko af594c8e44 retina_ocl.hpp: switched BasicRetinaFilter's members around to fix a -Wreorder warning. 2013-09-06 12:33:54 +04:00
Roman Donchenko bad927325f Merge pull request #1281 from SpecLad:the-smartest-pointer 2013-09-06 11:53:34 +04:00
hbristow 74accbd969 Added <algorithm> to mxarray.hpp, which seems to be needed explictly by some compilers 2013-09-06 16:42:32 +10:00
hbristow 6964f6aacc Removed unused Dynamic from matlab namespace - clashing with Eigen 2013-09-06 15:26:05 +10:00
Ozan Tonkal 5eed0d6bef remove common.h include from widgets.hpp 2013-09-05 21:03:40 +02:00
Ozan Tonkal f99e874704 tutorial: creating_widgets code 2013-09-05 21:03:40 +02:00
Ozan Tonkal b60894c1dd launching viz tutorial 2013-09-05 21:03:40 +02:00
Ozan Tonkal 31501ebf4f replace tabs by spaces 2013-09-05 21:03:39 +02:00
Ozan Tonkal a5b75769a3 initial documentation 2013-09-05 21:03:39 +02:00
Ozan Tonkal 2822845ba6 set get RenderingProperty id comes first 2013-09-05 21:03:39 +02:00
Ozan Tonkal 9d4fe6984b remove setWindowName method to avoid complications 2013-09-05 21:03:39 +02:00
Ozan Tonkal 21be9796ae comments on widgets where constructors might be confusing 2013-09-05 21:03:39 +02:00
ozantonkal 2705113bc4 remove common.cpp, remove commented code in common.h 2013-09-05 21:03:39 +02:00
ozantonkal ffbb5e9524 resetCamera, resetViewpoint in Viz3d 2013-09-05 21:03:39 +02:00
ozantonkal 4aa61dee50 minor refactoring interactor_style 2013-09-05 21:03:39 +02:00
ozantonkal af8a918e04 fix minor bug, minor cleaning, cv_assert with messages 2013-09-05 21:03:39 +02:00
ozantonkal 69f135ec57 fix memory leak in viz3d 2013-09-05 21:03:39 +02:00
ozantonkal 6c0c217562 removed reference counter in widgets, fixed memory leak 2013-09-05 21:03:39 +02:00
ozantonkal 4b443059ec reverted widget reference count in order to avoid memory leak 2013-09-05 21:03:39 +02:00
ozantonkal 8007e07ad2 load mesh function is finalized: color range is always 0-255 and RGB due to vtkPLYReader limitations 2013-09-05 21:03:39 +02:00
ozantonkal e4b13f2ef0 update reader after setting file name 2013-09-05 21:03:39 +02:00
ozantonkal 3da7dd9849 fix yellow and magenta color bgr codes 2013-09-05 21:03:39 +02:00
ozantonkal 9086cf5d79 remove unused includes and libraries from linking 2013-09-05 21:03:39 +02:00
ozantonkal 3038ffb886 setDesiredUpdateRate implementation in Viz3d 2013-09-05 20:56:33 +02:00
ozantonkal ed0162ad0b remove reference counting in widgets 2013-09-05 20:56:33 +02:00
ozantonkal 08917908f3 remove eigen dependency 2013-09-05 20:56:33 +02:00
ozantonkal f98614ece0 remove cloudactormap, shapeactormap. only vtkProp is stored and view transformation can be obtained using GetUserMatrix of vtkProp3D 2013-09-05 20:56:33 +02:00
ozantonkal f6e1a093cd implement window relevant methods in Viz3d 2013-09-05 20:56:33 +02:00
ozantonkal 4f416352e1 implemented actor representation methods in viz3d 2013-09-05 20:56:33 +02:00
ozantonkal cf36b8f817 rendering properties in Widget and Viz3d 2013-09-05 20:56:33 +02:00
ozantonkal b032b4dded move frompolyfile to widget class as static method, remove addpolygon and its alikes 2013-09-05 20:56:33 +02:00
ozantonkal 0bbaf5d47a removeAllWidgets implementation, removed other remove methods 2013-09-05 20:56:33 +02:00
ozantonkal e106dcc606 remove include vtk headers from outside of precomp.hpp 2013-09-05 20:56:32 +02:00
Roman Donchenko 86b841563b Added tests for Ptr. 2013-09-05 19:03:00 +04:00
Roman Donchenko c7d2fdc4b2 Fixed some dubious uses of tbb::task_scheduler_init. 2013-09-05 19:03:00 +04:00
Roman Donchenko a97ffe6513 Rewrote the documentation for Ptr to fit the new implementation. 2013-09-05 19:03:00 +04:00
Roman Donchenko a50d75d362 Made Filestorage able to not own its CvFileStorage instance.
This allows to get rid of the last remaining Ptr<T>::addref calls.
2013-09-05 19:03:00 +04:00
Roman Donchenko 3e189a2b41 Replaced calls to Ptr<T>::ptr to ::dynamicCast. 2013-09-05 19:03:00 +04:00
Roman Donchenko 24dee16b12 Added to CV_INIT_ALGORITHM a Ptr creation function, for convenience.
Also changed the static functions to inline, to stop GCC complaining
about unused functions.
2013-09-05 19:03:00 +04:00
Roman Donchenko dadee3752c Adapt Python bindings to the new Ptr. 2013-09-05 19:03:00 +04:00
Roman Donchenko 2f942efdf7 Java: removed usages of Ptr<T>::addref().
Now the features2d class wrappers use composition instead of inheritance.
2013-09-05 19:03:00 +04:00
Roman Donchenko 2a2c21bb63 Replace an incorrect usage of Ptr with a simple vector. 2013-09-05 19:02:59 +04:00
Roman Donchenko 62353b7980 Boring changes - samples. 2013-09-05 19:02:59 +04:00
Roman Donchenko 34af7eeb84 Boring changes - apps. 2013-09-05 19:02:59 +04:00
Roman Donchenko eaa7fcc3e6 Boring changes - legacy. 2013-09-05 19:02:59 +04:00
Roman Donchenko 34127ba80f Boring changes - contrib. 2013-09-05 19:02:59 +04:00
Roman Donchenko 3bca57ac25 Boring changes - ocl. 2013-09-05 19:02:59 +04:00
Roman Donchenko fc0e835762 Boring changes - gpuwarping. 2013-09-05 19:02:59 +04:00
Roman Donchenko d33ff4bb11 Boring changes - gpustereo. 2013-09-05 19:02:59 +04:00
Roman Donchenko d6146e9543 Boring changes - gpulegacy. 2013-09-05 19:02:59 +04:00
Roman Donchenko a007c7b980 Boring changes - gpuimgproc. 2013-09-05 19:02:58 +04:00
Roman Donchenko b165016ba7 Boring changes - gpufilters. 2013-09-05 19:02:58 +04:00
Roman Donchenko a57f93ee92 Boring changes - gpucodec. 2013-09-05 19:02:58 +04:00
Roman Donchenko 2c033251db Boring changes - gpubgsegm. 2013-09-05 19:02:58 +04:00
Roman Donchenko f8f0685397 Boring changes - gpuarithm. 2013-09-05 19:02:58 +04:00
Roman Donchenko 57595a8308 Boring changes - gpu. 2013-09-05 19:02:58 +04:00
Roman Donchenko 0dcb4f1f66 Boring changes - videostab. 2013-09-05 19:02:58 +04:00
Roman Donchenko 808e0cf10b Boring changes - video. 2013-09-05 19:02:58 +04:00
Roman Donchenko 93f757f8a2 Boring changes - superres. 2013-09-05 19:02:58 +04:00
Roman Donchenko f21851f0f4 Boring changes - stitching. 2013-09-05 19:02:58 +04:00
Roman Donchenko cce0f48d3e Boring changes - softcascade. 2013-09-05 19:02:58 +04:00
Roman Donchenko 32205d3c5b Boring changes - photo. 2013-09-05 19:02:58 +04:00
Roman Donchenko b12894d95a Boring changes - objdetect. 2013-09-05 19:02:58 +04:00
Roman Donchenko de6a934f66 Boring changes - nonfree. 2013-09-05 18:26:44 +04:00
Roman Donchenko 345bc633cc Boring changes - ml. 2013-09-05 18:26:44 +04:00
Roman Donchenko 1eacb485c5 Boring changes - features2d. 2013-09-05 18:26:44 +04:00
Roman Donchenko bd70a033fc Boring changes - calib3d. 2013-09-05 18:26:43 +04:00
Roman Donchenko 711fb6bd92 Boring changes - bioinspired. 2013-09-05 18:26:43 +04:00
Roman Donchenko beeb932d22 Boring changes - highgui. 2013-09-05 18:26:43 +04:00
Roman Donchenko 254d4ae429 Boring changes - imgproc. 2013-09-05 18:26:43 +04:00
Roman Donchenko 8200a95ced Boring changes - core.
This and several following commits contain the "boring" changes required
to support the new Ptr. These are changes like:

* new T -> makePtr<T> or .reset(new T) or Ptr<T>(new T)
  (depending on the situation)
* p.empty() -> !p
* delete_obj -> DefaultDeleter::operator()

and similar changes that are numerous, but primitive.
2013-09-05 18:26:43 +04:00
Roman Donchenko 461c98fa86 Replaced Ptr with my new implementation. 2013-09-05 14:54:20 +04:00
Fedor Morozov e33a4f79f8 Merge branch 'devel' of https://github.com/f-morozov/opencv into devel 2013-09-05 14:49:18 +04:00
Fedor Morozov 85eb52b8af Debevec Calibrate 2013-09-05 14:41:35 +04:00
fm cb27740de4 Linux compilation 2013-09-05 14:26:21 +04:00
Fedor Morozov 0f703b8162 Calibrate Debevec changes 2013-09-05 14:10:53 +04:00
Roman Donchenko ecc51817d9 Merge pull request #1399 from pengx17:master_retina_ocl_fix 2013-09-05 11:57:46 +04:00
Mathieu Barnachon 2fe340bf8a adding sample to train HOG and compare it with default people detector. 2013-09-05 17:33:08 +12:00
Mathieu Barnachon 464985205c Update PR after mdim review. 2013-09-05 16:05:54 +12:00
Daniel Angelov 25c0d5978c Update on the compare lines method. 2013-09-05 00:02:24 +03:00
Daniel Angelov b5e1eb7d48 Removed IOArray constness. 2013-09-04 14:59:57 +03:00
Alexander Shishkov cf275acbce small changes in the tutorial 2013-09-04 15:14:49 +04:00
Nghia Ho cc15898353 Merged with HEAD and removed C interface to rotatedRectangleIntersection 2013-09-04 20:45:10 +10:00
pengxiao e45f92a9e1 Fix a bug of ocl retina on NVIDIA platform. 2013-09-04 16:38:36 +08:00
Roman Donchenko fd3b2326b4 Merge pull request #1373 from abidrahmank:pykeypoints 2013-09-04 11:53:33 +04:00
Vladislav Vinogradov f46b7fcf86 fixed warnings in resize.cu 2013-09-04 11:15:18 +04:00
Vladislav Vinogradov 1ad4592bfc Merge branch 'master' into gpu-cuda-rename
Conflicts:
	modules/cudaoptflow/perf/perf_optflow.cpp
	modules/cudaoptflow/src/tvl1flow.cpp
	samples/gpu/stereo_multi.cpp
2013-09-04 09:58:32 +04:00
Roman Donchenko 009919872f Merge pull request #1389 from SpecLad:merge-2.4 2013-09-03 19:42:06 +04:00
Abid K 0902f183ca alignment of parameters as per speclad 2013-09-03 21:12:03 +05:30
Roman Donchenko 79457f8f49 Merge pull request #1224 from mbarnach:pca_io 2013-09-03 18:43:54 +04:00
Alexander Shishkov 359771fdac small fixes in the tutorial 2013-09-03 17:07:49 +04:00
Alexander Shishkov e354fa3fd1 fixed test data in highgui test for HDR 2013-09-03 14:24:14 +04:00
Alexander Shishkov 924f7ce373 small changes for compilation 2013-09-03 14:05:14 +04:00
hbristow 7e5bbec895 Removing trailing whitespace and expanded tabs 2013-09-03 10:14:45 +10:00
Anatoly Baksheev 35e7952909 simplify modules/viz/CMakeLists.txt 2013-09-03 01:59:00 +04:00
Roman Donchenko 18bb951574 Nuked the rest of the precomp.cpp files.
Consider this a part of merging #1357.
2013-09-02 19:53:45 +04:00
Roman Donchenko 9218f4976c Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/contrib/src/retina.cpp
	modules/gpu/perf/perf_video.cpp
	modules/gpuoptflow/src/tvl1flow.cpp
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/perf/perf_calib3d.cpp
	modules/ocl/perf/perf_color.cpp
	modules/ocl/perf/perf_match_template.cpp
	modules/ocl/src/precomp.hpp
	samples/gpu/stereo_multi.cpp
2013-09-02 19:44:51 +04:00
Fedor Morozov e15eabe3fa Ghostbusters 2013-09-02 16:03:10 +04:00
hbristow f57145dc64 Fixed regular expression for finding Matlab in Windows PATH 2013-09-02 20:43:33 +10:00
Vladislav Vinogradov 12f50d7f67 fixed video_writer sample 2013-09-02 14:00:44 +04:00
Vladislav Vinogradov ba4bf04c6c fixed incorrect GPUs -> CUDAs replacement 2013-09-02 14:00:44 +04:00
Vladislav Vinogradov a41006754e fix documentation 2013-09-02 14:00:44 +04:00
Vladislav Vinogradov 429bfad225 removed precomp.cpp files 2013-09-02 14:00:44 +04:00
Vladislav Vinogradov cbe437571e fixed docs 2013-09-02 14:00:44 +04:00
Vladislav Vinogradov f936c1283b fixed sanity test for cuda module 2013-09-02 14:00:44 +04:00
Vladislav Vinogradov fd88654b45 replaced GPU -> CUDA 2013-09-02 14:00:44 +04:00
Vladislav Vinogradov 3c34b24f1f replaced gpu->cuda in files names 2013-09-02 14:00:44 +04:00
Vladislav Vinogradov 80b9fd87dc removed gpu module from OPENCV2_BASE_MODULES 2013-09-02 14:00:44 +04:00
Vladislav Vinogradov ae94256edc renmaed gpu module -> cuda 2013-09-02 14:00:44 +04:00
Vladislav Vinogradov 29386f1449 renamed gpubgsegm -> cudabgsegm 2013-09-02 14:00:43 +04:00
Vladislav Vinogradov 259ceb7eaa renamed gpufeatures2d -> cudafeatures2d 2013-09-02 14:00:43 +04:00
Vladislav Vinogradov 5660d6a680 renamed gpuoptflow -> cudaoptflow 2013-09-02 14:00:43 +04:00
Vladislav Vinogradov a0ae602bb7 renamed gpuimgproc -> cudaimgproc 2013-09-02 14:00:43 +04:00
Vladislav Vinogradov 219b662127 renamed gpufilters -> cudafilters 2013-09-02 14:00:43 +04:00
Vladislav Vinogradov 71d61e07b1 renamed gpustereo -> cudastereo 2013-09-02 14:00:42 +04:00
Vladislav Vinogradov d4901a99ea renamed gpuwarping -> cudawarping 2013-09-02 14:00:42 +04:00
Vladislav Vinogradov dcd600cc47 renamed gpuarithm -> cudaarithm 2013-09-02 14:00:42 +04:00
Vladislav Vinogradov 6d216d78d9 renamed gpulegacy -> cudalegacy 2013-09-02 14:00:42 +04:00
Vladislav Vinogradov dbeb3e2968 renamed gpucodec -> cudacodec 2013-09-02 14:00:42 +04:00
Vladislav Vinogradov cfe4a71dc6 renamed gpu* source to cuda* in core module 2013-09-02 14:00:42 +04:00
Vladislav Vinogradov 91dd44e7fa removed compatibility headers 2013-09-02 14:00:42 +04:00
Vladislav Vinogradov fef646d4f8 removed mark_nvidia.py script 2013-09-02 14:00:42 +04:00
Vladislav Vinogradov a6308118b4 removed perf4au test 2013-09-02 14:00:42 +04:00
Vladislav Vinogradov 5a85f1b6da renamed gpucodec namespace -> cudacodec 2013-09-02 14:00:41 +04:00
Vladislav Vinogradov 8282f6ebc1 renamed gpu::cudev namespace -> cuda::device
cudev is used for new device layer
2013-09-02 14:00:41 +04:00
Vladislav Vinogradov e895b7455e renamed gpu namespace -> cuda 2013-09-02 14:00:41 +04:00
Vladislav Vinogradov e12496d150 removed gpu name usage from ocl module 2013-09-02 14:00:41 +04:00
hbristow c112c9aa00 Made binding compilation less verbose 2013-09-02 16:43:58 +10:00
hbristow 31c95ff7f8 Added new OpenCV definitions to bridge 2013-09-02 14:29:46 +10:00
hbristow 40227b78a5 Removed GSOC-specific proposal.pdf from root 2013-09-02 14:25:18 +10:00
hbristow cf078be3d6 Merge branch 'matlab' into matlab_public
Conflicts:
	CMakeLists.txt
	README.md
  samples/
2013-09-02 14:23:11 +10:00
dbloisi 23f5eacafd fixing trailing whitespaces 2013-09-01 22:38:21 +02:00
dbloisi 20f932bd46 fixing trailing whitespaces 2013-09-01 22:13:49 +02:00
dbloisi f0910466f9 fixing trailing whitespaces 2013-09-01 20:59:27 +02:00
dbloisi a34f7b7714 fixing other white spaces 2013-09-01 19:05:07 +02:00
dbloisi 582d5558cc trying to solve with space errors 2013-09-01 15:55:06 +02:00
hbristow 1d25e5f1ba manually added optical flow header to build 2013-09-01 17:10:44 +10:00
Daniel Angelov 24e916059f Added LineSegmentDetector documentation and an output image. 2013-08-31 13:46:24 +03:00
Daniel Angelov 9d78b8003e Update on LSD no to use any Mat* (IOArrays instead).
Updated to new license.
2013-08-31 13:46:24 +03:00
Alex Leontiev af74ec6044 Minor fixes
In response to the pull request comments by Vadim Pisarevsky. In
particular, the following was done:
    *)cv::reduce use instead of custom code for calculating
per-coordinate sum
    *) naming style of private methods is made consisted with overall --
mixed-case style
    *) irrelevant create()'s were removed -- I did not know that copyTo()
method itself calls create
2013-08-30 21:37:27 +08:00
Alex Leontiev f2fd0ad153 Fixed .rst indentation
This caused warnings.
2013-08-30 21:37:27 +08:00
Alex Leontiev b92c88ddd1 Removed trailing spaces
Continuation of work done in previous commit.
2013-08-30 21:35:47 +08:00
Alex Leontiev b1f029ccc5 Removed trailing spaces
This caused warnings.
2013-08-30 21:35:47 +08:00
Alex Leontiev 554e002747 Prepare Downhill Simplex for pull request
This is an implementation of so-called downhill simplex method
(https://en.wikipedia.org/wiki/Nelder%E2%80%93Mead_method)

Please, let me know if you have any comments, whoever you'd be.
2013-08-30 21:35:47 +08:00
abidrahmank 7fd8a19fe8 warning corrections 2013-08-30 15:58:10 +05:30
hbristow a64c34c3ec Updated cv help to include reference to named arguments 2013-08-30 16:48:41 +10:00
hbristow d16d637eb2 Fixed handling of optional arguments under ArgumentParser. Fixed default constructor error in MxArray 2013-08-30 16:10:32 +10:00
hbristow 25ee1f9099 Improved error messages for incorrect arguments 2013-08-30 15:48:20 +10:00
abidrahmank 14af369640 Python bindings for KeyPoint methods
Usage:

import numpy as np
import cv2
img = cv2.imread('messi5.jpg',0)
sift = cv2.SIFT()
kp = sift.detect(img)

pts = cv2.KeyPoint_convert(kp)

kps = cv2.KeyPoint_convert(pts.reshape(-1,1,2))

overlap = cv2.KeyPoint_overlap(kp[0],kp[1])
2013-08-30 11:11:06 +05:30
hbristow a780c3a7d1 Swapped out function assertions in favour of ArgumentParser 2013-08-30 15:06:57 +10:00
hbristow 8f62a52b9b Brought matlab module into cv namespace 2013-08-30 12:39:01 +10:00
hbristow bc93edac34 Removed all OpenCV-specific functionality from mxarray into bridge. mxarray is now standalone 2013-08-30 11:18:08 +10:00
zio dodo 5f7163bff2 Merge branch 'master' of https://github.com/Itseez/opencv into add_bs_tutorial
Conflicts:
	modules/stitching/src/motion_estimators.cpp
2013-08-29 20:12:12 +02:00
tambo83 281250ba0e added a brief description for the learning rate parameter in the apply method 2013-08-29 17:20:45 +02:00
hbristow 153549c7f6 Added LICENSE and Americanizations 2013-08-30 01:09:29 +10:00
hbristow 33c377b305 complete rewrite of ArgumentParser 2013-08-30 01:04:43 +10:00
Roman Donchenko fc37df05ec Merge pull request #1366 from asmorkalov:ocv_autobuffer_fix 2013-08-29 16:35:38 +04:00
Roman Donchenko 86f4cd253a Merge pull request #1309 from pengx17:master_retina_ocl 2013-08-29 16:26:55 +04:00
Alexander Smorkalov 5af2cc6223 AutoBuffer with initial zero size fixed. 2013-08-29 15:03:53 +04:00
hbristow d5abe79f74 untracked io for initial pull request 2013-08-29 10:49:15 +10:00
hbristow 9726346bc9 removed unused files from repo 2013-08-29 10:44:27 +10:00
hbristow 57505b9af9 Added LICENSE preamble to include files 2013-08-29 10:20:53 +10:00
Roman Donchenko 11dcd4f4f3 Merge pull request #1356 from SpecLad:homography-uninit 2013-08-28 18:05:10 +04:00
Roman Donchenko e59c74e1c7 Merge pull request #1348 from SpecLad:merge-2.4 2013-08-28 13:41:41 +04:00
Roman Donchenko 5e4ebf3403 Fixed incomplete matrix initialization in HomographyRefineCallback. 2013-08-28 13:20:14 +04:00
Roman Donchenko 7afc2677e6 Removed a duplicate line. 2013-08-28 13:13:15 +04:00
peng xiao 9f0a88c1d6 Remove trailing whitespace. 2013-08-28 16:23:46 +08:00
Roman Donchenko 10cb9a0c4a Merge pull request #1342 from nevion:master 2013-08-28 12:00:39 +04:00
hbristow 569e8006e3 updated README.md formatting 2013-08-28 17:58:08 +10:00
hbristow 2a0e357cd0 updated syntax highlighting 2013-08-28 17:56:39 +10:00
hbristow b87197dc37 updated syntax highlighting 2013-08-28 17:53:25 +10:00
hbristow eb83a9ed9f Enabled syntax highlighting 2013-08-28 17:49:20 +10:00
Roman Donchenko 1840fd5f00 Merge pull request #1248 from vkocheganov:chi_square_alt 2013-08-28 11:44:41 +04:00
hbristow 2ac31a87c9 Added tutorial for writing your own mex files 2013-08-28 17:40:20 +10:00
hbristow 78dc2c5423 Upadated include tree to match the rest of opencv. Added install configuration for custom mex compiler 2013-08-28 17:06:19 +10:00
hbristow 52dc51a62c Added custom OpenCV mex compiler 2013-08-28 12:01:34 +10:00
peng xiao 287c8a3330 Let ocl::context only be initialized once in retina_ocl test. 2013-08-28 09:17:05 +08:00
Fedor Morozov 9f9873017c HDR test changes 2013-08-28 02:17:49 +04:00
Roman Donchenko 2d6f35d6ed Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/gpuwarping/src/cuda/resize.cu
	modules/gpuwarping/src/resize.cpp
	modules/gpuwarping/test/test_resize.cpp
	modules/ocl/perf/main.cpp
	modules/ocl/perf/perf_calib3d.cpp
	modules/ocl/perf/perf_canny.cpp
	modules/ocl/perf/perf_color.cpp
	modules/ocl/perf/perf_haar.cpp
	modules/ocl/perf/perf_match_template.cpp
	modules/ocl/perf/perf_precomp.cpp
	modules/ocl/perf/perf_precomp.hpp
2013-08-27 19:15:47 +04:00
Roman Donchenko d32b62a177 Merge pull request #1341 from roynos:master 2013-08-27 17:47:56 +04:00
Roman Donchenko dd25f416a6 War on Whitespace, master edition: tabs. 2013-08-27 17:13:53 +04:00
Roman Donchenko 9ed475cf52 War on Whitespace, master edition: file endings. 2013-08-27 14:23:26 +04:00
Roman Donchenko 9b92545ce6 War on Whitespace, master edition: trailing spaces. 2013-08-27 13:57:24 +04:00
Roman Donchenko 2c4bbb313c Merge commit '43aec5ad' into merge-2.4
Conflicts:
	cmake/OpenCVConfig.cmake
	cmake/OpenCVLegacyOptions.cmake
	modules/contrib/src/retina.cpp
	modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst
	modules/gpu/doc/video.rst
	modules/gpu/src/speckle_filtering.cpp
	modules/python/src2/cv2.cv.hpp
	modules/python/test/test2.py
	samples/python/watershed.py
2013-08-27 13:26:44 +04:00
Roman Donchenko 4d06c4c7b6 Merge commit '43aec5ad^' into merge-2.4
Conflicts:
	modules/contrib/src/inputoutput.cpp
	modules/gpu/perf/perf_imgproc.cpp
	modules/gpuarithm/perf/perf_element_operations.cpp
	modules/gpuarithm/src/element_operations.cpp
	modules/ts/src/precomp.hpp
2013-08-27 13:23:26 +04:00
Roman Donchenko 657699a1da Merge pull request #1267 from clhsieh:gpu_example_build_failed_with_cuda5p5 2013-08-27 12:43:36 +04:00
Roman Donchenko 45a0b39a73 Merge pull request #1339 from mdim:ml_cpp_wrappers_fix 2013-08-27 12:37:33 +04:00
Jason Newton affab4f156 correct range computations, it is difficult to do the more efficient single pass 3N/2 implementations correctly in this particular setting without costing more than they save 2013-08-27 00:34:22 -07:00
Anatoly Baksheev 8b20ceb024 Merge pull request #19 from ozantonkal/acess_by_name_infrastructure
Acess by name infrastructure
2013-08-26 23:46:47 -07:00
Roman Donchenko 0daac6fd9d Merge pull request #1327 from alalek:ocl_master_tests_fix 2013-08-26 16:44:37 +04:00
Roman Donchenko f44ed7f37c Merge pull request #1340 from SpecLad:python-updates 2013-08-26 16:41:13 +04:00
Fedor Morozov 833f8d16fa Robertson and tutorial 2013-08-26 15:23:37 +04:00
Roy Reapor d38fca2c06 Ignore Windows' Thumbs.db 2013-08-25 19:55:00 -07:00
ozantonkal d83be1dccc fixes based on the feedback: window name prefix is automatically added when it is not there, singleton class returns reference instead of pointer, destructor is private, release function implemented 2013-08-23 18:49:21 +02:00
Roman Donchenko 055a581977 Moved Sphinx detection outside of the PYTHONINTERP_FOUND block.
Who knows, maybe the user's Sphinx installation uses a Python we couldn't find.
2013-08-23 18:48:08 +04:00
Roman Donchenko 67ae438dae Refactored NumPy detection.
Most importantly, added support for multiple include directores,
but also did some general cleanup.
2013-08-23 18:46:54 +04:00
Roman Donchenko dbb684b85f Bumped minimal Python version to 2.6.
Rationale: we already depend on it (e.g. some scripts use print_function).
2013-08-23 18:46:54 +04:00
Roman Donchenko 1a81da012d Removed old Python detection cruft.
None of this should be relevant as of CMake 2.8.7.
2013-08-23 18:46:51 +04:00
Maria Dimashova 989be02562 fixed cpp wrappers of ML tree-based models 2013-08-23 18:13:10 +04:00
Roman Donchenko 580677f43d Merge pull request #1304 from berak:doc_tut_cascade 2013-08-23 15:18:06 +04:00
zio dodo ea544f08cc Added a small modifications in the code formatting of background subtraction tutorial 2013-08-23 13:04:10 +02:00
Roman Donchenko 365def6090 Merge pull request #1323 from SpecLad:find-git 2013-08-23 14:48:22 +04:00
Roman Donchenko 5a32f0b6ca Merge pull request #1322 from SpecLad:terse 2013-08-23 12:11:41 +04:00
Roman Donchenko 66aa3255b9 Merge pull request #1328 from SpecLad:zlib-update 2013-08-23 12:06:17 +04:00
Changlin Hsieh 723ba29660 Update cmake files by using CUDA_CUDA_LIBRARIES 2013-08-23 16:05:35 +08:00
Alexander Alekhin 7685b983db OCL: tests: repair moments implementation in master branch, enable tests 2013-08-22 23:37:06 +04:00
Fedor Morozov e2e604eb18 HDR writing bug fix 2013-08-22 21:13:50 +04:00
berak 50288f1314 rebased commits 2013-08-22 18:40:30 +02:00
berak 926d6876d3 using VideoCapture instead of CvCapture* in cascade tutorial
corrected constants,  changed objdetection.cpp as well

updated objDetection2.cpp as well

fixed headers in objdetection2.cpp

removed useles RNG

fixed buildbot warnings (wow, i like that bot!)

victim of the war on whitespace

fixing buildbot warnings

fixing last buildbot warning, heya .

trying to rebase/squash commits
2013-08-22 17:38:59 +02:00
Roman Donchenko 9c01a96b14 Set minimal zlib version to 1.2.3.
Rationale: 1.2.3 was a security update, and we should avoid using
versions with known security vulnerabilities.
2013-08-22 18:17:19 +04:00
Roman Donchenko 6fed0e85c2 Cut down on the use of ZLIB_LIBRARY/ZLIB_INCLUDE_DIR.
They're not listed in the documentation for the FindZLIB module,
so we shouldn't use them unless necessary.
2013-08-22 18:17:19 +04:00
Roman Donchenko 797beef383 Updated zlib to 1.2.8. 2013-08-22 17:59:27 +04:00
Alexander Alekhin b7b584984e OCL: tests: repair/disable failed tests in ocl module 2013-08-22 17:06:47 +04:00
Roman Donchenko 880306f6d6 Don't search for Git ourselves - CMake can handle it now. 2013-08-22 13:28:17 +04:00
Roman Donchenko e45526b9c0 Dropped the CMAKE_VERBOSE option.
There's no reason for it to exist, since it just duplicates the
CMAKE_VERBOSE_MAKEFILE variable.
2013-08-22 12:41:14 +04:00
Mathieu Barnachon 4fbd5707f7 Fix warning on precision lost due to double to float conversion. 2013-08-22 17:34:31 +12:00
Mathieu Barnachon 7f3273c77f Adding an export for HOGDetector compatibility.
An SVM train with HOG could export a single vector for HOGDetector.
2013-08-22 15:00:32 +12:00
Roman Donchenko 893e8b4371 Merge pull request #942 from achalddave:patch-1 2013-08-21 16:06:31 +04:00
zio dodo 449b4d8a65 Added the tutorial on background subtraction, in the video section 2013-08-21 12:06:48 +02:00
peng xiao 9b20b51389 Fix build error on Mac 2013-08-21 14:23:10 +08:00
peng xiao 3cccded86d Fix build error when WITH_OPENCL is disabled. 2013-08-21 11:18:02 +08:00
ozantonkal 6bc393676d cv::viz::get(window_name) implementation 2013-08-20 20:22:14 +02:00
ozantonkal c37f091cc5 remove redundant statement 2013-08-20 18:18:01 +02:00
Roman Donchenko a1b633e28e Merge pull request #1298 from jet47:gpu-eliminate-doubles 2013-08-20 18:04:54 +04:00
Roman Donchenko beada19ad0 Merge pull request #1297 from SpecLad:merge-2.4 2013-08-20 14:10:22 +04:00
Roman Donchenko aa96d8d053 Fix the name of perf tests' precompiled header. 2013-08-20 12:51:33 +04:00
ozantonkal 669abd58bc initial shared pointer implementation for Viz3d, singleton VizAccessor, cv::viz::get function initial implementation 2013-08-19 20:09:47 +02:00
Roman Donchenko f76dd99299 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	cmake/OpenCVModule.cmake
	doc/tutorials/calib3d/camera_calibration/camera_calibration.rst
	doc/tutorials/features2d/feature_detection/feature_detection.rst
	doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.rst
	doc/tutorials/features2d/feature_homography/feature_homography.rst
	modules/core/include/opencv2/core/operations.hpp
	modules/core/src/arithm.cpp
	modules/gpu/perf/perf_video.cpp
	modules/imgproc/include/opencv2/imgproc/imgproc.hpp
	modules/java/generator/gen_java.py
	modules/java/generator/src/cpp/VideoCapture.cpp
	modules/nonfree/src/opencl/surf.cl
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/perf/perf_haar.cpp
	modules/ocl/perf/perf_precomp.hpp
	modules/ocl/src/color.cpp
	modules/ocl/src/filtering.cpp
	modules/ocl/test/test_color.cpp
	modules/ocl/test/test_objdetect.cpp
	modules/python/src2/cv2.cpp
	samples/gpu/CMakeLists.txt
	samples/gpu/super_resolution.cpp
2013-08-19 19:02:36 +04:00
Vladislav Vinogradov cd2b7448f4 eliminate unnecessary double arithmetics in CUDA 2013-08-19 15:56:45 +04:00
Roman Donchenko 0b270e2b08 Merge pull request #1296 from jet47:gpu-cvtcolor-fix-master 2013-08-19 14:26:12 +04:00
Roman Donchenko 3fc1885f48 Merge pull request #1294 from jet47:gpu-tests-fix 2013-08-19 14:21:50 +04:00
Vladislav Vinogradov 7bda6992e5 fixed gpu BGR <-> YUV color conversion 2013-08-19 13:17:55 +04:00
Vladislav Vinogradov 9f33de7071 added cvconfig.hpp header file to gpu tests
it uses HAVE_CUDA, HAVE_NVCUVID, etc. macroses
2013-08-19 12:46:57 +04:00
Roman Donchenko 473ca0849d Merge pull request #1285 from SpecLad:enum-compare 2013-08-19 12:00:18 +04:00
Mathieu Barnachon 43c9818895 Adding class for BOW image matcher (Feature #3005).
Same prototype as BOWImgDescriptorExtractor, but do only the matching.
If the feature is accepted, the BOWImgDescriptorExtractor and BOWImgDescriptorMatcher should probably refactor with inheritance.
Add a class to compute the keypoints, descriptors and matching from an image should be added to.
2013-08-18 11:32:04 +12:00
Nghia Ho d36dbe6ad6 Merge https://github.com/Itseez/opencv 2013-08-17 20:07:37 +10:00
Roman Donchenko 2349f7ea89 Merge pull request #1257 from SpecLad:merge-2.4 2013-08-16 18:42:18 +04:00
Roman Donchenko 2530b580a8 Merge branch 'master' into merge-2.4
Conflicts:
	modules/photo/doc/inpainting.rst
2013-08-16 14:14:12 +04:00
Roman Donchenko 2304a561ca Fixed a -Wenum-compare warning in cudev. 2013-08-16 13:53:37 +04:00
Nghia Ho d194bb6143 Merge https://github.com/Itseez/opencv 2013-08-15 21:51:36 +10:00
Roman Donchenko 556028eff5 Merge pull request #1253 from kamjagin:fixingCompilationOnOSX 2013-08-15 11:54:55 +04:00
kamjagin ed29d91d42 adding std to cstdint typedef of uint32_t 2013-08-14 17:16:52 +02:00
Miroslav Kobetski b595d73d6d defined uint for non-windows platforms too. replaced isnan for cvIsNaN. 2013-08-14 17:16:52 +02:00
Roman Donchenko d09c89c63e Merge pull request #1265 from abidrahmank:misc_docs2 2013-08-14 19:03:45 +04:00
Roman Donchenko 8e245f8a3a Merge pull request #1186 from SpecLad:dont-export-templates 2013-08-14 17:25:01 +04:00
Nghia Ho 2c9c4188ae Merge https://github.com/Itseez/opencv 2013-08-14 22:38:39 +10:00
Roman Donchenko 7992402ecf Merge pull request #1149 from jet47:generalized-hough-refactoring 2013-08-14 13:26:24 +04:00
Changlin Hsieh c1dd38cbff Fix GPU example build failed with cuda 5.5 2013-08-14 16:16:03 +08:00
Roman Donchenko 18358521f2 Merge pull request #1162 from jet47:cudev-integration 2013-08-14 12:00:34 +04:00
Achal Dave 0bc609257d Comparing rejected stage index with minimum required neighbors does not make sense
As described here, http://code.opencv.org/issues/3064, the test before
led to a case where we compared the index of the latest stage at which a
rectangle was rejected with the minimum number of neighbors required as
specified in `detectMultiScale`. Please see the issue for more
information.
2013-08-13 20:42:04 -07:00
abidrahmank 1b93ecfae8 docs changes 2013-08-13 22:07:44 +05:30
abidrahmank 92d04d439e docs changes 2013-08-13 21:58:49 +05:30
Anatoly Baksheev 52f141a5ba Merge pull request #18 from ozantonkal/implementing_camera
Implementing camera
2013-08-13 07:01:40 -07:00
Roman Donchenko 99624628a9 Merge pull request #1260 from SpecLad:no-cr-master 2013-08-13 16:00:20 +04:00
Nghia Ho 79965c9ee9 Replaced isfinite() with cvIsInf and cvIsNan 2013-08-13 21:26:21 +10:00
Roman Donchenko 339dd983ee Adjusted the camera calibration sample to master API. 2013-08-13 14:55:27 +04:00
Nghia Ho 723bc3cae9 Merge https://github.com/Itseez/opencv 2013-08-13 19:50:43 +10:00
Roman Donchenko 77df8e574f Fixed CR line endings in non_linear_svms.rst. 2013-08-13 13:29:09 +04:00
Roman Donchenko 6b5ac42a9b Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/calib3d/doc/camera_calibration_and_3d_reconstruction.rst
	modules/features2d/doc/common_interfaces_of_descriptor_extractors.rst
	modules/features2d/doc/object_categorization.rst
	modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst
	modules/gpu/doc/image_filtering.rst
	modules/gpu/doc/image_processing.rst
	modules/gpu/doc/video.rst
	modules/imgproc/doc/miscellaneous_transformations.rst
	modules/imgproc/doc/object_detection.rst
	modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst
	modules/imgproc/src/samplers.cpp
	modules/ml/doc/k_nearest_neighbors.rst
	modules/nonfree/doc/feature_detection.rst
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/photo/doc/inpainting.rst
	modules/ts/include/opencv2/ts.hpp
	platforms/scripts/camera_build.conf
	samples/android/camera-calibration/AndroidManifest.xml
2013-08-13 12:56:39 +04:00
peng xiao 29eefe52bb Add OpenCL accelerated implementation for Retina. 2013-08-13 16:27:12 +08:00
Roman Donchenko 9d283dea63 Merge pull request #1250 from denzp:opencl_detection_unix 2013-08-13 11:57:22 +04:00
Denis Zaryaev f4010cef29 properly set OpenCL lib search path 2013-08-12 18:25:01 +03:00
Roman Donchenko d8c6e89a54 Merge pull request #1238 from SpecLad:cmake-min-ver 2013-08-12 15:50:23 +04:00
Roman Donchenko afc6f79038 Inlined the getMD5 macro, which no longer saves us anything. 2013-08-12 15:38:58 +04:00
kocheganovvm 086db9d6db Introduce CV_COMP_CHISQR_ALT, an alternative method to calculate ChiSquare Histogram comparison
There's some disagreement about the correct formula.
has its supporters, however, for texture analysis, the newly introduced formula became
standard. The commit enables both uses without breaking backward compatibility.

First contributor of this commit was sperrholz.
2013-08-12 13:51:52 +04:00
Roman Donchenko 19d8f4f8dd Merge pull request #1247 from StevenPuttemans:bugfix_3205 2013-08-12 12:21:36 +04:00
StevenPuttemans 1a42dd905c Added fixes mentioned in #3205 : changing uint to unsigned literals for compilation on Mingw 4.7.2 2013-08-12 10:04:15 +02:00
ozantonkal b69a97bef3 access focal length and principal point in camera 2013-08-12 09:07:50 +02:00
hbristow ef2c1e1a24 Changed bad cast in MxArray 2013-08-12 11:38:59 +10:00
Denis Zaryaev 129f315f7c bugfix for OpenCL detection with Intel OpenCL SDK 1.2 on linux (Bug #3140) 2013-08-11 21:05:30 +03:00
hbristow fb41d7bf4e Commenting spree no.2 2013-08-12 00:52:27 +10:00
hbristow bfa88384c7 Updated documentation 2013-08-11 16:12:05 +10:00
hbristow e63369fe64 Updated nest list in markdown 2013-08-11 15:14:09 +10:00
hbristow 1e78a187db Updated nest list in markdown 2013-08-11 14:49:33 +10:00
hbristow 7786ed7bcb Updated nest list in markdown 2013-08-11 14:48:29 +10:00
hbristow a269e3216e Updated nest list in markdown 2013-08-11 14:46:28 +10:00
hbristow 542c88c60b Updated nest list in markdown 2013-08-11 14:44:25 +10:00
hbristow 5ed9365bac Updated nest list in markdown 2013-08-11 14:43:15 +10:00
hbristow 115a1471ae Updated nest list in markdown 2013-08-11 14:42:30 +10:00
hbristow 6f811f5cb3 Documentation spree no.1 2013-08-11 14:36:50 +10:00
ozantonkal 4a1573de9b principal point is always set even though the intrinsic parameters are not given (center of window), fixed computation mistakes in setWindowSize in camera class 2013-08-09 10:39:30 +02:00
hbristow 7aaefd4dce Improved escaped character formatting in docs 2013-08-09 15:15:08 +10:00
ozantonkal bb057491ea create camera from projection matrix (used for getCamera in viz) 2013-08-08 12:14:27 +02:00
Roman Donchenko e57407849a Removed obsolete CMake workaround. 2013-08-08 12:03:41 +04:00
Roman Donchenko 36874300c8 Removed CMakeParseArguments.cmake, which we don't use.
It's part of CMake nowadays, too.
2013-08-08 12:03:41 +04:00
Roman Donchenko a23abef9bd Removed OpenCVFindPkgConfig.cmake, since it's bundled with CMake now.
In fact, I don't think we actually use it... but I kept the include,
just in case.
2013-08-08 12:03:41 +04:00
Roman Donchenko 656416d174 Dropped OpenCVConfig.cmake - we don't use it anymore. 2013-08-08 12:03:41 +04:00
Roman Donchenko 168e2a4ccb Removed CMake version checks that we don't need anymore. 2013-08-08 12:03:41 +04:00
Roman Donchenko a87756e9b3 Bumped minimal CMake version to 2.8.7. 2013-08-08 12:03:30 +04:00
hbristow a659562c36 Changed command-line separator from module:file to module=file so that it works cross-platform 2013-08-08 05:26:56 +10:00
hbristow 3bf41c2832 Formatted URLs in the documentation so that they are redirected to the system browser instead of the builtin Matlab browser 2013-08-08 04:46:45 +10:00
hbristow fad7b35b9a Updated documentation formatting 2013-08-08 03:51:44 +10:00
hbristow 059d63cceb Added diagnostic/build information function 2013-08-08 02:42:17 +10:00
Nghia Ho 95ee02ba8e Added extra comment to test buildbot 2013-08-08 01:33:21 +10:00
ozantonkal 71dc5f8291 simulate real cameras by working around vtkUserTransform to set projection matrix 2013-08-07 16:20:23 +02:00
ozantonkal 422b967e9a fix computeProjectionMatrix in Camera class, also check if there is principal point defined 2013-08-07 15:52:24 +02:00
Roman Donchenko a495bbb967 Added a new file for recording minimal dependency versions. 2013-08-07 13:56:09 +04:00
hbristow f705020348 Linked online documentation now opens a browser window to the exact function reference using div tags 2013-08-07 19:28:58 +10:00
ozantonkal 5335489daa viz getWindowSize, setWindowSize 2013-08-07 09:28:39 +02:00
Fedor Morozov 19082e0504 Documentation update 2013-08-07 11:15:41 +04:00
hbristow 3483bf14b9 Added auto-generated docs to all OpenCV functions 2013-08-07 16:34:30 +10:00
Nghia 18e7aa5d19 Update intersection.cpp
Added #ifdef _WIN32 for finite number testing
2013-08-07 14:57:12 +10:00
Andrey Pavlenko 04c86f28b1 Merge pull request #1228 from vkocheganov:bug_3191 2013-08-06 21:01:40 +04:00
Andrey Pavlenko ab4fe8dd2c Merge pull request #1230 from SpecLad:merge-2.4 2013-08-06 20:54:30 +04:00
hbristow faeb0aa92a Now using python ArgumentParser to parse command line arguments in preparation for adding doc generation 2013-08-07 01:41:10 +10:00
hbristow c5ffd1fdea Updated main Matlab help string 2013-08-07 01:10:51 +10:00
hbristow 7ef3be3429 By default, all function now export at least one return value back into the Matlab workspace, even if none are requested. This is in line with Matlab's calling convention, where functions called without an lvalue or a semicolon have their first output printed to the terminal 2013-08-07 00:14:13 +10:00
Fedor Morozov 3725c1fb4c Documentation updates 2013-08-06 18:13:34 +04:00
Roman Donchenko 48a6edbdfe Fixed compilation errors. 2013-08-06 18:07:08 +04:00
Roman Donchenko 8bed7bb5f9 Fixed documentation errors. 2013-08-06 18:07:08 +04:00
Roman Donchenko 2f780ed994 Fix whitespace errors. 2013-08-06 18:07:00 +04:00
Fedor Morozov e914fc2471 Merge branch 'master' of https://github.com/f-morozov/opencv 2013-08-06 17:49:29 +04:00
Fedor Morozov 4a4c5190f0 Documentation updates 2013-08-06 17:49:02 +04:00
Alexander Shishkov 3c218717a9 Merge branch 'master' of https://github.com/f-morozov/opencv 2013-08-06 15:41:39 +04:00
Alexander Shishkov c4fb0e9dbb few changes for compilation 2013-08-06 15:41:32 +04:00
Fedor Morozov bef8d8192e Minor fixes, new MergeDebevec 2013-08-06 15:24:01 +04:00
hbristow 8f92973b8c Started documentation skeleton 2013-08-06 21:16:38 +10:00
Roman Donchenko dcaf923517 Merge remote-tracking branch 'origin/2.4'
Conflicts:
	3rdparty/ffmpeg/ffmpeg_version.cmake
	cmake/OpenCVFindLibsGrfmt.cmake
	cmake/templates/cvconfig.h.cmake
	modules/bioinspired/doc/retina/index.rst
	modules/calib3d/doc/camera_calibration_and_3d_reconstruction.rst
	modules/calib3d/src/precomp.hpp
	modules/contrib/src/inputoutput.cpp
	modules/contrib/src/precomp.hpp
	modules/core/include/opencv2/core/internal.hpp
	modules/core/include/opencv2/core/types_c.h
	modules/core/src/drawing.cpp
	modules/core/src/precomp.hpp
	modules/core/src/system.cpp
	modules/features2d/doc/common_interfaces_of_descriptor_matchers.rst
	modules/features2d/doc/common_interfaces_of_feature_detectors.rst
	modules/features2d/include/opencv2/features2d/features2d.hpp
	modules/features2d/src/precomp.hpp
	modules/flann/src/precomp.hpp
	modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst
	modules/gpu/doc/image_filtering.rst
	modules/gpu/doc/image_processing.rst
	modules/gpu/doc/video.rst
	modules/gpu/perf/perf_imgproc.cpp
	modules/gpu/perf4au/main.cpp
	modules/gpu/src/imgproc.cpp
	modules/gpu/src/precomp.hpp
	modules/gpu/test/test_imgproc.cpp
	modules/highgui/CMakeLists.txt
	modules/highgui/test/test_precomp.hpp
	modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst
	modules/imgproc/src/precomp.hpp
	modules/java/generator/src/cpp/Mat.cpp
	modules/legacy/src/precomp.hpp
	modules/ml/doc/k_nearest_neighbors.rst
	modules/ml/src/precomp.hpp
	modules/nonfree/doc/feature_detection.rst
	modules/nonfree/src/precomp.hpp
	modules/objdetect/include/opencv2/objdetect/objdetect.hpp
	modules/objdetect/src/cascadedetect.cpp
	modules/objdetect/src/hog.cpp
	modules/objdetect/src/precomp.hpp
	modules/objdetect/test/test_latentsvmdetector.cpp
	modules/ocl/src/hog.cpp
	modules/ocl/src/opencl/objdetect_hog.cl
	modules/ocl/src/precomp.hpp
	modules/photo/src/precomp.hpp
	modules/stitching/src/precomp.hpp
	modules/superres/perf/perf_precomp.hpp
	modules/superres/src/optical_flow.cpp
	modules/superres/src/precomp.hpp
	modules/superres/test/test_precomp.hpp
	modules/ts/include/opencv2/ts.hpp
	modules/video/src/precomp.hpp
	modules/videostab/src/precomp.hpp
	modules/world/src/precomp.hpp
2013-08-06 13:56:49 +04:00
kocheganovvm e9b9a6fc03 Fix unsequenced assignment (Bug #3191). 2013-08-06 08:08:13 +04:00
hbristow b654413567 Added mixed-precision check when attempting to link to an OpenCV version with different bitness. Bindings now compiling and linking on my Windows 7 VM with VS2012 and Matlab R2013a 2013-08-06 13:01:57 +10:00
ozantonkal 731a931c0c field of views are in radians 2013-08-05 19:35:20 +02:00
ozantonkal 32985aa724 fix camera constructor, add tentative KinectCamera method 2013-08-05 19:22:43 +02:00
ozantonkal 9c20e77013 fix conversion functions to use appropriate vtk function 2013-08-05 18:39:36 +02:00
Fedor Morozov 4c0f7f9e59 Tonemapping documentation update 2013-08-05 20:35:48 +04:00
Fedor Morozov cb999a231e Mantiuk's tonemapping 2013-08-05 19:31:10 +04:00
Fedor Morozov 17609b90c7 Mantiuk's tonemapping 2013-08-05 19:22:42 +04:00
hbristow 48aac747ca removed pkg_resources (setuptools) dependency from jinja. Matlab module now has no python dependencies beyond the core python libs 2013-08-06 00:40:57 +10:00
ozantonkal f8ad3c0204 fix field of view computation in setWindowSize 2013-08-05 16:06:02 +02:00
ozantonkal 119d97f1f6 remove old camera, rename new camera 2013-08-05 15:37:08 +02:00
ozantonkal f060eee5a5 fix window_size setter, remove camera related old methods from viz3d 2013-08-05 15:10:17 +02:00
ozantonkal 439ba98e0a initial implementation of projection matrix, 3D to window coordinates, window coordinates to 3D ray (not yet tested) 2013-08-05 13:01:21 +02:00
hbristow d00f4e267b Added Windows dll versioning and Debug library postfix checks. Dependent libraries now being found by linker :) 2013-08-05 17:37:48 +10:00
Andrey Pavlenko 4c03afe006 Merge pull request #1079 from AlexeySpizhevoy:master 2013-08-05 10:54:44 +04:00
Andrey Pavlenko 8a3aa1f5b6 Merge pull request #1221 from philippefoubert:branch_cmake_cmp0004 2013-08-05 10:26:23 +04:00
Andrey Pavlenko 487ff4f3aa Merge pull request #1151 from jet47:gpubgsegm-refactoring 2013-08-05 10:20:00 +04:00
hbristow ecb506842b Added Windows-specific configuration lookup for linker paths 2013-08-05 14:49:12 +10:00
Mathieu Barnachon ff85575b28 Adding read/write functions to PCA class. Update PCA test. 2013-08-05 12:06:55 +12:00
Philippe FOUBERT ebd413c696 Solve the problem seen when using recent versions of CMake (such as 2.8.11): OpenCVConfig.cmake violates the policy CMP0004.
Symptoms:
CMake Error at CMakeLists.txt:10 (add_executable):
Target "my_app" links to item "C:/Program Files " which has leading
or trailing whitespace. This is now an error according to policy CMP0004.

This problem occurs when building on Windows when we depend on libraries located (for example) in "C:\Program Files (x86)..."
2013-08-04 20:52:49 +02:00
ozantonkal 0bb89e767a fix field of view formula in camera class, implement get camera 2013-08-04 17:01:41 +02:00
hbristow dfda79e673 Added passthrough of CXX FLAGS to mex compiler 2013-08-05 00:44:38 +10:00
ozantonkal f445f76213 initial setCamera implementation 2013-08-03 16:33:11 +02:00
ozantonkal 4953786de1 remove boost include (caused by Kdevelop autocomplete) 2013-08-03 15:42:10 +02:00
ozantonkal e4e9ed876f spheres trajectory widget implementation 2013-08-03 15:40:36 +02:00
ozantonkal a76cc9ef88 initial camera implementation (camera2), fix bug (zeros method) 2013-08-03 15:24:15 +02:00
ozantonkal 8fa6b6a6ef initial setViewerPose implementation 2013-08-03 15:24:15 +02:00
Alexander Shishkov 6df203c449 Fixes for Linux compilation, small changes 2013-08-03 01:45:20 +04:00
Anatoly Baksheev 54774f6d3b updated license header 2013-08-02 13:45:43 +04:00
Anatoly Baksheev 69e66d7bb5 fixed little bug in makeCameraPose 2013-08-02 13:37:15 +04:00
Fedor Morozov c51b50b44c Algorithm names in code 2013-08-02 00:01:15 +04:00
Fedor Morozov ed0828d0a8 New HDR documentation 2013-08-01 15:34:03 +04:00
Fedor Morozov 302bf23f82 All hdr functions as Algorithms 2013-08-01 03:24:47 +04:00
Anatoly Baksheev f30f3b6c87 Merge pull request #17 from ozantonkal/implementing_widgets
Implementing widgets
2013-07-31 11:54:42 -07:00
Nghia Ho d01e95f4b4 Merge branch 'master' of https://github.com/nghiaho12/opencv 2013-08-01 00:03:39 +10:00
Nghia Ho bc3dd2452f Added test cpp 2013-07-31 23:59:23 +10:00
Nghia Ho c0bbdde8ba Added test cpp 2013-07-31 23:43:25 +10:00
Nghia Ho 61386e1abd Merge https://github.com/Itseez/opencv
Keeping up to date
2013-07-31 23:40:34 +10:00
Nghia Ho 00f63fa8f7 Finished test code, added image to the doc 2013-07-31 23:08:02 +10:00
Fedor Morozov 4d2ea847fa Tonemap as 3.0 algorithm 2013-07-31 16:05:31 +04:00
Andrey Pavlenko 4ed9b1ca9a Merge pull request #1166 from StevenPuttemans:patch_2288 2013-07-31 15:50:13 +04:00
StevenPuttemans f33fe94c0d Added the sample from patch #2288 : reading in sequence of images
Added bugfixes
- Changed CV_WINDOW_NORMAL to 1
- Changed the help function to static
- Added extra help information on mask specifics
2013-07-31 13:38:18 +02:00
Andrey Pavlenko a77456e8aa Merge pull request #1208 from berak:Bug_3094 2013-07-31 14:29:21 +04:00
hbristow 5e50791a9d Generator and compiler now working on Windows. Moved matlab to correct VS solution folder 2013-07-31 12:37:05 +10:00
hbristow 58ca8ed97f Improved finding Matlab on Windows machines. Needs testing on computers that have multiple version installed 2013-07-31 11:24:28 +10:00
Nghia Ho 27bcc0bf07 Merge https://github.com/Itseez/opencv
Keep up to date
2013-07-31 06:10:57 +10:00
berak 03c4a6299b expanded the CV_Assert in pyrdown_ to check for empty mats 2013-07-30 17:32:48 +02:00
Andrey Pavlenko c4e1edbb83 Merge pull request #1195 from jet47:gpucodec-remove-ffmpeg-dep 2013-07-30 18:22:08 +04:00
hbristow 627b9df85f removed experimental IO from build 2013-07-31 00:00:50 +10:00
hbristow 6549e5e052 Added flaky support for finding Matlab on Windows machines 2013-07-30 23:58:32 +10:00
Nghia Ho 3fcdbbe734 Merge https://github.com/Itseez/opencv 2013-07-30 23:58:10 +10:00
Andrey Pavlenko 93923141d5 Merge pull request #1108 from nailbiter:optimLP 2013-07-30 17:50:31 +04:00
Andrey Pavlenko b31293c984 Merge pull request #1194 from SpecLad:no-const-inputarray 2013-07-30 17:41:26 +04:00
Andrey Pavlenko cd62f9f7cb Merge pull request #1164 from bitwangyaoyao:master_fixHaar 2013-07-30 16:14:24 +04:00
Andrey Pavlenko c5e569d178 Merge pull request #1204 from berak:Bug_3170 2013-07-30 16:13:03 +04:00
Andrey Pavlenko 41d180f90a Merge pull request #1198 from znah:py_flann_fix 2013-07-30 14:17:33 +04:00
abidrahmank fa1b96bd36 imshow docs improvement bug#2490 2013-07-30 07:00:51 +05:30
abidrahmank 9628bb0b44 morphologyex docs bug#2169 2013-07-30 06:46:59 +05:30
Alex Leontiev 3013ad6624 Minor fixes
Request to comments on pull request for simplex method. In particular
*) while(1) is replaced with for(;;)
*) if(true){...} constructions in tests are replaced with #if 1 ...
 #endif
2013-07-30 04:14:36 +03:00
abidrahmank 29ddbbaa86 epilines pydocs 2013-07-30 00:27:58 +05:30
Fedor Morozov 258b98d15b Tonemap as Algorithm 2013-07-29 21:35:10 +04:00
ozantonkal f5816c883f fix setting color of 3D objects 2013-07-29 15:10:48 +02:00
ozantonkal b64e6ccc6c static function for appending clouds in cloud collection widget 2013-07-29 15:06:05 +02:00
Andrey Pavlenko 9e8dd28b0e Merge pull request #1200 from shervinemami:patch-1 2013-07-29 15:31:36 +04:00
ozantonkal 42266b04a5 makeCameraPose implementation 2013-07-29 12:25:46 +02:00
berak 1b10860f36 added add_definitions(-DCVAPI_EXPORTS) to cmakelists.txt 2013-07-29 12:16:37 +02:00
ozantonkal 250dac5b71 fix: trajectory path is now relative to the global frame 2013-07-29 11:01:59 +02:00
Nghia Ho cb16f733b9 Added C interface 2013-07-28 15:31:58 +10:00
Nghia Ho a40f217a38 changed from isnormal to isfinite, the prev ignored zero 2013-07-28 01:06:55 +10:00
Nghia Ho a0576d7b2a Fixed ret 2013-07-28 00:46:44 +10:00
Nghia Ho e2f00ce846 New intersection function for rotated rectangles 2013-07-28 00:12:24 +10:00
Shervin Emami 7dc147c1f2 Changed cornerHarris description to say it finds corners, not edges 2013-07-26 19:13:25 -07:00
ozantonkal 3fe5984e46 cloud collection widget implementation 2013-07-26 16:55:03 +02:00
Alexander Mordvintsev 25b9ac18e6 fixed Bug #3143 - flann 'not implemented' error 2013-07-26 17:59:38 +04:00
ozantonkal edfad34d39 trajectory with spheres and lines (based on the code snippet in gdocs) 2013-07-26 14:50:11 +02:00
Vladislav Vinogradov 60e2dbe810 removed ffmpeg dependency from gpucodec module:
used implementation from highgui module
2013-07-26 16:13:37 +04:00
Roman Donchenko 31de2833b4 Replace "const InputArray" with "InputArray".
InputArray is a reference, and references are always constant anyway. Making
it const even causes a GCC warning.
2013-07-26 14:52:56 +04:00
Roman Donchenko 4ac2db271d Removed CV_EXPORTS from all template classes (that I could find).
It doesn't make sense to export template classes, since there's no way
the user can learn that it can import them. In fact, it is somewhat
deleterious, because every module will export every instantiation
that it uses, but doesn't inline.
2013-07-25 19:40:08 +04:00
ozantonkal b661d72252 CameraPositionWidget: a workaround for setting frustum color in the presence of an image 2013-07-25 16:47:30 +02:00
ozantonkal ec756afe87 trajectorywidget display modes are combined with & instead of | 2013-07-25 16:08:23 +02:00
ozantonkal 64cdd82146 trajectory widget constructor with field of view 2013-07-25 15:08:45 +02:00
Alex Leontiev 52b250f466 Minor fixes
Fixing failed build.
2013-07-25 14:30:20 +03:00
ozantonkal 7d458e852e trajectory widget display options: display path, display frames, display both 2013-07-25 10:56:54 +02:00
ozantonkal aa2594c06c fix aspect_ratio computation from fovs, add casting for camerapositionwidget, trajectorywidget 2013-07-25 10:23:24 +02:00
Roman Donchenko 8afb7a40c6 Merge pull request #1159 from lluisgomez:scene_text_detection_NM 2013-07-25 12:13:49 +04:00
Roman Donchenko 98d36a4037 Merge pull request #1171 from SpecLad:drop-legacy-options 2013-07-25 12:05:36 +04:00
Roman Donchenko 4e1e0c9ee3 Merge pull request #1180 from nghiaho12:master 2013-07-25 12:04:09 +04:00
Nghia Ho eb2720a908 missing fclose when returning early 2013-07-24 23:53:18 +10:00
Roman Donchenko 45f7c83da4 Merge pull request #1119 from 23pointsNorth:lsd 2013-07-24 13:50:11 +04:00
Roman Donchenko b2d359b6ac Merge pull request #1170 from SpecLad:merge-2.4 2013-07-24 13:45:33 +04:00
ozantonkal 769512db2d move image copying structure to viz3d_impl: ConvertToVtkImage 2013-07-24 10:32:21 +02:00
ozantonkal 952029a47b GridImpl structure to shorten grid widget implementation 2013-07-24 10:13:01 +02:00
ozantonkal 6e5a712f6e Gridwidget with plane coefficients 2013-07-24 10:02:33 +02:00
ozantonkal 40b50755d3 add const keywords to gridwidget constructor 2013-07-23 15:46:14 +02:00
ozantonkal 4d70671231 intial implementation of frustum + image (the color of the frustum is currently dependent on the first pixel of the image) 2013-07-23 15:43:23 +02:00
lluis c4f88b0687 removed some unnecessary ERStat members as they are easily computable from others 2013-07-23 15:04:01 +02:00
lluis 43e7e6e475 removed extra cv:: scope qualifiers for better readability 2013-07-23 14:37:45 +02:00
lluis 2087d4602b using Rect for storing the bounding box instead of an integer array 2013-07-23 13:58:52 +02:00
lluis ca6b30a568 using explicit keyword in the ERStat constructor for safe contruction 2013-07-23 00:24:17 +02:00
ozantonkal f9938da67d image 3d widget with position, normal, up_vector 2013-07-22 17:18:19 +02:00
Roman Donchenko abe4219256 Drop the legacy CMake options.
3.0 seems like an appropriate time to do that.
2013-07-22 18:49:38 +04:00
ozantonkal d0bd344a42 image 3d widget use texture instead of imageactor for more flexibility (such as resizing) 2013-07-22 16:48:17 +02:00
Roman Donchenko 3939d78336 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/core/include/opencv2/core/types_c.h
	modules/gpu/src/cuda/imgproc.cu
	modules/gpu/src/cuda/safe_call.hpp
	modules/gpu/src/error.cpp
	modules/gpu/src/imgproc.cpp
	modules/imgproc/src/distransform.cpp
	modules/imgproc/src/shapedescr.cpp
	modules/python/src2/cv2.cpp
	modules/python/src2/cv2.cv.hpp
2013-07-22 18:38:57 +04:00
ozantonkal 27f5cd2afd overlay image widget constructor with Rect 2013-07-22 16:12:22 +02:00
ozantonkal 540f9a67f3 remove unnecessary declaration 2013-07-22 15:14:33 +02:00
ozantonkal c0f44ca421 shorten Trajectory widget implementation 2013-07-22 15:03:28 +02:00
ozantonkal 5af739dfc1 plane widget size fix 2013-07-22 14:34:44 +02:00
ozantonkal 16c8c98895 trajectory widget with frustums 2013-07-22 14:11:06 +02:00
Daniel Angelov ae93a3e681 The accurate LineSegmentDetector object. 2013-07-22 15:08:23 +03:00
Daniel Angelov 26847f92b3 Fixed the sample. 2013-07-22 14:46:34 +03:00
ozantonkal f3b228c91f initial implementation of trajectory widget 2013-07-22 12:53:19 +02:00
Roman Donchenko ef91d7e883 Merge pull request #1153 from abidrahmank:bgdGMG_docs 2013-07-22 14:52:36 +04:00
Daniel Angelov 982ccd784e Added the update on the sample. 2013-07-22 13:49:33 +03:00
yao 3d3e9ab635 Fix the problem of haar caused by merge 2013-07-22 17:53:56 +08:00
Vladislav Vinogradov 6dfd8f184c rewrote matrix operations with cudev module 2013-07-22 13:07:07 +04:00
ozantonkal 13a2516a6a avoid memory leak in mesh widget 2013-07-22 09:11:16 +02:00
Vladislav Vinogradov 2311b0b43b added cudev::GpuMat_<T> support to Input/Output arrays 2013-07-22 10:33:40 +04:00
Vladislav Vinogradov 1c0d2b37a7 added globPtr for GpuMat 2013-07-22 10:33:39 +04:00
Vladislav Vinogradov c23eb17997 added gridTransform/gridCopy overloads for GlobPtrSz 2013-07-22 10:33:39 +04:00
Daniel Angelov 6fa4834f31 Update on the class. Edited tests and samples. 2013-07-22 00:55:29 +03:00
Andrey Pavlenko aaf47578e8 Merge pull request #1155 from bitwangyaoyao:master_fix 2013-07-21 18:50:39 +04:00
Andrey Pavlenko bd4d24f0fa Merge pull request #1122 from SpecLad:merge-2.4 2013-07-21 18:46:27 +04:00
Andrey Pavlenko cd103e442f Merge pull request #1032 from jet47:gpuarithm-remove-obsolete-api 2013-07-21 18:45:47 +04:00
Fedor Morozov af2c9077f7 Calibration, various changes 2013-07-21 13:56:20 +04:00
Fedor Morozov 703cf8cef7 Calibration, various changes 2013-07-21 13:48:57 +04:00
abidrahmank 297b67d2b1 pydocs for cv2.findTransformECC 2013-07-21 13:40:11 +05:30
Daniel Angelov 6f3d6ded47 Test case to strict, as overlapping lines (based on random places) may occur. 2013-07-21 10:39:24 +03:00
Daniel Angelov 68e348f960 Added private operator=. 2013-07-21 10:08:11 +03:00
Daniel Angelov cedd768397 Fixed the M_PI to CV_PI 2013-07-21 01:54:27 +03:00
Daniel Angelov 965b3759b1 Update on the class to reflect the review. Split the class into virtual and implementation. change of name to LineSegmentDetector, using Input/Output-Arrays, general clean ups. 2013-07-21 01:31:51 +03:00
Alex Leontiev c123974f42 Eliminated all the calls to std::find()
This is done by keeping indexToRow vector, that keeps the information,
opposite to those kept by N and B. That is, while N and B help to
determine which variable corresponds to given column in column-vector c
or row in matrix b, indexToRow helps to determine the corresponding
row/column for a given variable.

At this point, I'm waiting for comments from pull request reviewer and
not working on any upgrades. Comments are appreciated, as usual.
2013-07-20 15:14:02 +03:00
lluis 9fbff009e9 fixed compilation errors and warnings on builds 3298 and 4384 2013-07-20 11:35:56 +02:00
lluis 6adba09463 fixed some warnings on build 4285 2013-07-20 11:13:38 +02:00
abidrahmank f36b9940e8 ref in inpainting docs 2013-07-20 14:07:19 +05:30
lluis 1d8e80aa3b add opencv_ml headers to precomp 2013-07-20 10:33:42 +02:00
lluis 5abe3b59f5 Class-specific Extremal Region Filter algorithm as proposed in :
Neumann L., Matas J.: Real-Time Scene Text Localization and Recognition, CVPR 2012.

High-level C++ interface and implementation of algorithm is in the objdetect module.
C++ example, a test image, and the default classifiers in xml files.
2013-07-20 01:10:05 +02:00
abidrahmank 692d807fa0 gabor filter docs Bug#1894 2013-07-20 00:15:28 +05:30
abidrahmank 84179b8a4e bgdsubtractorGMG docs 2013-07-19 23:11:30 +05:30
ozantonkal 0a3691d6ac CameraPositionWidget: constructor with Vec2f fov (tentative) 2013-07-19 18:30:12 +02:00
Alex Leontiev 33e7640fb0 Simplify printing procedures
Use opencv's print() procedure in place of my own procedures to output
matrices and std::vectors.

Interestingly enough, operator<< does not work for matrices, when called
from my .cpp files in src/ subfolder of the optim module, although it
works when called from tests and stand-alone programs, compiled with
opencv. I think, this requires investigation and, maybe, bug report.
2013-07-19 12:34:33 +03:00
Roman Donchenko 73b10bc8ca Merge pull request #1133 from abidrahmank:denoising_pydocs 2013-07-19 12:20:56 +04:00
yao 18f71fd410 Warning fixes 2013-07-19 14:36:41 +08:00
Alex Leontiev 459c16ca99 Minor fixes
In request to the comments for the pull request.
2013-07-19 03:09:39 +03:00
Alexander Shishkov b87d2e9ec2 cosmetic change 2013-07-19 03:10:38 +04:00
Alexander Shishkov 919f35644e Merge branch 'master' of https://github.com/f-morozov/opencv 2013-07-19 01:08:49 +04:00
Alexander Shishkov 35a39c19a3 minor changes 2013-07-19 01:08:42 +04:00
Fedor Morozov ec668ce3a7 Documentation 2013-07-19 00:23:49 +04:00
ozantonkal 2294eb82c9 fix aspect_ratio in camera position widget, add scale parameter (tentative implementation of scale) 2013-07-18 17:46:08 +02:00
Andrey Pavlenko 0386488629 Merge pull request #1095 from jet47:gpu-perf-tests 2013-07-18 19:32:37 +04:00
ozantonkal 9d3f3c66da camera position widget: constructor with no parameter, constructor with intrinsic matrix for visualizing frustum 2013-07-18 17:08:58 +02:00
Roman Donchenko 77f2d945f0 Merge pull request #1144 from prclibo:master 2013-07-18 16:05:40 +04:00
Vladislav Vinogradov 7737375106 updated documentation 2013-07-18 15:39:43 +04:00
Vladislav Vinogradov af2a700671 made module dependency optional 2013-07-18 15:39:42 +04:00
Vladislav Vinogradov 62edeeed16 refactored FGD algorithm 2013-07-18 15:39:42 +04:00
Vladislav Vinogradov 697793090d refactored GMG algorithm 2013-07-18 15:39:42 +04:00
Vladislav Vinogradov b8f0d1a0e4 refactored MOG2 algorithm 2013-07-18 15:39:42 +04:00
Vladislav Vinogradov a2adab7283 refactored MOG algorithm
converted it to abstract interface
2013-07-18 15:39:42 +04:00
Vladislav Vinogradov 88e67545ef split mog sources 2013-07-18 15:39:42 +04:00
Vladislav Vinogradov 7b87d72d80 refactored generalized hough (both CPU and GPU):
removed set/get methods from Algorithm (implement owns)
removed GHT_* enumeration
2013-07-18 15:17:33 +04:00
Andrey Pavlenko 4b234fa0a5 Merge pull request #1042 from jet47:gpuimgproc-refactoring 2013-07-18 14:22:44 +04:00
ozantonkal 3260404fdf initial CameraPositionWidget implementation using eye, look_at, up_vector 2013-07-18 10:39:34 +02:00
Bo Li 27a0ed0018 removed tab in five-point.cpp 2013-07-18 10:09:50 +08:00
Bo Li 9b5eca975b fixed a bug for the mask of recoverPose function 2013-07-18 09:55:39 +08:00
Alexander Shishkov a29ce401d5 minore changes in test on HDR fromat 2013-07-18 01:32:06 +04:00
Alexander Shishkov 245dc99248 added include precomp 2013-07-18 01:13:35 +04:00
Alexander Shishkov 707048f6e1 removed tonemap_algorithms due to wrapping problems 2013-07-18 00:55:39 +04:00
Alexander Shishkov 8ccca90dca small changes
added including for precomp
2013-07-18 00:28:40 +04:00
Roman Donchenko 73b5cc358e Merge pull request #1132 from apavlenko:master_ver_290 2013-07-17 17:51:56 +04:00
Andrey Pavlenko e04517af36 moving version to 2.9.0,
also adding NVidia copyright
2013-07-17 15:03:11 +04:00
ozantonkal 40e47e6f3f Image widgets implementation, GridWidget: vtkExtractEdges instead of Wireframe 2013-07-17 11:35:14 +02:00
Roman Donchenko 4f68212e64 Merge pull request #1124 from SpecLad:matx-div 2013-07-17 13:32:26 +04:00
Roman Donchenko 8f2047ada4 Merge pull request #1093 from jet47:fix-gpu-stream-test 2013-07-17 13:18:25 +04:00
Vladislav Vinogradov 39a25115e0 fixed compilation 2013-07-17 11:41:48 +04:00
Vladislav Vinogradov 59edad5a00 removed obsolete API 2013-07-17 11:40:01 +04:00
Vladislav Vinogradov 5da724001f made dependecy from gpufilters optional 2013-07-17 11:40:00 +04:00
Vladislav Vinogradov f614e35443 split hough sources 2013-07-17 11:40:00 +04:00
Vladislav Vinogradov 1d79e13133 removed dependecy from gpuarithm 2013-07-17 11:39:59 +04:00
Vladislav Vinogradov 9498f82085 updated documentation 2013-07-17 11:39:58 +04:00
Vladislav Vinogradov 62a5a70cd0 switched to Input/Output Array in bilateralFilter & blendLinear 2013-07-17 11:39:58 +04:00
Vladislav Vinogradov de56163f97 refactored gpu::matchTemplate (converted it into Algorithm) 2013-07-17 11:39:57 +04:00
Vladislav Vinogradov 1fcc8074bd switched to Input/Output Array in Mean Shift 2013-07-17 11:39:57 +04:00
Vladislav Vinogradov 70e6dc615a refactored GoodFeaturesToTrackDetector 2013-07-17 11:39:56 +04:00
Vladislav Vinogradov d7ff3ad0cf refactored cornerHarris and cornerMinEigenVal
* converted it into Algorithm
2013-07-17 11:39:55 +04:00
Vladislav Vinogradov ad4d6bed9d refactored gpu::GeneralizedHough 2013-07-17 11:39:55 +04:00
Vladislav Vinogradov 4087a45e73 refactored HoughCircles (converted it into Algorithm) 2013-07-17 11:39:54 +04:00
Vladislav Vinogradov 1652540a1f refactored HoughLines (converted it into Algorithm) 2013-07-17 11:39:54 +04:00
Vladislav Vinogradov 48fb8c4f8a refactored gpu::Canny (converted it into Algorithm) 2013-07-17 11:39:53 +04:00
Vladislav Vinogradov fc8476544c switched to Input/Output Array in Histogram Processing 2013-07-17 11:39:52 +04:00
Vladislav Vinogradov 9eea9835ab switched to Input/Output Array in Color Processing 2013-07-17 11:39:52 +04:00
Vladislav Vinogradov 4716f63444 fixed gpu performance tests:
used new CV_PERF_TEST_MAIN_WITH_IMPLS mechanism
2013-07-16 15:43:04 +04:00
Roman Donchenko 6d1ec452fc Merge pull request #1125 from SpecLad:softcascade-nowarn 2013-07-16 15:12:25 +04:00
Roman Donchenko 1160b04fb4 Fixed a build warning in softcascade. 2013-07-16 12:43:49 +04:00
Roman Donchenko 924fc070f0 Changed / for Matx to Matx::div, for symmetry with Matx::mul. 2013-07-16 12:25:26 +04:00
Roman Donchenko 3443fd85cd Merge pull request #984 from albenoit:master 2013-07-16 11:57:52 +04:00
Roman Donchenko feaa12a274 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/core/include/opencv2/core/version.hpp
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/src/initialization.cpp
	modules/ocl/test/main.cpp
	modules/superres/CMakeLists.txt
	modules/superres/src/input_array_utility.cpp
	modules/superres/src/input_array_utility.hpp
	modules/superres/src/optical_flow.cpp
2013-07-16 11:52:41 +04:00
ozantonkal 769eba7535 cube wire_frame fix using vtkOutlineSource 2013-07-16 09:06:14 +02:00
ozantonkal 4b85c849ca fix rgb and bgr incompatibility 2013-07-16 09:06:14 +02:00
ozantonkal 1bfd7ad17e arrow widget thickness parameter 2013-07-16 09:06:14 +02:00
Daniel Angelov 694d9ff2eb LSD enum now anonymous. 2013-07-15 23:28:19 +03:00
Anatoly Baksheev dc348ff93d removed Mesh::Ptr since mesh itself consists of shared points (cv::Mat) 2013-07-15 19:18:37 +04:00
Anatoly Baksheev 0e20473c97 minor mesh load fixes 2013-07-15 16:46:39 +04:00
Anatoly Baksheev 4c228c07f1 fixed copilation 2013-07-15 16:31:28 +04:00
Anatoly Baksheev 2d36a8f7da Merge pull request #16 from ozantonkal/implementing_widgets
Implementing widgets
2013-07-15 04:13:47 -07:00
ozantonkal efbebe6236 Merge branch 'implementing_widgets' of https://github.com/ozantonkal/opencv into implementing_widgets 2013-07-15 12:04:24 +02:00
ozantonkal 25f98bc022 mesh widget casting 2013-07-15 12:02:53 +02:00
ozantonkal b066d1982f mesh widget implementation 2013-07-15 12:02:20 +02:00
Anatoly Baksheev 757e61d94c restored OpenCVModule.cmake 2013-07-15 13:11:34 +04:00
alexandre benoit 12f65c61a8 updated doc wrt new bioinspired namespace convention 2013-07-15 09:58:16 +02:00
Roman Donchenko 52a9378257 Merge pull request #979 from jet47:gpuwarping-refactoring 2013-07-15 11:47:03 +04:00
Roman Donchenko 1590a1a538 Merge pull request #1068 from AoD314:webp2 2013-07-15 11:45:28 +04:00
alexandre benoit 7fe78efda3 retina included in namespace bioinspired + followed suggestions made by Vadim 2013-07-14 19:28:37 +02:00
Daniel Angelov d35601209e Added define guard for ln10. Fixed some warnings. 2013-07-14 14:29:56 +03:00
Daniel Angelov 22c8010b2d Added needed header, changed macro name. 2013-07-14 12:56:22 +03:00
Anatoly Baksheev 6ca1822f36 added comments with future work for VizImpl
added authors to license header
2013-07-13 20:42:49 +04:00
Anatoly Baksheev d6e2b657f9 more refactoring 2013-07-13 19:42:49 +04:00
Anatoly Baksheev 512afe2a90 beatification of test_viz 2013-07-13 18:23:46 +04:00
Anatoly Baksheev 83cb28f169 temp_viz removed 2013-07-13 18:01:56 +04:00
Anatoly Baksheev 3e41f0647e removed q subfolder 2013-07-13 17:45:46 +04:00
abidrahmank 61e50e2fda python docs for non-local means denoising 2013-07-13 16:00:15 +05:30
andrey.morozov 7d5185e8f1 updated webp to version 0.3.1 2013-07-13 14:09:44 +04:00
andrey.morozov e4e0862c2e added support image with alpha channel 2013-07-13 14:09:37 +04:00
Daniel Angelov 3350533f48 Fixed ambiguouty error, signess compare. 2013-07-13 05:08:15 +03:00
Daniel Angelov 6bd5e12be3 Added a sample to show usage of the class. 2013-07-13 04:11:27 +03:00
Daniel Angelov e51e00ac5f Added LSD accuracy tests. 2013-07-13 04:09:28 +03:00
Anatoly Baksheev f480eca668 removed Affine3f from coordinate frame constructor 2013-07-13 01:49:59 +04:00
Daniel Angelov 5350a2f1d9 Added Line Segmen Detector. 2013-07-13 00:21:02 +03:00
Anatoly Baksheev 328f0e32d8 added makeTransformToGlobal() function 2013-07-13 00:00:57 +04:00
Anatoly Baksheev 6045ae856b reshape continuous clouds for better performance. 2013-07-12 23:59:19 +04:00
Anatoly Baksheev ae2e3a1a93 viz license header template 2013-07-12 16:53:25 +04:00
Fedor Morozov 091b48de60 MTB alignment. Missing main file. 2013-07-12 16:08:06 +04:00
Fedor Morozov 35133df0de MTB alignment. Code, tests, application 2013-07-12 16:03:53 +04:00
Roman Donchenko 616dbd53f0 Merge pull request #1107 from abidrahmank:master 2013-07-12 11:40:33 +04:00
Roman Donchenko 3b8a13a1ed Merge pull request #1101 from jet47:cudev-stub-lib 2013-07-12 11:39:25 +04:00
hbristow 9cc949e341 Added more test cases 2013-07-12 17:31:25 +10:00
hbristow 5a34b00737 Added more test cases 2013-07-12 16:57:05 +10:00
hbristow 603d949354 Improved string handling. Swapped transpose interface for slow but correct implementation. Will come back to optimized implementation later. imshow now works correctly 2013-07-12 15:48:03 +10:00
Vladislav Vinogradov d52ef2f758 added stub library for cudev module
in order to make CMake scripts work properly
2013-07-12 08:47:12 +04:00
Vladislav Vinogradov 5e3934446d fixed test compilation for gpu::Stream 2013-07-12 08:45:55 +04:00
Vladislav Vinogradov afb08b33c7 removed obsolete API from gpuarithm module 2013-07-12 08:40:30 +04:00
Vladislav Vinogradov 0d9e3cfa37 updated documentation 2013-07-12 08:12:48 +04:00
Vladislav Vinogradov 6d6ff26887 refactored gpu::ImagePyramid (converted it to abstract interface) 2013-07-12 08:12:48 +04:00
Vladislav Vinogradov 2932beddcf switched to Input/Output Array in gpuwarping functions 2013-07-12 08:12:48 +04:00
hbristow 346f7d0f3e Fast deep-copy-transpose implemented which attempts to not thrash the cache. Good first step for now, but no transpose at all would be preferrable. Started I/O. 2013-07-12 10:38:48 +10:00
Alex Leontiev 6db2596ca9 Convenience fixes
Attempting to fix issues pointed out by Vadim Pisarevsky during the pull
request review. In particular, the following things are done:
*) The mechanism of debug info printing is changed and made more
procedure-style than the previous macro-style
*) z in solveLP() is now returned as a column-vector
*) Func parameter of solveLP() is now allowed to be column-vector, in
which case it is understood to be the transpose of what we need
*) Func and Constr now can contain floats, not only doubles (in the
former case the conversion is done via convertTo())
*)different constructor to allocate space for z in solveLP() is used,
making the size of z more explicit (this is just a notation change, not
functional, both constructors are achieving the same goal)
*) (big) mat.hpp and iostream headers are moved to precomp-headers from
optim.hpp
2013-07-11 22:05:14 +03:00
Alex Leontiev e9b432b1d9 Fixing the warnings
Fixed all of the warnings.
2013-07-11 14:43:48 +03:00
Anatoly Baksheev c6a8bd65a8 fixed some warnings for windows
minor buitification
2013-07-11 14:45:39 +04:00
ozantonkal acd63c1497 fix grid widget unused color 2013-07-11 11:52:59 +02:00
Alex Leontiev 6c9ae1100b Fixed the warnings
Fixed the code so to eliminate warnings related to shadowing and unused
parameters. In some settings, these warnings may be treated as an errors
and lead to failed build.

Suggested by Nikita Manovich.
2013-07-11 12:29:55 +03:00
Anatoly Baksheev ea8d485d76 Merge pull request #15 from ozantonkal/implementing_widgets
Implementing widgets
2013-07-11 02:28:55 -07:00
Andrey Pavlenko 75b86c9706 Merge pull request #1104 from nikman-ru:cap_reuse 2013-07-11 11:52:22 +04:00
ozantonkal eef8195569 clean unnecessary methods, make text3d face camera 2013-07-11 09:30:52 +02:00
Alex Leontiev fe6a7e935d Fix qualifiers on aux functions for solveLP()
Change qualifiers on auxiliary functions (for solveLP() procedure) from
const (that does not have much sense) to static (that makes them
invisible for outside world and hopefully exacerbates optimization).
2013-07-11 09:52:13 +03:00
Alex Leontiev ba537a95db Preparation for pull request
Additional cleaning for simplex method, removing the parts that are
currently unused. Removing developer's notes. Trying to reach production
level.
2013-07-11 09:31:10 +03:00
Andrey Pavlenko decd0c753a Merge pull request #1082 from jet47:gpu-warnings-fix 2013-07-11 09:41:46 +04:00
abidrahmank 1923d87f61 PyDocs for common interface of feature2d 2013-07-11 09:33:32 +05:30
abidrahmank f91f369788 PyDocs for FAST, ORB etc 2013-07-11 09:32:49 +05:30
abidrahmank 2047838106 feature2d drawing functions PyDocs 2013-07-11 09:31:25 +05:30
abidrahmank 031c77f4eb SIFT+SURF PyDocs 2013-07-11 09:30:21 +05:30
abidrahmank 5d863f7516 drawMatches python bindings 2013-07-11 09:28:37 +05:30
Alex Leontiev a95650111f Cleaning the code of simplex method
In particular, the following things are done:
*) Consistent tabulation of 4 spaces is ensured
*) New function dprintf() is introduced, so now printing of the debug
information can be turned on/off via the ALEX_DEBUG macro
*) Removed solveLP_aux namespace
*) All auxiliary functions are declared as static
*) The return codes of solveLP() are encapsulated in enum.
2013-07-10 20:11:52 +03:00
ozantonkal 5813a3a99d text3D widget implementation 2013-07-10 16:34:47 +02:00
Nikita Manovich 21211308d0 Fixed VideoCapture::open() does not release previous capture sources (Bug #3150).
VideoCapture didn't call release method and just ignored the new capture sources.
OpenCV documentation:
  bool VideoCapture::open(const string& filename);
  bool VideoCapture::open(int device);

The methods first call VideoCapture::release() to close the already opened file or camera.
2013-07-10 17:48:44 +04:00
ozantonkal e185900270 grid widget implementation 2013-07-10 15:34:19 +02:00
ozantonkal 71c76aecc9 PolyLine widget implementation 2013-07-10 12:51:17 +02:00
ozantonkal d3dee3a2fe explicit casting among widgets, removed implicit casting 2013-07-10 09:55:42 +02:00
Anatoly Baksheev e4c3416f58 experimental widget casting functionality 2013-07-09 20:16:43 +04:00
Anatoly Baksheev 509a93c7ce minor naming 2013-07-09 19:35:26 +04:00
ozantonkal 200b254bad rearrange widget constructors 2013-07-09 15:18:44 +02:00
ozantonkal 10d955f18b widget2d setcolor implementation 2013-07-09 14:28:55 +02:00
ozantonkal 318b1c00a9 implement assignment operator and copy constructor for all widgets existing 2013-07-09 14:12:49 +02:00
ozantonkal 195d60f4f8 fix widget delete bug 2013-07-09 11:07:21 +02:00
ozantonkal d324c03b6a initial redesigning widgets 2013-07-09 10:22:12 +02:00
Roman Donchenko 68a992b075 Merge pull request #1096 from SpecLad:merge-2.4 2013-07-09 11:50:19 +04:00
Anatoly Baksheev 061c28cde0 Merge pull request #14 from ozantonkal/implementing_widgets
Implementing widgets
2013-07-08 12:52:18 -07:00
ozantonkal b50d777985 cloudwidget private implementation for duplicate code, add cv_assert(exists), fix bug point_step bug in CloudNormalsWidget 2013-07-08 21:48:19 +02:00
ozantonkal cc08149d7c remove redundant statements 2013-07-08 19:05:35 +02:00
ozantonkal 658e4c5e97 set/get/updateWidgetPose implemented, cloudNormals with color 2013-07-08 18:56:13 +02:00
ozantonkal e76023be96 cloud normals widget implementation 2013-07-08 18:22:51 +02:00
Roman Donchenko c05bfe9d6d Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/features2d/include/opencv2/features2d/features2d.hpp
	modules/ocl/src/opencl/stereobp.cl
	modules/ocl/src/stereobp.cpp
2013-07-08 18:47:38 +04:00
ozantonkal 6e5ae98582 initial cloud widget implementation, fix safedowncasts 2013-07-08 15:12:50 +02:00
ozantonkal d394e233bb cube widget wireframe 2013-07-08 11:34:11 +02:00
ozantonkal 653eda45f8 text widget implementation 2013-07-08 10:41:42 +02:00
ozantonkal c4f4727ee5 showWidget takes Affine3f as argument 2013-07-08 10:53:00 +03:00
ozantonkal eafcdc004d plane widget size 2013-07-07 21:19:21 +03:00
ozantonkal 030400d50f circle widget thickness property 2013-07-07 16:21:47 +03:00
andrey.morozov 8d0452ed59 added test to save image with webp with alpha channel 2013-07-06 17:26:22 +04:00
Fedor Morozov 0aee5b61e3 Exposure fusion. Code, tests. 2013-07-05 16:14:08 +04:00
Anatoly Baksheev 9d684a39da Fixed ref counting bug, minor formatting 2013-07-05 14:35:12 +04:00
Anatoly Baksheev 45cdc41763 Merge pull request #13 from ozantonkal/implementing_widgets
Implementing widgets
2013-07-05 03:10:53 -07:00
Roman Donchenko de58039b46 Merge pull request #1081 from SpecLad:merge-2.4 2013-07-05 13:34:59 +04:00
Roman Donchenko 2f8be2a4b1 Merge pull request #1083 from jet47:cuda-device-layer 2013-07-05 13:30:11 +04:00
Alexey Spizhevoy dcb049df6a fixed docs 2013-07-05 10:16:22 +04:00
Alexey Spizhevoy 2a48f7c035 fixed include for Windows 2013-07-05 09:44:32 +04:00
ozantonkal 7e2643abff removed shape files 2013-07-04 19:05:56 +03:00
ozantonkal 4c3d1d583a remove ModelCoefficients, remove showShape methods from viz3d 2013-07-04 18:47:52 +03:00
ozantonkal 5bb95c4110 remove widget implementation 2013-07-04 18:36:26 +03:00
ozantonkal ecdd8513fd coordinate system widget implementation, update pose fix 2013-07-04 18:19:06 +03:00
ozantonkal 03cc439b08 cube widget implementation 2013-07-04 17:59:11 +03:00
ozantonkal f07486b563 cylinder widget implementation 2013-07-04 17:44:41 +03:00
Roman Donchenko 4d45b3e7f9 Merge pull request #1089 from SpecLad:contract-violations 2013-07-04 18:25:39 +04:00
alexandre benoit 188f889949 Merge branch 'master' of code.opencv.org:opencv 2013-07-04 16:19:24 +02:00
ozantonkal f97c3c8b06 circle widget and arrow widget implementation 2013-07-04 16:54:46 +03:00
Alexey Spizhevoy 406f342dc3 updated docs 2013-07-04 17:41:39 +04:00
ozantonkal d80a965f97 sphere widget implementation 2013-07-04 16:32:06 +03:00
Alexey Spizhevoy 027065a5a1 removed trailing whitespaces causing warnings 2013-07-04 17:31:12 +04:00
Alexey Spizhevoy cc85e86ee7 fixed Windows build 2013-07-04 17:22:36 +04:00
ozantonkal 3d3e3fd470 plane widget implementation 2013-07-04 16:15:20 +03:00
Roman Donchenko 0daf4b800a Fix bug: CommandLineParserParams's comparator would fail with equal arguments. 2013-07-04 17:09:29 +04:00
Roman Donchenko 4692d4b36e Fix bug: cv::String would break if assigned to itself. 2013-07-04 17:06:00 +04:00
ozantonkal ba89a6a34a line widget set/get line width 2013-07-04 16:05:05 +03:00
ozantonkal 158ed299c1 reference counting in widget 2013-07-04 15:57:49 +03:00
Alexey Spizhevoy 438a599288 added 'cmath' include 2013-07-04 16:57:20 +04:00
Fedor Morozov a5e11079d7 Fixes, missing files, tests 2013-07-04 16:51:39 +04:00
Anatoly Baksheev 141cfd562c widget_accessor.hpp - minimize dependencies 2013-07-04 15:16:48 +04:00
Anatoly Baksheev efa7f09048 slight refactoring of widget system code 2013-07-04 13:54:00 +04:00
hbristow d126263983 implemented faster transpose with SEE auto vectorization 2013-07-03 23:34:02 -07:00
ozantonkal daa2a205a4 remove redundant methods, implement assignment operator for widget 2013-07-03 22:27:09 +03:00
Vladislav Vinogradov b4d95b1406 fixed warnings in gpu modules from VS 2012 2013-07-03 22:21:10 +04:00
ozantonkal c8d2b5ff44 fix vtkActor to vtkLODActor, initial implementation LineWidget, showWidget 2013-07-03 20:53:03 +03:00
Vladislav Vinogradov 31d55af9c1 CUDA Device Layer:
header only library for CUDA programming
2013-07-03 21:32:15 +04:00
Roman Donchenko 4cf9990d4e Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	doc/tutorials/definitions/noContent.rst
	doc/tutorials/gpu/gpu-basics-similarity/gpu-basics-similarity.rst
	doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.rst
	doc/tutorials/introduction/how_to_write_a_tutorial/how_to_write_a_tutorial.rst
	modules/core/include/opencv2/core/core.hpp
	modules/core/include/opencv2/core/internal.hpp
	modules/core/include/opencv2/core/version.hpp
	modules/gpu/CMakeLists.txt
	modules/highgui/perf/perf_output.cpp
	modules/highgui/test/test_video_io.cpp
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/perf/main.cpp
	modules/ocl/src/hog.cpp
	modules/ocl/src/initialization.cpp
	modules/ocl/src/moments.cpp
	modules/ocl/src/opencl/moments.cl
	modules/ocl/test/main.cpp
	modules/ocl/test/test_moments.cpp
	modules/python/test/test.py
	modules/ts/include/opencv2/ts/ts_perf.hpp
	modules/ts/src/precomp.hpp
	modules/ts/src/ts_perf.cpp
2013-07-03 19:53:21 +04:00
ozantonkal 54c7dfab83 initial base widget implementation 2013-07-03 18:48:11 +03:00
Alexey Spizhevoy 37ea872204 added handling of camera parameters estimation errors (#3122) 2013-07-03 15:20:14 +04:00
Alex Leontiev a4a5e98cc0 Non-optimized simplex algorithm.
This version is supposed to work on all problems (please, let me know if
this is not so), but is not optimized yet in terms of numerical
stability and performance. Bland's rule is implemented as well, so
algorithm is supposed to allow no cycling. Additional check for multiple
solutions is added (in case of multiple solutions algorithm returns an
appropriate return code of 1 and returns arbitrary optimal solution).
Finally, now we have 5 tests.

Before Thursday we have 4 directions that can be tackled in parallel:
*) Prepare the pull request!
*) Make the code more clear and readable (refactoring)
*) Wrap the core solveLP() procedure in OOP-style interface
*) Test solveLP on non-trivial tests (possibly test against
http://www.coin-or.org/Clp/)
2013-07-03 13:54:23 +03:00
hbristow baa946c390 Split MxArray out of bridge into standalone file. Does not depend on bridge. Working to make it API complete with respect to mxArray, but with better calling syntax 2013-07-02 16:42:37 -07:00
Andrey Pavlenko 70deda354a Merge pull request #1047 from jet47:gpustream-remove-obsolete 2013-07-02 18:39:12 +04:00
Andrey Pavlenko 89086bdb8d Merge pull request #1046 from SpecLad:merge-2.4 2013-07-02 15:39:07 +04:00
hbristow 504558c0be Better C++11 and C++98 support/interop. Started writing map interface. Some core functions actually run 2013-07-01 16:33:55 -07:00
Anatoly Baksheev e0b7e63787 getShapePose/setShapePose simplification
little code beautification, formatting
2013-07-02 00:07:05 +04:00
Anatoly Baksheev 2229d91c50 Merge remote-tracking branch 'remotes/ozan/refactoring_shapeMethods' into viz
Conflicts:
	modules/viz/test/test_viz3d.cpp
2013-07-01 21:39:04 +04:00
hbristow 6fd296c0b0 More aggressive build warnings. The cmake configuration is quite fragile. Pay particular attention to quotes around variables 2013-06-29 16:30:17 -07:00
hbristow 538dbfe585 Now compiling under much more strigent warnings, with Clang and optional C++11 support 2013-06-29 14:24:53 -07:00
hbristow 53a7fbf74b Improved bridge. Fixed I/O problem in function template 2013-06-29 00:19:08 -07:00
hbristow 53c9c40eba started MxArray wrapper around mxArray class 2013-06-28 19:48:42 -07:00
Alex Leontiev ddc0010e7d The first draft of simplex algorithm, simple tests.
What we have now corresponds to "formal simplex algorithm", described in
Cormen's "Intro to Algorithms". It will work *only* if the initial
problem has (0,0,0,...,0) as feasible solution (consequently, it will
work unpredictably if problem was unfeasible or did not have zero-vector as
feasible solution). Moreover, it might cycle.

TODO (first priority)
1. Implement initialize_simplex() procedure, that shall check for
feasibility and generate initial feasible solution. (in particular, code
should pass all 4 tests implemented at the moment)
2. Implement Bland's rule to avoid cycling.
3. Make the code more clear.
4. Implement several non-trivial tests (??) and check algorithm against
them. Debug if necessary.

TODO (second priority)
1. Concentrate on stability and speed (make difficult tests)
2013-06-28 15:28:57 +03:00
Fedor Morozov 122f85f352 Tonemapping code 2013-06-28 16:25:12 +04:00
hbristow fc519aa3b3 Matlab constants now being parsed correctly. Over 700 constants correctly formatted :) 2013-06-27 20:03:38 -07:00
hbristow ef6327bb89 Now building all OpenCV functions 2013-06-27 18:13:04 -07:00
hbristow d6453cf051 Now builds all functions except those dependent on Features2d. Improved build detection if cmake is rerun 2013-06-27 16:25:18 -07:00
hbristow 245bc5dcc0 maintenant compiling video et photo aussi 2013-06-27 13:58:40 -07:00
hbristow 5bc55a042e Now building all functions (not classes) in core, imgproc, ml and highgui 2013-06-27 11:45:19 -07:00
Roman Donchenko 4f19216e45 Merge pull request #1036 from jet47:fix-gpu-deviceinfo 2013-06-27 15:37:42 +04:00
ozantonkal 1830059969 removed redundant addShape methods 2013-06-27 13:05:52 +03:00
ozantonkal 4a19ff3a7c createArrow and showArrow implementation without label 2013-06-27 12:33:19 +03:00
ozantonkal c4a07b7531 createSphere and showSphere implementations 2013-06-27 11:51:36 +03:00
Roman Donchenko c1f8d9e3d2 Merge pull request #1011 from wecacuee:master 2013-06-27 12:03:07 +04:00
hbristow bb56ac4ae6 Added delta builds of Matlab executables. Imgproc module now compiling 2013-06-27 00:25:48 -07:00
hbristow 136f205fb3 added handling of constants equaling constants for C++ map 2013-06-26 17:41:35 -07:00
hbristow 6b88a21be8 added handling of constants equaling constants. e.g. FMT_DEFAULT = FMT_MATLAB 2013-06-26 17:39:08 -07:00
hbristow c5720213e4 Commented enum maps 2013-06-26 16:13:50 -07:00
hbristow e51bdbeb2d All OpenCV constants being exported into matlab class and C++ map templates 2013-06-26 15:45:05 -07:00
Vikas Dhiman f15dc72b89 Removed misleading comment and added the divisibility test to ::run function. 2013-06-26 12:16:25 -04:00
Roman Donchenko 53afdb4b30 Merge pull request #1041 from abidrahmank:master 2013-06-26 16:38:54 +04:00
ozantonkal 17bdc29d5b setShapePose and getShapePose implementations 2013-06-26 12:52:43 +02:00
ozantonkal fd6eeac6aa showCylinder and showCircle implementations 2013-06-26 11:32:12 +02:00
ozantonkal 98edabd42c showCylinder implementation 2013-06-26 11:13:34 +02:00
ozantonkal 55683e7b3b showCube implementation 2013-06-26 10:46:26 +02:00
Vladislav Vinogradov 3c32fc1329 removed obsolete methods from gpu::Stream 2013-06-25 17:45:23 +04:00
Roman Donchenko f36f8067bc Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/calib3d/include/opencv2/calib3d/calib3d.hpp
	modules/core/include/opencv2/core/core.hpp
	modules/core/include/opencv2/core/cuda/limits.hpp
	modules/core/include/opencv2/core/internal.hpp
	modules/core/src/matrix.cpp
	modules/nonfree/test/test_features2d.cpp
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/src/hog.cpp
	modules/ocl/test/test_haar.cpp
	modules/ocl/test/test_objdetect.cpp
	modules/ocl/test/test_pyrup.cpp
	modules/ts/src/precomp.hpp
	samples/ocl/facedetect.cpp
	samples/ocl/hog.cpp
	samples/ocl/pyrlk_optical_flow.cpp
	samples/ocl/surf_matcher.cpp
2013-06-25 15:55:52 +04:00
Roman Donchenko 1dccf5743e Merge pull request #1024 from jet47:fix-gpuarithm-compilation 2013-06-25 14:38:18 +04:00
hbristow 0b9ff11537 Fixed bug where expected number of input variables was incorrect if any of the inputs were also outputs 2013-06-24 13:11:29 -07:00
hbristow da63919811 Improved error handling on entry to mex files 2013-06-24 12:42:28 -07:00
Alex Leontiev b216c0940c Created skeleton for simplex method.
Added LPSolver class together with two nested classes: LPFunction and
LPConstraints. These represent function to be maximized and constraints
imposed respectively. They are implementations of interfaces Function
and Constraints respectively (latter ones are nested classes of Solver
interface, which is generic interface for all optimization algorithms to
be implemented within this project).

The next step is to implement the simplex algorithm! First, we shall
implement it for the case of constraints of the form Ax<=b and x>=0.
Then, we shall extend the sets of problems that can be handled by the
conversion to the one we've handled already. Finally, we shale
concentrate on numerical stability and efficiency.
2013-06-24 20:27:11 +03:00
abidrahmank a1ea1a7ec5 boxpoints documentation 2013-06-24 16:17:23 +05:30
abidrahmank bcf9117957 Added missing python functions in highgui documentation
setMouseCallback
createTrackbar
2013-06-24 15:53:45 +05:30
abidrahmank 37f4e400e4 Added cv2.boxPoints() functionality to Python bindings (Feature #2023)
http://www.code.opencv.org/issues/2023

eg:

In [3]: box = ((10,10),(5,5),0)

In [4]: cv2.boxPoints(box)
Out[4]:
array([[  7.5,  12.5],
       [  7.5,   7.5],
       [ 12.5,   7.5],
       [ 12.5,  12.5]], dtype=float32)
2013-06-24 12:13:59 +05:30
Vladislav Vinogradov 98bd401534 fix gpu::DeviceInfo compilation under linux
glibc defines major and minor macros
which conflict with  gpu::DeviceInfo methods with the same name
2013-06-24 10:11:44 +04:00
hbristow 9b32c6e653 Updated README 2013-06-23 22:44:12 -07:00
hbristow 8cd48cf35a Added README and proposal. Staging for first public commit 2013-06-23 20:48:40 -07:00
Fedor Morozov 84ea0c9a97 Tests and rgbe fix 2013-06-24 05:54:58 +04:00
hbristow c8fdb2c1e0 Changed build locations so that the matlab module can be used in-place, without having to install 2013-06-23 13:54:54 -07:00
hbristow b0285d92b4 Improved file installation 2013-06-23 13:34:01 -07:00
hbristow 3b77fa5e8c Improved dependency checking 2013-06-23 09:44:26 -07:00
Fedor Morozov 96dfbf5d24 HDR formats support and HDR making. Code only. 2013-06-23 14:25:51 +04:00
Fedor Morozov 7469c935f3 HDR formats support and HDR making. Code only. 2013-06-23 14:19:09 +04:00
hbristow 24d5adfd54 Added commenting to modules/matlab/CMakeLists.txt 2013-06-22 23:52:05 -07:00
hbristow 755ce9d654 Matlab bindings now only building once rather than every call to make, via the use of some proxies. Matlab build currently only happens in one thread, so it can be pretty slow 2013-06-22 23:26:27 -07:00
hbristow 3b4814a52e Started writing the Bridge interface. Mex wrappers now starting to compile for core 2013-06-22 12:38:40 -07:00
hbristow 0263727b53 Function templates now include the full skeleton, from input to output. Class templates need work 2013-06-21 23:39:28 -07:00
hbristow f45bc35652 input/output assignment in templates is working for non-trivial cases. Updated parse_tree to handle '/IO' and '/S' modifiers 2013-06-21 22:55:48 -07:00
hbristow 1a15ed3279 Started handling trivial case of return references. Removed most modules from build tree while testing (cmake/OpenCVModule) 2013-06-21 17:33:24 -07:00
Roman Donchenko eff6dccb3b Merge pull request #1014 from jet47:gpustereo-refactoring 2013-06-21 17:38:36 +04:00
Roman Donchenko b20c9ad2d1 Merge pull request #1015 from SpecLad:merge-2.4 2013-06-21 17:38:04 +04:00
ozantonkal 93fe2f6e4d showPlane with color 2013-06-21 14:09:12 +02:00
ozantonkal f94c2414e6 showPlane implementation 2013-06-21 14:00:22 +02:00
ozantonkal 26a6823207 showLine implementation 2013-06-21 12:48:27 +02:00
Roman Donchenko 84639e444b Merge pull request #1010 from jet47:gpufilters-refactoring 2013-06-21 14:45:50 +04:00
Alex Leontiev f41b8b90ff Blank module and first draft of solver API.
At this point we have a skeleton of a new module (optim) which can
barely compile properly (unlike previous commit). Besides, there is a
first draft of solver and lpsolver (linear optimization solver) in this
commit.
2013-06-20 14:54:09 +03:00
Roman Donchenko 13323882d4 Merge pull request #1027 from jet47:fix-cuda-4.2-build 2013-06-20 14:11:52 +04:00
Vladislav Vinogradov f08d75a84b removed obsolete API 2013-06-20 11:24:29 +04:00
Vladislav Vinogradov 50166d2734 fixed compilation with CUDA 4.2 2013-06-19 15:29:20 +04:00
Roman Donchenko 13cd0a0502 Merge remote-tracking branch 'origin/2.4'
Original pull requests:
	#996 from jet47:gpu-nvcuvid-libraries
	#995 from jet47:fix-bug-2985
	#999 from snosov1:unreliable-results-fix
	#1005 from alekcac:doc_fix
	#1004 from jet47:fix-bug-3068
	#987 from jet47:bug-3085-fix
	#969 from pengx17:2.4_binary_cache
	#929 from dominikrose:mingw-libdc1394-2-windows
	#1000 from ivan-korolev:fix_sift_bug_2892
	#1001 from ivan-korolev:fix_stitching_bug_2405
	#998 from asmorkalov:android_cmake_mips_fix
	#993 from ivan-korolev:fix_videostab_bug_3023
	#988 from snosov1:3071-fix
	#986 from pengx17:2.4_initiated_context
	#982 from pengx17:2.4_fix_two_bugs
	#981 from SeninAndrew:ximea_camera_support_fix
	#991 from asmorkalov:android_javadoc_fix
	#972 from jet47:mog2-params-bug-2168
	#980 from SpecLad:include-config
	#973 from pengx17:2.4_oclclahe
	#903 from aks2:2.4
	#968 from asmorkalov:android_na_cproj_fix
	#971 from SpecLad:matchers-ctor
	#970 from asmorkalov:dshow_valid_check_fix
	#965 from apavlenko:fix_java_empty_mats

Conflicts:
	cmake/OpenCVModule.cmake
	modules/core/src/matmul.cpp
	modules/gpu/CMakeLists.txt
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/perf/perf_imgproc.cpp
	modules/ocl/src/imgproc.cpp
	modules/ocl/src/initialization.cpp
	modules/stitching/src/matchers.cpp
	modules/video/src/video_init.cpp
	modules/videostab/src/global_motion.cpp
2013-06-19 15:25:37 +04:00
Roman Donchenko 84262acbf0 Merge pull request #1012 from apavlenko:fix_3077 2013-06-19 12:25:23 +04:00
hbristow d9cea3b8b0 Compiling matlab from sources now appears as a single target 2013-06-19 17:37:41 +10:00
hbristow 0c726a3fbe Improved exception handling and unit tests 2013-06-19 16:37:57 +10:00
Vladislav Vinogradov 4b983679a5 fix gpuarithm module compilation (Bug #3103) 2013-06-19 10:13:33 +04:00
hbristow bbece095fb Starting writing Matlab testing framework 2013-06-19 15:04:52 +10:00
hbristow 31415e344f Matlab binding generation now at build time 2013-06-19 13:59:22 +10:00
hbristow 884f36ba65 Improved configure time tests. Added OpenCV specific exception handling 2013-06-19 11:54:14 +10:00
hbristow 4d135ac4d8 Improved exception handling in function template 2013-06-18 23:13:03 +10:00
hbristow 804d0924c9 cmake now attempts to generate and compile a simple mex file at configure time and reports the working status of the generator and compiler, rather than just naively saying Matlab exists 2013-06-18 23:00:48 +10:00
hbristow fc16cfcf41 Improved template formatting 2013-06-18 17:29:04 +10:00
hbristow 304fd03e64 Updated jinja version 2013-06-18 17:27:09 +10:00
Vladislav Vinogradov 4e29f0ee6d updated documentation 2013-06-18 08:36:49 +04:00
Alex Leontiev f2afe64521 Starting implement simplex algorithm. 2013-06-17 18:16:30 +03:00
ozantonkal b387581d4f initial refactoring 2013-06-17 16:32:52 +02:00
hbristow 2059972bf7 Preparing to rebase 2013-06-17 16:51:31 +10:00
hbristow 28c90609c9 Stripped more unnecessary files out of jinja. Now down to 21 files at 352KB. Stripped files are in jinja-unused for the moment 2013-06-17 16:51:25 +10:00
Hilton Bristow 30aa710022 Removed some debug statements 2013-06-17 16:51:24 +10:00
Hilton Bristow eda32520e2 Improved tempalte formatting 2013-06-17 16:51:24 +10:00
Hilton Bristow 66c40bee6f Template population now functional 2013-06-17 16:51:24 +10:00
Hilton Bristow 827b4f93e4 Stripped down jinja, added cmake support 2013-06-17 16:51:24 +10:00
Hilton Bristow 09e294711d Added class templates 2013-06-17 16:51:23 +10:00
Hilton Bristow c29a98ef84 Added README 2013-06-17 16:51:23 +10:00
Hilton Bristow 8e9cdf8ca3 Updated print formatting 2013-06-17 16:51:23 +10:00
Hilton Bristow 808f9dbc93 Improved parse tree, now building within main opencv build system 2013-06-17 16:51:23 +10:00
Hilton Bristow 5d1944bace Added jinja framework for templates and base templates for functions and docs 2013-06-17 16:48:07 +10:00
Hilton Bristow ac748747d4 FindMatlab.cmake in cmake find_package format 2013-06-17 16:48:06 +10:00
Hilton Bristow de93408dec Better conformity to find_package requirements 2013-06-17 16:48:06 +10:00
Hilton Bristow 60d7acb4fc Added Windows functionality to FindMatlab. Untested 2013-06-17 16:48:06 +10:00
Hilton Bristow e8e537a1c7 Added matlab generator stub 2013-06-17 16:48:06 +10:00
Hilton Bristow ded45b4d1a Added basic ability to find Matlab installations. Added test cpp file under modules/matlab/test to test mex compiler within cmake 2013-06-17 16:48:05 +10:00
Hilton Bristow 2e382c67ec Added Matlab to the main build 2013-06-17 16:40:54 +10:00
Hilton Bristow 411604fa90 Initial matlab commit 2013-06-17 16:40:54 +10:00
Vladislav Vinogradov 24108f8110 updated documentation 2013-06-17 09:53:39 +04:00
Andrey Pavlenko 01e9733155 fix for #3077
removing "-fvisibility=hidden" gcc option due to lack of `__attribute__ ((visibility("default")))` in jni_md.h/JNIEXPORT
2013-06-14 20:25:23 +04:00
Vikas Dhiman dbc9b4db0c support elementwise division for Matx with "/" operator. 2013-06-14 11:38:29 -04:00
Vladislav Vinogradov a380c473b9 switched to Input/Output Array in reprojectImageTo3D & drawColorDisp 2013-06-14 18:17:31 +04:00
Vladislav Vinogradov 3a02e599e0 refactored DisparityBilateralFilter 2013-06-14 18:17:31 +04:00
Vladislav Vinogradov be9bb8f18b refactored StereoConstantSpaceBP 2013-06-14 18:17:31 +04:00
Vladislav Vinogradov d0e89337da refactored StereoBeliefPropagation 2013-06-14 18:17:31 +04:00
Vladislav Vinogradov dd6d58f873 refactored StereoBM 2013-06-14 18:17:30 +04:00
Vladislav Vinogradov 4317cd1ffa refactored 1D Sum Filters 2013-06-14 17:25:57 +04:00
Vladislav Vinogradov 4bb297afc2 refactored Image Rank Filters 2013-06-14 17:25:57 +04:00
Vladislav Vinogradov 5720eaf354 refactored Morphology Filters 2013-06-14 17:25:57 +04:00
Vladislav Vinogradov 12ae11e2ff refactored Separable Linear Filters 2013-06-14 17:25:56 +04:00
Vladislav Vinogradov ee7eb1b807 refactored Laplacian filter 2013-06-14 17:25:56 +04:00
Vladislav Vinogradov 1eedc6c42a refactored Linear Filter 2013-06-14 17:25:56 +04:00
Vladislav Vinogradov fcfcd4cbce refactored box filter 2013-06-14 17:25:56 +04:00
Roman Donchenko 71db862dc2 Merge pull request #977 from jet47:gpucodec-refactoring 2013-06-14 16:24:24 +04:00
Roman Donchenko 2fc49ac564 Merge pull request #978 from jet47:gpuarithm-refactoring 2013-06-14 16:24:03 +04:00
Roman Donchenko 4bc4f4aa1f Merge pull request #1003 from vhdirk:gstreamerfixes 2013-06-14 15:51:03 +04:00
Roman Donchenko d998e38a12 Merge pull request #983 from HapeMask:python3-compatibility 2013-06-14 15:48:37 +04:00
Anatoly Baksheev 909f905b57 --amend 2013-06-14 14:22:03 +04:00
Anatoly Baksheev c65d888875 little refactoring 2013-06-14 14:20:19 +04:00
Roman Donchenko 130794d41c Merge pull request #990 from asmorkalov:pthread_build_fix 2013-06-14 11:48:05 +04:00
Roman Donchenko 83fa4d38a4 Merge pull request #976 from PeterMinin:num_detections 2013-06-14 11:24:00 +04:00
Peter Minin 7d70399d72 Add a new variant of detectMultiScale with output arguments 'objects' and 'numDetections'; factor most of detectMultiScale's code into 2 protected methods 2013-06-14 04:25:17 +04:00
Gabe Schwartz bb209193c9 Updated usage of METH_X definitions for python 3.
Python 3 requires METH_VARARGS | METH_KEYWORDS, not just METH_KEYWORDS.
2013-06-13 20:10:01 -04:00
Gabe Schwartz bce1b352e7 Updated cmake files to use print().
In these cases, just using print() is enough to ensure py2/3
compatibility.
2013-06-13 20:10:01 -04:00
Gabe Schwartz fb9781b97b Updated cv2.cpp to support Python 3 API.
Added a header with defines to enable the module to compile with either
python 2 or 3 without changes.
2013-06-13 20:10:01 -04:00
Gabe Schwartz 931ebab822 Updated generator and parser to support Python 3. 2013-06-13 18:39:47 -04:00
Alexander Smorkalov 37b67fa50d Fix compiler error due to missing pthread header (Issue #2953) 2013-06-13 16:11:39 +04:00
Dirk Van Haerenborgh 30f7f9717f allow for arbitraty number of sources and sinks 2013-06-13 11:16:33 +02:00
Roman Donchenko 6faf00b8e5 Merge pull request #696 from znah:detect_method 2013-06-13 12:01:59 +04:00
alexandre benoit c39159069e last warnings solved 2013-06-13 07:36:37 +02:00
alexandre benoit 2c1fb5fd71 minor correction after buildbot warnings 2013-06-13 06:55:35 +02:00
alexandre benoit 7bff79bbeb updated demos and tutorial regarding the Retina class transfer to bioinspired module. 2013-06-12 22:43:36 +02:00
alexandre benoit cdbbe0dfbe 1. created module bioinspired. 2.transfered Retina module into the new module bioinspired. 3. added a fast tone mapping method to Retina interface and wrapped existing reinafilter dedicated method 2013-06-12 22:40:43 +02:00
Anatoly Baksheev 7cfa3cbd8a Merge pull request #9 from ozantonkal/implementing_addPointCloud
Implementing add point cloud
2013-06-12 13:23:08 -07:00
ozantonkal f91b1a1771 showPointCloud with single color without duplicating color 2013-06-12 17:38:39 +02:00
Dirk Van Haerenborgh 6d66d11046 gstreamer: cleaning up resources 2013-06-12 16:58:16 +02:00
ozantonkal 0e90c0fff2 updated test for single color 2013-06-12 10:56:46 +02:00
ozantonkal 46cf22cdff showPointCloud with single color 2013-06-12 10:55:07 +02:00
ozantonkal 01086323b0 mistype fix 2013-06-12 09:29:04 +02:00
Anatoly Baksheev 1b51ee385b refactored showPointCloud to for shorter code. Implemented NanFilter::copy<T>() function 2013-06-11 22:01:50 +04:00
Anatoly Baksheev 1ae5918fa8 refactoring of copy_non_nans 2013-06-11 18:38:20 +04:00
Roman Donchenko 1acbc7b7bd Merge pull request #966 from berak:master 2013-06-11 18:17:07 +04:00
Vladislav Vinogradov a3341006ee updated documentation 2013-06-11 17:58:05 +04:00
Vladislav Vinogradov 8461cb3f4b refactored gpu::convolve function:
* converted it to Algorithm
* old API still can be used for source compatibility (marked as deprecated)
2013-06-11 17:58:05 +04:00
Vladislav Vinogradov 26a4be89b1 switched to Input/Output Array in Fourier operations 2013-06-11 17:58:05 +04:00
Vladislav Vinogradov 948661d722 switched to Input/Output Array in gpu::gemm 2013-06-11 17:58:05 +04:00
Vladislav Vinogradov 8fcef225fb switched to Input/Output Array in reductions operations 2013-06-11 17:58:05 +04:00
Vladislav Vinogradov c52d56964c switched to Input/Output Array in gpu::copyMakeBorder 2013-06-11 17:58:04 +04:00
Vladislav Vinogradov 539f367d0b refactored gpu::LUT function:
* converted it to Algorithm, because implementation uses inner buffers and
  requires preprocessing step
* new implementation splits preprocessing and transform,
  what is more effecient
* old API still can be used for source compatibility (marked as deprecated)
2013-06-11 17:58:04 +04:00
Vladislav Vinogradov 0c50d0821f switched to Input/Output Array in transpose/flip operations 2013-06-11 17:58:04 +04:00
Vladislav Vinogradov 3d8ca010b7 switched to Input/Output Array in split/merge operations 2013-06-11 17:58:04 +04:00
Vladislav Vinogradov 58c4d0eaeb switched to Input/Output Array in cart<->polar operations 2013-06-11 17:58:04 +04:00
Vladislav Vinogradov 0a83817ace switched to Input/Output Array in gpu::threshold 2013-06-11 17:58:04 +04:00
Vladislav Vinogradov 44ec450b53 switched to Input/Output Array in gpu::addWeighted 2013-06-11 17:58:04 +04:00
Vladislav Vinogradov ec70282bf7 switched to Input/Output Array in min/max operations 2013-06-11 17:58:04 +04:00
Vladislav Vinogradov f2aa6ebe15 switched to Input/Output Array in shift operations 2013-06-11 17:58:04 +04:00
Vladislav Vinogradov d81f54db0b switched to Input/Output Array in bitwise logical operations 2013-06-11 17:58:04 +04:00
Vladislav Vinogradov 04a1a6dd8f switched to Input/Output Array in gpu::compare 2013-06-11 17:58:04 +04:00
Vladislav Vinogradov b866890b27 switched to Input/Output Array in abs, sqr, sqrt, exp, log, pow 2013-06-11 17:58:04 +04:00
Vladislav Vinogradov 5ec8c51b98 switched to Input/Output Array in gpu::absdiff 2013-06-11 17:58:03 +04:00
Vladislav Vinogradov 3ee12cbeb4 switched to Input/Output Array in gpu::divide 2013-06-11 17:58:03 +04:00
Vladislav Vinogradov 4595e3aa3e switched to Input/Output Array in gpu::multiply 2013-06-11 17:58:03 +04:00
Vladislav Vinogradov ffa25be3d2 added arithm_op function to reduce code duplication 2013-06-11 17:58:03 +04:00
Vladislav Vinogradov 5330faf5a0 switched to Input/Output Array in gpu::subtract 2013-06-11 17:58:03 +04:00
Vladislav Vinogradov 4ebbf69134 switched to Input/Output Array in gpu::add 2013-06-11 17:58:03 +04:00
Vladislav Vinogradov 76211709a3 refactored VideoReader (convert it to abstract interface)
also refactored VideoSource interface (made it simplier, now it has only 2 abstract methods)
2013-06-11 17:57:40 +04:00
Vladislav Vinogradov e9a74c17f8 refactored VideoWriter class (convert it to abstract interface) 2013-06-11 17:57:39 +04:00
Roman Donchenko 7a07f1a9e7 Merge pull request #899 from LeszekSwirski:fix-drawingdoc 2013-06-11 17:30:19 +04:00
Roman Donchenko 7c4e3715b3 Merge pull request #975 from SpecLad:merge-2.4 2013-06-11 17:28:26 +04:00
Anatoly Baksheev da32ca4948 Merge pull request #6 from ozantonkal/implementing_addPointCloud
Implementing add point cloud
2013-06-11 03:37:56 -07:00
ozantonkal abdc022b20 implemented copy_non_nans, isnan 2013-06-11 11:02:26 +02:00
ozantonkal c4fe98977a implementation of * operator for Affine3f and point3d, initial implementation of isNaN 2013-06-11 11:02:26 +02:00
Roman Donchenko 81c6b46fc6 Merge pull request #974 from jet47:gpu-core-refactoring 2013-06-11 12:05:56 +04:00
Roman Donchenko 3bfc69740b Merge remote-tracking branch 'origin/2.4' into merge-2.4
Merged pull requests:
	#890 from caorong:patch-1
	#893 from jet47:gpu-arm-fixes
	#933 from pengx17:2.4_macfix_cont
	#935 from pengx17:2.4_filter2d_fix
	#936 from bitwangyaoyao:2.4_perf
	#937 from bitwangyaoyao:2.4_fixPyrLK
	#938 from pengx17:2.4_surf_sample
	#939 from pengx17:2.4_getDevice
	#940 from SpecLad:autolock
	#941 from apavlenko:signed_char
	#946 from bitwangyaoyao:2.4_samples2
	#947 from jet47:fix-gpu-arm-build
	#948 from jet47:cuda-5.5-support
	#952 from SpecLad:jepg
	#953 from jet47:fix-bug-3069
	#955 from SpecLad:symlink
	#957 from pengx17:2.4_fix_corner_detector
	#959 from SpecLad:qt4-build
	#960 from SpecLad:extra-modules

Conflicts:
	modules/core/include/opencv2/core/core.hpp
	modules/gpu/CMakeLists.txt
	modules/gpu/include/opencv2/gpu/device/vec_math.hpp
	modules/gpu/perf/perf_video.cpp
	modules/gpuimgproc/src/cuda/hough.cu
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/src/pyrlk.cpp
	samples/gpu/driver_api_multi.cpp
	samples/gpu/driver_api_stereo_multi.cpp
	samples/ocl/surf_matcher.cpp
2013-06-10 18:18:01 +04:00
Vladislav Vinogradov 4f0d72bf43 added missing <iostream> header 2013-06-10 17:47:55 +04:00
Vladislav Vinogradov 564fd21e87 fixed documentation build 2013-06-10 15:52:01 +04:00
Roman Donchenko e16af9bdc9 Merge pull request #958 from apavlenko:fix_java_mixchannels 2013-06-10 15:51:30 +04:00
Vadim Pisarevsky 1fe7ad850b Merge pull request #856 from ericgreveson:master 2013-06-10 15:25:09 +04:00
Andrey Pavlenko 438649ffee fixing Java wrapper for mixChannels
'dst' should be treated as an input arg (epilog not needed)
2013-06-10 14:37:01 +04:00
Anatoly Baksheev c622ebf890 implemented wasStopped flag 2013-06-10 14:11:34 +04:00
Anatoly Baksheev 0f5da429c5 misprint 2013-06-10 12:42:11 +04:00
Vladislav Vinogradov 439c3574ed renamed gpu_private.hpp to private.gpu.hpp 2013-06-10 12:40:32 +04:00
Vladislav Vinogradov 0489489322 used cudaMalloc for 1-row or 1-column matrix instead of cudaMallocPitch 2013-06-10 12:40:32 +04:00
Vladislav Vinogradov 1db4afac6a made createContinuous & ensureSizeIsEnough generic (OutputArray support) 2013-06-10 12:40:32 +04:00
Vladislav Vinogradov f17b836d24 added Event class (wrapper for cudaEvent) 2013-06-10 12:40:32 +04:00
Vladislav Vinogradov 2dab93c2e8 refactored gpu info structures (TargetArchs and DeviceInfo)
now DeviceInfo provides full information about device (from cudaDeviceProp)
2013-06-10 12:40:32 +04:00
Vladislav Vinogradov 76f4b02b06 refactored gpu::Stream (minor fixes) 2013-06-10 12:40:31 +04:00
Vladislav Vinogradov a52af84dcf refactored CudaMem (now alloc type assign only in constructor) 2013-06-10 12:40:31 +04:00
Vladislav Vinogradov cc34a8ac3c new implementation for GpuMat::setTo (without constant memory) 2013-06-10 12:40:31 +04:00
Vladislav Vinogradov 69be49bac1 refactored GpuMat:
* switch to InputArray/OutputArray
* add Stream support
2013-06-10 12:40:31 +04:00
Vladislav Vinogradov db1178b5df moved GpuMat implementation to separate file 2013-06-10 12:40:31 +04:00
Vladislav Vinogradov 2153a14872 moved inline implementation to separate file 2013-06-10 12:40:31 +04:00
Vladislav Vinogradov 6994a02c15 added Stream support to ogl::Buffer 2013-06-10 12:40:31 +04:00
Vladislav Vinogradov 649737b6a8 removed obsolete DevMem2D class 2013-06-10 12:40:30 +04:00
Vladislav Vinogradov 4c9773d55f renamed gpu headers (made it more consistent) 2013-06-10 12:40:30 +04:00
Vladislav Vinogradov 6c253a41c2 added CudaMem support to Input/Output arrays 2013-06-10 12:40:30 +04:00
Vladislav Vinogradov 2fae1d9507 removed ogl::Texture2D support from InputArray 2013-06-10 12:40:30 +04:00
Anatoly Baksheev 909c45f1b9 little refactoring 2013-06-10 12:32:03 +04:00
Roman Donchenko 173442bb2e Merge pull request #964 from jet47:cuda-5.5-support 2013-06-10 12:05:52 +04:00
Anatoly Baksheev 01e99db675 Merge pull request #5 from ozantonkal/implementing_addPointCloud
Implementing add point cloud
2013-06-10 00:36:49 -07:00
berak 765a2c6045 Moments.nu** fields initialized in completeMomentState( Moments* moments ) 2013-06-07 18:29:00 +02:00
berak 610e29fa31 restored utility.hpp 2013-06-07 18:13:15 +02:00
berak 50e27ffc37 added initialization of Moments.nu** params in completeMomentState( Moments* moments ) 2013-06-07 17:22:42 +02:00
ozantonkal aecff5237b CV_64FC3 support 2013-06-07 16:07:23 +02:00
Vladislav Vinogradov 4559d46190 fixed BroxOpticalFlow sanity test (increase epsilon value) 2013-06-07 16:32:43 +04:00
Vladislav Vinogradov 4d9a1cf14b fixed BoxFilter sanity test (different rounding results) 2013-06-07 16:32:43 +04:00
Vladislav Vinogradov 302250f241 fixed BroxOpticalFlow regression test
the output of BroxOpticalFlow differs a bit in CUDA 5.5
2013-06-07 16:32:43 +04:00
Vladislav Vinogradov 14e4b3adde rewrite core/cuda/vec_math.hpp file
old version isn't compiled with CUDA 5.5
new version doesn't depend on functional.hpp
2013-06-07 16:32:43 +04:00
Vladislav Vinogradov 869a35faef fixed constructors for functional objects (added __host__ modifier) 2013-06-07 16:32:43 +04:00
Vladislav Vinogradov bf7c1c6c25 fixed NPP error constants usage 2013-06-07 16:32:43 +04:00
Roman Donchenko c929547164 Merge pull request #900 from jet47:restore-gpu-modules 2013-06-07 14:33:35 +04:00
ozantonkal e58b0b3507 removed cv keywords and redundant lines from showPointCloud 2013-06-07 12:16:22 +02:00
Anatoly Baksheev 59acccfa6a Merge pull request #4 from ozantonkal/implementing_addPointCloud
showPointCloud initial implementation together with test
2013-06-07 02:50:42 -07:00
Vadim Pisarevsky a5ffa1da34 Merge pull request #963 from bitwangyaoyao:master_oclMat 2013-06-07 13:43:51 +04:00
Vladislav Vinogradov 9488ed46ee fixed compiler warning
removed -fvisibility-inlines-hidden compiler option for CUDA sources
2013-06-07 13:34:33 +04:00
ozantonkal d11d07aaf5 showPointCloud initial implementation together with test 2013-06-07 11:18:26 +02:00
Vladislav Vinogradov 3eeaa9189c Revert "Revert "Merge pull request #836 from jet47:gpu-modules"" 2013-06-07 13:05:39 +04:00
Roman Donchenko 10340fe234 Merge pull request #949 from SpecLad:merge-2.4 2013-06-07 12:45:03 +04:00
yao 9284c07a84 remove commented lines 2013-06-07 15:31:12 +08:00
Roman Donchenko aa7f70c31e Merge pull request #951 from apavlenko:fix_java_test_randshuffle 2013-06-07 11:28:10 +04:00
yao 960a0eacf3 merge openCLMallocPitch and openCLMallocPitchEx into one interface 2013-06-07 15:27:44 +08:00
Roman Donchenko 0a42a3eb06 Merge pull request #956 from IanVS:COLOR_CODE 2013-06-06 12:09:41 +04:00
IanVS 41fc41829c Updated documentation to new "COLOR_" format for color conversion enums. 2013-06-05 21:59:01 -04:00
Roman Donchenko bae85660da Merge remote-tracking branch 'origin/2.4'
Pull requests:
	#943 from jet47:cuda-5.5-support
	#944 from jet47:cmake-2.8.11-cuda-fix
	#912 from SpecLad:contributing
	#934 from SpecLad:parallel-for
	#931 from jet47:gpu-test-fixes
	#932 from bitwangyaoyao:2.4_fixBFM
	#918 from bitwangyaoyao:2.4_samples
	#924 from pengx17:2.4_arithm_fix
	#925 from pengx17:2.4_canny_tmp_fix
	#927 from bitwangyaoyao:2.4_perf
	#930 from pengx17:2.4_haar_ext
	#928 from apavlenko:bugfix_3027
	#920 from asmorkalov:android_move
	#910 from pengx17:2.4_oclgfft
	#913 from janm399:2.4
	#916 from bitwangyaoyao:2.4_fixPyrLK
	#919 from abidrahmank:2.4
	#923 from pengx17:2.4_macfix

Conflicts:
	modules/calib3d/src/stereobm.cpp
	modules/features2d/src/detectors.cpp
	modules/gpu/src/error.cpp
	modules/gpu/src/precomp.hpp
	modules/imgproc/src/distransform.cpp
	modules/imgproc/src/morph.cpp
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/perf/perf_color.cpp
	modules/ocl/perf/perf_imgproc.cpp
	modules/ocl/perf/perf_match_template.cpp
	modules/ocl/perf/precomp.cpp
	modules/ocl/perf/precomp.hpp
	modules/ocl/src/arithm.cpp
	modules/ocl/src/canny.cpp
	modules/ocl/src/filtering.cpp
	modules/ocl/src/haar.cpp
	modules/ocl/src/hog.cpp
	modules/ocl/src/imgproc.cpp
	modules/ocl/src/opencl/haarobjectdetect.cl
	modules/ocl/src/pyrlk.cpp
	modules/video/src/bgfg_gaussmix2.cpp
	modules/video/src/lkpyramid.cpp
	platforms/linux/scripts/cmake_arm_gnueabi_hardfp.sh
	platforms/linux/scripts/cmake_arm_gnueabi_softfp.sh
	platforms/scripts/ABI_compat_generator.py
	samples/ocl/facedetect.cpp
2013-06-05 15:42:07 +04:00
Roman Donchenko a760684674 Merge pull request #950 from apavlenko:fix_java_mat_dump 2013-06-05 13:32:34 +04:00
Andrey Pavlenko c2d3ce9ce5 fix failing test
small matrix becomes the same after shuffling
2013-06-05 12:41:09 +04:00
Andrey Pavlenko c7873dd03d fixing broken Mat::dump() in Java 2013-06-05 11:46:06 +04:00
Vadim Pisarevsky 6e119049ce Merge pull request #945 from malcolmreynolds:master 2013-06-04 13:32:34 +04:00
Malcolm Reynolds a9c9210bf9 update safe_call.hpp to fix OpenCL import on case sensitive mac FS
On a Mac with a case sensitive filesystem <OpenCL/OpenCL.h> does not exist but <OpenCL/opencl.h> does. I presume (!), but have no way to test, that on a Mac with case insensitive FS this change will make no difference.
2013-06-03 18:07:05 +02:00
Malcolm Reynolds 229ff632b6 update util.hpp to fix OpenCL import on case sensitive mac FS
On a Mac with a case sensitive filesystem <OpenCL/OpenCL.h> does not exist but <OpenCL/opencl.h> does. I presume (!), but have no way to test, that on a Mac with case insensitive FS this change will make no difference.
2013-06-03 18:06:25 +02:00
Anatoly Baksheev ace0933bed fixed compilation (included ctime in precomp.hpp) 2013-05-31 13:42:49 +04:00
Anatoly Baksheev 58025c572c Merge pull request #3 from ozantonkal/removing_boost_dependency
Removing boost dependency
2013-05-31 02:04:41 -07:00
Alex Leontiev 47ce461d97 The initial commit for generic optimization
Generic optimization package for openCV project, will be developed
between the June and September of 2013. This work is funded by Google
Summer of Code 2013 project. This project is about
implementing several algorithms, that will find global maxima/minima of a
given function on a given domain subject to a given constraints.

All comments/suggestions are warmly appreciated and to be sent to
alozz1991@gmail.com (please, mention the word "openCV" in topic of
message, for I'm using the spam-filters)
2013-05-31 07:39:15 +03:00
ozantonkal 6603cc4405 boost dependency has been removed 2013-05-30 20:01:33 +02:00
ozantonkal e10582ce4f Initial implementation of keyboard callback registration mechanism without boost 2013-05-29 20:58:57 +02:00
Anatoly Baksheev ddcfab3182 Merge pull request #1 from ozantonkal/viz
fix linux compilation errors
2013-05-29 11:05:46 -07:00
ozantonkal e75057956a fix linux compilation errors 2013-05-29 18:37:53 +02:00
Roman Donchenko d81d3fc830 Merge pull request #921 from SpecLad:merge-2.4 2013-05-29 16:24:49 +04:00
Roman Donchenko 5ac3b8d5d8 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Pull requests:
	#904 from ograycode:2.4
	#905 from bitwangyaoyao:2.4_TVL1
	#902 from apavlenko:fix_run_py
	#882 from pengx17:2.4_rewrite_query_info

Conflicts:
	modules/nonfree/src/surf.ocl.cpp
	modules/ocl/include/opencv2/ocl/private/util.hpp
	modules/ocl/src/hog.cpp
	modules/ocl/src/pyrlk.cpp
	modules/ocl/src/tvl1flow.cpp
2013-05-27 16:58:04 +04:00
Anatoly Baksheev 0e7d4a5703 First version of 'viz' module 2013-05-24 17:58:39 +04:00
Roman Donchenko 56121d01ea Merge pull request #911 from jrdi:patch-1 2013-05-23 15:17:55 +04:00
Roman Donchenko cfa985db43 Merge pull request #917 from SpecLad:cuda-4-build 2013-05-23 15:15:00 +04:00
Roman Donchenko dad58d8940 Fix a build error which manifests when building with CUDA < 5. 2013-05-23 14:00:13 +04:00
Roman Donchenko 4da0cdb959 Merge pull request #914 from SpecLad:master 2013-05-23 13:54:57 +04:00
Roman Donchenko 5e0e1fac87 Merge commit 'b51a1a7d' (PR #895 from 2.4)
Conflicts:
	modules/ocl/CMakeLists.txt
	modules/ocl/perf/perf_color.cpp
	modules/ocl/perf/perf_match_template.cpp
	modules/ocl/perf/precomp.cpp
	modules/ocl/perf/precomp.hpp
2013-05-22 18:28:28 +04:00
Jordi Villar ee29b0454c fix parenthesis 2013-05-22 13:57:43 +03:00
Andrey Pavlenko 61567adc5d Merge pull request #797 from vhdirk:installheaders 2013-05-22 13:54:20 +04:00
Roman Donchenko 7efb24917f Merge pull request #887 from LeszekSwirski:fix-glinkedptrmutex 2013-05-22 12:57:04 +04:00
Roman Donchenko b5c013682b Merge pull request #907 from SpecLad:master 2013-05-22 12:03:28 +04:00
Roman Donchenko 029fce10c9 Merge remote-tracking branch 'origin/2.4'
Conflicts:
	3rdparty/libjasper/CMakeLists.txt
	cmake/OpenCVDetectOpenCL.cmake
	modules/calib3d/doc/camera_calibration_and_3d_reconstruction.rst
	modules/imgproc/src/floodfill.cpp
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/src/arithm.cpp
	modules/ocl/src/haar.cpp
	modules/ocl/src/imgproc.cpp
	modules/ocl/src/initialization.cpp
	modules/ocl/src/matrix_operations.cpp
	modules/ocl/src/mcwutil.cpp
	modules/ocl/src/opencl/arithm_bitwise_and_mask.cl
	modules/ocl/src/opencl/arithm_bitwise_and_scalar_mask.cl
	modules/ocl/src/opencl/arithm_bitwise_binary_mask.cl
	modules/ocl/src/opencl/arithm_bitwise_binary_scalar.cl
	modules/ocl/src/opencl/arithm_bitwise_binary_scalar_mask.cl
	modules/ocl/src/opencl/arithm_bitwise_or.cl
	modules/ocl/src/opencl/arithm_bitwise_or_scalar.cl
	modules/ocl/src/opencl/arithm_bitwise_or_scalar_mask.cl
	modules/ocl/src/opencl/arithm_bitwise_xor.cl
	modules/ocl/src/opencl/arithm_bitwise_xor_mask.cl
	modules/ocl/src/opencl/arithm_bitwise_xor_scalar.cl
	modules/ocl/src/stereobm.cpp
	modules/ocl/test/precomp.hpp
	modules/python/src2/api
	modules/ts/src/ts_func.cpp
	samples/gpu/bgfg_segm.cpp
2013-05-21 17:19:23 +04:00
Leszek Swirski 7542d66dbd Fix drawing documentation referring to C API macros 2013-05-20 10:56:06 +01:00
ericgreveson e7995b4d5d Take account of multi-channel matrices when comparing histograms
Ensure that all channels are considered when comparing multi-channel histograms
2013-05-18 23:31:22 +02:00
Vadim Pisarevsky 416eaf2ae1 Merge pull request #896 from jet47:removed-vibe-master 2013-05-17 14:44:49 +04:00
Vladislav Vinogradov 49a4f27d42 removed VIBE implementation 2013-05-17 11:27:00 +04:00
Leszek Swirski 0e8c2b0395 Fix visibility of g_linked_ptr_mutex on Windows
Reverts some changes in b8ed00bd64
2013-05-15 14:42:28 +01:00
Vadim Pisarevsky 54afb85d0c Merge pull request #823 from pickle27:starter_image_sequence 2013-05-14 15:56:35 +04:00
Vadim Pisarevsky 14c50d2fce Merge pull request #874 from pengx17:master_queryDeviceInfo_rewrite 2013-05-13 23:03:24 +04:00
Vadim Pisarevsky 6e44e0a476 Merge pull request #881 from apavlenko:hidden_visibility 2013-05-13 22:08:45 +04:00
Andrey Pavlenko 885566295a Merge pull request #840 from pablospe:master 2013-05-13 21:22:27 +04:00
Andrey Kamaev b8ed00bd64 Compile OpenCV with GCC visibility set to hidden 2013-05-13 18:33:20 +04:00
Vadim Pisarevsky 8130d92602 Merge pull request #841 from Pastafarianist:patch-1 2013-05-12 13:00:23 +04:00
Vadim Pisarevsky 103ee12f00 Merge pull request #845 from githubuser0xFFFF:master 2013-05-12 12:54:44 +04:00
Vadim Pisarevsky 4b49b84976 Merge pull request #848 from pengx17:master_ocl_platform_name 2013-05-12 12:54:25 +04:00
Vadim Pisarevsky f1e8f69d2c Merge pull request #861 from albenoit:master 2013-05-12 12:53:14 +04:00
Vadim Pisarevsky 7f083a049d Merge pull request #867 from Pastafarianist:patch-2 2013-05-12 12:52:46 +04:00
peng xiao e5ea018185 Let surf.ocl use the new queryDeviceInfo interface. 2013-05-09 17:19:51 +08:00
peng xiao bfa0f02303 Rewrite queryDeviceInfo interface.
Previously the function may cause some unsafe issue. It is fixed now by introducing a template parameter.
2013-05-09 17:15:26 +08:00
peng xiao 861de8a6e9 CL_PLATFORM_VENDOR should be CL_PLATFORM_NAME. 2013-05-08 17:19:34 +08:00
Vadim Pisarevsky 6e24fc37db Merge pull request #869 from bpmckinnon:master 2013-05-07 16:32:58 +04:00
Brian McKinnon 36745a80c3 Added #include <limits> to files that were missing it. 2013-05-06 22:45:11 -04:00
Pastafarianist d2116f38fe Fixed typo 2013-05-05 16:17:41 +04:00
alexandre benoit a5acc9ee1f nicer interface with the use of InputArray and OutptArray instated of (const Mat&) 2013-05-03 11:45:13 +02:00
alexandre benoit b58d9f1c2a enhancing documentation 2013-05-01 19:35:32 +02:00
alexandre benoit f5d2d7b29b enhancing documentation 2013-05-01 13:58:53 +02:00
alexandre benoit cf6e833169 trying to solve valarray pointer access problem, enhancing documentation 2013-05-01 11:47:26 +02:00
alexandre benoit 9adde75be3 updated doc+minor typo/buildbot reports correction 2013-04-30 20:26:00 +02:00
alexandre benoit 9c26387ce0 updated sources to correct buildbot warnings 2013-04-30 17:32:47 +02:00
alexandre benoit 25b482f1c9 updated/corrected documentation 2013-04-30 16:52:47 +02:00
alexandre benoit a659e287fb minor error correction 2013-04-30 14:52:14 +02:00
alexandre benoit 80e65e08b5 updated doc and interface code to solve compile warnings and errors 2013-04-30 14:40:03 +02:00
alexandre benoit b70b5a3011 corrections required for portability. To be validated by buildbot 2013-04-30 13:13:50 +02:00
alexandre benoit 1976b3d9b6 updated doc 2013-04-29 20:08:13 +02:00
ericgreveson 19794e6857 Fix for spurious assert in cv::compareHist
When comparing histograms that look like multi-channel images (e.g a 3D histogram, of 4x4x4 bins, might appear as a CV_32FC4 matrix), cv::compareHist would complain because it was expecting the matrix type() == CV_32F. Now we test matrix depth() == CV_32F instead.
2013-04-29 19:52:41 +02:00
alexandre benoit 72742f5316 resolved conflicts, updated retina class interface and optimized a heavy retinacolor process 2013-04-29 19:06:35 +02:00
alexandre benoit 9549949228 minor chnges for conflict removal 2013-04-29 15:12:44 +02:00
alexandre benoit 16dea7b90d updated comments and new retina interface use 2013-04-27 23:18:47 +02:00
albenoit 9e1ce1ed52 Merge pull request #2 from albenoit/retina_devel
Retina devel
2013-04-27 13:47:30 -07:00
alexandre benoit ea1a64477f updated tutorial with new retina interface use 2013-04-27 22:39:28 +02:00
albenoit a4bc167ed4 Merge pull request #1 from albenoit/retina_devel_newinterface
Retina devel newinterface
2013-04-27 12:51:20 -07:00
alexandre benoit 737046916c activated parallelized gradient computation 2013-04-27 21:30:35 +02:00
alexandre benoit 3b15eefcad forgot method name update 2013-04-27 21:22:57 +02:00
alexandre benoit b62d101115 updated retina interface for cleaner use, following OpenCV standards 2013-04-27 21:13:45 +02:00
peng xiao bb4b410512 Add ocl::PlatformName to ocl::Info. 2013-04-25 15:00:50 +08:00
Uwe Kindler ca42a50de6 Changed visibility of the virtual functions in OnePassStabilizer and TwoPassStabilizer that are derived from StabilizerBase from private to protected to enable stabilizer implementations that are derived from OnePassStabilizer and TwoPassStabilier to properly overwrite these functions 2013-04-24 07:33:22 +02:00
Kevin Hughes 69c626e720 starter_video.cpp hid local functions 2013-04-22 22:28:35 -04:00
Kevin Hughes 3441b2df65 starter_video.cpp changed CV WINDOW KEEPRATIO to just WINDOW KEEPTATIO to fix build error 2013-04-22 16:35:23 -04:00
Pastafarianist 28427ce2e8 Fixed typo 2013-04-21 23:04:54 +04:00
Pablo Speciale caf449a991 The deletion of "cv.py" file (Commit b2ba8b9) breaks "make install" 2013-04-20 15:55:48 -07:00
Andrey Kamaev 416fb50594 Revert "Merge pull request #836 from jet47:gpu-modules"
This reverts commit fba72cb60d, reversing
changes made to 02131ffb62.
2013-04-18 15:03:50 +04:00
Andrey Pavlenko fba72cb60d Merge pull request #836 from jet47:gpu-modules 2013-04-18 14:51:26 +04:00
Vladislav Vinogradov 564f609885 fixed samples compilation 2013-04-18 13:28:34 +04:00
Vladislav Vinogradov 787e56ab5c disabled gpucodec module on MacOS 2013-04-18 13:28:34 +04:00
Vladislav Vinogradov 3be997cfa9 gpulegacy module fixes 2013-04-18 13:28:34 +04:00
Vladislav Vinogradov 6d735c11c6 removed const qualifier (it produces warnings) 2013-04-18 13:28:34 +04:00
Vladislav Vinogradov 0ce10532b3 softcascade module fixes 2013-04-18 13:28:34 +04:00
Vladislav Vinogradov 5ee9d3111d fixed gpu tutorial 2013-04-18 13:28:34 +04:00
Vladislav Vinogradov 13d087e62d videostab module fixes 2013-04-18 13:28:34 +04:00
Vladislav Vinogradov fdeec6896c stitching module fixes 2013-04-18 13:28:30 +04:00
Vladislav Vinogradov 033dd77504 superres module fixes 2013-04-18 12:36:11 +04:00
Vladislav Vinogradov f375c86dfb photo module fixes 2013-04-18 12:36:11 +04:00
Vladislav Vinogradov 12f16b7a26 nonfree module fixes 2013-04-18 12:36:11 +04:00
Vladislav Vinogradov 5d7bbdc837 gpu module fixes 2013-04-18 12:36:07 +04:00
Vladislav Vinogradov 3156e803be gpuoptflow module fixes 2013-04-18 11:33:34 +04:00
Vladislav Vinogradov f531dd839c gpubgsegm module fixes 2013-04-18 11:33:34 +04:00
Vladislav Vinogradov c0b3424a23 gpuimgproc module fixes 2013-04-18 11:33:34 +04:00
Vladislav Vinogradov b4f3d08725 gpuarithm module fixes 2013-04-18 11:33:34 +04:00
Vladislav Vinogradov 43d5e2d8b4 removed gpu BORDER_* constants 2013-04-18 11:33:34 +04:00
Vladislav Vinogradov d5ee931287 fixed compilation issues 2013-04-18 11:33:34 +04:00
Vladislav Vinogradov ac0f506d0e split gpuvideo onto gpuoptflow and gpubgsegm 2013-04-18 11:33:34 +04:00
Vladislav Vinogradov eda124ec32 removed gpuobjdetect module 2013-04-18 11:33:33 +04:00
Vladislav Vinogradov 28b1caa730 gpustereo module for stereo correspondence 2013-04-18 11:33:33 +04:00
Vladislav Vinogradov cad9518928 moved image labeling to gpu module 2013-04-18 11:33:33 +04:00
Vladislav Vinogradov e72ba73e70 moved gpu nlm to photo module 2013-04-18 11:33:33 +04:00
Vladislav Vinogradov fc3730fcc2 gpuwarping module for image warping 2013-04-18 11:33:33 +04:00
Vladislav Vinogradov 71eeaa7276 gpuarithm module fixes 2013-04-18 11:33:33 +04:00
Vladislav Vinogradov 508fb6aa5b renamed gpunvidia -> gpulegacy 2013-04-18 11:33:33 +04:00
Vladislav Vinogradov 7e91e1871d simplify CMakeLists.txt for gpu module 2013-04-18 11:33:32 +04:00
Vladislav Vinogradov 77aafc2984 removed unused includes 2013-04-18 11:33:32 +04:00
Vladislav Vinogradov 623c7da747 removed obsolete source files from gpu module 2013-04-18 11:33:32 +04:00
Vladislav Vinogradov a981dc93d0 removed obsolete headers from gpu module 2013-04-18 11:33:32 +04:00
Vladislav Vinogradov 96ac27e68c removed nv_perf_test (it is a duplicate for perf4au) 2013-04-18 11:33:32 +04:00
Vladislav Vinogradov a6648b5372 gpuobjdetect module for object detection 2013-04-18 11:33:32 +04:00
Vladislav Vinogradov b08b9ab83b gpucalib3d module for camera calibration and stereo correspondence 2013-04-18 11:33:32 +04:00
Vladislav Vinogradov fc1fa28556 gpuvideo module for video processing 2013-04-18 11:33:32 +04:00
Vladislav Vinogradov 7544ddbfef gpufeatures2d module 2d for feature detection and matching 2013-04-18 11:33:31 +04:00
Vladislav Vinogradov e41aea0acf gpuimgproc module for image processing 2013-04-18 11:33:31 +04:00
Vladislav Vinogradov d569e72ad4 moved mulSpectrums, dft and convolve to gpuarithm 2013-04-18 11:33:31 +04:00
Vladislav Vinogradov c56bdbc1c5 moved integral to gpuarithm module 2013-04-18 11:33:31 +04:00
Vladislav Vinogradov 10ac854358 moved copyMakeBorder to gpuarithm module 2013-04-18 11:33:31 +04:00
Vladislav Vinogradov d08ebfe4d3 moved rectStdDev to gpuarithm 2013-04-18 11:33:31 +04:00
Vladislav Vinogradov ca474de639 made objdetect dependecy for gpunvidia optional 2013-04-18 11:33:31 +04:00
Vladislav Vinogradov e654714973 replaced NCV_EXPORTS with CV_EXPORTS 2013-04-18 11:33:30 +04:00
Vladislav Vinogradov ed006a0612 added private header to gpunvidia module 2013-04-18 11:33:30 +04:00
Vladislav Vinogradov c2402053b9 removed columnSum function (it is a duplicate for reduce) 2013-04-18 11:33:30 +04:00
Vladislav Vinogradov 229ca0914a gpunvidia module for NCV & NPP API 2013-04-18 11:33:30 +04:00
Vladislav Vinogradov bc0e563092 CV_GPU_TEST_MAIN macros 2013-04-18 11:33:30 +04:00
Vladislav Vinogradov 84de6ce036 gpufilters module for image filtering 2013-04-18 11:33:30 +04:00
Vladislav Vinogradov 31c8b527c6 gpuarithm module for arithmetics operations on matrices 2013-04-18 11:33:30 +04:00
Vladislav Vinogradov 1b00a3ed54 gpucodec module for video decoding/encoding 2013-04-18 11:33:29 +04:00
Andrey Kamaev 02131ffb62 Merge pull request #828 from tim36272:patch-1 2013-04-17 22:30:39 +04:00
Kevin Hughes 47c84335f0 removed starter_image_sequence.cpp 2013-04-17 13:22:37 -04:00
Kevin Hughes eedb6fa3c4 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 2013-04-17 13:20:32 -04:00
Andrey Kamaev ea280b2c0e Merge pull request #831 from jet47:fix-build 2013-04-17 16:50:47 +04:00
Vladislav Vinogradov 54e7c76d99 fixed compilation errors 2013-04-17 15:24:53 +04:00
Andrey Kamaev 8fdab9f631 Merge branch '2.4' 2013-04-17 12:07:17 +04:00
tim36272 5ef3ef9c4a Clarified floodfill documentation
Clarified what value floodfill sets pixels in the mask to when FOODFILL_MASK_ONLY is set.
2013-04-17 00:34:20 -07:00
Andrey Kamaev 974f1f4895 Merge pull request #824 from taka-no-me:reduce_c_api_deps 2013-04-17 11:09:16 +04:00
Andrey Kamaev 8f32902ce6 Minimize usages of legacy C API inside the library 2013-04-16 12:00:02 +04:00
Andrey Kamaev 4223a59497 Merge pull request #809 from taka-no-me:drop_python1 2013-04-16 10:15:51 +04:00
Kevin Hughes b141762070 added an example of using cv::VideoCapture to read image sequences like 000.pmg, 001.png ... 100.png etc. 2013-04-15 13:21:20 -04:00
Andrey Kamaev f7641be434 Merge pull request #812 from bitwangyaoyao:master_uhp 2013-04-15 12:12:46 +04:00
Andrey Kamaev 6168bf0062 Merge pull request #813 from bitwangyaoyao:master_fix 2013-04-13 16:34:07 +04:00
Andrey Kamaev a54a307386 Merge pull request #810 from pengx17:master_fix_ocl_tmflag 2013-04-13 16:33:53 +04:00
yao 2f781a53a9 Fix arithm's substract mismatch caused by incomplete merge 2013-04-13 15:57:12 +08:00
yao 40d0e0eda0 use host data when DEVICE_MEM_UHP is set (the risk of vary align size is owned by users) 2013-04-13 14:58:49 +08:00
Andrey Kamaev 298ccf6487 Turn pyopencv_to and pyopencv_from into templates
This protects from unwanted implicit conversions between types at compile time.
2013-04-13 01:02:57 +04:00
Andrey Kamaev 8b294c6c90 Remove documentation for old python wrapper 2013-04-12 19:37:40 +04:00
Andrey Kamaev f886651cf0 Drop old python samples and tests 2013-04-12 19:37:40 +04:00
Andrey Kamaev b2ba8b9969 Drop old python interface 2013-04-12 19:37:40 +04:00
Andrey Kamaev 909d6fcf51 Move legacy part of opencv_contrib to separate header 2013-04-12 19:37:40 +04:00
Andrey Kamaev 3b364330ad Merge branch '2.4' 2013-04-12 15:35:38 +04:00
Andrey Kamaev b0933dd473 Merge pull request #803 from taka-no-me:split_c_cpp3 2013-04-12 15:01:48 +04:00
Andrey Kamaev 8406312571 Remove C API from OpenCL module 2013-04-12 14:37:02 +04:00
Andrey Kamaev 4296b456e5 Add missed constants for reduce operation 2013-04-12 14:37:02 +04:00
Andrey Kamaev bd59bc3e4a Remove ifdef __cplusplus from nonfree headers 2013-04-12 14:37:02 +04:00
Andrey Kamaev 5e048d1fa5 Move C API of opencv_objdetect to separate file
Also move cv::linemod to own header
2013-04-12 14:37:01 +04:00
Vadim Pisarevsky c019d06de3 Merge pull request #805 from pengx17:master_canny_fix 2013-04-12 13:46:07 +04:00
Vadim Pisarevsky 5a2c5227f4 Merge pull request #798 from pengx17:master_ocl_mleak 2013-04-12 13:45:44 +04:00
peng xiao 5eb551b340 Remove my test codes. 2013-04-12 16:21:52 +08:00
peng xiao 4f328d8388 Fix a potential bug of ocl::CannyBuf.
The program would crash if release is called twice.
2013-04-12 15:43:33 +08:00
peng xiao 7586145235 Remove unused kernels. 2013-04-12 14:32:13 +08:00
peng xiao 33361929fe Fix a compilation error when HAVE_CLAMDFFT is on. 2013-04-12 11:36:17 +08:00
peng xiao aec7a67d0f Fix a bug of ocl::Canny when src/dst using the same buffer. 2013-04-12 11:10:47 +08:00
peng xiao 242955ce22 Format ocl::Canny header 2013-04-12 11:01:56 +08:00
peng xiao 6c2079b778 Test code clean up. 2013-04-12 10:59:15 +08:00
peng xiao 22ca7e44d6 Change ocl::Canny test case category 2013-04-12 10:58:42 +08:00
Andrey Kamaev e5a33723fc Move C API of opencv_calib3d to separate file 2013-04-11 21:00:17 +04:00
Andrey Kamaev 199a35a105 Move C API of opencv_video to separate file 2013-04-11 17:38:33 +04:00
peng xiao a2f4b301f3 Fix an incorrect type cast. 2013-04-11 16:59:32 +08:00
Andrey Kamaev e27f4da9c6 Merge pull request #795 from taka-no-me:move_imgproc_utils_to_core 2013-04-11 11:35:15 +04:00
Andrey Kamaev ebb1f12aa7 Merge pull request #791 from taka-no-me:cleanup_core_api 2013-04-11 11:34:04 +04:00
Dirk Van Haerenborgh caa9ac4ed9 fix installation of main module headers
see: http://code.opencv.org/issues/2897

The order of the 2 conditions is really important, as every MATCHES
operator sets ${CMAKE_MATCH_1}, which is needed inside the condition
block. Ideally, this should be done using a single regex with a
negative forward lookahead, but CMake doesn't seem to support this
2013-04-10 18:15:06 +02:00
Andrey Kamaev 4846dcdfeb Move borderInterpolate and copyMakeBorder documentation 2013-04-10 19:14:25 +04:00
Andrey Kamaev c98c246fc2 Move border type constants and Moments class to core module 2013-04-10 19:14:24 +04:00
Andrey Kamaev ad793ee3f4 Update documentation 2013-04-09 13:36:32 +04:00
Andrey Kamaev b0e6606b98 Cleanup core module API
* Drop some low level API
* Remove outdated overloads
* Utilize Input/OutputArray
2013-04-09 13:36:32 +04:00
Andrey Kamaev f4ae0cf19c Merge pull request #790 from jet47:fix-gpu-build 2013-04-09 13:14:37 +04:00
Andrey Kamaev 36bf8af820 Merge pull request #788 from jet47:fix-2938 2013-04-09 13:14:06 +04:00
Vladislav Vinogradov ba1a1aecaa fixed gpu module compilation 2013-04-09 10:41:35 +04:00
Vladislav Vinogradov f50aabf012 fixed bug #2938 2013-04-09 10:14:25 +04:00
Andrey Kamaev 913e6833d5 Merge pull request #785 from taka-no-me:split_c_cpp2 2013-04-09 08:53:50 +04:00
Andrey Kamaev f03c7521c6 Merge pull request #783 from pengx17:master_matchTemplate_dft 2013-04-09 08:53:17 +04:00
Andrey Kamaev 2cd67cc92b Merge pull request #761 from jet47:gpu-core-refactoring 2013-04-09 08:50:45 +04:00
Andrey Kamaev e8107610d1 Merge pull request #787 from taka-no-me:quiet_nvcc 2013-04-08 20:10:34 +04:00
Andrey Kamaev 3107f79cea Cast to unsigned inside CV_XADD to quiet nvcc 2013-04-08 18:17:29 +04:00
Vladislav Vinogradov a783f5c260 removed blank lines at then end of file 2013-04-08 17:25:16 +04:00
Vladislav Vinogradov 068fb03011 fixed compilation warnings 2013-04-08 17:25:16 +04:00
Vladislav Vinogradov b50090f850 restore cudaSafeCall 2013-04-08 17:25:16 +04:00
Vladislav Vinogradov 2bad639aee fixed source_group 2013-04-08 17:25:16 +04:00
Vladislav Vinogradov d47e89d704 fixed windows build 2013-04-08 17:25:16 +04:00
Vladislav Vinogradov 6e28e67741 removed static_check.hpp 2013-04-08 17:25:16 +04:00
Vladislav Vinogradov 910ef57109 renamed cuda namespace to cudev 2013-04-08 17:25:15 +04:00
Vladislav Vinogradov 1bb141c465 fixed build 2013-04-08 17:25:15 +04:00
Vladislav Vinogradov 193e857392 removed cu_safe_call.h and cu_safe_call.cpp 2013-04-08 17:25:15 +04:00
Vladislav Vinogradov 204a19b431 moved common gpu utility functionality to gpu_private.hpp 2013-04-08 17:25:15 +04:00
Vladislav Vinogradov 28b1e81883 renamed device -> cuda 2013-04-08 17:25:15 +04:00
Vladislav Vinogradov a57707b8d8 moved device layer to core module 2013-04-08 17:25:15 +04:00
Andrey Kamaev 54511b4198 Merge pull request #724 from jet47:tvl1-updates 2013-04-08 17:13:35 +04:00
Andrey Kamaev dd74a851f3 Fix build errors 2013-04-08 17:10:31 +04:00
Andrey Kamaev befd696720 Update documentation 2013-04-08 15:47:29 +04:00
Andrey Kamaev ae4e76395f Make flann headers independent from OpenCV C API 2013-04-08 15:47:29 +04:00
Andrey Kamaev 69648f0a6f Make photo.hpp independent from C API 2013-04-08 15:47:29 +04:00
Andrey Kamaev 0738ea7d0f Make highgui.hpp independent from C API 2013-04-08 15:47:29 +04:00
Andrey Kamaev 288a0634c2 Make imgproc.hpp independent from C API 2013-04-08 15:47:28 +04:00
Vladislav Vinogradov c89786bc2d fixed sanity test on Windows 2013-04-08 15:18:26 +04:00
Vladislav Vinogradov 8d97d9598e updated GPU version of TVL1 2013-04-08 15:18:26 +04:00
Stefan Walk 6062601c4d Make rescaling flexible and add median filtering
Previously the pyramid was done with a rescaling factor of 2 (implied by the
use of pyrDown). This often leads to inferior results compared to a scale step
of e.g. 0.8 (a factor of 2 is obviously faster). This commit makes the scale
step configurable and uses a resonable default value.

The other change in this commit is that median filtering is added. This is not
described in this paper but it is done in the author's implementation. (See
e.g. "Secrets of optical flow estimation and their principles", Sun et al.,
CVPR 2010) This serves as periodic outlier removal during optimization, leading
to smoother flow fields while preserving motion edges. This includes splitting
the optimization loop into two loops.
2013-04-08 15:18:26 +04:00
Andrey Kamaev 7ac0d86992 Merge pull request #786 from cuda-geek:fix-build-gpu-off-cuda-on 2013-04-08 15:11:28 +04:00
Andrey Kamaev 058a9ab136 Merge pull request #784 from jet47:fix-gpu-build 2013-04-08 15:11:16 +04:00
marina.kolpakova 780a8cc149 fix build without gpu module with cuda 2013-04-08 14:13:19 +04:00
Vladislav Vinogradov bf6c08a9ea fixed compilation with CUDA 2013-04-08 13:29:04 +04:00
peng xiao 143f8f69d6 Add some documentation on ocl::convolve 2013-04-08 17:15:52 +08:00
peng xiao 3fea2620e6 Fix some compilation errors and warnings. 2013-04-08 16:22:20 +08:00
peng xiao 77501f3ed0 ocl: Add dft based convolve implementation.
Match template in ocl module now can be utilized with dft based
convolve. Note this feature needs OpenCV to be built with clAmdFft
library.
2013-04-08 15:19:44 +08:00
Andrey Kamaev 6ef43cd96e Merge pull request #779 from sivapvarma:master 2013-04-08 10:11:33 +04:00
Andrey Kamaev 67073daf19 Merge branch '2.4' 2013-04-05 21:11:59 +04:00
Siva Prasad Varma 3b0ce8e132 Add HoughTransform examples python2
houghlines.py for HoughLinesP() and HoughLines()
houghcircles.py for HoughCircles()
2013-04-05 14:32:07 +05:30
Andrey Kamaev 3785439917 Merge pull request #763 from gpsinghsandhu:video-doc-minor-typo 2013-04-04 18:16:15 +04:00
Andrey Kamaev bfac291838 Merge pull request #757 from jackculpepper:master 2013-04-04 18:15:03 +04:00
gpsinghsandhu 6b71f56025 minor typo in the research paper title 2013-04-04 15:58:11 +05:30
jackculpepper 297e6d0b73 mark multiple return arguments for python bindings 2013-04-04 00:51:52 -07:00
Andrey Kamaev 78c70ab948 Merge pull request #747 from taka-no-me:split_c_cpp 2013-04-04 00:55:22 +04:00
Andrey Kamaev d4bb421ce2 Fix findEssentialMat function
Also remove all usages of std::complex from OpenCV modules
2013-04-03 17:25:00 +04:00
Andrey Kamaev 422803e866 Merge pull request #746 from jet47:fix-gpu-compilation 2013-04-03 15:58:48 +04:00
Andrey Kamaev 4cf5c3568d Merge pull request #737 from AoD314:webp2 2013-04-03 15:58:31 +04:00
Andrey Kamaev de848a08d3 Merge pull request #722 from gpsinghsandhu:blob-detector-cpp 2013-04-03 15:58:17 +04:00
Andrey Kamaev 6ce050d264 Update docs 2013-04-03 14:10:03 +04:00
Andrey Kamaev 940eedfb27 Finalize core headers reorganization 2013-04-03 14:10:03 +04:00
Vladislav Vinogradov 366f859ada fixed compilation after CV_IMPLEMENT_QSORT_EX removing 2013-04-03 12:59:40 +04:00
Andrey Kamaev c979de1eed Rewrite Mat formatting without std streams 2013-04-03 11:55:19 +04:00
AoD314 740941c8b8 update libwebp up to 0.3.0 2013-04-02 15:22:10 +04:00
Andrey Kamaev 7193a73ca0 Move FileStorage to separate header 2013-04-01 19:18:05 +04:00
Andrey Kamaev 517062039e Make core/internal.hpp a private header 2013-04-01 17:29:10 +04:00
Andrey Kamaev d62bc8cfbf Remove more old definitions from internal.hpp 2013-04-01 16:32:08 +04:00
Andrey Kamaev e972d6b8c0 Drop template Vector class 2013-04-01 15:24:35 +04:00
Andrey Kamaev 3890a74565 Drop outdated definitions from internal.hpp
This also fixes few clang build errors
2013-04-01 15:24:35 +04:00
Andrey Kamaev 605382562d Fix stack corruption in cvConvexHull2 and heap corruption in OutputArray::create 2013-04-01 15:24:35 +04:00
Andrey Kamaev b28f594917 Drop fast_abs 2013-04-01 15:24:35 +04:00
Andrey Kamaev 6fea48c54f Drop operator* from MatCommaInitializer 2013-04-01 15:24:34 +04:00
Andrey Kamaev 4ab650d15b Remove gcd function from core headers 2013-04-01 15:24:34 +04:00
Andrey Kamaev c886afb502 Finalize cv::Mat transition 2013-04-01 15:24:34 +04:00
Andrey Kamaev 71e43852ce Fix MSVC build issues 2013-04-01 15:24:34 +04:00
Andrey Kamaev 2b1ef95415 Completely separate C and C++ API of OpenCV core 2013-04-01 15:24:34 +04:00
Andrey Kamaev 715fa3303e Move cv::Mat out of core.hpp 2013-04-01 15:24:34 +04:00
Andrey Kamaev 135c0b6cb5 Move cv::TermCriteria out of core.hpp 2013-04-01 15:24:34 +04:00
Andrey Kamaev fbd435898b Rename mat.hpp 2013-04-01 15:24:33 +04:00
Andrey Kamaev 3d1d219561 Move cv::fastMalloc, cv::fastFree and cv::Ptr out of core.hpp 2013-04-01 15:24:33 +04:00
Andrey Kamaev 489bd59b72 Move implementation of C++ container classes to types.hpp 2013-04-01 15:24:33 +04:00
Andrey Kamaev 6c071cbdd8 Norms are moved out form operations.hpp 2013-04-01 15:24:33 +04:00
Andrey Kamaev 969a7133a9 Implementation of cv::Matx and cv::Vec is almost moved to matx.hpp 2013-04-01 15:24:33 +04:00
Andrey Kamaev d2192c0759 Move cv::Matx and cv::Vec to separate header 2013-04-01 15:24:33 +04:00
Andrey Kamaev 5e7ab8baf3 Move cv::Scalar_ to types.hpp 2013-04-01 15:24:33 +04:00
Andrey Kamaev 6ceca90c44 Move most of the traits classes out of core.hpp 2013-04-01 15:24:33 +04:00
Andrey Kamaev 2249f19120 Move cv::Range, cv::KeyPoint and cv::DMatch 2013-04-01 15:24:33 +04:00
Andrey Kamaev 93d76ac23f Move cv::RotatedRect 2013-04-01 15:24:33 +04:00
Andrey Kamaev 62adc01980 Move cv::Rect_ 2013-04-01 15:24:33 +04:00
Andrey Kamaev addf0309ec Move cv::Size_ 2013-04-01 15:24:32 +04:00
Andrey Kamaev 13b31b0804 Move C++ basic structures to separate header and inverse dependency from C API
cv::Complex, cv::Point_ and cv::Point3_ are moved.
2013-04-01 15:24:32 +04:00
Andrey Kamaev 19f8f85c51 Move C structures wrappers from core.hpp to core_c.h
Also move RTTIImpl class to the only usage
2013-04-01 15:24:32 +04:00
Andrey Kamaev 6bf49d49e7 Drop CvModule and cvSetMemoryManager 2013-04-01 15:24:32 +04:00
Andrey Kamaev db45e04d58 Merge pull request #720 from taka-no-me:drop_sort 2013-04-01 15:14:45 +04:00
gpsinghsandhu 77e51ff9c4 contours with zero area rejected
reject contours with zero area by using the "continue" statement to be in sync with the condition checking style used in the whole file
2013-03-31 16:13:40 +05:30
gpsinghsandhu 0d16a9befb In response to Bug #2927
change to reject contours with moms.m00 = 0.0
2013-03-30 00:33:22 +05:30
Andrey Kamaev f77a375354 Merge branch '2.4' 2013-03-29 19:38:35 +04:00
Andrey Kamaev 3ceca9b7b1 Merge pull request #694 from mistydemeo:fix_java_detection 2013-03-29 18:24:11 +04:00
Andrey Kamaev f4b98e9628 Merge pull request #719 from jet47:gpu-fix-build 2013-03-29 18:23:05 +04:00
Andrey Kamaev 0bb785c979 Merge pull request #717 from ryanobjc:patch-1 2013-03-29 18:21:59 +04:00
Andrey Kamaev 7ff68d5e0d Merge pull request #711 from taka-no-me:move_keypoint_dmatch 2013-03-29 18:21:38 +04:00
Andrey Kamaev 855acc9748 Add specialization for << operator for writing std::string to FileStorage 2013-03-29 16:27:12 +04:00
Andrey Kamaev cc6bdfb045 Remove inline sorting algorithms from core headers 2013-03-28 17:22:50 +04:00
Vladislav Vinogradov 2661c2e213 fixed warnings 2013-03-28 11:49:47 +04:00
Vladislav Vinogradov 76e748ccc1 removed internal_header.hpp - it produces many warnings 2013-03-28 11:49:26 +04:00
Vladislav Vinogradov 15f09f8068 fixed gpu module compilation 2013-03-28 11:48:43 +04:00
Ryan Rawson 0d49de51b7 Update operations_on_arrays.rst
Remove weirdo unicode – and just use a normal -
2013-03-27 02:52:53 -07:00
Andrey Kamaev 20534c9beb Merge pull request #692 from vpisarev:refactor_calib3d_stereo 2013-03-26 18:38:16 +04:00
Andrey Kamaev 2edfae5070 Move documentation for cv::KeyPoint and cv::DMatch to core 2013-03-26 17:20:51 +04:00
Andrey Kamaev 49f6dad13f Move cv::KeyPoint and cv::DMatch to core 2013-03-26 16:08:43 +04:00
Andrey Kamaev 8eff34ee0b Merge pull request #709 from taka-no-me:cv_format 2013-03-26 14:36:47 +04:00
Andrey Kamaev 6e2708e042 Merge pull request #708 from taka-no-me:gstreamer_10_28 2013-03-26 14:36:25 +04:00
Andrey Kamaev 0e58853be3 Merge pull request #706 from taka-no-me:str_gpumat 2013-03-26 14:36:10 +04:00
Andrey Kamaev 6377922716 Fix build with gstreamer 0.10.28 2013-03-26 13:10:09 +04:00
Vadim Pisarevsky 322d781192 avoid explicit std::string use 2013-03-26 12:55:21 +04:00
Andrey Kamaev 2107ea9773 More accurate implementation of cv::format 2013-03-26 11:54:04 +04:00
Andrey Kamaev 5fd58a0103 Fix std::string to cv::String migration problems in gpumat.cpp 2013-03-26 11:24:54 +04:00
Andrey Kamaev 69c9fe357d Merge pull request #702 from taka-no-me:refactor_core_headers 2013-03-26 11:00:03 +04:00
Andrey Kamaev 98585a9688 Merge pull request #703 from jacob-baines:patch-2 2013-03-25 20:26:39 +04:00
Andrey Kamaev aaf69c422e Fix clang build for Android (CV_XADD) 2013-03-25 18:06:02 +04:00
Jacob Baines 866d676582 Memory Leak Fix
Memory leak in BoostedSoftCascadeOctave::traverse
2013-03-25 11:02:50 -03:00
Andrey Kamaev deb7f4d474 Fix globbing failure when stat call fails 2013-03-25 17:38:50 +04:00
Andrey Kamaev a3e31a69df Merge pull request #684 from vhdirk:gstreamer-1.x 2013-03-25 17:01:43 +04:00
Andrey Kamaev 78a843e8ac Move implementation of cv::String methods out of class definition 2013-03-25 16:01:23 +04:00
Andrey Kamaev 3d3385654a Use C++ style includes when compiled as C++ 2013-03-25 16:01:06 +04:00
Andrey Kamaev 8c41c614eb Merge pull request #700 from cuda-geek/fix_build_with_cuda
fix master build with CUDA after latest 2.4 merge
2013-03-25 03:27:31 -07:00
Andrey Kamaev 04eabf8d9f Merge pull request #699 from jacob-baines/patch-1
Mismatching new[] / delete
2013-03-25 03:26:18 -07:00
Andrey Kamaev bafd359083 Merge pull request #695 from taka-no-me/cv_str
cv::String to replace the std::string
2013-03-25 03:24:42 -07:00
Andrey Kamaev a3994bc45f Merge pull request #671 from cuda-geek/static_assert
Static assert
2013-03-25 03:23:20 -07:00
Vadim Pisarevsky f8b61e4eca fixed hopefully last warnings in the doc builder 2013-03-25 12:04:11 +04:00
marina.kolpakova dd9e786a8e fix build gpu tests after video module refactoring 2013-03-25 09:34:51 +04:00
marina.kolpakova 84f45e1e03 fixed build with CUDA after latest merge 2013-03-25 08:08:36 +04:00
Jacob Baines 1e1645e214 Mismatching new[] / delete 2013-03-24 22:45:31 -03:00
Vadim Pisarevsky 44157c421f fixed python test failures (modified stereo correspondence test to use cv2.* stuff), fixed docs 2013-03-25 00:42:46 +04:00
marina.kolpakova 4096b54560 use static assertation where suitable 2013-03-25 00:29:12 +04:00
marina.kolpakova 5c1c13e745 static assert 2013-03-25 00:29:12 +04:00
Vadim Pisarevsky 7b5923e98b fixed docs and compile error on Linux 2013-03-24 23:09:17 +04:00
Alexander Mordvintsev 4d510be2c9 added compute function to Feature2D (dirty workaround for #2699) 2013-03-23 14:06:33 +04:00
Andrey Kamaev 877dfae044 Fix build of ocl module 2013-03-22 22:14:57 +04:00
Andrey Kamaev 33ef7990b0 Update documentation 2013-03-22 22:14:54 +04:00
Andrey Kamaev be7bbe3aa9 Drop cv:: prefix from cv::String used inside the cv namespace 2013-03-22 22:14:50 +04:00
Andrey Kamaev 75513a46dc Remove all include directives for <string> 2013-03-22 22:14:47 +04:00
Andrey Kamaev 29b544d83c Use cv::String in Android camera wrapper 2013-03-22 22:14:43 +04:00
Andrey Kamaev 3088808926 Fix build of various backends 2013-03-22 22:14:40 +04:00
Andrey Kamaev 29cfeb7cee Fix build of apps and samples 2013-03-22 22:14:36 +04:00
Andrey Kamaev 688d170de7 Java wrapper is adapted for cv::String 2013-03-22 22:14:33 +04:00
Andrey Kamaev 707d3e0a62 Python wrapper is adapted for cv::String 2013-03-22 22:14:30 +04:00
Andrey Kamaev 2ad7b97f1c All modules (except ocl and gpu) compiles and pass tests 2013-03-22 22:14:26 +04:00
Andrey Kamaev 762aefd71b Compile opencv_test_core with cv::String instead of std::string
All tests passed!
2013-03-22 22:14:22 +04:00
Andrey Kamaev 14bb4cbe1e Add cv::String class 2013-03-22 22:14:18 +04:00
Misty De Meo a423afddc1 Fix ant/Java detection in cmake scripts
Mac OS X 10.7 and newer don't come with Java installed. They do
include some stub binaries, which ask the user if they want to
install Java when run.

OpenCV's cmake script just checks for the existence of an ant
binary and assumes that Java's available if ant is. As a result,
cmake will configure the build to use Java and it will fail once
it tries to compile the Java bindings.

This fixes the issue by checking for the exit status of
`ant -version` - it exits 0 if Java is installed, or 1
otherwise.
2013-03-22 11:18:42 -05:00
Andrey Kamaev ec15d6f383 Merge pull request #690 from berak:master 2013-03-22 19:35:17 +04:00
Andrey Kamaev 82d7292ee7 Merge pull request #680 from vpisarev:c2cpp_video_take2 2013-03-22 19:34:53 +04:00
berak d32af86e75 Update CMakeLists.txt
exclude IlmImf/b44ExpLogTable.cpp from the build,

it's used originally to generate IlmImf/b44ExpLogTable.h, but not nessecary for the library.(probably only here for documentation

when included with static linking it introduces a problem with multiple definitions of main()
2013-03-22 09:31:40 +01:00
Vadim Pisarevsky 40dd25d6c2 restored CV_EXPORTS_W in the background subtraction classes 2013-03-22 01:29:33 +04:00
Vadim Pisarevsky 7661625c39 converter stereo correspondence algorithms to the new style 2013-03-22 01:05:30 +04:00
Andrey Kamaev 1ca8f33b4e Merge branch '2.4' 2013-03-21 23:11:54 +04:00
Vadim Pisarevsky d310ccad0a fixed documentation and warnings on Windows 2013-03-21 20:23:52 +04:00
Andrey Kamaev bbae05413d Merge pull request #682 from vpisarev/python_str_fix
repaired std::string handling
2013-03-21 08:57:39 -07:00
Dirk Van Haerenborgh 921675c4e2 eliminated warnings 2013-03-21 16:11:53 +01:00
Vadim Pisarevsky 09127aa358 fixed warnings; added read/write methods; fixed docs 2013-03-21 15:46:21 +04:00
Andrey Kamaev 2d764fe1c6 Merge pull request #665 from taka-no-me:core_utility 2013-03-21 14:47:49 +04:00
Dirk Van Haerenborgh 4f3453dbbf bomb commit of gstreamer videocapture and videowriter 2013-03-21 10:22:56 +01:00
Vadim Pisarevsky 0990b42ebc Merge pull request #657 from prclibo:master 2013-03-21 12:23:49 +04:00
Vadim Pisarevsky 219bdb9809 Merge pull request #681 from jbohren-forks:fix-ellipse-segfault 2013-03-21 12:22:01 +04:00
Vadim Pisarevsky 4e1619d8ee repaired std::string handling 2013-03-21 11:30:38 +04:00
Jonathan Bohren a7a0f92e58 Fixing segfault for near-zero-sized ellipses 2013-03-20 16:51:48 -04:00
Vadim Pisarevsky 07e0f7bf59 refactored video module; use the new-style algorithms now 2013-03-20 19:51:49 +04:00
Vadim Pisarevsky 14a0abbfa9 refactored video module; use the new-style algorithms now 2013-03-20 19:51:33 +04:00
Andrey Kamaev 89356ff16d Move non-CV functionality from core.hpp to separate utility.hpp header 2013-03-20 17:56:06 +04:00
Bo Li 94b12eae92 update five-point license 2013-03-20 09:53:44 +01:00
Andrey Kamaev 87563c6638 Merge pull request #670 from Nerei:osx_compilation 2013-03-19 19:39:08 +04:00
Andrey Kamaev bb6a58aee2 Merge pull request #668 from AoD314:webp2 2013-03-19 19:38:52 +04:00
Anatoly Baksheev 08e55b7801 compilation for osx 2013-03-19 18:59:56 +04:00
AoD314 7d0c600504 improved test of webp 2013-03-19 18:04:15 +04:00
Andrey Kamaev 6d6ef07e30 Merge pull request #666 from cuda-geek:warnings 2013-03-19 17:42:58 +04:00
marina.kolpakova 238ea7f0f0 fix warnings under win. 2013-03-19 03:34:55 +04:00
Andrey Kamaev 1ad7af3c3b Merge pull request #654 from fish2000:patch-1 2013-03-18 15:56:55 +04:00
Andrey Kamaev 0b0c9be771 Merge pull request #636 from ilya-lavrenov:SSE2_HOG 2013-03-18 15:56:16 +04:00
cuda-geek 3f8d87d82c Merge pull request #661 from cuda-geek:merge-cpu-gpu-detections 2013-03-18 15:34:02 +04:00
marina.kolpakova 43db0d543d fix win warnings 2013-03-18 13:50:45 +04:00
cuda-geek f768d8c93f Merge pull request #658 from Nerei:affine3_classes 2013-03-18 13:36:01 +04:00
cuda-geek f510b49cc2 Merge pull request #650 from taka-no-me:cvdef 2013-03-18 13:10:54 +04:00
cuda-geek d8755fd1c0 Merge pull request #653 from jbohren-forks:master 2013-03-18 13:10:25 +04:00
Anatoly Baksheev ceadaed108 Added Affine3<T> class 2013-03-18 11:51:43 +04:00
marina.kolpakova 318257f3a3 refactor cpp files naming 2013-03-18 08:17:13 +04:00
marina.kolpakova 0211843062 merge Detection structure for CPU and GPU soft cascade detectors 2013-03-18 06:58:53 +04:00
cuda-geek 7772811585 Merge pull request #659 from Nerei:master 2013-03-18 00:46:40 +04:00
Anatoly Baksheev fe10c74faa fixed compilation for vs2008 2013-03-17 18:02:52 +04:00
marina.kolpakova 92ba74a3ee fix cuda 2013-03-17 05:50:45 +04:00
Bo Li 28256209b0 updated doc 2013-03-15 21:30:22 +01:00
Bo Li 2435e59890 rewrite five-point coeff matrix. 2013-03-15 20:44:41 +01:00
Andrey Kamaev ea79357fd3 Merge pull request #647 from taka-no-me:fix_ffmpeg_wrapper 2013-03-15 17:50:32 +04:00
Andrey Kamaev e75df56317 Unified handling of InputOutputArrays in Python wrapper generator
This makes arguments of type InputOutputArray required in python unless they
have a default value in C++.

As result following python functions changes signatures in non-trivial way:

* calcOpticalFlowFarneback
* calcOpticalFlowPyrLK
* calibrateCamera
* findContours
* findTransformECC
* floodFill
* kmeans
* PCACompute
* stereoCalibrate

And the following functions become return their modified inputs as a return
value:

* accumulate
* accumulateProduct
* accumulateSquare
* accumulateWeighted
* circle
* completeSymm
* cornerSubPix
* drawChessboardCorners
* drawContours
* drawDataMatrixCodes
* ellipse
* fillConvexPoly
* fillPoly
* filterSpeckles
* grabCut
* insertChannel
* line
* patchNaNs
* polylines
* randn
* randShuffle
* randu
* rectangle
* setIdentity
* updateMotionHistory
* validateDisparity
* watershed
2013-03-15 17:44:49 +04:00
Alexander Bohn / FI$H2k f3ee55e042 Fix for encoding errors when building Java source
The generated OpenCV Java source can contain characters outside of ASCII on some systems – this patch allows the ant task to compile them.
2013-03-15 06:47:52 -03:00
Andrey Kamaev a1c456b7c3 Extract common base header for C and C++ APIs 2013-03-15 10:38:38 +04:00
Andrey Kamaev 1eb34e062c Merge pull request #648 from cuda-geek:move-gpu-soft-cascade-to-softcascade-module 2013-03-15 10:35:04 +04:00
Jonathan Bohren 221d610d55 calib3d model superscript should be subscript 2013-03-15 00:29:46 -03:00
marina.kolpakova 157a98edf7 refactored cuda error handling; remove optional dependancies in soft cascade training app 2013-03-14 23:43:03 +04:00
marina.kolpakova a476664144 fixed compilation with latest master changes 2013-03-14 20:12:52 +04:00
Andrey Kamaev 14d27112e9 Fix build of ffmpeg wrapper with some versions of avutil 2013-03-14 14:52:13 +04:00
marina.kolpakova 6f11dc03b9 implement integral 2013-03-14 12:28:02 +04:00
marina.kolpakova 83e7d3dd67 remove generic version of GPU channel computer. 2013-03-14 12:28:02 +04:00
marina.kolpakova 3c8e66d580 softcascade: remove device dependency on gpu 2013-03-14 12:28:01 +04:00
marina.kolpakova 6daf17f974 remove softcascade host dependencies on gpu module 2013-03-14 12:28:01 +04:00
marina.kolpakova 5120322cea move gpu version of soft cascade to dedicated module 2013-03-14 12:27:13 +04:00
marina.kolpakova 9b00c14fff moved documentation for CUDA version of softcascade 2013-03-14 12:25:18 +04:00
Andrey Kamaev d9cd753835 Merge pull request #645 from taka-no-me:bump_headers 2013-03-14 11:42:23 +04:00
Andrey Kamaev b076b69e68 Merge pull request #642 from taka-no-me:fix1 2013-03-14 11:42:05 +04:00
Andrey Kamaev f622a2e79c Merge pull request #641 from taka-no-me:stlfree_xadd 2013-03-14 11:41:36 +04:00
Andrey Kamaev 7d0938d481 Merge pull request #640 from cuda-geek:soft-cascade-sample 2013-03-14 11:41:17 +04:00
Andrey Kamaev a42a0f5fca Added compatibility headers 2013-03-13 17:26:56 +04:00
Andrey Kamaev ad5cddc007 Main module headers are moved 1 level up
e.g. <opencv2/core/core.hpp> become <opencv2/core.hpp>

Also renamed <opencv2/core/opengl_interop.hpp> to <opencv2/core/opengl.hpp>
2013-03-13 17:26:56 +04:00
cuda-geek 061dd7e84e Merge pull request #643 from cuda-geek:refactor-softcascade-globbing 2013-03-13 17:00:53 +04:00
marina.kolpakova 18aa5c921f use OpenCV's twister. 2013-03-13 14:20:04 +04:00
marina.kolpakova cf66942505 enable training test. refactor globbing 2013-03-13 13:43:22 +04:00
Andrey Kamaev 7e50d3e571 Fixed MSVC warnings 2013-03-13 11:34:04 +04:00
marina.kolpakova b4b63cd698 add softcascade to people detector sample 2013-03-13 07:39:50 +04:00
Andrey Kamaev 55698548dd Avoid assert in lapac.cpp if findHomography fails in BestOf2NearestMatcher::match 2013-03-12 22:49:40 +04:00
Andrey Kamaev 013fd9bf59 Make CV_XADD independent on STL and system headers 2013-03-12 20:32:41 +04:00
Andrey Kamaev 9f3ce0dd97 Reword and merge pull request #625 from jet47/gpu-fixes 2013-03-12 18:14:23 +04:00
Vladislav Vinogradov ecb2ebfba4 Move opengl iterop code to cv::ogl namespace
Fixed issues: #2737 #2848
2013-03-12 18:13:11 +04:00
cuda-geek e4f55a7ec0 Merge pull request #629 from cuda-geek:globbing 2013-03-12 15:57:56 +04:00
cuda-geek 009158e1f8 Merge pull request #621 from cuda-geek:twister 2013-03-12 13:11:50 +04:00
Andrey Kamaev fb04f3a58d Merge pull request #622 from moshekaplan:python2_cleanups 2013-03-11 21:14:20 +04:00
Andrey Kamaev fb76095378 Merge pull request #610 from AoD314:webp2 2013-03-11 21:13:36 +04:00
Ilya Lavrenov 8b510ad8dc sse2 hog 2013-03-11 20:21:48 +04:00
Andrey Kamaev 9b7dfd677d Merge branch '2.4' 2013-03-11 18:50:19 +04:00
Andrey Kamaev 9b8c871874 Merge pull request #634 from taka-no-me:c++11-master 2013-03-11 17:15:09 +04:00
Andrey Kamaev 2a06fd98c0 Fix build errors with c++11 2013-03-11 16:03:48 +04:00
AoD314 9680176fa9 added docs 2013-03-11 15:47:21 +04:00
AoD314 eb012a5993 added tests for WebP 2013-03-11 11:51:46 +04:00
AoD314 63d9ee9523 This code is based on https://github.com/prasannatsm/opencv code.
- added webp (lossy and lossless without alpha channel)
- added tests
2013-03-11 11:51:38 +04:00
cuda_geek 61094d350b add dlobbing for Windows 2013-03-09 23:21:17 +04:00
marina.kolpakova a486aafe7c add dlobbing under *nix 2013-03-09 21:10:45 +04:00
marina.kolpakova 12fe6ff734 add Mersenne Twister random number generator 2013-03-09 19:18:37 +04:00
AoD314 fd44322b4f added CMakeLists.txt for build WebP 2013-03-07 19:31:02 +04:00
AoD314 e7cb317c7d added cpu-features for WebP 2013-03-07 19:07:43 +04:00
AoD314 500b7318be added WebP library 2013-03-07 19:07:31 +04:00
Moshe Kaplan bd042d9cc3 Fixed shebangs, added error checking 2013-03-06 01:41:02 -05:00
Andrey Kamaev 6569a58518 Merge pull request #592 from vpisarev:c2cpp_calib3d_ptsetreg 2013-03-05 17:39:53 +04:00
Andrey Kamaev 816adcfdac Merge pull request #605 from vpisarev:c2cpp_calib3d_stereo 2013-03-05 15:26:51 +04:00
cuda-geek b9ab5939a4 Merge pull request #607 from cuda-geek:auto-compile-cuda 2013-03-05 13:50:29 +04:00
cuda-geek fcde059ca4 Merge pull request #618 from caotto:master 2013-03-05 13:12:39 +04:00
marina.kolpakova 39ecd94010 forbid recursive globbing for OpenCV modules sources 2013-03-05 11:34:46 +04:00
cuda-geek c0ba0c9099 Merge pull request #596 from ArtanisCV:master 2013-03-05 08:57:58 +04:00
cuda-geek 7e9f1c33d0 Merge pull request #617 from moshekaplan:master 2013-03-05 08:56:58 +04:00
Charles Otto c02f94392b Add version checks to previous modifications to ffmpeg_cap_impl.hpp
Add version checks around uses of AVCodecID and av_opt_set, since these aren't
defined for older versions of ffmpeg.
2013-03-04 22:14:52 -05:00
Charles Otto 52137ceed0 Allow encoding with libx264 via ffmpeg to work
Add a call to avcodec_get_context_defaults3, this sets per-codec default values
and in the case of libx264 will stop VideoWriter::open (with fourcc=x264) from
failing due to libx264 complaining about broken ffmpeg default settings.

Set some additional libx264 encoder parameters.
2013-03-04 19:29:05 -05:00
Vadim Pisarevsky f303de12d8 mask.create() re-converted to new style 2013-03-05 00:03:37 +04:00
Vadim Pisarevsky 0c61a8887e reverting changes in Homography kernel function. For some reason GCC on Linux does not like it. 2013-03-05 00:00:21 +04:00
Moshe Kaplan facd580f28 Small changes to Python samples
Update find_obj.py:
    Added additional error checking for the loaded files and modified the detector check to be more pythonic (is versus ==).

    Update common.py:
    Fixed a typo (contais -> contains)
2013-03-04 12:25:35 -05:00
Andrey Kamaev 9e12b7c3c2 Merge release 2.4.4 2013-03-04 19:43:49 +04:00
Vadim Pisarevsky 7fd1d75738 some more minor fixes 2013-03-04 16:02:15 +04:00
cuda-geek 52a45ed191 Merge pull request #606 from cuda-geek:fix-depth-less-2-bug-in-soft-cascade 2013-03-03 08:59:56 +04:00
cuda-geek 1c3cde110d Merge pull request #608 from cuda-geek:soft-cascade-hot-fixes 2013-03-03 08:59:37 +04:00
Vadim Pisarevsky 8a6d2bbd3d several minor fixes proposed by Andrey 2013-03-03 00:54:46 +04:00
marina.kolpakova ac471fadd6 remove unused parameter from softcascade::Octave constructor 2013-03-02 13:06:29 +04:00
marina.kolpakova d539dae6d0 fix typo in integral buffer initialization 2013-03-02 09:33:17 +04:00
marina.kolpakova 1bf696f392 fixes for soft cascade training app 2013-03-02 09:24:13 +04:00
Vadim Pisarevsky df89f30b4a removed preset parameter in createStereoBM, updated stereo_match sample 2013-03-02 02:17:49 +04:00
marina.kolpakova 19f863ec13 add possibility to create CUDA powered modules with ocv_define_module macro 2013-03-02 00:17:46 +04:00
marina.kolpakova 445f39a4a3 fix uninitialized magnitude channel bug 2013-03-01 23:40:32 +04:00
marina.kolpakova 12d23aae02 refactor channel builder
fix condition for sample index in assert
2013-03-01 23:39:32 +04:00
marina.kolpakova 1c3c11a4cc fix import in scale_caltech python script 2013-03-01 23:33:28 +04:00
marina.kolpakova 516a6cc59d fix bug: depth of resulting tree is less then 2. 2013-03-01 23:21:25 +04:00
Artanis 11f8c74c51 Remove "build/" from .gitignore 2013-03-01 15:43:12 +08:00
Artanis 993522598b Add implementations for Mat::zeros() and Mat::ones()
In class Mat, "static MatExpr Mat::zeros(int ndims, const int* sz, int
type)" and "static MatExpr Mat::ones(int ndims, const int* sz, int
type)" are declared but never implemented. That means we can see their
manuals from
"http://docs.opencv.org/modules/core/doc/basic_structures.html" but we
can't use them. Here I tried to finish their implementation.
I have also changed MatOp_Initializer::assign to make it support
multi-dimension Mat.
Test cases are added in test_math.cpp as well.
2013-03-01 13:18:44 +08:00
Artanis 0532a521a2 Add "build\" into .gitignore 2013-03-01 09:47:46 +08:00
Vadim Pisarevsky b6efe30527 new API for StereoMatchers 2013-03-01 02:24:46 +04:00
Vadim Pisarevsky d925879366 reverted dangerous change in _InputArray::size() 2013-02-28 23:02:04 +04:00
Vadim Pisarevsky 374e3a0890 rewritten several functions from calib3d: findhomography, findfundamentalmat, findessentialmat, estimateaffine3d, computecorrespondepilines, convert points{to/from}homogeneous to C++. 2013-02-28 18:25:05 +04:00
Andrey Kamaev 891d7da6ee Merge branch '2.4' 2013-02-28 11:17:06 +04:00
Andrey Kamaev c5e979ceb7 Merge pull request #581 from vpisarev:ios_fix 2013-02-28 01:58:13 +04:00
Andrey Kamaev c6318ffaa0 Merge pull request #567 2013-02-28 01:50:40 +04:00
Georgios Evangelidis f40725bb50 Add ECC algorithm
Evangelidis, G.D. and Psarakis E.Z. "Parametric Image Alignment using Enhanced
Correlation Coefficient Maximization", IEEE Transactions on PAMI, vol. 32, no.
10, 2008
2013-02-28 01:48:00 +04:00
Vadim Pisarevsky 11ba220e02 fixed iOS framework compile errors after recent changes 2013-02-28 00:54:01 +04:00
Andrey Kamaev b9b4200504 Merge pull request #580 from vrabaud:patch-1 2013-02-28 00:39:04 +04:00
Andrey Kamaev 68bb317ce1 Merge pull request #462 from kobigurk:master 2013-02-28 00:38:20 +04:00
Vincent Rabaud c7bbd1aef2 Update cmake/templates/OpenCVConfig.cmake.in
find_package(OpenCV) should not include_directories by default, that is not standard afaik. Plus that creates problems when creating the ROS package :)
2013-02-27 11:00:38 -08:00
Andrey Kamaev d620ef0d55 Merge pull request #577 from ilya-lavrenov:BilateralFilter 2013-02-27 19:44:56 +04:00
Andrey Kamaev 7b79eaf5be Merge pull request #511 from aritzlc:master 2013-02-27 19:33:01 +04:00
Ilya Lavrenov 3eed5d8c72 additional improvements for 32f 2013-02-27 17:54:22 +04:00
Ilya Lavrenov efad6942e2 some improvements of existing sse3 optimization of bilateral filter in case of 8uc3. Now perf tests take 6120ms instead of previous 7250ms (1.18x speed-up) 2013-02-27 16:53:09 +04:00
Andrey Kamaev 242a6de719 Merge pull request #566 from FabricioS:master 2013-02-27 11:37:31 +04:00
Andrey Kamaev 351ecbbcce Repair build 2013-02-26 23:12:20 +04:00
Fabrice Silva eca114ae95 Fix definition of the covariance matrix of derivatives. 2013-02-26 18:50:20 +01:00
cuda-geek 15e125c751 Merge pull request #543 from taka-no-me:explicit_stl 2013-02-26 20:54:13 +04:00
Andrey Kamaev 9f888fdb97 Merge pull request #490 from mschoeler:master 2013-02-26 18:33:05 +04:00
alegarda 0448f240a0 Added constants to gen_java.py 2013-02-26 11:21:43 +01:00
cuda-geek 37568b26ed Merge pull request #545 from cuda-geek:fix_lying_assertation 2013-02-25 23:11:02 +04:00
marina.kolpakova 9e5698b967 fix lying assertation and hard-coded shrinkage 2013-02-25 19:49:12 +04:00
Andrey Kamaev d586f4a103 Fix x64 build warnings 2013-02-25 15:04:19 +04:00
Andrey Kamaev 2a6fb2867e Remove all using directives for STL namespace and members
Made all STL usages explicit to be able automatically find all usages of
particular class or function.
2013-02-25 15:04:17 +04:00
Andrey Kamaev f783f34e0b Merge pull request #534 from emchristiansen:c++11 2013-02-24 23:31:12 +04:00
marina.kolpakova ef6c236655 restore missed gpu functionality after merge #dddd285d 2013-02-24 22:14:57 +04:00
Andrey Kamaev dddd285d3b Merge branch 2.4 2013-02-24 20:16:53 +04:00
Eric Christiansen a66f7cb9bc allows building with -std=c++11 under G++ 2013-02-22 13:28:20 -08:00
Markus Schoeler 5484a41960 Corrected a mistake in CHI2 kernel in line 354 and line 362 svm.cpp
Added new kernels to documentation
2013-02-22 15:43:41 +01:00
Andrey Kamaev 0b8a6da817 Merge branch '2.4' 2013-02-22 17:33:30 +04:00
alegarda 6bf7fd997a Indentation Ok 2013-02-21 15:48:23 +01:00
alegarda 62655b05f4 Indentation ok 2013-02-21 15:25:22 +01:00
alegarda cb61e91023 distCoeffs0 cols to 12 2013-02-21 10:18:55 +01:00
alegarda 8a2b50dca6 Fixed undistort.cpp 2013-02-21 10:00:28 +01:00
alegarda d3d8a782b5 Thin prism distortion model added doc
Thin prism distortion model added to the
camera_calibration_and_3d_reconstruction.rst
2013-02-20 15:25:49 +01:00
alegarda 76d03fccb9 Added Thin Prism Distortion Model
Only the code.
2013-02-20 15:11:47 +01:00
Andrey Kamaev 0ccdc5b4af Merge pull request #509 from taka-no-me:fix_docs_master 2013-02-20 15:50:47 +04:00
Andrey Kamaev 11bd936f0b Fix warnings from documentation build 2013-02-20 15:07:13 +04:00
Andrey Kamaev 9498856b22 Fix documentation problems found by check_docs2 script 2013-02-20 15:07:13 +04:00
Andrey Kamaev 637397f621 Merge branch '2.4' 2013-02-20 12:31:16 +04:00
Andrey Kamaev 262fc929aa Merge branch '2.4' 2013-02-18 15:35:42 +04:00
Andrey Kamaev ec7a7c0f7c Merge pull request #493 from pppoe:master 2013-02-16 14:23:14 +04:00
Haoxiang Li 3f86fd82f8 update: detected rectangles may be partially outside the image 2013-02-15 11:05:56 -05:00
Andrey Kamaev 4cc3dfe27c Merge pull request #482 from vpisarev:c2cpp_imgproc_part2 2013-02-14 20:13:45 +04:00
Markus Schoeler ddb0afbc44 Changed line 1266 in svm.cpp to allow the new kernels to be used 2013-02-14 15:28:10 +01:00
Vadim Pisarevsky 3c25ddd9ff restored 8u->32f cvGetQuadrangleSubPix() mode (need better test for it) 2013-02-14 18:14:55 +04:00
Vadim Pisarevsky 78402bf596 made several minor fixes as pointed out by Andrey 2013-02-14 15:36:20 +04:00
Markus Schoeler 7cab6798c0 Added two kernels to existing SVM framework
Histogram intersection kernel (accessible by using SVM::INTER in CV namespace as kernel_type)
Exponetial chi2 kernel (accessible by using SVM::CHI2 in CV namespace as kernel_type)

Formulars:
Exp-CHI2
k(x,y) = exp(-gamma * CHI2(x,y))
CHI2(x,y) = 1- 2* SUM_i[(xi-yi)²/(xi+yi)]

Intersec
k(x,y) = SUM_i[min(xi,yi)]
2013-02-14 11:30:30 +01:00
kobigurk 18a5b8dfc6 fixed tab indent 2013-02-13 14:21:34 +02:00
kobigurk 88e0127f44 API of TiffDecoder back to what it was - normalizeChannelsNumber moved to protected
test code unified - channels number is tested for other formats as well
2013-02-13 14:13:36 +02:00
kobigurk 109e047a28 * img_test is now tested for channel numbers instead of img
* fixed indentation to use spaces and trailing spaces
2013-02-13 13:33:07 +02:00
Vadim Pisarevsky 77d647b675 2 more warnings on Windows fixed 2013-02-13 02:32:10 +04:00
Vadim Pisarevsky bd063e47d7 fixed the remaining warning in houghlines 2013-02-13 01:47:17 +04:00
Vadim Pisarevsky 8f33e80515 fixed bug in the new version of cornerSubPix 2013-02-13 01:46:02 +04:00
Vadim Pisarevsky 16d825adbc fixed compile warnings and opencv_perf_imgproc failures 2013-02-13 01:23:57 +04:00
Vadim Pisarevsky 944588e732 converted houghlines to C++ 2013-02-12 23:16:06 +04:00
Vadim Pisarevsky 7f8c925319 finished distance transform; fixed warnings 2013-02-12 21:35:37 +04:00
Andrey Kamaev 956aa68fb5 Merge branch '2.4' 2013-02-12 20:30:17 +04:00
Vadim Pisarevsky 05ea571b08 almost finished distance transform conversion (discrete voronoi diagram mode is not ready yet) 2013-02-12 18:56:22 +04:00
Vadim Pisarevsky 9124a76ae7 converted moments function to C++ 2013-02-12 18:07:22 +04:00
Vadim Pisarevsky 59a5ba8938 converted watershed + pyrmeanshiftfilter to C++ 2013-02-12 17:08:42 +04:00
Andrey Kamaev b44b920997 Merge branch '2.4' 2013-02-12 16:30:18 +04:00
kobigurk 9f80c6c989 added test for 4 channel tiff 2013-02-12 11:21:51 +02:00
Vadim Pisarevsky 06f4a56469 converted flood fill, getrectsubpix & cornersubpix to C++ 2013-02-11 23:49:10 +04:00
kobigurk 7927ebf20e alpha channels support for 8-bit tiffs 2013-02-10 01:22:49 +02:00
Andrey Kamaev c527340cb6 Merge branch 2.4 2013-02-04 17:15:55 +04:00
Andrey Kamaev 4d785fff99 Merge pull request #409 from asmorkalov:giganetix_cams_patch_master 2013-02-04 14:57:14 +04:00
Andrey Kamaev 5a767863bd Merge pull request #413 from berak:master 2013-02-04 12:56:12 +04:00
marina.kolpakova 7c98735c0d add compute capability check 2013-02-03 22:44:13 +04:00
berak baf2b87a0d Update modules/contrib/include/opencv2/contrib/contrib.hpp
class LevMarqSparse is not tagged CV_EXPORTS, 
so the contrib module,  built the on win using vs won't contain that symbol,
trying to create an instance of LevMarqSparse will lead to a 'undefined symbol' err, because it did not make it into the library.
2013-02-01 21:13:55 +01:00
cuda-geek f52ce6529b Merge pull request #322 from cuda-geek:training 2013-02-01 18:45:12 +04:00
marina.kolpakova cc538ddfa6 changes related with code review 2013-02-01 17:47:05 +04:00
Alexander Smorkalov 75191e8f2f Smartek Giganetix Cameras support (Patch #2192) integrated to master. 2013-02-01 16:54:00 +04:00
Andrey Kamaev 61079547f0 Merge branch '2.4' 2013-02-01 14:59:40 +04:00
marina.kolpakova f7ac73998a code review fixes 2013-02-01 14:36:06 +04:00
marina.kolpakova 14ac8a528e final refactoring and test for training 2013-02-01 14:36:06 +04:00
marina.kolpakova d314c602d5 add documentation for new classes 2013-02-01 14:36:06 +04:00
marina.kolpakova 1613aa45bc fix python bindings 2013-02-01 14:36:06 +04:00
marina.kolpakova fa15fcc53e move feature pool to softcascade module 2013-02-01 14:36:06 +04:00
marina.kolpakova 0b039f3c6b refactor feature pool 2013-02-01 14:36:06 +04:00
marina.kolpakova b4aa33b6d3 move ICF -> ChannelFeature 2013-02-01 14:36:06 +04:00
marina.kolpakova a01f596474 update documentation for softcascade module 2013-02-01 14:36:06 +04:00
marina.kolpakova 7f80054dfd move miscellaneous python scripts to softcascade module 2013-02-01 14:36:06 +04:00
marina.kolpakova 4ba8b53152 split public interface and realization for SoftCascadeOctave 2013-02-01 14:36:06 +04:00
marina.kolpakova f3227c3f1a merged ICFPreprocessor and Channels -> ChannelFeatureBuilder 2013-02-01 14:36:06 +04:00
marina.kolpakova 49ec664238 add IntegralChannelComputer 2013-02-01 14:36:05 +04:00
marina.kolpakova 716a9ccb71 move training to softcascade module
rename Octave -> SoftCascadeOctave
2013-02-01 14:36:05 +04:00
marina.kolpakova 61441a1014 rename SCascade -> SoftCascadeDetector 2013-02-01 14:36:05 +04:00
marina.kolpakova 1b43b0e2df move soft cascade functionality into dedicated module 2013-02-01 14:36:05 +04:00
marina.kolpakova 28098b6632 refactor python 2013-02-01 14:35:29 +04:00
marina.kolpakova 8cf30c728e parse Caltech annotations 2013-02-01 14:35:29 +04:00
marina.kolpakova 1fc7134f21 add legend for ROC plot 2013-02-01 14:35:29 +04:00
marina.kolpakova faecb4f01d ROC script refactoring 2013-02-01 14:35:29 +04:00
marina.kolpakova e9232a4b67 add parameter to control range and extended range for annotations 2013-02-01 14:35:29 +04:00
marina.kolpakova decb137185 use long seeds only for 64 bit systems 2013-02-01 14:35:29 +04:00
marina.kolpakova 5f082b9876 improve ROC test script: handle ignored 2013-02-01 14:35:29 +04:00
marina.kolpakova 922de414ef refactor python ROC script and add axis ticks 2013-02-01 14:35:29 +04:00
marina.kolpakova 990ca86de6 fix spelling 2013-02-01 14:35:28 +04:00
marina.kolpakova 11f3927c58 allow multiple detectors 2013-02-01 14:35:28 +04:00
marina.kolpakova 469eeea370 add ROC estimation
in the same way as Dallar's matlab toolbox does
2013-02-01 14:35:28 +04:00
marina.kolpakova 4c4c878b1b add detection to ground truth matching
according to Piotr Dollar paper
2013-02-01 14:35:28 +04:00
marina.kolpakova d1952f28d9 add cropping and aspect ratio normalization 2013-02-01 14:35:28 +04:00
marina.kolpakova 18df46fbe9 add plotting function (matplotlib required) 2013-02-01 14:35:28 +04:00
marina.kolpakova 4622aea86a ROC test: add overlap calculation according to Pascal criteria 2013-02-01 14:35:28 +04:00
marina.kolpakova acdf5444e4 add improved softcascade detector 2013-02-01 14:35:28 +04:00
marina.kolpakova ca08101f7e caltech ROC test:
- parse idl
- replase option parser with argument parser
2013-02-01 14:35:28 +04:00
marina.kolpakova 8cd509e58e Caltech-style ROC testing script 2013-02-01 14:35:28 +04:00
marina.kolpakova b0905c67ba minor 2013-02-01 14:35:28 +04:00
marina.kolpakova 737f5efbfb filter samples 2013-02-01 14:35:28 +04:00
marina.kolpakova 8d9875cc7b add script for negatives extraction 2013-02-01 14:35:28 +04:00
marina.kolpakova c073138d6d generalize extraction method for any scale 2013-02-01 14:35:28 +04:00
marina.kolpakova 7a713a4932 collect Caltech positives for 32x64 octave:
- resized
- cropped
- flipped around the x axis
2013-02-01 14:35:28 +04:00
marina.kolpakova 56edff90ba drop deth code 2013-02-01 14:35:28 +04:00
marina.kolpakova 16aacf1780 use long seeds 2013-02-01 14:35:27 +04:00
marina.kolpakova 31687178d2 implement positive sample extraction 2013-02-01 14:35:27 +04:00
marina.kolpakova 92e50d952f caltech parsing script 2013-02-01 14:35:27 +04:00
marina.kolpakova e903ce10ce fix wartings for 32bit build 2013-02-01 14:35:27 +04:00
marina.kolpakova c0462358ca fix warnings under win 2013-02-01 14:35:27 +04:00
marina.kolpakova a28f5a89b3 move preprocessor to objdetect 2013-02-01 14:35:27 +04:00
marina.kolpakova 8672ae58e2 fix globbing under win 2013-02-01 14:34:40 +04:00
marina.kolpakova e2de3b0b81 fix build inder mac 2013-02-01 14:34:40 +04:00
marina.kolpakova dc12b4476a suppress debug out for soft cascade Octave 2013-02-01 14:34:40 +04:00
marina.kolpakova e35eebd4d4 fix android build 2013-02-01 14:34:40 +04:00
marina.kolpakova e47f58f4ce replace Mats to Input/OutputArrays for Octave's public interface 2013-02-01 14:34:40 +04:00
marina.kolpakova e7bab669fa replace cv::Mat to Input/Output arrays 2013-02-01 14:34:40 +04:00
marina.kolpakova 184ae44dea refactoring 2013-02-01 14:34:40 +04:00
marina.kolpakova a0f2203f22 raplase error output on CV_Error 2013-02-01 14:34:40 +04:00
marina.kolpakova dd8de0c41f move soft cascade octave to ml module 2013-02-01 14:34:40 +04:00
marina.kolpakova a0e93d0482 move image extraction logic from Octave to Dataset class 2013-02-01 14:34:40 +04:00
marina.kolpakova a3600b94db created abstract FeaturePool class 2013-02-01 14:34:40 +04:00
marina.kolpakova 19236b6e43 remove dead code 2013-02-01 14:34:39 +04:00
marina.kolpakova d4d47b1e58 restore backword compatibility 2013-02-01 14:34:39 +04:00
marina.kolpakova bda6f39d48 move rescaling script location 2013-02-01 14:34:39 +04:00
marina.kolpakova 2610a45a27 add file storage release 2013-02-01 14:34:39 +04:00
marina.kolpakova 23d0e36167 fix floating point precision 2013-02-01 14:34:39 +04:00
marina.kolpakova ef4b18f341 script for scaling inria dataset for multiple-octaves training 2013-02-01 14:34:39 +04:00
marina.kolpakova 4356d34542 write features to soft cascade xml 2013-02-01 14:34:39 +04:00
marina.kolpakova 1f01052955 fix inintial weighting 2013-02-01 14:34:39 +04:00
marina.kolpakova a8d0e04912 amplement weidhting according to L. Bourdev and J. Brandt paper "Robust Object Detection Via Soft Cascade" 2013-02-01 14:34:39 +04:00
marina.kolpakova c091092174 fix typo 2013-02-01 14:34:39 +04:00
marina.kolpakova c0f68ec400 add xml serialization 2013-02-01 14:34:39 +04:00
marina.kolpakova 69304611db commented debug out 2013-02-01 14:34:39 +04:00
marina.kolpakova 2e4b8d07cc integrate pruning 2013-02-01 14:34:39 +04:00
marina.kolpakova a89299acb2 store result to xml. 2013-02-01 14:34:39 +04:00
marina.kolpakova bfa26fd447 refactoring 2013-02-01 14:34:39 +04:00
marina.kolpakova 883d691c2b fix feature computing 2013-02-01 14:34:39 +04:00
marina.kolpakova 30b2a94582 load from config xml and fix integral representation 2013-02-01 14:34:39 +04:00
marina.kolpakova a2382ce6a2 add ability to store/load training configuration 2013-02-01 14:34:39 +04:00
marina.kolpakova a8c3431e61 set parameters 2013-02-01 14:34:39 +04:00
marina.kolpakova f6e3e3f049 add negatives generation 2013-02-01 14:34:39 +04:00
marina.kolpakova a388884675 Positives preprocessing 2013-02-01 14:34:38 +04:00
marina.kolpakova 4ca760d9c9 debug output information. 2013-02-01 14:34:38 +04:00
marina.kolpakova 554080d89b add file globbing 2013-02-01 14:34:38 +04:00
marina.kolpakova 86973f8ede feature pool generation:
- use random from tr1 extension
    - extend cv::Boost
2013-02-01 14:34:38 +04:00
marina.kolpakova 948365b1c8 Add new app dedicated for training soft cascades. 2013-02-01 14:34:38 +04:00
cuda-geek d874d93e24 Merge pull request #372 from cuda-geek:gpu-cascade-fixes 2013-01-31 20:13:31 +04:00
cuda-geek 6b4304efda Merge pull request #388 from ivan-korolev:fix_cmd_line_parsing_in_samples 2013-01-31 17:15:14 +04:00
Andrey Kamaev 57d3152cd0 Merge branch '2.4' 2013-01-31 14:35:27 +04:00
Ivan Korolev 36451319c1 fixed cmd line parsing in the samples 2013-01-31 12:08:43 +04:00
marina.kolpakova cb329400df fix tests 2013-01-30 15:55:04 +04:00
marina.kolpakova 8d9c9c2690 integrate new cascade format to GPU soft cascade implementation 2013-01-30 15:55:04 +04:00
Andrey Kamaev 7572b4d400 Merge branch '2.4' 2013-01-30 15:12:50 +04:00
Andrey Kamaev 78a338159d Merge branch '2.4' 2013-01-29 14:17:13 +04:00
Andrey Kamaev 013e9294f6 Merge branch '2.4' 2013-01-29 14:16:48 +04:00
Andrey Kamaev 0734d9b877 Merge branch '2.4' 2013-01-29 14:16:07 +04:00
Andrey Kamaev 9de36c5592 Merge pull request #338 from taka-no-me:ocl_warnings_master 2013-01-25 19:08:53 +04:00
Andrey Kamaev d3aef0d378 Fix OpenCL build warnings 2013-01-25 18:41:06 +04:00
Andrey Kamaev 2e02654004 Fix build of Java tests 2013-01-25 17:08:36 +04:00
Andrey Kamaev f4e27bcbbc Merge branch '2.4' 2013-01-25 16:30:36 +04:00
Andrey Kamaev 0487067964 Merge pull request #317 from vpisarev:c2cpp_refactor_imgproc 2013-01-24 13:03:34 +04:00
Vadim Pisarevsky efd00238e2 fixed warnings; restored fixed_size parameter in AutoBuffer 2013-01-23 21:47:58 +04:00
Vadim Pisarevsky dc4d0398f3 converted few more comp. geometry functions to C++ 2013-01-22 16:54:31 +04:00
cuda-geek a8a842332b Merge pull request #311 from cuda-geek:soft-cascade-refactoring-and-fixes 2013-01-22 00:27:02 +04:00
Andrey Kamaev dda337bdf2 Merge pull request #303 from taka-no-me:fix_split_merge_test 2013-01-21 14:14:17 +04:00
Vadim Pisarevsky c2241dccc5 converted fitline to C++, fixed Mat::checkVector(). 2013-01-21 01:07:47 +04:00
Vadim Pisarevsky c197a46e7e removed rarely used fixed_size parameter from AutoBuffer type, added optional AutoBuffer* but to cvarrToMat in order to speedup CvSeq->Mat conversion; finished conversion of convex hull and related functions to C++ 2013-01-20 00:58:51 +04:00
Andrey Kamaev d169f62d28 Merge pull request #307 from taka-no-me:lena.png 2013-01-19 12:02:33 +04:00
Andrey Kamaev f3f55b30b0 Merge pull request #267 from pclove1:ocl_hough 2013-01-19 12:02:14 +04:00
Vadim Pisarevsky 457fa52111 convex hull converted to C++; other 2 functions in convhull.cpp are yet to be finished. 2013-01-19 00:26:01 +04:00
marina.kolpakova e15bdea663 fix test for new cascade 2013-01-18 17:14:11 +04:00
marina.kolpakova 53433884ee fix python wrapping 2013-01-18 15:58:48 +04:00
marina.kolpakova f9649a029b fix typo 2013-01-18 15:58:47 +04:00
marina.kolpakova 0a40bbd0d0 add two types of feature boxes support:
- (left, top, width, height)
 - (left, top, right, bottom)
2013-01-18 15:58:47 +04:00
marina.kolpakova f7921b5ab3 fix soft scade xml 2013-01-18 15:58:47 +04:00
marina.kolpakova 913faf2ef4 fix test for a new test data 2013-01-18 15:58:47 +04:00
marina.kolpakova 9efd668a57 a bit refactored soft cascade 2013-01-18 15:58:47 +04:00
marina.kolpakova f1b4b13e64 perf test 2013-01-18 15:58:47 +04:00
marina.kolpakova 8fc4078429 xml for soft cascade 2013-01-18 15:58:47 +04:00
marina.kolpakova 0c6c78d149 integrate 128x256 scale; remove log 2013-01-18 15:58:47 +04:00
marina.kolpakova e09694bde8 integrated 128x256 scale 2013-01-18 15:58:47 +04:00
marina.kolpakova 3e7965a5a5 first debug integration of newly trained cascade 2013-01-18 15:58:46 +04:00
Andrey Kamaev 90ff4e6fc8 Convert test image to losless format
This fixes java tests failing with new jpeg versions
2013-01-17 20:43:57 +04:00
Andrey Kamaev dc0788c864 Merge branch 2.4 2013-01-17 18:39:20 +04:00
Vadim Pisarevsky e3941d0965 refactored approxpoly 2013-01-17 00:11:08 +04:00
Andrey Kamaev ae5661d5dc Fix random failures of Split and Merge tests 2013-01-16 17:55:27 +04:00
Andrey Kamaev 867ddebe07 Merge pull request #289 from jmbuena:master 2013-01-16 17:01:00 +04:00
Andrey Kamaev bb73332168 Merge pull request #293 from taka-no-me:libjpeg9 2013-01-16 16:08:07 +04:00
Suenghoon Park 06da75ffe0 Merge branch 'master' of git://github.com/Itseez/opencv into ocl_hough 2013-01-15 12:21:25 -05:00
Andrey Kamaev 9e3570260b Update libjpeg to "Version 9 13-Jan-2013" 2013-01-14 11:07:49 +04:00
jmbuena 28a7be69ea Fixed compile warnings on CvHomographyEstimator 2013-01-12 12:32:51 +01:00
Andrey Kamaev 084b1c7969 Merge branch 2.4 2013-01-11 15:45:23 +04:00
jmbuena 6d738f6a3f Changed RANSAC Homography estimation for speed. Each minimal set is checked for consistency before actually fit a candidate homography. 2013-01-11 01:55:56 +01:00
Vadim Pisarevsky 19229f2fa0 Merge pull request #253 from Nerei:smart_operators_for_smart_ptr 2013-01-10 20:35:22 +04:00
Andrey Kamaev a99799caa3 Merge pull request #286 from taka-no-me:tweak_phase_test_threshold 2013-01-10 19:57:23 +04:00
Andrey Kamaev 20c5a8788d Weaken acceptance criteria in phase test 2013-01-10 17:12:14 +04:00
Vadim Pisarevsky b68df415a9 Merge pull request #135 from nevion:master 2013-01-10 16:43:45 +04:00
Anatoly Baksheev a09b973c2e Smart operators for smart Ptr (feature #2637) 2013-01-07 22:33:12 +04:00
Suenghoon Park 269ccaa431 Merge branch 'master' of git://github.com/Itseez/opencv into ocl_hough 2013-01-02 14:59:59 -05:00
Andrey Kamaev 47963f0083 Merge pull request #277 from ilya-lavrenov:ResizeAreaFast 2013-01-01 21:34:17 +04:00
Ilya Lavrenov 1bc76813f3 fixed bug connected with SSE2 version of resize with AREA interpolation 2012-12-31 15:35:40 +04:00
cuda-geek 66d986478c Merge pull request #276 from cuda-geek:fix-precomps 2012-12-30 17:27:54 +04:00
marina.kolpakova e53d57664d fix precompiled headers usage in gpu module 2012-12-30 16:58:41 +04:00
Vladislav Vinogradov bb07e2710e decreased source size in NCV.VectorOperations test 2012-12-29 20:07:29 +04:00
marina.kolpakova 45191dd6a5 merge CUDA dev branch 2012-12-29 19:44:38 +04:00
Andrey Kamaev cc2110440a Merge pull request #273 from saskathex:master 2012-12-29 15:03:50 +04:00
Suenghoon Park 4f965296fc modified performance test for ocl::HoughCircles 2012-12-28 16:32:10 -05:00
saskathex eb326cdbc8 Fixed misspelled words. 2012-12-28 19:29:15 +01:00
Suenghoon Park 0afa9cede5 removed personal info from the license header 2012-12-28 10:08:28 -05:00
Andrey Kamaev 3759476b38 Merge pull request #266 from prclibo:master 2012-12-28 12:51:34 +04:00
Suenghoon Park 2124de80a5 Merge branch 'master' of git://github.com/Itseez/opencv into ocl_hough 2012-12-26 17:40:38 -05:00
Suenghoon Park 8a1d6a1bb2 added documentation for ocl::HoughCircles 2012-12-26 17:40:26 -05:00
Suenghoon Park b1faa46d3a added performance test 2012-12-26 16:49:58 -05:00
Bo Li 956a029ede added code, test and doc for five-point algorithm 2012-12-26 18:58:50 +01:00
Anatoly Baksheev b1aa7aecf0 fixed CC for CAMRA 2012-12-26 21:47:06 +04:00
Anatoly Baksheev 389ecbe96d warnings, renamed Marina's GPU_PERF_TEST_P 2012-12-25 22:00:20 +04:00
Anatoly Baksheev be22891f71 added GPU_PERF_TESTP_P but haven't switched test to it (only perf4au app) 2012-12-25 21:23:15 +04:00
Andrey Kamaev 132b5d6435 Merge release 2.4.3.2 2012-12-25 19:07:08 +04:00
Suenghoon Park 78202100df added unit test for HoughCircles 2012-12-24 22:53:27 -05:00
Suenghoon Park ecb6c20915 Merge branch 'master' of git://github.com/Itseez/opencv into ocl_hough 2012-12-24 18:42:22 -05:00
Suenghoon Park e1c6564d5e fixed a typo in ocl.hpp 2012-12-24 18:41:51 -05:00
Andrey Kamaev 13b6a3a15e Merge branch 2.4 2012-12-24 17:10:07 +04:00
marina.kolpakova 2128bd25e4 fix warnings under win 2012-12-24 15:28:05 +04:00
marina.kolpakova 15e7712a26 Merge branch from CUDA team 2012-12-24 15:08:46 +04:00
marina.kolpakova 3882bbbf35 improve carma build
- exclude system paths from library search paths
 - remove hardcoded paths to compiler
 - enable compiling with 3d-parties
 - enable build as shared libraries
2012-12-24 14:54:57 +04:00
Vladislav Vinogradov 5138b7d209 Merge branch 'master' into cuda-dev 2012-12-24 13:48:33 +04:00
Vladislav Vinogradov 4db68b50f2 fixed Sobel and Scharr tests
compare inner part
2012-12-23 14:21:16 +04:00
Andrey Kamaev c02179a765 Revert "_InputArray/_OutputArray destructors are temporary made non-virtual. Please, restore it after 2.4.3"
This reverts commit 4be7619ce4.
2012-12-22 21:14:14 +04:00
Andrey Kamaev 62af76c646 Merge pull request #249 from taka-no-me:tvl1_max_rmse 2012-12-21 23:05:44 +04:00
Andrey Kamaev 962884cdec Merge branch 2.4 2012-12-21 17:58:48 +04:00
Andrey Kamaev c513d4ecd6 Increase max RMSE error for tvl1 optical flow test 2012-12-21 14:18:07 +04:00
Vladislav Vinogradov 2f1ca1b6b3 fixed build for CARMA:
* added CMake toolchain file
* added WITH_NVCUVID flag
2012-12-21 13:45:50 +04:00
vlad 11293d071f Revert "disabled video decoding under linux"
This reverts commit 889674ef43.
2012-12-21 12:54:38 +04:00
Vladislav Vinogradov 660d23aa04 added cv::gpu::resetDevice to RunPerfTestBody 2012-12-20 15:33:04 +04:00
Vladislav Vinogradov 1a76242d99 added GPU_TEST_P macros 2012-12-20 15:33:04 +04:00
Jason Newton 4cb25e9584 update documentation to latest connected components interface 2012-12-19 14:55:46 -08:00
Vladislav Vinogradov 4ba33fa1ed Revert "call resetDevice if gpu test fails"
This reverts commit ab25fe9e37.
2012-12-19 11:13:31 +04:00
Vadim Pisarevsky 31857082f4 probably fixed build problems on Android 2012-12-18 14:12:07 -08:00
Vladislav Vinogradov 41c9377db0 fixed warnings under windows 2012-12-18 18:03:54 +04:00
Vladislav Vinogradov ab25fe9e37 call resetDevice if gpu test fails 2012-12-18 16:59:00 +04:00
Vadim Pisarevsky 3edf7c5386 Merge pull request #220 from ilya-lavrenov:SIMDFastAreaResize 2012-12-18 15:00:00 +04:00
Vladislav Vinogradov 0973e86d8a fixed printShortCudaDeviceInfo for new CC 2012-12-18 13:56:21 +04:00
Vladislav Vinogradov bac94f85c1 fixed printCudaDeviceInfo for 3.5 CC (Patch #2641) 2012-12-18 13:50:19 +04:00
Vadim Pisarevsky d3354c543e Merge pull request #229 from Nerei:master 2012-12-17 20:28:57 +04:00
Vladislav Vinogradov dd8e442bda replaced DeviceInfo().supports with deviceSupports 2012-12-17 17:03:39 +04:00
Ilya Lavrenov a319bae6e2 added #undef _mm_packus_epi32 2012-12-17 16:56:37 +04:00
Ilya Lavrenov d246b41573 changed loop condition 2012-12-17 15:50:01 +04:00
Ilya Lavrenov c2f2e33a5e removed debug messages 2012-12-17 15:45:20 +04:00
Ilya Lavrenov 743dce6a4b Merge remote-tracking branch 'upstream/master' into SIMDFastAreaResize-2 2012-12-17 15:27:32 +04:00
Ilya Lavrenov aa0dafcc1f replaced _mm_packs_epi32 to _mm_packus_epi32 2012-12-17 14:09:25 +04:00
Anatoly Baksheev 680eeecc3b fixed samples compilation 2012-12-17 13:19:26 +04:00
Vladislav Vinogradov 1a1f454241 updated gpu houghlines sample 2012-12-17 11:15:45 +04:00
Jason Newton e1b60aa4e3 drop usage of macros... the type is already there! 2012-12-16 22:44:36 -08:00
Vladislav Vinogradov da017fbeb9 fast optical flow bm implementation 2012-12-17 10:39:19 +04:00
Jason Newton 5f86eb8d63 proper dimensions from cv::Size in output stats/centroid 2012-12-16 18:33:50 -08:00
Vadim Pisarevsky 2508d8e2b4 Merge pull request #218 from taka-no-me:drop_utf16 2012-12-16 22:16:54 +04:00
Vadim Pisarevsky d6add763c7 Merge pull request #228 from Nerei:master 2012-12-16 22:15:07 +04:00
Vadim Pisarevsky 1eae455acb fixed build warnings from VS; hopefully, fixes Android build too 2012-12-15 23:14:50 +04:00
Anatoly Baksheev 94c310fc14 added Ptr::operator== 2012-12-15 22:48:50 +04:00
Vadim Pisarevsky 2a42960ff2 Merge branch 'master' of https://github.com/nevion/opencv into cc 2012-12-15 21:45:55 +04:00
Jason Newton ad0bfdfb25 disable windows build warning for connectedcomponents template argument comparisons 2012-12-15 05:56:18 -08:00
Jason Newton 68e77ac051 use opencv's integer type convension 2012-12-15 04:25:55 -08:00
cuda-geek aabb40e34d Merge pull request #217 from jet47:fix-tvl1-test 2012-12-15 00:45:12 +04:00
Andrey Kamaev fe0b88d291 Set sanity threshold for TVL1 optical flow to 0.5 2012-12-14 18:35:23 +04:00
Ilya Lavrenov 6059a6875a fixed bug with s1 calculating 2012-12-14 17:54:07 +04:00
Ilya Lavrenov 4ccb5a30d9 fixed bug with s1 calculating 2012-12-14 17:41:42 +04:00
Andrey Kamaev 1284121d89 Set sanity threshold for TVL1 optical flow to 0.02 2012-12-14 17:40:51 +04:00
Andrey Kamaev f5cd20d80b Merge branch 2.4 2012-12-14 14:46:41 +04:00
Ilya Lavrenov 16f9b6f5e4 reproducing C++ version of resize area fast 2012-12-14 14:32:00 +04:00
Suenghoon Park 13c44dd318 finished ocl::HoughCircles 2012-12-14 03:25:46 -05:00
Vladislav Vinogradov caf91ac159 new gpu::HoughLinesP implementation 2012-12-13 17:18:25 +04:00
Vladislav Vinogradov 8c057af862 fixed windows build 2012-12-13 15:40:05 +04:00
Vladislav Vinogradov da93a1dab9 fixed build for CARMA platform 2012-12-13 13:49:32 +04:00
Vladislav Vinogradov 889674ef43 disabled video decoding under linux 2012-12-13 13:48:24 +04:00
Suenghoon Park 0656f13107 removed useless comments in buildPointList_gpu() 2012-12-13 02:43:13 -05:00
Suenghoon Park 3a04cfedab added HoughCircles in ocl.hpp 2012-12-13 02:35:31 -05:00
Suenghoon Park ad86b80375 finished buildPointList 2012-12-13 02:33:21 -05:00
cuda-geek 464826c232 Merge pull request #181 from cuda-geek:nms 2012-12-12 15:39:20 +04:00
Vadim Pisarevsky eaeae4a1ba Merge pull request #184 from ilya-lavrenov:Demosaicing 2012-12-12 13:54:58 +04:00
marina.kolpakova 5ddf4e4ed7 change expected values for soft cascade test according to changes in implementation 2012-12-12 09:37:21 +04:00
marina.kolpakova 2d45af790e fix according to pull requests comments 2012-12-12 05:07:39 +04:00
marina.kolpakova 88c71d1b7d add NMS according to Dollar's paper. 2012-12-12 04:31:44 +04:00
marina.kolpakova 9785a8ae34 fix docs for SCascade 2012-12-12 04:22:01 +04:00
marina.kolpakova c470e15d45 integrate speprocessing strategy 2012-12-12 03:43:20 +04:00
marina.kolpakova d23a4f50bd add resize 2012-12-12 00:39:40 +04:00
marina.kolpakova 8ef19e7664 hack luv 2012-12-12 00:39:40 +04:00
marina.kolpakova 0e1005ca92 optimize hog bin computing 2012-12-12 00:39:40 +04:00
marina.kolpakova ee291a15da add preprocessing only function 2012-12-12 00:39:40 +04:00
Ilya Lavrenov d1ca934115 sse2 version of resize area fast for types CV_(8, 16)UC(1, 3, 4) 2012-12-11 15:14:50 +04:00
Vladislav Vinogradov 87e0eee92b fixed remap and warp gpu tests 2012-12-11 14:38:08 +04:00
Vladislav Vinogradov 746bc168e6 fixed gpu warpAffine and warpPerspective with NPP 2012-12-11 11:05:06 +04:00
marina.kolpakova a6c3ed5b36 Merge branch master into cuda-dev 2012-12-11 01:12:14 +04:00
Andrey Kamaev 67ce03d7dd Merge branch 2.4 2012-12-10 23:51:34 +04:00
Andrey Kamaev 49e038c724 Merge pull request #203 from asmorkalov/android_cam_stub
Native camera warper libraries build improvements
2012-12-10 08:07:48 -08:00
Andrey Kamaev 940cf978b1 Merge pull request #213 from qwaker00/patch-1
Update modules/ml/doc/gradient_boosted_trees.rst
2012-12-10 08:07:00 -08:00
Anatoly Baksheev 50946b59c1 minor device namespace refactor 2012-12-10 17:36:02 +04:00
Jason Newton 63debf5032 connectedcomponents test case 2012-12-10 02:21:45 -08:00
Ilya Lavrenov 615e7b2747 added SIMD optimization of Edge-Aware Demosaicing in case of CV_8U 2012-12-10 13:29:08 +04:00
Vladislav Vinogradov 53f1e73535 fixed Video_calcOpticalFlowDual_TVL1 test (Bug #2597)
uses RMSE instead of bitwise equivalence
2012-12-10 13:03:47 +04:00
Vladislav Vinogradov 5fe9bb717d fixed build under linux with OpenGL 2012-12-10 11:05:51 +04:00
Jason Newton d094e4bdbe drop support for 8bit output for size cost relative to utility 2012-12-08 23:09:17 -08:00
Jason Newton e70b3ef598 use a ltype parameter to determine result Label image type; export stats with differening types over different outputarrays 2012-12-08 23:09:14 -08:00
Jason Newton 6a4d881a78 use vector instead of non-standard stack allocation. also correct program argument borkage 2012-12-08 23:09:05 -08:00
Andrey Kamaev 18e77d606c Drop functions working with multibyte characters 2012-12-08 18:18:11 +04:00
marina.kolpakova 79c3a8e03b fix build under win. 2012-12-07 16:56:54 +04:00
Vladislav Vinogradov 4102aaaf15 fixed compilation of color.cu under windows x86
it was some bug in nvcc (it fails on this file)
2012-12-07 14:16:18 +04:00
Vladislav Vinogradov c6263eb253 fixed build with CUDA and witout OpenGL 2012-12-07 14:03:23 +04:00
Eugene Gritskevich 8ca86e2f52 Update modules/ml/doc/gradient_boosted_trees.rst 2012-12-06 21:44:55 +03:00
Vladislav Vinogradov 0d880479f0 updated nv perf test script (added opticalFlowBM and HoughLinesP) 2012-12-06 16:00:47 +04:00
Vladislav Vinogradov aad76090ce gpu::HoughLinesP 2012-12-06 15:14:20 +04:00
Vladislav Vinogradov a6dc6f72b3 gpu::calcOpticalFlowBM 2012-12-06 15:11:13 +04:00
Vladislav Vinogradov afa5809473 added additional performance tests 2012-12-05 17:21:08 +04:00
Vladislav Vinogradov e17710c478 removed type check in gpu::FarnebackOpticalFlow
now it supports all depths
2012-12-05 14:20:48 +04:00
Vladislav Vinogradov 0930ac497f removed type check in gpu::PyrLKOpticalFlow
not it support all depths
2012-12-05 14:20:18 +04:00
Vladislav Vinogradov d94f08f0e7 added more types support for gpu separable filters 2012-12-05 14:19:36 +04:00
Vladislav Vinogradov b689eca8a0 fixed OpenGL tests
now create window only once per test case
2012-12-05 14:18:57 +04:00
cuda-geek 722dedb04d Merge pull request #201 from taka-no-me:drop_unsupported_highgui 2012-12-05 12:22:38 +04:00
Vladislav Vinogradov aabc33c772 temporarily disabled reduceKeyVal implementation for kepler
used fermi implementation
2012-12-05 10:36:54 +04:00
Vladislav Vinogradov e311613fc8 fixed warnings "double not supported" 2012-12-04 10:37:13 +04:00
Vladislav Vinogradov 7ab9c4ccee fixed compilation on 1.1 CC 2012-12-04 10:36:46 +04:00
Vladislav Vinogradov 06776b612c fixed warnings 2012-12-03 13:27:20 +04:00
Alexander Smorkalov be80ad1607 Native camera warper libraries build improved
Environment variables support added to Android tree path;
Default config updated to use env variable.
2012-12-03 13:25:44 +04:00
Vladislav Vinogradov 05d842bcd8 a bit more opengl refactoring:
* added Access parameter to GlBuffer::mapHost
* added autoRelease parameter to all create methods
* fixed indentation in gl_core_3_1
* minor improvments for opengl sample
2012-12-03 13:11:06 +04:00
Ilya Lavrenov 07744ccf3d removed imshow call 2012-12-03 12:30:19 +04:00
Andrey Kamaev ae5649d3f7 Drop unsupported imageio from grfmt 2012-12-03 09:56:09 +04:00
Andrey Kamaev 00fbf58902 Revert incompletely applied patch from #2192
This reverts commit 2e7656dbdf.
2012-12-03 09:55:53 +04:00
Andrey Kamaev 476efd7d37 Drop unsupported yzx and mil camera backends 2012-12-03 09:28:01 +04:00
Andrey Kamaev e10ee89ec4 Merge branch 2.4 2012-11-30 19:54:24 +04:00
Vladislav Vinogradov 08fbf667f9 refactored opengl functionality
* removed OpenGLFuncTab, now extensions are loaded internally
* renamed GlTexture -> GlTexture2D
* added support of GlBuffer and GlTexture2D to InputArray/OutputArray
* added ELEMENT_ARRAY_BUFFER and PIXEL_PACK_BUFFER targets
* added copyFrom/copyTo method for GlBuffer and GlTexture2D
* removed GlFont
* removed pointCloudShow
* removed OpenGLCleanCallback
2012-11-30 17:35:28 +04:00
Ilya Lavrenov c09a325d3e fixed error connected with incorrect range 2012-11-30 13:26:40 +04:00
Ilya Lavrenov 98031a4147 removed const modificators 2012-11-30 12:31:33 +04:00
Vladislav Vinogradov 2eebd8d939 fixed build under windows 2012-11-29 18:40:27 +04:00
Andrey Kamaev 50bebd6f0b Merge pull request #166 from askforeric:pvapi_updates 2012-11-28 11:31:01 +04:00
askforeric 3923484341 Refactored the PvAPI capture class to better facilitate dynamic property changes
- Added Gain control
- Changed default acquisition mode to grayscale
- Fixed a signed/unsigned compare issue
- Implemented frame resizing
- Implemented automatic buffer resizing on frame resize
- Corrected camera initialization so that it attempts to put the camera in Mono8
  but does not fail if this doesn't succeed.
2012-11-28 11:28:16 +04:00
marina.kolpakova 2e0161c6c5 create objects mat if empty 2012-11-28 10:50:33 +04:00
marina.kolpakova d985861462 remove unused std imports 2012-11-28 03:51:37 +04:00
marina.kolpakova 1d97a4549d fixed compilation for GCC 4.6 2012-11-28 03:51:37 +04:00
Vladislav Vinogradov 0b2c1dc871 fixed build without CUDA 2012-11-27 18:43:17 +04:00
Vladislav Vinogradov d2591704e8 Merge branch 'kepler-optimization' into cuda-dev 2012-11-27 16:34:45 +04:00
Ilya Lavrenov b8b13ccd5c parallel version of Bayer2Gray 2012-11-27 15:27:58 +04:00
Jason Newton 00bdca7684 A few changes to comply with upstream requirements for merge.
-Change input/output order from (out Labeled, in Image) -> (in Image, Out Labeled) and convert
to Input/OutputArrays in the process.

-Adopt OutputArray for statistics export so that the algorithm is "wrapper friendly" and not requiring a new struct in
language bindings at the expense of using doubles for everything and slowing statistics computation down..
2012-11-27 02:31:38 -08:00
Ilya Lavrenov ce5e9a71b5 fixed some warnings on Windows and added debug messages 2012-11-27 13:54:11 +04:00
Ilya Lavrenov 4116cbe2c0 Merge remote-tracking branch 'upstream/master' into Demosaicing 2012-11-27 12:46:49 +04:00
Vladislav Vinogradov 2eca75ccdd added common TransformFunctorTraits for element operations 2012-11-27 11:08:53 +04:00
marina.kolpakova 22b0ea1cf0 sort for Hough sanity checks 2012-11-26 23:54:10 +04:00
marina.kolpakova 554a7cb33a add epsilon in sanity checks 2012-11-26 23:52:56 +04:00
Andrey Kamaev 61a40ddff8 Merge pull request #186 from vpisarev:doc_fixes_master 2012-11-26 22:34:42 +04:00
Vadim Pisarevsky 70c409f0e8 fixed building PDFs in master 2012-11-26 20:40:45 +04:00
Ilya Lavrenov 3fa630639f fixed bayer2bgra in case when size.width <= 2 2012-11-26 19:45:56 +04:00
marina.kolpakova 209f16455d Merge cuda-geek/soft-cascade-gpu into cuda-dev 2012-11-26 19:15:02 +04:00
marina.kolpakova 1712d0930c Merge origin/master into cuda-dev 2012-11-26 18:56:33 +04:00
marina.kolpakova 05cd88ae42 clean code; fix problems in documentation 2012-11-26 18:50:08 +04:00
marina.kolpakova bd3179bda8 fix CUDA support for streams for NMS; refactor tests 2012-11-26 17:53:25 +04:00
marina.kolpakova 60c0e41ba5 integrate NMS (Dollar's criteria) 2012-11-26 17:22:47 +04:00
Ilya Lavrenov 5225672dc0 added edge-aware demosaicing and bayer to bgra conversion 2012-11-26 16:17:43 +04:00
Vladislav Vinogradov f022b12c57 saturate_cast via asm cvt command 2012-11-26 15:36:15 +04:00
marina.kolpakova d2e88e1d4d nms: part 1 2012-11-26 15:26:11 +04:00
Vladislav Vinogradov 63a022dcd7 added explicit unroll to reduce implementation 2012-11-26 13:12:50 +04:00
Vladislav Vinogradov 11c6eb6305 element operations 2012-11-26 11:45:25 +04:00
Vladislav Vinogradov f00efcfc59 added optimized deviceSupports function 2012-11-26 11:41:52 +04:00
Vladislav Vinogradov a71ef7d67b convertTo 2012-11-26 11:37:51 +04:00
Vladislav Vinogradov 572d2d6a84 warpScanInclusive 2012-11-26 11:37:51 +04:00
Vladislav Vinogradov 76e8794e81 fixed warnings on old compute capabilities 2012-11-26 11:37:51 +04:00
Vladislav Vinogradov e6b1ccdcdf removed old reduce implementation 2012-11-26 11:37:51 +04:00
Vladislav Vinogradov e8f9762ef3 matrix reduction 2012-11-26 11:37:50 +04:00
Vladislav Vinogradov fbf3de43a2 SURF 2012-11-26 11:37:38 +04:00
Vladislav Vinogradov 19c87d1c9d ORB 2012-11-26 11:37:38 +04:00
Vladislav Vinogradov 7f97fb481c FastNonLocalMeans 2012-11-26 11:37:37 +04:00
Vladislav Vinogradov 1f1e24be3c PyrLKOpticalFlow 2012-11-26 11:37:37 +04:00
Vladislav Vinogradov 1b571bde10 StereoConstantSpaceBP 2012-11-26 11:37:37 +04:00
Vladislav Vinogradov 0e339dd137 hog 2012-11-26 11:37:37 +04:00
Vladislav Vinogradov 0ddd16cf78 calcHist & equalizeHist 2012-11-26 11:37:37 +04:00
Vladislav Vinogradov 7e57648ea2 FGDStatModel 2012-11-26 11:37:37 +04:00
Vladislav Vinogradov 28716d7f30 Canny 2012-11-26 11:37:37 +04:00
Vladislav Vinogradov e299595667 computeHypothesisScoresKernel 2012-11-26 11:37:37 +04:00
Vladislav Vinogradov 05db02fbc8 BruteForceMatcher 2012-11-26 11:37:37 +04:00
Vladislav Vinogradov 7a1874b2cc new reduce and reduceKeyVal implementation 2012-11-26 11:37:36 +04:00
Vladislav Vinogradov d47c112434 fix abs_func and minimum/maximum functors 2012-11-26 11:37:36 +04:00
marina.kolpakova 5c2d59066f Merge pull #173 request from cuda-geek/fix-sc-arm 2012-11-23 14:22:04 +04:00
Jason Newton d5aa679d3f adjust output type to return int32... it should at least be unsigned but this breaks python bindings;
remove non-8bit input type support, not worth the binary size
2012-11-22 21:26:52 -08:00
marina.kolpakova 6ccd7aca4c fix tests for arm 2012-11-22 13:26:13 +04:00
Andrey Kamaev 7f542e391a Merge branch 2.4
Conflicts:
	android/service/engine/AndroidManifest.xml - use file from 2.4
	modules/contrib/src/detection_based_tracker.cpp - move #include <pthread.h> as in 2.4
	modules/java/android_test/src/org/opencv/test/OpenCVTestRunner.java - use file from 2.4
2012-11-20 19:12:00 +04:00
marina.kolpakova a9f10e5cad fixed compile without cuda 2012-11-14 20:34:17 +04:00
marina.kolpakova 0865227049 check if scaling values changed 2012-11-14 20:28:08 +04:00
marina.kolpakova c3e4a52fbe soft cascade sample 2012-11-14 20:11:18 +04:00
Andrey Kamaev 2e2d927273 Merge pull request #128 from LeonidBeynenson/fix_args_calcOpticalFlowSF 2012-11-14 17:30:06 +04:00
marina.kolpakova ee4f003e72 fixed typo 2012-11-14 14:49:38 +04:00
marina.kolpakova 781c04324e refactor: PrefixSum 2012-11-14 14:47:00 +04:00
marina.kolpakova a30bbda3bd remove hardcoded values 2012-11-14 14:36:59 +04:00
LeonidBeynenson 52a136227d Modified documentation for calcOpticalFlowSF. 2012-11-14 14:27:41 +04:00
marina.kolpakova 8acfbde68e remove debug detect at scale method 2012-11-14 14:22:12 +04:00
marina.kolpakova 72e2b8b370 remove size constraints of input frame 2012-11-14 14:00:02 +04:00
marina.kolpakova 08910e81af integrate pre-Kepler architectures 2012-11-14 12:40:44 +04:00
marina.kolpakova e3c93ad9cf Revert "Merge pull request #141 from jet47/gpu-pyrlk-fix" because this bug appears only in 2.4
This reverts commit 7e301c5c0e, reversing
changes made to b5e009eb87.
2012-11-13 23:52:18 +04:00
marina.kolpakova be40bd5c74 Merge remote-tracking branch 'cuda-geek/soft-cascade-cpu' 2012-11-13 23:37:44 +04:00
marina.kolpakova 1edab12068 fix for negative confidence 2012-11-13 23:08:19 +04:00
Andrey Kamaev 9719ea93b6 Merge branch 2.4 2012-11-13 19:54:48 +04:00
Andrey Kamaev aba5bae400 Merge pull request #147 from taka-no-me/win_warnings 2012-11-13 19:48:59 +04:00
Andrey Kamaev 0938358002 Merge pull requests #136, #142, #150, #152 from asmorkalov/new_framework_tutorial, asmorkalov/fd_package_fix, asmorkalov/java_test_fix and asmorkalov/engine_build_fix 2012-11-13 19:47:16 +04:00
Alexander Smorkalov 96e4eed018 Logcat message for disabled test cases added. 2012-11-13 11:41:08 +04:00
Alexander Smorkalov 9f5fcff3ea More common way of test case disabling implemented. 2012-11-13 10:29:49 +04:00
marina.kolpakova bd9ca48fab export to python/java 2012-11-13 02:49:35 +04:00
Alexander Smorkalov 6fb959710d Code review comments applied. 2012-11-12 18:01:56 +04:00
Alexander Smorkalov e06c5b6fd5 Code review comments applied. 2012-11-12 17:47:20 +04:00
marina.kolpakova aa92be34d6 GK107 Policy 2012-11-12 16:37:18 +04:00
Alexander Smorkalov dda2eb0f76 Libinfo build fix;
Libinfo revision formating fix;
HW dependent VersionCode for Manager implemented.
2012-11-12 12:57:09 +04:00
marina.kolpakova 580d8173e5 refactor computing of scaling factor 2012-11-12 11:54:40 +04:00
Vladislav Vinogradov afff9cf716 Optimized buffers reuse in gpu module:
ensureSizeIsEnough now doesn't reallocate memory, if buffer is small submat of big matrix
fixed createContinous according new changes
2012-11-12 10:30:35 +04:00
Vladislav Vinogradov 810829f32e speedup compilation of row_filter.cu and column_filter.cu
split them into several small files
2012-11-12 10:16:04 +04:00
Vladislav Vinogradov 29f89e8930 moved block.hpp to include folder 2012-11-12 09:51:31 +04:00
marina.kolpakova d3ac282487 GPU soft cascade documentation 2012-11-10 05:48:06 +04:00
marina.kolpakova 916967cac5 add comments to class declaration 2012-11-10 05:13:37 +04:00
marina.kolpakova 0cbf9eb22a add support for CUDA streams 2012-11-10 05:13:26 +04:00
marina.kolpakova 40600fa504 GPU version becomes algorithm 2012-11-10 05:13:19 +04:00
marina.kolpakova e6eb1b99e1 fix negative confidence bug 2012-11-10 05:13:01 +04:00
marina.kolpakova 27eb2e27db enable fast integral for Kepler 2012-11-10 05:12:48 +04:00
marina.kolpakova 9b251f8130 remove Sobel normalization 2012-11-10 05:12:38 +04:00
marina.kolpakova df392cc830 use fast integral for soft cascade 2012-11-10 05:12:27 +04:00
marina.kolpakova ac5cd48279 add DeviceInfo parameter to the soft cascade tests 2012-11-10 05:12:13 +04:00
marina.kolpakova fba62c9251 fix compilation problem after rebase 2012-11-10 05:12:01 +04:00
marina.kolpakova 2bd35c4358 add support for precomputed integrals 2012-11-10 05:11:48 +04:00
marina.kolpakova fa55d51b6a add sanity check to performance tests for soft cascade 2012-11-10 05:11:35 +04:00
marina.kolpakova ca81628a9a fix retrieval of detections count 2012-11-10 05:11:21 +04:00
marina.kolpakova 022a8b9698 fix rounding bug in Level creation 2012-11-10 05:11:11 +04:00
marina.kolpakova 2bcb8dbd83 refactor performance tests 2012-11-10 05:11:00 +04:00
marina.kolpakova f196e9fda4 add factory method for Fields structure 2012-11-10 05:10:42 +04:00
marina.kolpakova 0898c3c651 kernel policy 2012-11-10 05:10:35 +04:00
marina.kolpakova 916ba4c0ea refactor preprocessing 2012-11-10 05:10:28 +04:00
marina.kolpakova fa62e2b72f move preprocessing into separate function 2012-11-10 05:10:13 +04:00
marina.kolpakova 312a58fcec fix performance test 2012-11-10 05:10:03 +04:00
marina.kolpakova ef431f70b6 fix buggy threshold zeroing if feature has zero area 2012-11-10 05:09:45 +04:00
marina.kolpakova 0424e2c8d2 remove debug code 2012-11-10 05:09:34 +04:00
marina.kolpakova 1b9bccb856 move Level into shared memory 2012-11-10 05:09:15 +04:00
marina.kolpakova 30bce16ad6 optimize roi loads
only one thread load roi for all block
2012-11-10 05:08:56 +04:00
marina.kolpakova fdef0adf95 Corrects objects matrix in case of the absence of objects 2012-11-10 05:08:43 +04:00
marina.kolpakova 838842cc96 Add performance detection test in ROI; refactored soft cascade performance tests 2012-11-10 05:08:32 +04:00
marina.kolpakova dd595376ba Add performance test for detection in ROI; refactor soft cascade performance tests 2012-11-10 05:08:09 +04:00
marina.kolpakova eb91593c08 add roi support 2012-11-10 05:08:03 +04:00
marina.kolpakova 64d6e6a48d add getROISize 2012-11-10 05:07:55 +04:00
marina.kolpakova 672cf1f445 implement different behaviour for up- and down-scaling 2012-11-10 05:07:40 +04:00
marina.kolpakova 56c7ef06e7 integrate Kepler version 2012-11-10 05:07:26 +04:00
marina.kolpakova 7db1323f81 add test that stores detections on the specific scale 2012-11-10 05:07:09 +04:00
marina.kolpakova b52fea7fae update soft cascade interface: - add class Detection in interface, - split sync- and async- versions, - add support for detecting at the specific scale. 2012-11-10 05:06:54 +04:00
marina.kolpakova 612a258506 kepler specific version 2012-11-10 05:06:44 +04:00
marina.kolpakova 0314e0e5d7 add kind in detection representation 2012-11-10 05:06:30 +04:00
marina.kolpakova c0359ed5c5 fix test: enough size for detection matrix 2012-11-10 05:06:17 +04:00
marina.kolpakova 72b499df00 add detection storing 2012-11-10 05:06:05 +04:00
marina.kolpakova 8108bd30fe optimize memory usage 2012-11-10 05:05:43 +04:00
marina.kolpakova b83d4add2e memory optimization 2012-11-10 05:05:25 +04:00
marina.kolpakova 4d9c7c1012 preprocessing ~1.981 ms 2012-11-10 05:05:17 +04:00
marina.kolpakova 1917366528 empty cascade 2012-11-10 05:05:09 +04:00
marina.kolpakova 4881205bae refactor logs 2012-11-10 05:04:52 +04:00
marina.kolpakova dca27b4622 fix cast bug; add logging 2012-11-10 05:04:36 +04:00
marina.kolpakova e606a0d651 remove dead code 2012-11-10 05:04:20 +04:00
marina.kolpakova ba50d19341 first version of soft cascade on GPU 2012-11-10 05:03:59 +04:00
marina.kolpakova 1bf85996b3 add detections vector initialization in tests 2012-11-10 05:03:43 +04:00
marina.kolpakova 08b4e780de add shrinking kernel 2012-11-10 05:03:29 +04:00
marina.kolpakova 1cf7a46f3a fix data paths in performance test 2012-11-10 05:03:05 +04:00
marina.kolpakova 0691dc554f fix compilation 2012-11-10 05:02:52 +04:00
marina.kolpakova 5d15e4ea58 CUDA kernels interface 2012-11-10 05:02:37 +04:00
marina.kolpakova 1a52a322b5 add performance test for GPU soft cascade 2012-11-10 05:02:16 +04:00
marina.kolpakova 14a0dd8c98 fix typo in cascade loading 2012-11-10 05:02:01 +04:00
marina.kolpakova a3af5ede80 CUDA callers 2012-11-10 05:01:44 +04:00
marina.kolpakova 4aac1444ad integral channel storage are cached as a cascade's field 2012-11-10 05:01:25 +04:00
marina.kolpakova 1ab7af6995 GPU soft cascade: buffers preallocation 2012-11-10 05:01:09 +04:00
marina.kolpakova 2b7ce8b160 precompute feature response for scaling factor 2012-11-10 05:00:53 +04:00
marina.kolpakova 267d140bfe soft cascade: gpu representation 2012-11-10 05:00:33 +04:00
marina.kolpakova dd9c53497b GPU interface for soft cascade 2012-11-10 05:00:16 +04:00
marina.kolpakova d65b3e0617 fix warning in CUDA samples 2012-11-10 04:59:55 +04:00
Alexander Smorkalov baef62b4d2 Java test fix. Eclipse test execution fix. 2012-11-09 11:46:14 +04:00
Andrey Kamaev 0a4ed2bc01 Fix Windows build warnings 2012-11-09 10:10:04 +04:00
marina.kolpakova 665bf430d5 fix warnings under win 2012-11-09 00:07:32 +04:00
Vladislav Vinogradov bff818afbd fixed static build of gpu module with ffmpeg:
multiple definition of cap_ffmpeg_impl.hpp functions in gpu and highgui
2012-11-08 15:49:56 +04:00
mikle 7ef378b230 Android tutorial updated. HelloWorld sample ported on new framework. 2012-11-08 14:51:42 +04:00
marina.kolpakova 8a3e897999 min and max params become double 2012-11-08 02:34:49 +04:00
marina.kolpakova e379771c03 git warning 2012-11-08 02:34:49 +04:00
marina.kolpakova f93cffaa0d fix compilation under win 2012-11-08 02:34:49 +04:00
marina.kolpakova 1022094dc0 fix levels computing 2012-11-08 02:34:49 +04:00
marina.kolpakova f1e36043e6 clean code 2012-11-08 02:34:49 +04:00
marina.kolpakova 4656872161 fixed typo 2012-11-08 02:34:49 +04:00
marina.kolpakova 5fb9f48360 fix angle scaling 2012-11-08 02:34:49 +04:00
marina.kolpakova 31a073ca66 documentation 2012-11-08 02:34:49 +04:00
marina.kolpakova 4207552e19 add object init 2012-11-08 02:34:49 +04:00
marina.kolpakova 157ab66ab9 add ROI support 2012-11-08 02:34:49 +04:00
marina.kolpakova 6a3a723938 refactor integral channels 2012-11-08 02:34:48 +04:00
marina.kolpakova 65543c53f6 update test according to resize usage 2012-11-08 02:34:48 +04:00
marina.kolpakova 4a1c4a9862 soft cascade become Algorithm 2012-11-08 02:34:48 +04:00
Alexander Smorkalov 95b7f5c46c Face Detection sample namespace replaced on org.opencv.facedetect for consistency with Google Play. 2012-11-07 13:27:33 +04:00
NikoKJ 95869a6081 fix the compilation bug of main.cpp in perf test and accuracy test on ocl module. It caused by the incompatibility of command line parser class in core.hpp between master branch and 2.4 branch. 2012-11-07 13:49:09 +08:00
marina.kolpakova ff8417db00 remove input frame size constraints 2012-11-07 03:19:07 +04:00
marina.kolpakova 3cb9afb4e7 test update because changed Sobel Normalization 2012-11-07 03:19:07 +04:00
marina.kolpakova a84334cfc2 brief soft cascade interface description 2012-11-07 03:19:07 +04:00
marina.kolpakova 2e8ed77383 get rid of hard-coded values 2012-11-07 03:19:07 +04:00
marina.kolpakova 16dd09ccfc move scale related parameters to SoftCascade constructor 2012-11-07 03:19:07 +04:00
marina.kolpakova 017d970b9a load SoftCascade from FileStorage 2012-11-07 03:19:06 +04:00
marina.kolpakova a22ee13620 rename markDetection to addDetection 2012-11-07 03:19:06 +04:00
marina.kolpakova 40c0c60e2b remove unused struct 2012-11-07 03:19:06 +04:00
marina.kolpakova 7b6da394f0 rename Stage to Weak because there is no such term for Soft Cascades 2012-11-07 03:19:06 +04:00
marina.kolpakova 2d0fc80c95 use IntegralChannels class 2012-11-07 03:19:06 +04:00
marina.kolpakova 3d41846c39 move frame processing into separate class 2012-11-07 03:19:06 +04:00
marina.kolpakova 5651743784 remove debug imshow from code 2012-11-07 03:19:06 +04:00
marina.kolpakova 8e092f8b5d add Detection struct to interface 2012-11-07 03:19:06 +04:00
marina.kolpakova 754fd7311b improve pointer usage 2012-11-07 03:19:06 +04:00
marina.kolpakova 2914f24521 improve cpu version of SoftCascade:
- remove division
 - remove cvRound
 - cache feature area
2012-11-07 03:19:06 +04:00
marina.kolpakova 2d2c46e717 add const qualifier to detectMultiScale method 2012-11-07 03:19:06 +04:00
marina.kolpakova 9771c3c7ec remove Mat copying 2012-11-07 03:19:05 +04:00
marina.kolpakova 0ff8a4633d remove pow calculations 2012-11-07 03:19:05 +04:00
marina.kolpakova cc300a69b1 add perfomance test for CPU soft cascade 2012-11-07 03:19:05 +04:00
marina.kolpakova 26af7d7389 refactor logs 2012-11-07 03:19:05 +04:00
marina.kolpakova b6081438fa clean code 2012-11-07 03:19:05 +04:00
marina.kolpakova 296aa8854c fix hog channels 2012-11-07 03:19:05 +04:00
marina.kolpakova efd2615844 fix floating point bug 2012-11-07 03:19:05 +04:00
marina.kolpakova 765dea9ddf fix bugs in the soft cascade detect method; add options for debug logging
- WITH_DEBUG_OUT for logging cascade scales
- DEBUG_STORE_IMAGES for xml matrix serialization
- DEBUG_SHOW_RESULT to see detection result
2012-11-07 03:19:05 +04:00
marina.kolpakova ba27d89173 add feature rescaling according to Dollal's paper FPDW 2012-11-07 03:19:05 +04:00
marina.kolpakova 8d90b973b0 add detectAt to soft cascade 2012-11-07 03:19:05 +04:00
marina.kolpakova 801368ee82 refactoring 2012-11-07 03:19:05 +04:00
marina.kolpakova 6f53be4102 shrinking before integral calculation 2012-11-07 03:19:04 +04:00
marina.kolpakova dc74ce20ab OpenCV friendly xml format for soft cascade 2012-11-07 03:19:04 +04:00
marina.kolpakova c04725b681 add apply cascade method 2012-11-07 03:19:04 +04:00
marina.kolpakova 695827050f Integral images for ICF 2012-11-07 03:19:04 +04:00
marina.kolpakova b0b85f36f6 add test for soft cascade detect method 2012-11-07 03:19:04 +04:00
marina.kolpakova f01c5d9033 compute scales pyramid 2012-11-07 03:19:04 +04:00
marina.kolpakova a54d456ad0 parse soft cascade from xml 2012-11-07 03:19:04 +04:00
marina.kolpakova fe2c38be80 add method to fill soft cascade 2012-11-07 03:19:04 +04:00
marina.kolpakova 7290d8576d add ICF feature 2012-11-07 03:19:04 +04:00
marina.kolpakova fb113e5ce4 scale pyramid calculations 2012-11-07 03:19:04 +04:00
marina.kolpakova cd301e530f minor in train application 2012-11-07 03:19:04 +04:00
marina.kolpakova 9966d7feba add structures for cascade representation 2012-11-07 03:19:04 +04:00
marina.kolpakova 108fd169f7 dummy soft cascade 2012-11-07 03:19:03 +04:00
Jason Newton 85880397c4 connectedcomponents: use opencv integral types, add to docs, fix up things for a python export 2012-11-05 12:02:53 -08:00
Jason Newton 4c0cb2576d connectedComponents: peep-hole optimizations, mostly surrouding the fact that cv::Mat::at is expensive in a tight-loop -also added a "blobstats" version 2012-11-05 08:10:35 -08:00
Jason Newton 45b4f4f32b connectedComponents: warning free version 2012-11-05 08:10:29 -08:00
Vladislav Vinogradov beb377b38c gpu implementation of Dual TV-L1 Optical Flow 2012-11-02 19:51:43 +04:00
Andrey Kamaev 4d059e9e5b Merge release 2.4.3 2012-11-02 17:58:02 +04:00
LeonidBeynenson 02646427fb Fixed arguments of the function calcOpticalFlowSF. 2012-11-01 19:31:45 +04:00
Andrey Kamaev 66b90d19a6 Merge pull request #81 from stephenfox/master 2012-10-31 16:59:45 +04:00
Andrey Kamaev 468eefe0ce Merge branch '2.4' 2012-10-30 15:10:17 +04:00
marina.kolpakova 0f65dacb8b Merge pull request #104 from AoD314:master 2012-10-29 15:12:52 +04:00
marina.kolpakova e55b2f7d60 Merge pull request #99 from jet47:tvl1-opt-flow 2012-10-29 15:00:40 +04:00
alexandre benoit a0c92265db minor updates for doc redirections and tutorial images size 2012-10-28 18:52:04 +01:00
alexandre benoit 4e58fd645c minor update 2012-10-28 18:34:48 +01:00
alexandre benoit 02666567b0 updated first image sample 2012-10-28 10:57:03 +01:00
morozov.andrey e0cfc0ccf5 fixed bug with incorrect syntax in CommandLineParser 2012-10-26 19:46:17 +04:00
Andrey Kamaev 729d76ad09 Merge branch '2.4' 2012-10-25 15:32:48 +04:00
Vladislav Vinogradov 8db5b7d7d4 fixed warnings under Windows 2012-10-25 13:28:30 +04:00
Vladislav Vinogradov 0ad849d2fd Dual TV-L1 optical flow implementation 2012-10-25 11:25:35 +04:00
marina.kolpakova 772586801b Merge pull request #87 from jet47:cmd-parser-fix 2012-10-25 00:40:50 +04:00
Andrey Kamaev 6211f156e6 Merge 2.4.3-rc 2012-10-24 19:56:27 +04:00
alexandre benoit b5bd86b2a7 added retina code tutorial 2012-10-24 12:20:59 +02:00
alexandre benoit 4c5bcd80de updated tutorial, rapid spell check, retina parameters discussion added 2012-10-24 12:04:32 +02:00
alexandre benoit 90d10e6b73 updated tutorial, need spell check, validation, nicer images and a discussion on parameters 2012-10-23 18:57:39 +02:00
Andrey Kamaev f14a711bda Merge pull request #85 from Nerei/master 2012-10-23 20:47:56 +04:00
Andrey Kamaev 91f47d2779 Merge branch '2.4'
Conflicts:
	modules/core/include/opencv2/core/version.hpp
2012-10-23 20:39:02 +04:00
Andrey Kamaev 8dbde3297e Merge branch '2.4' 2012-10-23 20:32:19 +04:00
Vladislav Vinogradov 26f9534544 fixed string->string conversion 2012-10-23 15:24:21 +04:00
Anatoly Baksheev d681717702 warnings 2012-10-23 15:13:46 +04:00
Anatoly Baksheev 275ab53ebc Added default Eigen search path to support Eigen that comes with PCL 2012-10-23 15:12:39 +04:00
OpenCV Buildbot 1cb21d292b update FFMPEG wrapper binaries 2012-10-23 13:17:43 +04:00
Stephen Fox 9f8ce906f4 fix to documentation regarding CV_CAP_OPENNI_* in high gui userguide
fix comments to accurate match CV_CAP_OPENNI_* vs. wrong OPENNI_*
2012-10-22 23:18:46 -05:00
Andrey Kamaev 57775988e7 Merge branch '2.4' 2012-10-22 16:57:56 +04:00
Andrey Kamaev ef6a6cfb40 Merge pull request #69 from mdim/core_tests 2012-10-22 16:47:49 +04:00
alexandre benoit 6e63073c6c adding retina tutorial 2012-10-22 13:51:55 +02:00
alexandre benoit 0d3fb3cef3 introducing a tutorial for the retina model 2012-10-22 13:36:30 +02:00
Maria Dimashova 78dd1893bb added tests for cv::merge, cv::split, cv::phase 2012-10-21 12:22:39 +04:00
Andrey Kamaev d9ffe5e7c4 Merge branch '2.4' 2012-10-19 15:07:12 +04:00
Andrey Kamaev cb66dd8000 Normalize android/scripts/wincfg.cmd.tmpl 2012-10-19 15:06:32 +04:00
Andrey Kamaev e8dd73798c Merge pull request #59 from taka-no-me:doc/fix-signatures-master 2012-10-19 15:03:26 +04:00
Andrey Kamaev 5bc104cef5 Merge branch '2.4' 2012-10-19 15:00:05 +04:00
Andrey Kamaev 73bbabf207 Eliminate discrepancies between signatures in documentation and OpenCV headers
All errors were found by doc/check_docs2.py
2012-10-18 13:03:12 +04:00
Andrey Kamaev 0e7ca71dcc Normalize whitespace in documentation and text files 2012-10-17 21:42:09 +04:00
Andrey Kamaev 9337246867 Merge branch '2.4' 2012-10-17 16:18:08 +04:00
OpenCV Buildbot 81f826db2b Normalize line endings and whitespace 2012-10-17 15:57:49 +04:00
Andrey Kamaev 0442bca235 Revert "partially recovered binary compatibility (ticket #2415)"
This reverts commit 94b97b7a63.
2012-10-16 19:37:12 +04:00
Andrey Kamaev 075372a71c Revert "fixed compilation error because of DetectionBasedTracker"
This reverts commit 9b8c47399a.
2012-10-16 19:37:02 +04:00
Andrey Kamaev e7b81688a4 Revert "yet another portion of changes towards the binary compatibility"
This reverts commit 618fbf5508.
2012-10-16 19:35:57 +04:00
Andrey Kamaev 18ab16dbd3 Revert "some more fixes towards binary compatibility"
This reverts commit a8c5e35619.

Conflicts:
	modules/imgproc/src/imgwarp.cpp
2012-10-16 19:35:28 +04:00
3766 changed files with 790999 additions and 1045662 deletions
+1
View File
@@ -23,6 +23,7 @@
*.idl text
*.java text
*.js text
*.m text
*.mk text
*.mm text
*.plist text
+2
View File
@@ -1,8 +1,10 @@
*.autosave
*.pyc
*.user
*~
.*.swp
.DS_Store
.sw[a-z]
Thumbs.db
tags
tegra/
+2
View File
@@ -0,0 +1,2 @@
[tgit]
icon = doc/opencv.ico
+1 -1
View File
@@ -210,7 +210,7 @@
#include <string>
#endif
#if defined(linux) || defined(__APPLE__) || defined(__MACOSX)
#if defined(__linux__) || defined(__APPLE__) || defined(__MACOSX)
#include <alloca.h>
#include <emmintrin.h>
+7 -7
View File
@@ -332,13 +332,13 @@ typedef unsigned int cl_GLenum;
/* Define basic vector types */
#if defined( __VEC__ )
#include <altivec.h> /* may be omitted depending on compiler. AltiVec spec provides no way to detect whether the header is required. */
typedef vector unsigned char __cl_uchar16;
typedef vector signed char __cl_char16;
typedef vector unsigned short __cl_ushort8;
typedef vector signed short __cl_short8;
typedef vector unsigned int __cl_uint4;
typedef vector signed int __cl_int4;
typedef vector float __cl_float4;
typedef __vector unsigned char __cl_uchar16;
typedef __vector signed char __cl_char16;
typedef __vector unsigned short __cl_ushort8;
typedef __vector signed short __cl_short8;
typedef __vector unsigned int __cl_uint4;
typedef __vector signed int __cl_int4;
typedef __vector float __cl_float4;
#define __CL_UCHAR16__ 1
#define __CL_CHAR16__ 1
#define __CL_USHORT8__ 1
+2
View File
@@ -0,0 +1,2 @@
downloads/
unpack/
+108
View File
@@ -0,0 +1,108 @@
#
# The script downloads ICV package
#
# On return this will define:
# OPENCV_ICV_PATH - path to unpacked downloaded package
#
function(_icv_downloader)
# Define actual ICV versions
if(APPLE)
set(OPENCV_ICV_PACKAGE_NAME "ippicv_macosx_20141027.tgz")
set(OPENCV_ICV_PACKAGE_HASH "9662fe0694a67e59491a0dcc82fa26e0")
set(OPENCV_ICV_PLATFORM "macosx")
set(OPENCV_ICV_PACKAGE_SUBDIR "/ippicv_osx")
elseif(UNIX)
if(ANDROID AND (NOT ANDROID_ABI STREQUAL x86))
return()
endif()
set(OPENCV_ICV_PACKAGE_NAME "ippicv_linux_20141027.tgz")
set(OPENCV_ICV_PACKAGE_HASH "8b449a536a2157bcad08a2b9f266828b")
set(OPENCV_ICV_PLATFORM "linux")
set(OPENCV_ICV_PACKAGE_SUBDIR "/ippicv_lnx")
elseif(WIN32 AND NOT ARM)
set(OPENCV_ICV_PACKAGE_NAME "ippicv_windows_20141027.zip")
set(OPENCV_ICV_PACKAGE_HASH "b59f865d1ba16e8c84124e19d78eec57")
set(OPENCV_ICV_PLATFORM "windows")
set(OPENCV_ICV_PACKAGE_SUBDIR "/ippicv_win")
else()
return() # Not supported
endif()
set(OPENCV_ICV_UNPACK_PATH "${CMAKE_CURRENT_LIST_DIR}/unpack")
set(OPENCV_ICV_PATH "${OPENCV_ICV_UNPACK_PATH}${OPENCV_ICV_PACKAGE_SUBDIR}")
if(DEFINED OPENCV_ICV_PACKAGE_DOWNLOADED
AND OPENCV_ICV_PACKAGE_DOWNLOADED STREQUAL OPENCV_ICV_PACKAGE_HASH
AND EXISTS ${OPENCV_ICV_PATH})
# Package has been downloaded and checked by the previous build
set(OPENCV_ICV_PATH "${OPENCV_ICV_PATH}" PARENT_SCOPE)
return()
else()
if(EXISTS ${OPENCV_ICV_UNPACK_PATH})
message(STATUS "ICV: Removing previous unpacked package: ${OPENCV_ICV_UNPACK_PATH}")
file(REMOVE_RECURSE ${OPENCV_ICV_UNPACK_PATH})
endif()
endif()
unset(OPENCV_ICV_PACKAGE_DOWNLOADED CACHE)
set(OPENCV_ICV_PACKAGE_ARCHIVE "${CMAKE_CURRENT_LIST_DIR}/downloads/${OPENCV_ICV_PLATFORM}-${OPENCV_ICV_PACKAGE_HASH}/${OPENCV_ICV_PACKAGE_NAME}")
get_filename_component(OPENCV_ICV_PACKAGE_ARCHIVE_DIR "${OPENCV_ICV_PACKAGE_ARCHIVE}" PATH)
if(EXISTS "${OPENCV_ICV_PACKAGE_ARCHIVE}")
file(MD5 "${OPENCV_ICV_PACKAGE_ARCHIVE}" archive_md5)
if(NOT archive_md5 STREQUAL OPENCV_ICV_PACKAGE_HASH)
message(WARNING "ICV: Local copy of ICV package has invalid MD5 hash: ${archive_md5} (expected: ${OPENCV_ICV_PACKAGE_HASH})")
file(REMOVE "${OPENCV_ICV_PACKAGE_ARCHIVE}")
file(REMOVE_RECURSE "${OPENCV_ICV_PACKAGE_ARCHIVE_DIR}")
endif()
endif()
if(NOT EXISTS "${OPENCV_ICV_PACKAGE_ARCHIVE}")
if(NOT DEFINED OPENCV_ICV_URL)
if(DEFINED ENV{OPENCV_ICV_URL})
set(OPENCV_ICV_URL $ENV{OPENCV_ICV_URL})
else()
set(OPENCV_ICV_URL "http://sourceforge.net/projects/opencvlibrary/files/3rdparty/ippicv")
endif()
endif()
file(MAKE_DIRECTORY ${OPENCV_ICV_PACKAGE_ARCHIVE_DIR})
message(STATUS "ICV: Downloading ${OPENCV_ICV_PACKAGE_NAME}...")
file(DOWNLOAD "${OPENCV_ICV_URL}/${OPENCV_ICV_PACKAGE_NAME}" "${OPENCV_ICV_PACKAGE_ARCHIVE}"
TIMEOUT 600 STATUS __status
EXPECTED_MD5 ${OPENCV_ICV_PACKAGE_HASH})
if(NOT __status EQUAL 0)
message(FATAL_ERROR "ICV: Failed to download ICV package: ${OPENCV_ICV_PACKAGE_NAME}. Status=${__status}")
else()
# Don't remove this code, because EXPECTED_MD5 parameter doesn't fail "file(DOWNLOAD)" step
# on wrong hash
file(MD5 "${OPENCV_ICV_PACKAGE_ARCHIVE}" archive_md5)
if(NOT archive_md5 STREQUAL OPENCV_ICV_PACKAGE_HASH)
message(FATAL_ERROR "ICV: Downloaded copy of ICV package has invalid MD5 hash: ${archive_md5} (expected: ${OPENCV_ICV_PACKAGE_HASH})")
endif()
endif()
endif()
ocv_assert(EXISTS "${OPENCV_ICV_PACKAGE_ARCHIVE}")
ocv_assert(NOT EXISTS "${OPENCV_ICV_UNPACK_PATH}")
file(MAKE_DIRECTORY ${OPENCV_ICV_UNPACK_PATH})
ocv_assert(EXISTS "${OPENCV_ICV_UNPACK_PATH}")
message(STATUS "ICV: Unpacking ${OPENCV_ICV_PACKAGE_NAME} to ${OPENCV_ICV_UNPACK_PATH}...")
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xz "${OPENCV_ICV_PACKAGE_ARCHIVE}"
WORKING_DIRECTORY "${OPENCV_ICV_UNPACK_PATH}"
RESULT_VARIABLE __result)
if(NOT __result EQUAL 0)
message(FATAL_ERROR "ICV: Failed to unpack ICV package from ${OPENCV_ICV_PACKAGE_ARCHIVE} to ${OPENCV_ICV_UNPACK_PATH} with error ${__result}")
endif()
ocv_assert(EXISTS "${OPENCV_ICV_PATH}")
set(OPENCV_ICV_PACKAGE_DOWNLOADED "${OPENCV_ICV_PACKAGE_HASH}" CACHE INTERNAL "ICV package hash")
message(STATUS "ICV: Package successfully downloaded")
set(OPENCV_ICV_PATH "${OPENCV_ICV_PATH}" PARENT_SCOPE)
endfunction()
_icv_downloader()
+33
View File
@@ -0,0 +1,33 @@
Jinja is written and maintained by the Jinja Team and various
contributors:
Lead Developer:
- Armin Ronacher <armin.ronacher@active-4.com>
Developers:
- Christoph Hack
- Georg Brandl
Contributors:
- Bryan McLemore
- Mickaël Guérin <kael@crocobox.org>
- Cameron Knight
- Lawrence Journal-World.
- David Cramer
Patches and suggestions:
- Ronny Pfannschmidt
- Axel Böhm
- Alexey Melchakov
- Bryan McLemore
- Clovis Fabricio (nosklo)
- Cameron Knight
- Peter van Dijk (Habbie)
- Stefan Ebner
- Rene Leonhardt
- Thomas Waldmann
- Cory Benfield (Lukasa)
+31
View File
@@ -0,0 +1,31 @@
Copyright (c) 2009 by the Jinja Team, see AUTHORS for more details.
Some 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.
* The names of the contributors may not 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.
+69
View File
@@ -0,0 +1,69 @@
# -*- coding: utf-8 -*-
"""
jinja2
~~~~~~
Jinja2 is a template engine written in pure Python. It provides a
Django inspired non-XML syntax but supports inline expressions and
an optional sandboxed environment.
Nutshell
--------
Here a small example of a Jinja2 template::
{% extends 'base.html' %}
{% block title %}Memberlist{% endblock %}
{% block content %}
<ul>
{% for user in users %}
<li><a href="{{ user.url }}">{{ user.username }}</a></li>
{% endfor %}
</ul>
{% endblock %}
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
__docformat__ = 'restructuredtext en'
__version__ = '2.7.1'
# high level interface
from jinja2.environment import Environment, Template
# loaders
from jinja2.loaders import BaseLoader, FileSystemLoader, PackageLoader, \
DictLoader, FunctionLoader, PrefixLoader, ChoiceLoader, \
ModuleLoader
# bytecode caches
from jinja2.bccache import BytecodeCache, FileSystemBytecodeCache, \
MemcachedBytecodeCache
# undefined types
from jinja2.runtime import Undefined, DebugUndefined, StrictUndefined
# exceptions
from jinja2.exceptions import TemplateError, UndefinedError, \
TemplateNotFound, TemplatesNotFound, TemplateSyntaxError, \
TemplateAssertionError
# decorators and public utilities
from jinja2.filters import environmentfilter, contextfilter, \
evalcontextfilter
from jinja2.utils import Markup, escape, clear_caches, \
environmentfunction, evalcontextfunction, contextfunction, \
is_undefined
__all__ = [
'Environment', 'Template', 'BaseLoader', 'FileSystemLoader',
'PackageLoader', 'DictLoader', 'FunctionLoader', 'PrefixLoader',
'ChoiceLoader', 'BytecodeCache', 'FileSystemBytecodeCache',
'MemcachedBytecodeCache', 'Undefined', 'DebugUndefined',
'StrictUndefined', 'TemplateError', 'UndefinedError', 'TemplateNotFound',
'TemplatesNotFound', 'TemplateSyntaxError', 'TemplateAssertionError',
'ModuleLoader', 'environmentfilter', 'contextfilter', 'Markup', 'escape',
'environmentfunction', 'contextfunction', 'clear_caches', 'is_undefined',
'evalcontextfilter', 'evalcontextfunction'
]
+150
View File
@@ -0,0 +1,150 @@
# -*- coding: utf-8 -*-
"""
jinja2._compat
~~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: Copyright 2013 by the Jinja team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
PY2 = sys.version_info[0] == 2
PYPY = hasattr(sys, 'pypy_translation_info')
_identity = lambda x: x
if not PY2:
unichr = chr
range_type = range
text_type = str
string_types = (str,)
iterkeys = lambda d: iter(d.keys())
itervalues = lambda d: iter(d.values())
iteritems = lambda d: iter(d.items())
import pickle
from io import BytesIO, StringIO
NativeStringIO = StringIO
def reraise(tp, value, tb=None):
if value.__traceback__ is not tb:
raise value.with_traceback(tb)
raise value
ifilter = filter
imap = map
izip = zip
intern = sys.intern
implements_iterator = _identity
implements_to_string = _identity
encode_filename = _identity
get_next = lambda x: x.__next__
else:
unichr = unichr
text_type = unicode
range_type = xrange
string_types = (str, unicode)
iterkeys = lambda d: d.iterkeys()
itervalues = lambda d: d.itervalues()
iteritems = lambda d: d.iteritems()
import cPickle as pickle
from cStringIO import StringIO as BytesIO, StringIO
NativeStringIO = BytesIO
exec('def reraise(tp, value, tb=None):\n raise tp, value, tb')
from itertools import imap, izip, ifilter
intern = intern
def implements_iterator(cls):
cls.next = cls.__next__
del cls.__next__
return cls
def implements_to_string(cls):
cls.__unicode__ = cls.__str__
cls.__str__ = lambda x: x.__unicode__().encode('utf-8')
return cls
get_next = lambda x: x.next
def encode_filename(filename):
if isinstance(filename, unicode):
return filename.encode('utf-8')
return filename
try:
next = next
except NameError:
def next(it):
return it.next()
def with_metaclass(meta, *bases):
# This requires a bit of explanation: the basic idea is to make a
# dummy metaclass for one level of class instanciation that replaces
# itself with the actual metaclass. Because of internal type checks
# we also need to make sure that we downgrade the custom metaclass
# for one level to something closer to type (that's why __call__ and
# __init__ comes back from type etc.).
#
# This has the advantage over six.with_metaclass in that it does not
# introduce dummy classes into the final MRO.
class metaclass(meta):
__call__ = type.__call__
__init__ = type.__init__
def __new__(cls, name, this_bases, d):
if this_bases is None:
return type.__new__(cls, name, (), d)
return meta(name, bases, d)
return metaclass('temporary_class', None, {})
try:
from collections import Mapping as mapping_types
except ImportError:
import UserDict
mapping_types = (UserDict.UserDict, UserDict.DictMixin, dict)
# common types. These do exist in the special types module too which however
# does not exist in IronPython out of the box. Also that way we don't have
# to deal with implementation specific stuff here
class _C(object):
def method(self): pass
def _func():
yield None
function_type = type(_func)
generator_type = type(_func())
method_type = type(_C().method)
code_type = type(_C.method.__code__)
try:
raise TypeError()
except TypeError:
_tb = sys.exc_info()[2]
traceback_type = type(_tb)
frame_type = type(_tb.tb_frame)
try:
from urllib.parse import quote_from_bytes as url_quote
except ImportError:
from urllib import quote as url_quote
try:
from thread import allocate_lock
except ImportError:
try:
from threading import Lock as allocate_lock
except ImportError:
from dummy_thread import allocate_lock
+132
View File
File diff suppressed because one or more lines are too long
+311
View File
@@ -0,0 +1,311 @@
# -*- coding: utf-8 -*-
"""
jinja2.bccache
~~~~~~~~~~~~~~
This module implements the bytecode cache system Jinja is optionally
using. This is useful if you have very complex template situations and
the compiliation of all those templates slow down your application too
much.
Situations where this is useful are often forking web applications that
are initialized on the first request.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from os import path, listdir
import sys
import marshal
import tempfile
import fnmatch
from hashlib import sha1
from jinja2.utils import open_if_exists
from jinja2._compat import BytesIO, pickle, PY2, text_type
# marshal works better on 3.x, one hack less required
if not PY2:
marshal_dump = marshal.dump
marshal_load = marshal.load
else:
def marshal_dump(code, f):
if isinstance(f, file):
marshal.dump(code, f)
else:
f.write(marshal.dumps(code))
def marshal_load(f):
if isinstance(f, file):
return marshal.load(f)
return marshal.loads(f.read())
bc_version = 2
# magic version used to only change with new jinja versions. With 2.6
# we change this to also take Python version changes into account. The
# reason for this is that Python tends to segfault if fed earlier bytecode
# versions because someone thought it would be a good idea to reuse opcodes
# or make Python incompatible with earlier versions.
bc_magic = 'j2'.encode('ascii') + \
pickle.dumps(bc_version, 2) + \
pickle.dumps((sys.version_info[0] << 24) | sys.version_info[1])
class Bucket(object):
"""Buckets are used to store the bytecode for one template. It's created
and initialized by the bytecode cache and passed to the loading functions.
The buckets get an internal checksum from the cache assigned and use this
to automatically reject outdated cache material. Individual bytecode
cache subclasses don't have to care about cache invalidation.
"""
def __init__(self, environment, key, checksum):
self.environment = environment
self.key = key
self.checksum = checksum
self.reset()
def reset(self):
"""Resets the bucket (unloads the bytecode)."""
self.code = None
def load_bytecode(self, f):
"""Loads bytecode from a file or file like object."""
# make sure the magic header is correct
magic = f.read(len(bc_magic))
if magic != bc_magic:
self.reset()
return
# the source code of the file changed, we need to reload
checksum = pickle.load(f)
if self.checksum != checksum:
self.reset()
return
self.code = marshal_load(f)
def write_bytecode(self, f):
"""Dump the bytecode into the file or file like object passed."""
if self.code is None:
raise TypeError('can\'t write empty bucket')
f.write(bc_magic)
pickle.dump(self.checksum, f, 2)
marshal_dump(self.code, f)
def bytecode_from_string(self, string):
"""Load bytecode from a string."""
self.load_bytecode(BytesIO(string))
def bytecode_to_string(self):
"""Return the bytecode as string."""
out = BytesIO()
self.write_bytecode(out)
return out.getvalue()
class BytecodeCache(object):
"""To implement your own bytecode cache you have to subclass this class
and override :meth:`load_bytecode` and :meth:`dump_bytecode`. Both of
these methods are passed a :class:`~jinja2.bccache.Bucket`.
A very basic bytecode cache that saves the bytecode on the file system::
from os import path
class MyCache(BytecodeCache):
def __init__(self, directory):
self.directory = directory
def load_bytecode(self, bucket):
filename = path.join(self.directory, bucket.key)
if path.exists(filename):
with open(filename, 'rb') as f:
bucket.load_bytecode(f)
def dump_bytecode(self, bucket):
filename = path.join(self.directory, bucket.key)
with open(filename, 'wb') as f:
bucket.write_bytecode(f)
A more advanced version of a filesystem based bytecode cache is part of
Jinja2.
"""
def load_bytecode(self, bucket):
"""Subclasses have to override this method to load bytecode into a
bucket. If they are not able to find code in the cache for the
bucket, it must not do anything.
"""
raise NotImplementedError()
def dump_bytecode(self, bucket):
"""Subclasses have to override this method to write the bytecode
from a bucket back to the cache. If it unable to do so it must not
fail silently but raise an exception.
"""
raise NotImplementedError()
def clear(self):
"""Clears the cache. This method is not used by Jinja2 but should be
implemented to allow applications to clear the bytecode cache used
by a particular environment.
"""
def get_cache_key(self, name, filename=None):
"""Returns the unique hash key for this template name."""
hash = sha1(name.encode('utf-8'))
if filename is not None:
filename = '|' + filename
if isinstance(filename, text_type):
filename = filename.encode('utf-8')
hash.update(filename)
return hash.hexdigest()
def get_source_checksum(self, source):
"""Returns a checksum for the source."""
return sha1(source.encode('utf-8')).hexdigest()
def get_bucket(self, environment, name, filename, source):
"""Return a cache bucket for the given template. All arguments are
mandatory but filename may be `None`.
"""
key = self.get_cache_key(name, filename)
checksum = self.get_source_checksum(source)
bucket = Bucket(environment, key, checksum)
self.load_bytecode(bucket)
return bucket
def set_bucket(self, bucket):
"""Put the bucket into the cache."""
self.dump_bytecode(bucket)
class FileSystemBytecodeCache(BytecodeCache):
"""A bytecode cache that stores bytecode on the filesystem. It accepts
two arguments: The directory where the cache items are stored and a
pattern string that is used to build the filename.
If no directory is specified the system temporary items folder is used.
The pattern can be used to have multiple separate caches operate on the
same directory. The default pattern is ``'__jinja2_%s.cache'``. ``%s``
is replaced with the cache key.
>>> bcc = FileSystemBytecodeCache('/tmp/jinja_cache', '%s.cache')
This bytecode cache supports clearing of the cache using the clear method.
"""
def __init__(self, directory=None, pattern='__jinja2_%s.cache'):
if directory is None:
directory = tempfile.gettempdir()
self.directory = directory
self.pattern = pattern
def _get_cache_filename(self, bucket):
return path.join(self.directory, self.pattern % bucket.key)
def load_bytecode(self, bucket):
f = open_if_exists(self._get_cache_filename(bucket), 'rb')
if f is not None:
try:
bucket.load_bytecode(f)
finally:
f.close()
def dump_bytecode(self, bucket):
f = open(self._get_cache_filename(bucket), 'wb')
try:
bucket.write_bytecode(f)
finally:
f.close()
def clear(self):
# imported lazily here because google app-engine doesn't support
# write access on the file system and the function does not exist
# normally.
from os import remove
files = fnmatch.filter(listdir(self.directory), self.pattern % '*')
for filename in files:
try:
remove(path.join(self.directory, filename))
except OSError:
pass
class MemcachedBytecodeCache(BytecodeCache):
"""This class implements a bytecode cache that uses a memcache cache for
storing the information. It does not enforce a specific memcache library
(tummy's memcache or cmemcache) but will accept any class that provides
the minimal interface required.
Libraries compatible with this class:
- `werkzeug <http://werkzeug.pocoo.org/>`_.contrib.cache
- `python-memcached <http://www.tummy.com/Community/software/python-memcached/>`_
- `cmemcache <http://gijsbert.org/cmemcache/>`_
(Unfortunately the django cache interface is not compatible because it
does not support storing binary data, only unicode. You can however pass
the underlying cache client to the bytecode cache which is available
as `django.core.cache.cache._client`.)
The minimal interface for the client passed to the constructor is this:
.. class:: MinimalClientInterface
.. method:: set(key, value[, timeout])
Stores the bytecode in the cache. `value` is a string and
`timeout` the timeout of the key. If timeout is not provided
a default timeout or no timeout should be assumed, if it's
provided it's an integer with the number of seconds the cache
item should exist.
.. method:: get(key)
Returns the value for the cache key. If the item does not
exist in the cache the return value must be `None`.
The other arguments to the constructor are the prefix for all keys that
is added before the actual cache key and the timeout for the bytecode in
the cache system. We recommend a high (or no) timeout.
This bytecode cache does not support clearing of used items in the cache.
The clear method is a no-operation function.
.. versionadded:: 2.7
Added support for ignoring memcache errors through the
`ignore_memcache_errors` parameter.
"""
def __init__(self, client, prefix='jinja2/bytecode/', timeout=None,
ignore_memcache_errors=True):
self.client = client
self.prefix = prefix
self.timeout = timeout
self.ignore_memcache_errors = ignore_memcache_errors
def load_bytecode(self, bucket):
try:
code = self.client.get(self.prefix + bucket.key)
except Exception:
if not self.ignore_memcache_errors:
raise
code = None
if code is not None:
bucket.bytecode_from_string(code)
def dump_bytecode(self, bucket):
args = (self.prefix + bucket.key, bucket.bytecode_to_string())
if self.timeout is not None:
args += (self.timeout,)
try:
self.client.set(*args)
except Exception:
if not self.ignore_memcache_errors:
raise
+1640
View File
File diff suppressed because it is too large Load Diff
+32
View File
@@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
"""
jinja.constants
~~~~~~~~~~~~~~~
Various constants.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
#: list of lorem ipsum words used by the lipsum() helper function
LOREM_IPSUM_WORDS = u'''\
a ac accumsan ad adipiscing aenean aliquam aliquet amet ante aptent arcu at
auctor augue bibendum blandit class commodo condimentum congue consectetuer
consequat conubia convallis cras cubilia cum curabitur curae cursus dapibus
diam dictum dictumst dignissim dis dolor donec dui duis egestas eget eleifend
elementum elit enim erat eros est et etiam eu euismod facilisi facilisis fames
faucibus felis fermentum feugiat fringilla fusce gravida habitant habitasse hac
hendrerit hymenaeos iaculis id imperdiet in inceptos integer interdum ipsum
justo lacinia lacus laoreet lectus leo libero ligula litora lobortis lorem
luctus maecenas magna magnis malesuada massa mattis mauris metus mi molestie
mollis montes morbi mus nam nascetur natoque nec neque netus nibh nisi nisl non
nonummy nostra nulla nullam nunc odio orci ornare parturient pede pellentesque
penatibus per pharetra phasellus placerat platea porta porttitor posuere
potenti praesent pretium primis proin pulvinar purus quam quis quisque rhoncus
ridiculus risus rutrum sagittis sapien scelerisque sed sem semper senectus sit
sociis sociosqu sodales sollicitudin suscipit suspendisse taciti tellus tempor
tempus tincidunt torquent tortor tristique turpis ullamcorper ultrices
ultricies urna ut varius vehicula vel velit venenatis vestibulum vitae vivamus
viverra volutpat vulputate'''
+337
View File
@@ -0,0 +1,337 @@
# -*- coding: utf-8 -*-
"""
jinja2.debug
~~~~~~~~~~~~
Implements the debug interface for Jinja. This module does some pretty
ugly stuff with the Python traceback system in order to achieve tracebacks
with correct line numbers, locals and contents.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import sys
import traceback
from types import TracebackType
from jinja2.utils import missing, internal_code
from jinja2.exceptions import TemplateSyntaxError
from jinja2._compat import iteritems, reraise, code_type
# on pypy we can take advantage of transparent proxies
try:
from __pypy__ import tproxy
except ImportError:
tproxy = None
# how does the raise helper look like?
try:
exec("raise TypeError, 'foo'")
except SyntaxError:
raise_helper = 'raise __jinja_exception__[1]'
except TypeError:
raise_helper = 'raise __jinja_exception__[0], __jinja_exception__[1]'
class TracebackFrameProxy(object):
"""Proxies a traceback frame."""
def __init__(self, tb):
self.tb = tb
self._tb_next = None
@property
def tb_next(self):
return self._tb_next
def set_next(self, next):
if tb_set_next is not None:
try:
tb_set_next(self.tb, next and next.tb or None)
except Exception:
# this function can fail due to all the hackery it does
# on various python implementations. We just catch errors
# down and ignore them if necessary.
pass
self._tb_next = next
@property
def is_jinja_frame(self):
return '__jinja_template__' in self.tb.tb_frame.f_globals
def __getattr__(self, name):
return getattr(self.tb, name)
def make_frame_proxy(frame):
proxy = TracebackFrameProxy(frame)
if tproxy is None:
return proxy
def operation_handler(operation, *args, **kwargs):
if operation in ('__getattribute__', '__getattr__'):
return getattr(proxy, args[0])
elif operation == '__setattr__':
proxy.__setattr__(*args, **kwargs)
else:
return getattr(proxy, operation)(*args, **kwargs)
return tproxy(TracebackType, operation_handler)
class ProcessedTraceback(object):
"""Holds a Jinja preprocessed traceback for printing or reraising."""
def __init__(self, exc_type, exc_value, frames):
assert frames, 'no frames for this traceback?'
self.exc_type = exc_type
self.exc_value = exc_value
self.frames = frames
# newly concatenate the frames (which are proxies)
prev_tb = None
for tb in self.frames:
if prev_tb is not None:
prev_tb.set_next(tb)
prev_tb = tb
prev_tb.set_next(None)
def render_as_text(self, limit=None):
"""Return a string with the traceback."""
lines = traceback.format_exception(self.exc_type, self.exc_value,
self.frames[0], limit=limit)
return ''.join(lines).rstrip()
def render_as_html(self, full=False):
"""Return a unicode string with the traceback as rendered HTML."""
from jinja2.debugrenderer import render_traceback
return u'%s\n\n<!--\n%s\n-->' % (
render_traceback(self, full=full),
self.render_as_text().decode('utf-8', 'replace')
)
@property
def is_template_syntax_error(self):
"""`True` if this is a template syntax error."""
return isinstance(self.exc_value, TemplateSyntaxError)
@property
def exc_info(self):
"""Exception info tuple with a proxy around the frame objects."""
return self.exc_type, self.exc_value, self.frames[0]
@property
def standard_exc_info(self):
"""Standard python exc_info for re-raising"""
tb = self.frames[0]
# the frame will be an actual traceback (or transparent proxy) if
# we are on pypy or a python implementation with support for tproxy
if type(tb) is not TracebackType:
tb = tb.tb
return self.exc_type, self.exc_value, tb
def make_traceback(exc_info, source_hint=None):
"""Creates a processed traceback object from the exc_info."""
exc_type, exc_value, tb = exc_info
if isinstance(exc_value, TemplateSyntaxError):
exc_info = translate_syntax_error(exc_value, source_hint)
initial_skip = 0
else:
initial_skip = 1
return translate_exception(exc_info, initial_skip)
def translate_syntax_error(error, source=None):
"""Rewrites a syntax error to please traceback systems."""
error.source = source
error.translated = True
exc_info = (error.__class__, error, None)
filename = error.filename
if filename is None:
filename = '<unknown>'
return fake_exc_info(exc_info, filename, error.lineno)
def translate_exception(exc_info, initial_skip=0):
"""If passed an exc_info it will automatically rewrite the exceptions
all the way down to the correct line numbers and frames.
"""
tb = exc_info[2]
frames = []
# skip some internal frames if wanted
for x in range(initial_skip):
if tb is not None:
tb = tb.tb_next
initial_tb = tb
while tb is not None:
# skip frames decorated with @internalcode. These are internal
# calls we can't avoid and that are useless in template debugging
# output.
if tb.tb_frame.f_code in internal_code:
tb = tb.tb_next
continue
# save a reference to the next frame if we override the current
# one with a faked one.
next = tb.tb_next
# fake template exceptions
template = tb.tb_frame.f_globals.get('__jinja_template__')
if template is not None:
lineno = template.get_corresponding_lineno(tb.tb_lineno)
tb = fake_exc_info(exc_info[:2] + (tb,), template.filename,
lineno)[2]
frames.append(make_frame_proxy(tb))
tb = next
# if we don't have any exceptions in the frames left, we have to
# reraise it unchanged.
# XXX: can we backup here? when could this happen?
if not frames:
reraise(exc_info[0], exc_info[1], exc_info[2])
return ProcessedTraceback(exc_info[0], exc_info[1], frames)
def fake_exc_info(exc_info, filename, lineno):
"""Helper for `translate_exception`."""
exc_type, exc_value, tb = exc_info
# figure the real context out
if tb is not None:
real_locals = tb.tb_frame.f_locals.copy()
ctx = real_locals.get('context')
if ctx:
locals = ctx.get_all()
else:
locals = {}
for name, value in iteritems(real_locals):
if name.startswith('l_') and value is not missing:
locals[name[2:]] = value
# if there is a local called __jinja_exception__, we get
# rid of it to not break the debug functionality.
locals.pop('__jinja_exception__', None)
else:
locals = {}
# assamble fake globals we need
globals = {
'__name__': filename,
'__file__': filename,
'__jinja_exception__': exc_info[:2],
# we don't want to keep the reference to the template around
# to not cause circular dependencies, but we mark it as Jinja
# frame for the ProcessedTraceback
'__jinja_template__': None
}
# and fake the exception
code = compile('\n' * (lineno - 1) + raise_helper, filename, 'exec')
# if it's possible, change the name of the code. This won't work
# on some python environments such as google appengine
try:
if tb is None:
location = 'template'
else:
function = tb.tb_frame.f_code.co_name
if function == 'root':
location = 'top-level template code'
elif function.startswith('block_'):
location = 'block "%s"' % function[6:]
else:
location = 'template'
code = code_type(0, code.co_nlocals, code.co_stacksize,
code.co_flags, code.co_code, code.co_consts,
code.co_names, code.co_varnames, filename,
location, code.co_firstlineno,
code.co_lnotab, (), ())
except:
pass
# execute the code and catch the new traceback
try:
exec(code, globals, locals)
except:
exc_info = sys.exc_info()
new_tb = exc_info[2].tb_next
# return without this frame
return exc_info[:2] + (new_tb,)
def _init_ugly_crap():
"""This function implements a few ugly things so that we can patch the
traceback objects. The function returned allows resetting `tb_next` on
any python traceback object. Do not attempt to use this on non cpython
interpreters
"""
import ctypes
from types import TracebackType
# figure out side of _Py_ssize_t
if hasattr(ctypes.pythonapi, 'Py_InitModule4_64'):
_Py_ssize_t = ctypes.c_int64
else:
_Py_ssize_t = ctypes.c_int
# regular python
class _PyObject(ctypes.Structure):
pass
_PyObject._fields_ = [
('ob_refcnt', _Py_ssize_t),
('ob_type', ctypes.POINTER(_PyObject))
]
# python with trace
if hasattr(sys, 'getobjects'):
class _PyObject(ctypes.Structure):
pass
_PyObject._fields_ = [
('_ob_next', ctypes.POINTER(_PyObject)),
('_ob_prev', ctypes.POINTER(_PyObject)),
('ob_refcnt', _Py_ssize_t),
('ob_type', ctypes.POINTER(_PyObject))
]
class _Traceback(_PyObject):
pass
_Traceback._fields_ = [
('tb_next', ctypes.POINTER(_Traceback)),
('tb_frame', ctypes.POINTER(_PyObject)),
('tb_lasti', ctypes.c_int),
('tb_lineno', ctypes.c_int)
]
def tb_set_next(tb, next):
"""Set the tb_next attribute of a traceback object."""
if not (isinstance(tb, TracebackType) and
(next is None or isinstance(next, TracebackType))):
raise TypeError('tb_set_next arguments must be traceback objects')
obj = _Traceback.from_address(id(tb))
if tb.tb_next is not None:
old = _Traceback.from_address(id(tb.tb_next))
old.ob_refcnt -= 1
if next is None:
obj.tb_next = ctypes.POINTER(_Traceback)()
else:
next = _Traceback.from_address(id(next))
next.ob_refcnt += 1
obj.tb_next = ctypes.pointer(next)
return tb_set_next
# try to get a tb_set_next implementation if we don't have transparent
# proxies.
tb_set_next = None
if tproxy is None:
try:
tb_set_next = _init_ugly_crap()
except:
pass
del _init_ugly_crap
+43
View File
@@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
"""
jinja2.defaults
~~~~~~~~~~~~~~~
Jinja default filters and tags.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2._compat import range_type
from jinja2.utils import generate_lorem_ipsum, Cycler, Joiner
# defaults for the parser / lexer
BLOCK_START_STRING = '{%'
BLOCK_END_STRING = '%}'
VARIABLE_START_STRING = '{{'
VARIABLE_END_STRING = '}}'
COMMENT_START_STRING = '{#'
COMMENT_END_STRING = '#}'
LINE_STATEMENT_PREFIX = None
LINE_COMMENT_PREFIX = None
TRIM_BLOCKS = False
LSTRIP_BLOCKS = False
NEWLINE_SEQUENCE = '\n'
KEEP_TRAILING_NEWLINE = False
# default filters, tests and namespace
from jinja2.filters import FILTERS as DEFAULT_FILTERS
from jinja2.tests import TESTS as DEFAULT_TESTS
DEFAULT_NAMESPACE = {
'range': range_type,
'dict': lambda **kw: kw,
'lipsum': generate_lorem_ipsum,
'cycler': Cycler,
'joiner': Joiner
}
# export all constants
__all__ = tuple(x for x in locals().keys() if x.isupper())
+1191
View File
File diff suppressed because it is too large Load Diff
+146
View File
@@ -0,0 +1,146 @@
# -*- coding: utf-8 -*-
"""
jinja2.exceptions
~~~~~~~~~~~~~~~~~
Jinja exceptions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2._compat import imap, text_type, PY2, implements_to_string
class TemplateError(Exception):
"""Baseclass for all template errors."""
if PY2:
def __init__(self, message=None):
if message is not None:
message = text_type(message).encode('utf-8')
Exception.__init__(self, message)
@property
def message(self):
if self.args:
message = self.args[0]
if message is not None:
return message.decode('utf-8', 'replace')
def __unicode__(self):
return self.message or u''
else:
def __init__(self, message=None):
Exception.__init__(self, message)
@property
def message(self):
if self.args:
message = self.args[0]
if message is not None:
return message
@implements_to_string
class TemplateNotFound(IOError, LookupError, TemplateError):
"""Raised if a template does not exist."""
# looks weird, but removes the warning descriptor that just
# bogusly warns us about message being deprecated
message = None
def __init__(self, name, message=None):
IOError.__init__(self)
if message is None:
message = name
self.message = message
self.name = name
self.templates = [name]
def __str__(self):
return self.message
class TemplatesNotFound(TemplateNotFound):
"""Like :class:`TemplateNotFound` but raised if multiple templates
are selected. This is a subclass of :class:`TemplateNotFound`
exception, so just catching the base exception will catch both.
.. versionadded:: 2.2
"""
def __init__(self, names=(), message=None):
if message is None:
message = u'none of the templates given were found: ' + \
u', '.join(imap(text_type, names))
TemplateNotFound.__init__(self, names and names[-1] or None, message)
self.templates = list(names)
@implements_to_string
class TemplateSyntaxError(TemplateError):
"""Raised to tell the user that there is a problem with the template."""
def __init__(self, message, lineno, name=None, filename=None):
TemplateError.__init__(self, message)
self.lineno = lineno
self.name = name
self.filename = filename
self.source = None
# this is set to True if the debug.translate_syntax_error
# function translated the syntax error into a new traceback
self.translated = False
def __str__(self):
# for translated errors we only return the message
if self.translated:
return self.message
# otherwise attach some stuff
location = 'line %d' % self.lineno
name = self.filename or self.name
if name:
location = 'File "%s", %s' % (name, location)
lines = [self.message, ' ' + location]
# if the source is set, add the line to the output
if self.source is not None:
try:
line = self.source.splitlines()[self.lineno - 1]
except IndexError:
line = None
if line:
lines.append(' ' + line.strip())
return u'\n'.join(lines)
class TemplateAssertionError(TemplateSyntaxError):
"""Like a template syntax error, but covers cases where something in the
template caused an error at compile time that wasn't necessarily caused
by a syntax error. However it's a direct subclass of
:exc:`TemplateSyntaxError` and has the same attributes.
"""
class TemplateRuntimeError(TemplateError):
"""A generic runtime error in the template engine. Under some situations
Jinja may raise this exception.
"""
class UndefinedError(TemplateRuntimeError):
"""Raised if a template tries to operate on :class:`Undefined`."""
class SecurityError(TemplateRuntimeError):
"""Raised if a template tries to do something insecure if the
sandbox is enabled.
"""
class FilterArgumentError(TemplateRuntimeError):
"""This error is raised if a filter was called with inappropriate
arguments
"""
+636
View File
@@ -0,0 +1,636 @@
# -*- coding: utf-8 -*-
"""
jinja2.ext
~~~~~~~~~~
Jinja extensions allow to add custom tags similar to the way django custom
tags work. By default two example extensions exist: an i18n and a cache
extension.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2 import nodes
from jinja2.defaults import BLOCK_START_STRING, \
BLOCK_END_STRING, VARIABLE_START_STRING, VARIABLE_END_STRING, \
COMMENT_START_STRING, COMMENT_END_STRING, LINE_STATEMENT_PREFIX, \
LINE_COMMENT_PREFIX, TRIM_BLOCKS, NEWLINE_SEQUENCE, \
KEEP_TRAILING_NEWLINE, LSTRIP_BLOCKS
from jinja2.environment import Environment
from jinja2.runtime import concat
from jinja2.exceptions import TemplateAssertionError, TemplateSyntaxError
from jinja2.utils import contextfunction, import_string, Markup
from jinja2._compat import next, with_metaclass, string_types, iteritems
# the only real useful gettext functions for a Jinja template. Note
# that ugettext must be assigned to gettext as Jinja doesn't support
# non unicode strings.
GETTEXT_FUNCTIONS = ('_', 'gettext', 'ngettext')
class ExtensionRegistry(type):
"""Gives the extension an unique identifier."""
def __new__(cls, name, bases, d):
rv = type.__new__(cls, name, bases, d)
rv.identifier = rv.__module__ + '.' + rv.__name__
return rv
class Extension(with_metaclass(ExtensionRegistry, object)):
"""Extensions can be used to add extra functionality to the Jinja template
system at the parser level. Custom extensions are bound to an environment
but may not store environment specific data on `self`. The reason for
this is that an extension can be bound to another environment (for
overlays) by creating a copy and reassigning the `environment` attribute.
As extensions are created by the environment they cannot accept any
arguments for configuration. One may want to work around that by using
a factory function, but that is not possible as extensions are identified
by their import name. The correct way to configure the extension is
storing the configuration values on the environment. Because this way the
environment ends up acting as central configuration storage the
attributes may clash which is why extensions have to ensure that the names
they choose for configuration are not too generic. ``prefix`` for example
is a terrible name, ``fragment_cache_prefix`` on the other hand is a good
name as includes the name of the extension (fragment cache).
"""
#: if this extension parses this is the list of tags it's listening to.
tags = set()
#: the priority of that extension. This is especially useful for
#: extensions that preprocess values. A lower value means higher
#: priority.
#:
#: .. versionadded:: 2.4
priority = 100
def __init__(self, environment):
self.environment = environment
def bind(self, environment):
"""Create a copy of this extension bound to another environment."""
rv = object.__new__(self.__class__)
rv.__dict__.update(self.__dict__)
rv.environment = environment
return rv
def preprocess(self, source, name, filename=None):
"""This method is called before the actual lexing and can be used to
preprocess the source. The `filename` is optional. The return value
must be the preprocessed source.
"""
return source
def filter_stream(self, stream):
"""It's passed a :class:`~jinja2.lexer.TokenStream` that can be used
to filter tokens returned. This method has to return an iterable of
:class:`~jinja2.lexer.Token`\s, but it doesn't have to return a
:class:`~jinja2.lexer.TokenStream`.
In the `ext` folder of the Jinja2 source distribution there is a file
called `inlinegettext.py` which implements a filter that utilizes this
method.
"""
return stream
def parse(self, parser):
"""If any of the :attr:`tags` matched this method is called with the
parser as first argument. The token the parser stream is pointing at
is the name token that matched. This method has to return one or a
list of multiple nodes.
"""
raise NotImplementedError()
def attr(self, name, lineno=None):
"""Return an attribute node for the current extension. This is useful
to pass constants on extensions to generated template code.
::
self.attr('_my_attribute', lineno=lineno)
"""
return nodes.ExtensionAttribute(self.identifier, name, lineno=lineno)
def call_method(self, name, args=None, kwargs=None, dyn_args=None,
dyn_kwargs=None, lineno=None):
"""Call a method of the extension. This is a shortcut for
:meth:`attr` + :class:`jinja2.nodes.Call`.
"""
if args is None:
args = []
if kwargs is None:
kwargs = []
return nodes.Call(self.attr(name, lineno=lineno), args, kwargs,
dyn_args, dyn_kwargs, lineno=lineno)
@contextfunction
def _gettext_alias(__context, *args, **kwargs):
return __context.call(__context.resolve('gettext'), *args, **kwargs)
def _make_new_gettext(func):
@contextfunction
def gettext(__context, __string, **variables):
rv = __context.call(func, __string)
if __context.eval_ctx.autoescape:
rv = Markup(rv)
return rv % variables
return gettext
def _make_new_ngettext(func):
@contextfunction
def ngettext(__context, __singular, __plural, __num, **variables):
variables.setdefault('num', __num)
rv = __context.call(func, __singular, __plural, __num)
if __context.eval_ctx.autoescape:
rv = Markup(rv)
return rv % variables
return ngettext
class InternationalizationExtension(Extension):
"""This extension adds gettext support to Jinja2."""
tags = set(['trans'])
# TODO: the i18n extension is currently reevaluating values in a few
# situations. Take this example:
# {% trans count=something() %}{{ count }} foo{% pluralize
# %}{{ count }} fooss{% endtrans %}
# something is called twice here. One time for the gettext value and
# the other time for the n-parameter of the ngettext function.
def __init__(self, environment):
Extension.__init__(self, environment)
environment.globals['_'] = _gettext_alias
environment.extend(
install_gettext_translations=self._install,
install_null_translations=self._install_null,
install_gettext_callables=self._install_callables,
uninstall_gettext_translations=self._uninstall,
extract_translations=self._extract,
newstyle_gettext=False
)
def _install(self, translations, newstyle=None):
gettext = getattr(translations, 'ugettext', None)
if gettext is None:
gettext = translations.gettext
ngettext = getattr(translations, 'ungettext', None)
if ngettext is None:
ngettext = translations.ngettext
self._install_callables(gettext, ngettext, newstyle)
def _install_null(self, newstyle=None):
self._install_callables(
lambda x: x,
lambda s, p, n: (n != 1 and (p,) or (s,))[0],
newstyle
)
def _install_callables(self, gettext, ngettext, newstyle=None):
if newstyle is not None:
self.environment.newstyle_gettext = newstyle
if self.environment.newstyle_gettext:
gettext = _make_new_gettext(gettext)
ngettext = _make_new_ngettext(ngettext)
self.environment.globals.update(
gettext=gettext,
ngettext=ngettext
)
def _uninstall(self, translations):
for key in 'gettext', 'ngettext':
self.environment.globals.pop(key, None)
def _extract(self, source, gettext_functions=GETTEXT_FUNCTIONS):
if isinstance(source, string_types):
source = self.environment.parse(source)
return extract_from_ast(source, gettext_functions)
def parse(self, parser):
"""Parse a translatable tag."""
lineno = next(parser.stream).lineno
num_called_num = False
# find all the variables referenced. Additionally a variable can be
# defined in the body of the trans block too, but this is checked at
# a later state.
plural_expr = None
plural_expr_assignment = None
variables = {}
while parser.stream.current.type != 'block_end':
if variables:
parser.stream.expect('comma')
# skip colon for python compatibility
if parser.stream.skip_if('colon'):
break
name = parser.stream.expect('name')
if name.value in variables:
parser.fail('translatable variable %r defined twice.' %
name.value, name.lineno,
exc=TemplateAssertionError)
# expressions
if parser.stream.current.type == 'assign':
next(parser.stream)
variables[name.value] = var = parser.parse_expression()
else:
variables[name.value] = var = nodes.Name(name.value, 'load')
if plural_expr is None:
if isinstance(var, nodes.Call):
plural_expr = nodes.Name('_trans', 'load')
variables[name.value] = plural_expr
plural_expr_assignment = nodes.Assign(
nodes.Name('_trans', 'store'), var)
else:
plural_expr = var
num_called_num = name.value == 'num'
parser.stream.expect('block_end')
plural = plural_names = None
have_plural = False
referenced = set()
# now parse until endtrans or pluralize
singular_names, singular = self._parse_block(parser, True)
if singular_names:
referenced.update(singular_names)
if plural_expr is None:
plural_expr = nodes.Name(singular_names[0], 'load')
num_called_num = singular_names[0] == 'num'
# if we have a pluralize block, we parse that too
if parser.stream.current.test('name:pluralize'):
have_plural = True
next(parser.stream)
if parser.stream.current.type != 'block_end':
name = parser.stream.expect('name')
if name.value not in variables:
parser.fail('unknown variable %r for pluralization' %
name.value, name.lineno,
exc=TemplateAssertionError)
plural_expr = variables[name.value]
num_called_num = name.value == 'num'
parser.stream.expect('block_end')
plural_names, plural = self._parse_block(parser, False)
next(parser.stream)
referenced.update(plural_names)
else:
next(parser.stream)
# register free names as simple name expressions
for var in referenced:
if var not in variables:
variables[var] = nodes.Name(var, 'load')
if not have_plural:
plural_expr = None
elif plural_expr is None:
parser.fail('pluralize without variables', lineno)
node = self._make_node(singular, plural, variables, plural_expr,
bool(referenced),
num_called_num and have_plural)
node.set_lineno(lineno)
if plural_expr_assignment is not None:
return [plural_expr_assignment, node]
else:
return node
def _parse_block(self, parser, allow_pluralize):
"""Parse until the next block tag with a given name."""
referenced = []
buf = []
while 1:
if parser.stream.current.type == 'data':
buf.append(parser.stream.current.value.replace('%', '%%'))
next(parser.stream)
elif parser.stream.current.type == 'variable_begin':
next(parser.stream)
name = parser.stream.expect('name').value
referenced.append(name)
buf.append('%%(%s)s' % name)
parser.stream.expect('variable_end')
elif parser.stream.current.type == 'block_begin':
next(parser.stream)
if parser.stream.current.test('name:endtrans'):
break
elif parser.stream.current.test('name:pluralize'):
if allow_pluralize:
break
parser.fail('a translatable section can have only one '
'pluralize section')
parser.fail('control structures in translatable sections are '
'not allowed')
elif parser.stream.eos:
parser.fail('unclosed translation block')
else:
assert False, 'internal parser error'
return referenced, concat(buf)
def _make_node(self, singular, plural, variables, plural_expr,
vars_referenced, num_called_num):
"""Generates a useful node from the data provided."""
# no variables referenced? no need to escape for old style
# gettext invocations only if there are vars.
if not vars_referenced and not self.environment.newstyle_gettext:
singular = singular.replace('%%', '%')
if plural:
plural = plural.replace('%%', '%')
# singular only:
if plural_expr is None:
gettext = nodes.Name('gettext', 'load')
node = nodes.Call(gettext, [nodes.Const(singular)],
[], None, None)
# singular and plural
else:
ngettext = nodes.Name('ngettext', 'load')
node = nodes.Call(ngettext, [
nodes.Const(singular),
nodes.Const(plural),
plural_expr
], [], None, None)
# in case newstyle gettext is used, the method is powerful
# enough to handle the variable expansion and autoescape
# handling itself
if self.environment.newstyle_gettext:
for key, value in iteritems(variables):
# the function adds that later anyways in case num was
# called num, so just skip it.
if num_called_num and key == 'num':
continue
node.kwargs.append(nodes.Keyword(key, value))
# otherwise do that here
else:
# mark the return value as safe if we are in an
# environment with autoescaping turned on
node = nodes.MarkSafeIfAutoescape(node)
if variables:
node = nodes.Mod(node, nodes.Dict([
nodes.Pair(nodes.Const(key), value)
for key, value in variables.items()
]))
return nodes.Output([node])
class ExprStmtExtension(Extension):
"""Adds a `do` tag to Jinja2 that works like the print statement just
that it doesn't print the return value.
"""
tags = set(['do'])
def parse(self, parser):
node = nodes.ExprStmt(lineno=next(parser.stream).lineno)
node.node = parser.parse_tuple()
return node
class LoopControlExtension(Extension):
"""Adds break and continue to the template engine."""
tags = set(['break', 'continue'])
def parse(self, parser):
token = next(parser.stream)
if token.value == 'break':
return nodes.Break(lineno=token.lineno)
return nodes.Continue(lineno=token.lineno)
class WithExtension(Extension):
"""Adds support for a django-like with block."""
tags = set(['with'])
def parse(self, parser):
node = nodes.Scope(lineno=next(parser.stream).lineno)
assignments = []
while parser.stream.current.type != 'block_end':
lineno = parser.stream.current.lineno
if assignments:
parser.stream.expect('comma')
target = parser.parse_assign_target()
parser.stream.expect('assign')
expr = parser.parse_expression()
assignments.append(nodes.Assign(target, expr, lineno=lineno))
node.body = assignments + \
list(parser.parse_statements(('name:endwith',),
drop_needle=True))
return node
class AutoEscapeExtension(Extension):
"""Changes auto escape rules for a scope."""
tags = set(['autoescape'])
def parse(self, parser):
node = nodes.ScopedEvalContextModifier(lineno=next(parser.stream).lineno)
node.options = [
nodes.Keyword('autoescape', parser.parse_expression())
]
node.body = parser.parse_statements(('name:endautoescape',),
drop_needle=True)
return nodes.Scope([node])
def extract_from_ast(node, gettext_functions=GETTEXT_FUNCTIONS,
babel_style=True):
"""Extract localizable strings from the given template node. Per
default this function returns matches in babel style that means non string
parameters as well as keyword arguments are returned as `None`. This
allows Babel to figure out what you really meant if you are using
gettext functions that allow keyword arguments for placeholder expansion.
If you don't want that behavior set the `babel_style` parameter to `False`
which causes only strings to be returned and parameters are always stored
in tuples. As a consequence invalid gettext calls (calls without a single
string parameter or string parameters after non-string parameters) are
skipped.
This example explains the behavior:
>>> from jinja2 import Environment
>>> env = Environment()
>>> node = env.parse('{{ (_("foo"), _(), ngettext("foo", "bar", 42)) }}')
>>> list(extract_from_ast(node))
[(1, '_', 'foo'), (1, '_', ()), (1, 'ngettext', ('foo', 'bar', None))]
>>> list(extract_from_ast(node, babel_style=False))
[(1, '_', ('foo',)), (1, 'ngettext', ('foo', 'bar'))]
For every string found this function yields a ``(lineno, function,
message)`` tuple, where:
* ``lineno`` is the number of the line on which the string was found,
* ``function`` is the name of the ``gettext`` function used (if the
string was extracted from embedded Python code), and
* ``message`` is the string itself (a ``unicode`` object, or a tuple
of ``unicode`` objects for functions with multiple string arguments).
This extraction function operates on the AST and is because of that unable
to extract any comments. For comment support you have to use the babel
extraction interface or extract comments yourself.
"""
for node in node.find_all(nodes.Call):
if not isinstance(node.node, nodes.Name) or \
node.node.name not in gettext_functions:
continue
strings = []
for arg in node.args:
if isinstance(arg, nodes.Const) and \
isinstance(arg.value, string_types):
strings.append(arg.value)
else:
strings.append(None)
for arg in node.kwargs:
strings.append(None)
if node.dyn_args is not None:
strings.append(None)
if node.dyn_kwargs is not None:
strings.append(None)
if not babel_style:
strings = tuple(x for x in strings if x is not None)
if not strings:
continue
else:
if len(strings) == 1:
strings = strings[0]
else:
strings = tuple(strings)
yield node.lineno, node.node.name, strings
class _CommentFinder(object):
"""Helper class to find comments in a token stream. Can only
find comments for gettext calls forwards. Once the comment
from line 4 is found, a comment for line 1 will not return a
usable value.
"""
def __init__(self, tokens, comment_tags):
self.tokens = tokens
self.comment_tags = comment_tags
self.offset = 0
self.last_lineno = 0
def find_backwards(self, offset):
try:
for _, token_type, token_value in \
reversed(self.tokens[self.offset:offset]):
if token_type in ('comment', 'linecomment'):
try:
prefix, comment = token_value.split(None, 1)
except ValueError:
continue
if prefix in self.comment_tags:
return [comment.rstrip()]
return []
finally:
self.offset = offset
def find_comments(self, lineno):
if not self.comment_tags or self.last_lineno > lineno:
return []
for idx, (token_lineno, _, _) in enumerate(self.tokens[self.offset:]):
if token_lineno > lineno:
return self.find_backwards(self.offset + idx)
return self.find_backwards(len(self.tokens))
def babel_extract(fileobj, keywords, comment_tags, options):
"""Babel extraction method for Jinja templates.
.. versionchanged:: 2.3
Basic support for translation comments was added. If `comment_tags`
is now set to a list of keywords for extraction, the extractor will
try to find the best preceeding comment that begins with one of the
keywords. For best results, make sure to not have more than one
gettext call in one line of code and the matching comment in the
same line or the line before.
.. versionchanged:: 2.5.1
The `newstyle_gettext` flag can be set to `True` to enable newstyle
gettext calls.
.. versionchanged:: 2.7
A `silent` option can now be provided. If set to `False` template
syntax errors are propagated instead of being ignored.
:param fileobj: the file-like object the messages should be extracted from
:param keywords: a list of keywords (i.e. function names) that should be
recognized as translation functions
:param comment_tags: a list of translator tags to search for and include
in the results.
:param options: a dictionary of additional options (optional)
:return: an iterator over ``(lineno, funcname, message, comments)`` tuples.
(comments will be empty currently)
"""
extensions = set()
for extension in options.get('extensions', '').split(','):
extension = extension.strip()
if not extension:
continue
extensions.add(import_string(extension))
if InternationalizationExtension not in extensions:
extensions.add(InternationalizationExtension)
def getbool(options, key, default=False):
return options.get(key, str(default)).lower() in \
('1', 'on', 'yes', 'true')
silent = getbool(options, 'silent', True)
environment = Environment(
options.get('block_start_string', BLOCK_START_STRING),
options.get('block_end_string', BLOCK_END_STRING),
options.get('variable_start_string', VARIABLE_START_STRING),
options.get('variable_end_string', VARIABLE_END_STRING),
options.get('comment_start_string', COMMENT_START_STRING),
options.get('comment_end_string', COMMENT_END_STRING),
options.get('line_statement_prefix') or LINE_STATEMENT_PREFIX,
options.get('line_comment_prefix') or LINE_COMMENT_PREFIX,
getbool(options, 'trim_blocks', TRIM_BLOCKS),
getbool(options, 'lstrip_blocks', LSTRIP_BLOCKS),
NEWLINE_SEQUENCE,
getbool(options, 'keep_trailing_newline', KEEP_TRAILING_NEWLINE),
frozenset(extensions),
cache_size=0,
auto_reload=False
)
if getbool(options, 'newstyle_gettext'):
environment.newstyle_gettext = True
source = fileobj.read().decode(options.get('encoding', 'utf-8'))
try:
node = environment.parse(source)
tokens = list(environment.lex(environment.preprocess(source)))
except TemplateSyntaxError as e:
if not silent:
raise
# skip templates with syntax errors
return
finder = _CommentFinder(tokens, comment_tags)
for lineno, func, message in extract_from_ast(node, keywords):
yield lineno, func, message, finder.find_comments(lineno)
#: nicer import names
i18n = InternationalizationExtension
do = ExprStmtExtension
loopcontrols = LoopControlExtension
with_ = WithExtension
autoescape = AutoEscapeExtension
+987
View File
@@ -0,0 +1,987 @@
# -*- coding: utf-8 -*-
"""
jinja2.filters
~~~~~~~~~~~~~~
Bundled jinja filters.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import math
from random import choice
from operator import itemgetter
from itertools import groupby
from jinja2.utils import Markup, escape, pformat, urlize, soft_unicode, \
unicode_urlencode
from jinja2.runtime import Undefined
from jinja2.exceptions import FilterArgumentError
from jinja2._compat import next, imap, string_types, text_type, iteritems
_word_re = re.compile(r'\w+(?u)')
def contextfilter(f):
"""Decorator for marking context dependent filters. The current
:class:`Context` will be passed as first argument.
"""
f.contextfilter = True
return f
def evalcontextfilter(f):
"""Decorator for marking eval-context dependent filters. An eval
context object is passed as first argument. For more information
about the eval context, see :ref:`eval-context`.
.. versionadded:: 2.4
"""
f.evalcontextfilter = True
return f
def environmentfilter(f):
"""Decorator for marking evironment dependent filters. The current
:class:`Environment` is passed to the filter as first argument.
"""
f.environmentfilter = True
return f
def make_attrgetter(environment, attribute):
"""Returns a callable that looks up the given attribute from a
passed object with the rules of the environment. Dots are allowed
to access attributes of attributes. Integer parts in paths are
looked up as integers.
"""
if not isinstance(attribute, string_types) \
or ('.' not in attribute and not attribute.isdigit()):
return lambda x: environment.getitem(x, attribute)
attribute = attribute.split('.')
def attrgetter(item):
for part in attribute:
if part.isdigit():
part = int(part)
item = environment.getitem(item, part)
return item
return attrgetter
def do_forceescape(value):
"""Enforce HTML escaping. This will probably double escape variables."""
if hasattr(value, '__html__'):
value = value.__html__()
return escape(text_type(value))
def do_urlencode(value):
"""Escape strings for use in URLs (uses UTF-8 encoding). It accepts both
dictionaries and regular strings as well as pairwise iterables.
.. versionadded:: 2.7
"""
itemiter = None
if isinstance(value, dict):
itemiter = iteritems(value)
elif not isinstance(value, string_types):
try:
itemiter = iter(value)
except TypeError:
pass
if itemiter is None:
return unicode_urlencode(value)
return u'&'.join(unicode_urlencode(k) + '=' +
unicode_urlencode(v) for k, v in itemiter)
@evalcontextfilter
def do_replace(eval_ctx, s, old, new, count=None):
"""Return a copy of the value with all occurrences of a substring
replaced with a new one. The first argument is the substring
that should be replaced, the second is the replacement string.
If the optional third argument ``count`` is given, only the first
``count`` occurrences are replaced:
.. sourcecode:: jinja
{{ "Hello World"|replace("Hello", "Goodbye") }}
-> Goodbye World
{{ "aaaaargh"|replace("a", "d'oh, ", 2) }}
-> d'oh, d'oh, aaargh
"""
if count is None:
count = -1
if not eval_ctx.autoescape:
return text_type(s).replace(text_type(old), text_type(new), count)
if hasattr(old, '__html__') or hasattr(new, '__html__') and \
not hasattr(s, '__html__'):
s = escape(s)
else:
s = soft_unicode(s)
return s.replace(soft_unicode(old), soft_unicode(new), count)
def do_upper(s):
"""Convert a value to uppercase."""
return soft_unicode(s).upper()
def do_lower(s):
"""Convert a value to lowercase."""
return soft_unicode(s).lower()
@evalcontextfilter
def do_xmlattr(_eval_ctx, d, autospace=True):
"""Create an SGML/XML attribute string based on the items in a dict.
All values that are neither `none` nor `undefined` are automatically
escaped:
.. sourcecode:: html+jinja
<ul{{ {'class': 'my_list', 'missing': none,
'id': 'list-%d'|format(variable)}|xmlattr }}>
...
</ul>
Results in something like this:
.. sourcecode:: html
<ul class="my_list" id="list-42">
...
</ul>
As you can see it automatically prepends a space in front of the item
if the filter returned something unless the second parameter is false.
"""
rv = u' '.join(
u'%s="%s"' % (escape(key), escape(value))
for key, value in iteritems(d)
if value is not None and not isinstance(value, Undefined)
)
if autospace and rv:
rv = u' ' + rv
if _eval_ctx.autoescape:
rv = Markup(rv)
return rv
def do_capitalize(s):
"""Capitalize a value. The first character will be uppercase, all others
lowercase.
"""
return soft_unicode(s).capitalize()
def do_title(s):
"""Return a titlecased version of the value. I.e. words will start with
uppercase letters, all remaining characters are lowercase.
"""
rv = []
for item in re.compile(r'([-\s]+)(?u)').split(s):
if not item:
continue
rv.append(item[0].upper() + item[1:].lower())
return ''.join(rv)
def do_dictsort(value, case_sensitive=False, by='key'):
"""Sort a dict and yield (key, value) pairs. Because python dicts are
unsorted you may want to use this function to order them by either
key or value:
.. sourcecode:: jinja
{% for item in mydict|dictsort %}
sort the dict by key, case insensitive
{% for item in mydict|dictsort(true) %}
sort the dict by key, case sensitive
{% for item in mydict|dictsort(false, 'value') %}
sort the dict by key, case insensitive, sorted
normally and ordered by value.
"""
if by == 'key':
pos = 0
elif by == 'value':
pos = 1
else:
raise FilterArgumentError('You can only sort by either '
'"key" or "value"')
def sort_func(item):
value = item[pos]
if isinstance(value, string_types) and not case_sensitive:
value = value.lower()
return value
return sorted(value.items(), key=sort_func)
@environmentfilter
def do_sort(environment, value, reverse=False, case_sensitive=False,
attribute=None):
"""Sort an iterable. Per default it sorts ascending, if you pass it
true as first argument it will reverse the sorting.
If the iterable is made of strings the third parameter can be used to
control the case sensitiveness of the comparison which is disabled by
default.
.. sourcecode:: jinja
{% for item in iterable|sort %}
...
{% endfor %}
It is also possible to sort by an attribute (for example to sort
by the date of an object) by specifying the `attribute` parameter:
.. sourcecode:: jinja
{% for item in iterable|sort(attribute='date') %}
...
{% endfor %}
.. versionchanged:: 2.6
The `attribute` parameter was added.
"""
if not case_sensitive:
def sort_func(item):
if isinstance(item, string_types):
item = item.lower()
return item
else:
sort_func = None
if attribute is not None:
getter = make_attrgetter(environment, attribute)
def sort_func(item, processor=sort_func or (lambda x: x)):
return processor(getter(item))
return sorted(value, key=sort_func, reverse=reverse)
def do_default(value, default_value=u'', boolean=False):
"""If the value is undefined it will return the passed default value,
otherwise the value of the variable:
.. sourcecode:: jinja
{{ my_variable|default('my_variable is not defined') }}
This will output the value of ``my_variable`` if the variable was
defined, otherwise ``'my_variable is not defined'``. If you want
to use default with variables that evaluate to false you have to
set the second parameter to `true`:
.. sourcecode:: jinja
{{ ''|default('the string was empty', true) }}
"""
if isinstance(value, Undefined) or (boolean and not value):
return default_value
return value
@evalcontextfilter
def do_join(eval_ctx, value, d=u'', attribute=None):
"""Return a string which is the concatenation of the strings in the
sequence. The separator between elements is an empty string per
default, you can define it with the optional parameter:
.. sourcecode:: jinja
{{ [1, 2, 3]|join('|') }}
-> 1|2|3
{{ [1, 2, 3]|join }}
-> 123
It is also possible to join certain attributes of an object:
.. sourcecode:: jinja
{{ users|join(', ', attribute='username') }}
.. versionadded:: 2.6
The `attribute` parameter was added.
"""
if attribute is not None:
value = imap(make_attrgetter(eval_ctx.environment, attribute), value)
# no automatic escaping? joining is a lot eaiser then
if not eval_ctx.autoescape:
return text_type(d).join(imap(text_type, value))
# if the delimiter doesn't have an html representation we check
# if any of the items has. If yes we do a coercion to Markup
if not hasattr(d, '__html__'):
value = list(value)
do_escape = False
for idx, item in enumerate(value):
if hasattr(item, '__html__'):
do_escape = True
else:
value[idx] = text_type(item)
if do_escape:
d = escape(d)
else:
d = text_type(d)
return d.join(value)
# no html involved, to normal joining
return soft_unicode(d).join(imap(soft_unicode, value))
def do_center(value, width=80):
"""Centers the value in a field of a given width."""
return text_type(value).center(width)
@environmentfilter
def do_first(environment, seq):
"""Return the first item of a sequence."""
try:
return next(iter(seq))
except StopIteration:
return environment.undefined('No first item, sequence was empty.')
@environmentfilter
def do_last(environment, seq):
"""Return the last item of a sequence."""
try:
return next(iter(reversed(seq)))
except StopIteration:
return environment.undefined('No last item, sequence was empty.')
@environmentfilter
def do_random(environment, seq):
"""Return a random item from the sequence."""
try:
return choice(seq)
except IndexError:
return environment.undefined('No random item, sequence was empty.')
def do_filesizeformat(value, binary=False):
"""Format the value like a 'human-readable' file size (i.e. 13 kB,
4.1 MB, 102 Bytes, etc). Per default decimal prefixes are used (Mega,
Giga, etc.), if the second parameter is set to `True` the binary
prefixes are used (Mebi, Gibi).
"""
bytes = float(value)
base = binary and 1024 or 1000
prefixes = [
(binary and 'KiB' or 'kB'),
(binary and 'MiB' or 'MB'),
(binary and 'GiB' or 'GB'),
(binary and 'TiB' or 'TB'),
(binary and 'PiB' or 'PB'),
(binary and 'EiB' or 'EB'),
(binary and 'ZiB' or 'ZB'),
(binary and 'YiB' or 'YB')
]
if bytes == 1:
return '1 Byte'
elif bytes < base:
return '%d Bytes' % bytes
else:
for i, prefix in enumerate(prefixes):
unit = base ** (i + 2)
if bytes < unit:
return '%.1f %s' % ((base * bytes / unit), prefix)
return '%.1f %s' % ((base * bytes / unit), prefix)
def do_pprint(value, verbose=False):
"""Pretty print a variable. Useful for debugging.
With Jinja 1.2 onwards you can pass it a parameter. If this parameter
is truthy the output will be more verbose (this requires `pretty`)
"""
return pformat(value, verbose=verbose)
@evalcontextfilter
def do_urlize(eval_ctx, value, trim_url_limit=None, nofollow=False):
"""Converts URLs in plain text into clickable links.
If you pass the filter an additional integer it will shorten the urls
to that number. Also a third argument exists that makes the urls
"nofollow":
.. sourcecode:: jinja
{{ mytext|urlize(40, true) }}
links are shortened to 40 chars and defined with rel="nofollow"
"""
rv = urlize(value, trim_url_limit, nofollow)
if eval_ctx.autoescape:
rv = Markup(rv)
return rv
def do_indent(s, width=4, indentfirst=False):
"""Return a copy of the passed string, each line indented by
4 spaces. The first line is not indented. If you want to
change the number of spaces or indent the first line too
you can pass additional parameters to the filter:
.. sourcecode:: jinja
{{ mytext|indent(2, true) }}
indent by two spaces and indent the first line too.
"""
indention = u' ' * width
rv = (u'\n' + indention).join(s.splitlines())
if indentfirst:
rv = indention + rv
return rv
def do_truncate(s, length=255, killwords=False, end='...'):
"""Return a truncated copy of the string. The length is specified
with the first parameter which defaults to ``255``. If the second
parameter is ``true`` the filter will cut the text at length. Otherwise
it will discard the last word. If the text was in fact
truncated it will append an ellipsis sign (``"..."``). If you want a
different ellipsis sign than ``"..."`` you can specify it using the
third parameter.
.. sourcecode:: jinja
{{ "foo bar"|truncate(5) }}
-> "foo ..."
{{ "foo bar"|truncate(5, True) }}
-> "foo b..."
"""
if len(s) <= length:
return s
elif killwords:
return s[:length] + end
words = s.split(' ')
result = []
m = 0
for word in words:
m += len(word) + 1
if m > length:
break
result.append(word)
result.append(end)
return u' '.join(result)
@environmentfilter
def do_wordwrap(environment, s, width=79, break_long_words=True,
wrapstring=None):
"""
Return a copy of the string passed to the filter wrapped after
``79`` characters. You can override this default using the first
parameter. If you set the second parameter to `false` Jinja will not
split words apart if they are longer than `width`. By default, the newlines
will be the default newlines for the environment, but this can be changed
using the wrapstring keyword argument.
.. versionadded:: 2.7
Added support for the `wrapstring` parameter.
"""
if not wrapstring:
wrapstring = environment.newline_sequence
import textwrap
return wrapstring.join(textwrap.wrap(s, width=width, expand_tabs=False,
replace_whitespace=False,
break_long_words=break_long_words))
def do_wordcount(s):
"""Count the words in that string."""
return len(_word_re.findall(s))
def do_int(value, default=0):
"""Convert the value into an integer. If the
conversion doesn't work it will return ``0``. You can
override this default using the first parameter.
"""
try:
return int(value)
except (TypeError, ValueError):
# this quirk is necessary so that "42.23"|int gives 42.
try:
return int(float(value))
except (TypeError, ValueError):
return default
def do_float(value, default=0.0):
"""Convert the value into a floating point number. If the
conversion doesn't work it will return ``0.0``. You can
override this default using the first parameter.
"""
try:
return float(value)
except (TypeError, ValueError):
return default
def do_format(value, *args, **kwargs):
"""
Apply python string formatting on an object:
.. sourcecode:: jinja
{{ "%s - %s"|format("Hello?", "Foo!") }}
-> Hello? - Foo!
"""
if args and kwargs:
raise FilterArgumentError('can\'t handle positional and keyword '
'arguments at the same time')
return soft_unicode(value) % (kwargs or args)
def do_trim(value):
"""Strip leading and trailing whitespace."""
return soft_unicode(value).strip()
def do_striptags(value):
"""Strip SGML/XML tags and replace adjacent whitespace by one space.
"""
if hasattr(value, '__html__'):
value = value.__html__()
return Markup(text_type(value)).striptags()
def do_slice(value, slices, fill_with=None):
"""Slice an iterator and return a list of lists containing
those items. Useful if you want to create a div containing
three ul tags that represent columns:
.. sourcecode:: html+jinja
<div class="columwrapper">
{%- for column in items|slice(3) %}
<ul class="column-{{ loop.index }}">
{%- for item in column %}
<li>{{ item }}</li>
{%- endfor %}
</ul>
{%- endfor %}
</div>
If you pass it a second argument it's used to fill missing
values on the last iteration.
"""
seq = list(value)
length = len(seq)
items_per_slice = length // slices
slices_with_extra = length % slices
offset = 0
for slice_number in range(slices):
start = offset + slice_number * items_per_slice
if slice_number < slices_with_extra:
offset += 1
end = offset + (slice_number + 1) * items_per_slice
tmp = seq[start:end]
if fill_with is not None and slice_number >= slices_with_extra:
tmp.append(fill_with)
yield tmp
def do_batch(value, linecount, fill_with=None):
"""
A filter that batches items. It works pretty much like `slice`
just the other way round. It returns a list of lists with the
given number of items. If you provide a second parameter this
is used to fill up missing items. See this example:
.. sourcecode:: html+jinja
<table>
{%- for row in items|batch(3, '&nbsp;') %}
<tr>
{%- for column in row %}
<td>{{ column }}</td>
{%- endfor %}
</tr>
{%- endfor %}
</table>
"""
result = []
tmp = []
for item in value:
if len(tmp) == linecount:
yield tmp
tmp = []
tmp.append(item)
if tmp:
if fill_with is not None and len(tmp) < linecount:
tmp += [fill_with] * (linecount - len(tmp))
yield tmp
def do_round(value, precision=0, method='common'):
"""Round the number to a given precision. The first
parameter specifies the precision (default is ``0``), the
second the rounding method:
- ``'common'`` rounds either up or down
- ``'ceil'`` always rounds up
- ``'floor'`` always rounds down
If you don't specify a method ``'common'`` is used.
.. sourcecode:: jinja
{{ 42.55|round }}
-> 43.0
{{ 42.55|round(1, 'floor') }}
-> 42.5
Note that even if rounded to 0 precision, a float is returned. If
you need a real integer, pipe it through `int`:
.. sourcecode:: jinja
{{ 42.55|round|int }}
-> 43
"""
if not method in ('common', 'ceil', 'floor'):
raise FilterArgumentError('method must be common, ceil or floor')
if method == 'common':
return round(value, precision)
func = getattr(math, method)
return func(value * (10 ** precision)) / (10 ** precision)
@environmentfilter
def do_groupby(environment, value, attribute):
"""Group a sequence of objects by a common attribute.
If you for example have a list of dicts or objects that represent persons
with `gender`, `first_name` and `last_name` attributes and you want to
group all users by genders you can do something like the following
snippet:
.. sourcecode:: html+jinja
<ul>
{% for group in persons|groupby('gender') %}
<li>{{ group.grouper }}<ul>
{% for person in group.list %}
<li>{{ person.first_name }} {{ person.last_name }}</li>
{% endfor %}</ul></li>
{% endfor %}
</ul>
Additionally it's possible to use tuple unpacking for the grouper and
list:
.. sourcecode:: html+jinja
<ul>
{% for grouper, list in persons|groupby('gender') %}
...
{% endfor %}
</ul>
As you can see the item we're grouping by is stored in the `grouper`
attribute and the `list` contains all the objects that have this grouper
in common.
.. versionchanged:: 2.6
It's now possible to use dotted notation to group by the child
attribute of another attribute.
"""
expr = make_attrgetter(environment, attribute)
return sorted(map(_GroupTuple, groupby(sorted(value, key=expr), expr)))
class _GroupTuple(tuple):
__slots__ = ()
grouper = property(itemgetter(0))
list = property(itemgetter(1))
def __new__(cls, xxx_todo_changeme):
(key, value) = xxx_todo_changeme
return tuple.__new__(cls, (key, list(value)))
@environmentfilter
def do_sum(environment, iterable, attribute=None, start=0):
"""Returns the sum of a sequence of numbers plus the value of parameter
'start' (which defaults to 0). When the sequence is empty it returns
start.
It is also possible to sum up only certain attributes:
.. sourcecode:: jinja
Total: {{ items|sum(attribute='price') }}
.. versionchanged:: 2.6
The `attribute` parameter was added to allow suming up over
attributes. Also the `start` parameter was moved on to the right.
"""
if attribute is not None:
iterable = imap(make_attrgetter(environment, attribute), iterable)
return sum(iterable, start)
def do_list(value):
"""Convert the value into a list. If it was a string the returned list
will be a list of characters.
"""
return list(value)
def do_mark_safe(value):
"""Mark the value as safe which means that in an environment with automatic
escaping enabled this variable will not be escaped.
"""
return Markup(value)
def do_mark_unsafe(value):
"""Mark a value as unsafe. This is the reverse operation for :func:`safe`."""
return text_type(value)
def do_reverse(value):
"""Reverse the object or return an iterator the iterates over it the other
way round.
"""
if isinstance(value, string_types):
return value[::-1]
try:
return reversed(value)
except TypeError:
try:
rv = list(value)
rv.reverse()
return rv
except TypeError:
raise FilterArgumentError('argument must be iterable')
@environmentfilter
def do_attr(environment, obj, name):
"""Get an attribute of an object. ``foo|attr("bar")`` works like
``foo["bar"]`` just that always an attribute is returned and items are not
looked up.
See :ref:`Notes on subscriptions <notes-on-subscriptions>` for more details.
"""
try:
name = str(name)
except UnicodeError:
pass
else:
try:
value = getattr(obj, name)
except AttributeError:
pass
else:
if environment.sandboxed and not \
environment.is_safe_attribute(obj, name, value):
return environment.unsafe_undefined(obj, name)
return value
return environment.undefined(obj=obj, name=name)
@contextfilter
def do_map(*args, **kwargs):
"""Applies a filter on a sequence of objects or looks up an attribute.
This is useful when dealing with lists of objects but you are really
only interested in a certain value of it.
The basic usage is mapping on an attribute. Imagine you have a list
of users but you are only interested in a list of usernames:
.. sourcecode:: jinja
Users on this page: {{ users|map(attribute='username')|join(', ') }}
Alternatively you can let it invoke a filter by passing the name of the
filter and the arguments afterwards. A good example would be applying a
text conversion filter on a sequence:
.. sourcecode:: jinja
Users on this page: {{ titles|map('lower')|join(', ') }}
.. versionadded:: 2.7
"""
context = args[0]
seq = args[1]
if len(args) == 2 and 'attribute' in kwargs:
attribute = kwargs.pop('attribute')
if kwargs:
raise FilterArgumentError('Unexpected keyword argument %r' %
next(iter(kwargs)))
func = make_attrgetter(context.environment, attribute)
else:
try:
name = args[2]
args = args[3:]
except LookupError:
raise FilterArgumentError('map requires a filter argument')
func = lambda item: context.environment.call_filter(
name, item, args, kwargs, context=context)
if seq:
for item in seq:
yield func(item)
@contextfilter
def do_select(*args, **kwargs):
"""Filters a sequence of objects by appying a test to either the object
or the attribute and only selecting the ones with the test succeeding.
Example usage:
.. sourcecode:: jinja
{{ numbers|select("odd") }}
.. versionadded:: 2.7
"""
return _select_or_reject(args, kwargs, lambda x: x, False)
@contextfilter
def do_reject(*args, **kwargs):
"""Filters a sequence of objects by appying a test to either the object
or the attribute and rejecting the ones with the test succeeding.
Example usage:
.. sourcecode:: jinja
{{ numbers|reject("odd") }}
.. versionadded:: 2.7
"""
return _select_or_reject(args, kwargs, lambda x: not x, False)
@contextfilter
def do_selectattr(*args, **kwargs):
"""Filters a sequence of objects by appying a test to either the object
or the attribute and only selecting the ones with the test succeeding.
Example usage:
.. sourcecode:: jinja
{{ users|selectattr("is_active") }}
{{ users|selectattr("email", "none") }}
.. versionadded:: 2.7
"""
return _select_or_reject(args, kwargs, lambda x: x, True)
@contextfilter
def do_rejectattr(*args, **kwargs):
"""Filters a sequence of objects by appying a test to either the object
or the attribute and rejecting the ones with the test succeeding.
.. sourcecode:: jinja
{{ users|rejectattr("is_active") }}
{{ users|rejectattr("email", "none") }}
.. versionadded:: 2.7
"""
return _select_or_reject(args, kwargs, lambda x: not x, True)
def _select_or_reject(args, kwargs, modfunc, lookup_attr):
context = args[0]
seq = args[1]
if lookup_attr:
try:
attr = args[2]
except LookupError:
raise FilterArgumentError('Missing parameter for attribute name')
transfunc = make_attrgetter(context.environment, attr)
off = 1
else:
off = 0
transfunc = lambda x: x
try:
name = args[2 + off]
args = args[3 + off:]
func = lambda item: context.environment.call_test(
name, item, args, kwargs)
except LookupError:
func = bool
if seq:
for item in seq:
if modfunc(func(transfunc(item))):
yield item
FILTERS = {
'attr': do_attr,
'replace': do_replace,
'upper': do_upper,
'lower': do_lower,
'escape': escape,
'e': escape,
'forceescape': do_forceescape,
'capitalize': do_capitalize,
'title': do_title,
'default': do_default,
'd': do_default,
'join': do_join,
'count': len,
'dictsort': do_dictsort,
'sort': do_sort,
'length': len,
'reverse': do_reverse,
'center': do_center,
'indent': do_indent,
'title': do_title,
'capitalize': do_capitalize,
'first': do_first,
'last': do_last,
'map': do_map,
'random': do_random,
'reject': do_reject,
'rejectattr': do_rejectattr,
'filesizeformat': do_filesizeformat,
'pprint': do_pprint,
'truncate': do_truncate,
'wordwrap': do_wordwrap,
'wordcount': do_wordcount,
'int': do_int,
'float': do_float,
'string': soft_unicode,
'list': do_list,
'urlize': do_urlize,
'format': do_format,
'trim': do_trim,
'striptags': do_striptags,
'select': do_select,
'selectattr': do_selectattr,
'slice': do_slice,
'batch': do_batch,
'sum': do_sum,
'abs': abs,
'round': do_round,
'groupby': do_groupby,
'safe': do_mark_safe,
'xmlattr': do_xmlattr,
'urlencode': do_urlencode
}
+733
View File
@@ -0,0 +1,733 @@
# -*- coding: utf-8 -*-
"""
jinja2.lexer
~~~~~~~~~~~~
This module implements a Jinja / Python combination lexer. The
`Lexer` class provided by this module is used to do some preprocessing
for Jinja.
On the one hand it filters out invalid operators like the bitshift
operators we don't allow in templates. On the other hand it separates
template code and python code in expressions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
from operator import itemgetter
from collections import deque
from jinja2.exceptions import TemplateSyntaxError
from jinja2.utils import LRUCache
from jinja2._compat import next, iteritems, implements_iterator, text_type, \
intern
# cache for the lexers. Exists in order to be able to have multiple
# environments with the same lexer
_lexer_cache = LRUCache(50)
# static regular expressions
whitespace_re = re.compile(r'\s+', re.U)
string_re = re.compile(r"('([^'\\]*(?:\\.[^'\\]*)*)'"
r'|"([^"\\]*(?:\\.[^"\\]*)*)")', re.S)
integer_re = re.compile(r'\d+')
# we use the unicode identifier rule if this python version is able
# to handle unicode identifiers, otherwise the standard ASCII one.
try:
compile('föö', '<unknown>', 'eval')
except SyntaxError:
name_re = re.compile(r'\b[a-zA-Z_][a-zA-Z0-9_]*\b')
else:
from jinja2 import _stringdefs
name_re = re.compile(r'[%s][%s]*' % (_stringdefs.xid_start,
_stringdefs.xid_continue))
float_re = re.compile(r'(?<!\.)\d+\.\d+')
newline_re = re.compile(r'(\r\n|\r|\n)')
# internal the tokens and keep references to them
TOKEN_ADD = intern('add')
TOKEN_ASSIGN = intern('assign')
TOKEN_COLON = intern('colon')
TOKEN_COMMA = intern('comma')
TOKEN_DIV = intern('div')
TOKEN_DOT = intern('dot')
TOKEN_EQ = intern('eq')
TOKEN_FLOORDIV = intern('floordiv')
TOKEN_GT = intern('gt')
TOKEN_GTEQ = intern('gteq')
TOKEN_LBRACE = intern('lbrace')
TOKEN_LBRACKET = intern('lbracket')
TOKEN_LPAREN = intern('lparen')
TOKEN_LT = intern('lt')
TOKEN_LTEQ = intern('lteq')
TOKEN_MOD = intern('mod')
TOKEN_MUL = intern('mul')
TOKEN_NE = intern('ne')
TOKEN_PIPE = intern('pipe')
TOKEN_POW = intern('pow')
TOKEN_RBRACE = intern('rbrace')
TOKEN_RBRACKET = intern('rbracket')
TOKEN_RPAREN = intern('rparen')
TOKEN_SEMICOLON = intern('semicolon')
TOKEN_SUB = intern('sub')
TOKEN_TILDE = intern('tilde')
TOKEN_WHITESPACE = intern('whitespace')
TOKEN_FLOAT = intern('float')
TOKEN_INTEGER = intern('integer')
TOKEN_NAME = intern('name')
TOKEN_STRING = intern('string')
TOKEN_OPERATOR = intern('operator')
TOKEN_BLOCK_BEGIN = intern('block_begin')
TOKEN_BLOCK_END = intern('block_end')
TOKEN_VARIABLE_BEGIN = intern('variable_begin')
TOKEN_VARIABLE_END = intern('variable_end')
TOKEN_RAW_BEGIN = intern('raw_begin')
TOKEN_RAW_END = intern('raw_end')
TOKEN_COMMENT_BEGIN = intern('comment_begin')
TOKEN_COMMENT_END = intern('comment_end')
TOKEN_COMMENT = intern('comment')
TOKEN_LINESTATEMENT_BEGIN = intern('linestatement_begin')
TOKEN_LINESTATEMENT_END = intern('linestatement_end')
TOKEN_LINECOMMENT_BEGIN = intern('linecomment_begin')
TOKEN_LINECOMMENT_END = intern('linecomment_end')
TOKEN_LINECOMMENT = intern('linecomment')
TOKEN_DATA = intern('data')
TOKEN_INITIAL = intern('initial')
TOKEN_EOF = intern('eof')
# bind operators to token types
operators = {
'+': TOKEN_ADD,
'-': TOKEN_SUB,
'/': TOKEN_DIV,
'//': TOKEN_FLOORDIV,
'*': TOKEN_MUL,
'%': TOKEN_MOD,
'**': TOKEN_POW,
'~': TOKEN_TILDE,
'[': TOKEN_LBRACKET,
']': TOKEN_RBRACKET,
'(': TOKEN_LPAREN,
')': TOKEN_RPAREN,
'{': TOKEN_LBRACE,
'}': TOKEN_RBRACE,
'==': TOKEN_EQ,
'!=': TOKEN_NE,
'>': TOKEN_GT,
'>=': TOKEN_GTEQ,
'<': TOKEN_LT,
'<=': TOKEN_LTEQ,
'=': TOKEN_ASSIGN,
'.': TOKEN_DOT,
':': TOKEN_COLON,
'|': TOKEN_PIPE,
',': TOKEN_COMMA,
';': TOKEN_SEMICOLON
}
reverse_operators = dict([(v, k) for k, v in iteritems(operators)])
assert len(operators) == len(reverse_operators), 'operators dropped'
operator_re = re.compile('(%s)' % '|'.join(re.escape(x) for x in
sorted(operators, key=lambda x: -len(x))))
ignored_tokens = frozenset([TOKEN_COMMENT_BEGIN, TOKEN_COMMENT,
TOKEN_COMMENT_END, TOKEN_WHITESPACE,
TOKEN_WHITESPACE, TOKEN_LINECOMMENT_BEGIN,
TOKEN_LINECOMMENT_END, TOKEN_LINECOMMENT])
ignore_if_empty = frozenset([TOKEN_WHITESPACE, TOKEN_DATA,
TOKEN_COMMENT, TOKEN_LINECOMMENT])
def _describe_token_type(token_type):
if token_type in reverse_operators:
return reverse_operators[token_type]
return {
TOKEN_COMMENT_BEGIN: 'begin of comment',
TOKEN_COMMENT_END: 'end of comment',
TOKEN_COMMENT: 'comment',
TOKEN_LINECOMMENT: 'comment',
TOKEN_BLOCK_BEGIN: 'begin of statement block',
TOKEN_BLOCK_END: 'end of statement block',
TOKEN_VARIABLE_BEGIN: 'begin of print statement',
TOKEN_VARIABLE_END: 'end of print statement',
TOKEN_LINESTATEMENT_BEGIN: 'begin of line statement',
TOKEN_LINESTATEMENT_END: 'end of line statement',
TOKEN_DATA: 'template data / text',
TOKEN_EOF: 'end of template'
}.get(token_type, token_type)
def describe_token(token):
"""Returns a description of the token."""
if token.type == 'name':
return token.value
return _describe_token_type(token.type)
def describe_token_expr(expr):
"""Like `describe_token` but for token expressions."""
if ':' in expr:
type, value = expr.split(':', 1)
if type == 'name':
return value
else:
type = expr
return _describe_token_type(type)
def count_newlines(value):
"""Count the number of newline characters in the string. This is
useful for extensions that filter a stream.
"""
return len(newline_re.findall(value))
def compile_rules(environment):
"""Compiles all the rules from the environment into a list of rules."""
e = re.escape
rules = [
(len(environment.comment_start_string), 'comment',
e(environment.comment_start_string)),
(len(environment.block_start_string), 'block',
e(environment.block_start_string)),
(len(environment.variable_start_string), 'variable',
e(environment.variable_start_string))
]
if environment.line_statement_prefix is not None:
rules.append((len(environment.line_statement_prefix), 'linestatement',
r'^[ \t\v]*' + e(environment.line_statement_prefix)))
if environment.line_comment_prefix is not None:
rules.append((len(environment.line_comment_prefix), 'linecomment',
r'(?:^|(?<=\S))[^\S\r\n]*' +
e(environment.line_comment_prefix)))
return [x[1:] for x in sorted(rules, reverse=True)]
class Failure(object):
"""Class that raises a `TemplateSyntaxError` if called.
Used by the `Lexer` to specify known errors.
"""
def __init__(self, message, cls=TemplateSyntaxError):
self.message = message
self.error_class = cls
def __call__(self, lineno, filename):
raise self.error_class(self.message, lineno, filename)
class Token(tuple):
"""Token class."""
__slots__ = ()
lineno, type, value = (property(itemgetter(x)) for x in range(3))
def __new__(cls, lineno, type, value):
return tuple.__new__(cls, (lineno, intern(str(type)), value))
def __str__(self):
if self.type in reverse_operators:
return reverse_operators[self.type]
elif self.type == 'name':
return self.value
return self.type
def test(self, expr):
"""Test a token against a token expression. This can either be a
token type or ``'token_type:token_value'``. This can only test
against string values and types.
"""
# here we do a regular string equality check as test_any is usually
# passed an iterable of not interned strings.
if self.type == expr:
return True
elif ':' in expr:
return expr.split(':', 1) == [self.type, self.value]
return False
def test_any(self, *iterable):
"""Test against multiple token expressions."""
for expr in iterable:
if self.test(expr):
return True
return False
def __repr__(self):
return 'Token(%r, %r, %r)' % (
self.lineno,
self.type,
self.value
)
@implements_iterator
class TokenStreamIterator(object):
"""The iterator for tokenstreams. Iterate over the stream
until the eof token is reached.
"""
def __init__(self, stream):
self.stream = stream
def __iter__(self):
return self
def __next__(self):
token = self.stream.current
if token.type is TOKEN_EOF:
self.stream.close()
raise StopIteration()
next(self.stream)
return token
@implements_iterator
class TokenStream(object):
"""A token stream is an iterable that yields :class:`Token`\s. The
parser however does not iterate over it but calls :meth:`next` to go
one token ahead. The current active token is stored as :attr:`current`.
"""
def __init__(self, generator, name, filename):
self._iter = iter(generator)
self._pushed = deque()
self.name = name
self.filename = filename
self.closed = False
self.current = Token(1, TOKEN_INITIAL, '')
next(self)
def __iter__(self):
return TokenStreamIterator(self)
def __bool__(self):
return bool(self._pushed) or self.current.type is not TOKEN_EOF
__nonzero__ = __bool__ # py2
eos = property(lambda x: not x, doc="Are we at the end of the stream?")
def push(self, token):
"""Push a token back to the stream."""
self._pushed.append(token)
def look(self):
"""Look at the next token."""
old_token = next(self)
result = self.current
self.push(result)
self.current = old_token
return result
def skip(self, n=1):
"""Got n tokens ahead."""
for x in range(n):
next(self)
def next_if(self, expr):
"""Perform the token test and return the token if it matched.
Otherwise the return value is `None`.
"""
if self.current.test(expr):
return next(self)
def skip_if(self, expr):
"""Like :meth:`next_if` but only returns `True` or `False`."""
return self.next_if(expr) is not None
def __next__(self):
"""Go one token ahead and return the old one"""
rv = self.current
if self._pushed:
self.current = self._pushed.popleft()
elif self.current.type is not TOKEN_EOF:
try:
self.current = next(self._iter)
except StopIteration:
self.close()
return rv
def close(self):
"""Close the stream."""
self.current = Token(self.current.lineno, TOKEN_EOF, '')
self._iter = None
self.closed = True
def expect(self, expr):
"""Expect a given token type and return it. This accepts the same
argument as :meth:`jinja2.lexer.Token.test`.
"""
if not self.current.test(expr):
expr = describe_token_expr(expr)
if self.current.type is TOKEN_EOF:
raise TemplateSyntaxError('unexpected end of template, '
'expected %r.' % expr,
self.current.lineno,
self.name, self.filename)
raise TemplateSyntaxError("expected token %r, got %r" %
(expr, describe_token(self.current)),
self.current.lineno,
self.name, self.filename)
try:
return self.current
finally:
next(self)
def get_lexer(environment):
"""Return a lexer which is probably cached."""
key = (environment.block_start_string,
environment.block_end_string,
environment.variable_start_string,
environment.variable_end_string,
environment.comment_start_string,
environment.comment_end_string,
environment.line_statement_prefix,
environment.line_comment_prefix,
environment.trim_blocks,
environment.lstrip_blocks,
environment.newline_sequence,
environment.keep_trailing_newline)
lexer = _lexer_cache.get(key)
if lexer is None:
lexer = Lexer(environment)
_lexer_cache[key] = lexer
return lexer
class Lexer(object):
"""Class that implements a lexer for a given environment. Automatically
created by the environment class, usually you don't have to do that.
Note that the lexer is not automatically bound to an environment.
Multiple environments can share the same lexer.
"""
def __init__(self, environment):
# shortcuts
c = lambda x: re.compile(x, re.M | re.S)
e = re.escape
# lexing rules for tags
tag_rules = [
(whitespace_re, TOKEN_WHITESPACE, None),
(float_re, TOKEN_FLOAT, None),
(integer_re, TOKEN_INTEGER, None),
(name_re, TOKEN_NAME, None),
(string_re, TOKEN_STRING, None),
(operator_re, TOKEN_OPERATOR, None)
]
# assemble the root lexing rule. because "|" is ungreedy
# we have to sort by length so that the lexer continues working
# as expected when we have parsing rules like <% for block and
# <%= for variables. (if someone wants asp like syntax)
# variables are just part of the rules if variable processing
# is required.
root_tag_rules = compile_rules(environment)
# block suffix if trimming is enabled
block_suffix_re = environment.trim_blocks and '\\n?' or ''
# strip leading spaces if lstrip_blocks is enabled
prefix_re = {}
if environment.lstrip_blocks:
# use '{%+' to manually disable lstrip_blocks behavior
no_lstrip_re = e('+')
# detect overlap between block and variable or comment strings
block_diff = c(r'^%s(.*)' % e(environment.block_start_string))
# make sure we don't mistake a block for a variable or a comment
m = block_diff.match(environment.comment_start_string)
no_lstrip_re += m and r'|%s' % e(m.group(1)) or ''
m = block_diff.match(environment.variable_start_string)
no_lstrip_re += m and r'|%s' % e(m.group(1)) or ''
# detect overlap between comment and variable strings
comment_diff = c(r'^%s(.*)' % e(environment.comment_start_string))
m = comment_diff.match(environment.variable_start_string)
no_variable_re = m and r'(?!%s)' % e(m.group(1)) or ''
lstrip_re = r'^[ \t]*'
block_prefix_re = r'%s%s(?!%s)|%s\+?' % (
lstrip_re,
e(environment.block_start_string),
no_lstrip_re,
e(environment.block_start_string),
)
comment_prefix_re = r'%s%s%s|%s\+?' % (
lstrip_re,
e(environment.comment_start_string),
no_variable_re,
e(environment.comment_start_string),
)
prefix_re['block'] = block_prefix_re
prefix_re['comment'] = comment_prefix_re
else:
block_prefix_re = '%s' % e(environment.block_start_string)
self.newline_sequence = environment.newline_sequence
self.keep_trailing_newline = environment.keep_trailing_newline
# global lexing rules
self.rules = {
'root': [
# directives
(c('(.*?)(?:%s)' % '|'.join(
[r'(?P<raw_begin>(?:\s*%s\-|%s)\s*raw\s*(?:\-%s\s*|%s))' % (
e(environment.block_start_string),
block_prefix_re,
e(environment.block_end_string),
e(environment.block_end_string)
)] + [
r'(?P<%s_begin>\s*%s\-|%s)' % (n, r, prefix_re.get(n,r))
for n, r in root_tag_rules
])), (TOKEN_DATA, '#bygroup'), '#bygroup'),
# data
(c('.+'), TOKEN_DATA, None)
],
# comments
TOKEN_COMMENT_BEGIN: [
(c(r'(.*?)((?:\-%s\s*|%s)%s)' % (
e(environment.comment_end_string),
e(environment.comment_end_string),
block_suffix_re
)), (TOKEN_COMMENT, TOKEN_COMMENT_END), '#pop'),
(c('(.)'), (Failure('Missing end of comment tag'),), None)
],
# blocks
TOKEN_BLOCK_BEGIN: [
(c('(?:\-%s\s*|%s)%s' % (
e(environment.block_end_string),
e(environment.block_end_string),
block_suffix_re
)), TOKEN_BLOCK_END, '#pop'),
] + tag_rules,
# variables
TOKEN_VARIABLE_BEGIN: [
(c('\-%s\s*|%s' % (
e(environment.variable_end_string),
e(environment.variable_end_string)
)), TOKEN_VARIABLE_END, '#pop')
] + tag_rules,
# raw block
TOKEN_RAW_BEGIN: [
(c('(.*?)((?:\s*%s\-|%s)\s*endraw\s*(?:\-%s\s*|%s%s))' % (
e(environment.block_start_string),
block_prefix_re,
e(environment.block_end_string),
e(environment.block_end_string),
block_suffix_re
)), (TOKEN_DATA, TOKEN_RAW_END), '#pop'),
(c('(.)'), (Failure('Missing end of raw directive'),), None)
],
# line statements
TOKEN_LINESTATEMENT_BEGIN: [
(c(r'\s*(\n|$)'), TOKEN_LINESTATEMENT_END, '#pop')
] + tag_rules,
# line comments
TOKEN_LINECOMMENT_BEGIN: [
(c(r'(.*?)()(?=\n|$)'), (TOKEN_LINECOMMENT,
TOKEN_LINECOMMENT_END), '#pop')
]
}
def _normalize_newlines(self, value):
"""Called for strings and template data to normalize it to unicode."""
return newline_re.sub(self.newline_sequence, value)
def tokenize(self, source, name=None, filename=None, state=None):
"""Calls tokeniter + tokenize and wraps it in a token stream.
"""
stream = self.tokeniter(source, name, filename, state)
return TokenStream(self.wrap(stream, name, filename), name, filename)
def wrap(self, stream, name=None, filename=None):
"""This is called with the stream as returned by `tokenize` and wraps
every token in a :class:`Token` and converts the value.
"""
for lineno, token, value in stream:
if token in ignored_tokens:
continue
elif token == 'linestatement_begin':
token = 'block_begin'
elif token == 'linestatement_end':
token = 'block_end'
# we are not interested in those tokens in the parser
elif token in ('raw_begin', 'raw_end'):
continue
elif token == 'data':
value = self._normalize_newlines(value)
elif token == 'keyword':
token = value
elif token == 'name':
value = str(value)
elif token == 'string':
# try to unescape string
try:
value = self._normalize_newlines(value[1:-1]) \
.encode('ascii', 'backslashreplace') \
.decode('unicode-escape')
except Exception as e:
msg = str(e).split(':')[-1].strip()
raise TemplateSyntaxError(msg, lineno, name, filename)
# if we can express it as bytestring (ascii only)
# we do that for support of semi broken APIs
# as datetime.datetime.strftime. On python 3 this
# call becomes a noop thanks to 2to3
try:
value = str(value)
except UnicodeError:
pass
elif token == 'integer':
value = int(value)
elif token == 'float':
value = float(value)
elif token == 'operator':
token = operators[value]
yield Token(lineno, token, value)
def tokeniter(self, source, name, filename=None, state=None):
"""This method tokenizes the text and returns the tokens in a
generator. Use this method if you just want to tokenize a template.
"""
source = text_type(source)
lines = source.splitlines()
if self.keep_trailing_newline and source:
for newline in ('\r\n', '\r', '\n'):
if source.endswith(newline):
lines.append('')
break
source = '\n'.join(lines)
pos = 0
lineno = 1
stack = ['root']
if state is not None and state != 'root':
assert state in ('variable', 'block'), 'invalid state'
stack.append(state + '_begin')
else:
state = 'root'
statetokens = self.rules[stack[-1]]
source_length = len(source)
balancing_stack = []
while 1:
# tokenizer loop
for regex, tokens, new_state in statetokens:
m = regex.match(source, pos)
# if no match we try again with the next rule
if m is None:
continue
# we only match blocks and variables if braces / parentheses
# are balanced. continue parsing with the lower rule which
# is the operator rule. do this only if the end tags look
# like operators
if balancing_stack and \
tokens in ('variable_end', 'block_end',
'linestatement_end'):
continue
# tuples support more options
if isinstance(tokens, tuple):
for idx, token in enumerate(tokens):
# failure group
if token.__class__ is Failure:
raise token(lineno, filename)
# bygroup is a bit more complex, in that case we
# yield for the current token the first named
# group that matched
elif token == '#bygroup':
for key, value in iteritems(m.groupdict()):
if value is not None:
yield lineno, key, value
lineno += value.count('\n')
break
else:
raise RuntimeError('%r wanted to resolve '
'the token dynamically'
' but no group matched'
% regex)
# normal group
else:
data = m.group(idx + 1)
if data or token not in ignore_if_empty:
yield lineno, token, data
lineno += data.count('\n')
# strings as token just are yielded as it.
else:
data = m.group()
# update brace/parentheses balance
if tokens == 'operator':
if data == '{':
balancing_stack.append('}')
elif data == '(':
balancing_stack.append(')')
elif data == '[':
balancing_stack.append(']')
elif data in ('}', ')', ']'):
if not balancing_stack:
raise TemplateSyntaxError('unexpected \'%s\'' %
data, lineno, name,
filename)
expected_op = balancing_stack.pop()
if expected_op != data:
raise TemplateSyntaxError('unexpected \'%s\', '
'expected \'%s\'' %
(data, expected_op),
lineno, name,
filename)
# yield items
if data or tokens not in ignore_if_empty:
yield lineno, tokens, data
lineno += data.count('\n')
# fetch new position into new variable so that we can check
# if there is a internal parsing error which would result
# in an infinite loop
pos2 = m.end()
# handle state changes
if new_state is not None:
# remove the uppermost state
if new_state == '#pop':
stack.pop()
# resolve the new state by group checking
elif new_state == '#bygroup':
for key, value in iteritems(m.groupdict()):
if value is not None:
stack.append(key)
break
else:
raise RuntimeError('%r wanted to resolve the '
'new state dynamically but'
' no group matched' %
regex)
# direct state name given
else:
stack.append(new_state)
statetokens = self.rules[stack[-1]]
# we are still at the same position and no stack change.
# this means a loop without break condition, avoid that and
# raise error
elif pos2 == pos:
raise RuntimeError('%r yielded empty string without '
'stack change' % regex)
# publish new function and start again
pos = pos2
break
# if loop terminated without break we haven't found a single match
# either we are at the end of the file or we have a problem
else:
# end of text
if pos >= source_length:
return
# something went wrong
raise TemplateSyntaxError('unexpected char %r at %d' %
(source[pos], pos), lineno,
name, filename)
+471
View File
@@ -0,0 +1,471 @@
# -*- coding: utf-8 -*-
"""
jinja2.loaders
~~~~~~~~~~~~~~
Jinja loader classes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import weakref
from types import ModuleType
from os import path
from hashlib import sha1
from jinja2.exceptions import TemplateNotFound
from jinja2.utils import open_if_exists, internalcode
from jinja2._compat import string_types, iteritems
def split_template_path(template):
"""Split a path into segments and perform a sanity check. If it detects
'..' in the path it will raise a `TemplateNotFound` error.
"""
pieces = []
for piece in template.split('/'):
if path.sep in piece \
or (path.altsep and path.altsep in piece) or \
piece == path.pardir:
raise TemplateNotFound(template)
elif piece and piece != '.':
pieces.append(piece)
return pieces
class BaseLoader(object):
"""Baseclass for all loaders. Subclass this and override `get_source` to
implement a custom loading mechanism. The environment provides a
`get_template` method that calls the loader's `load` method to get the
:class:`Template` object.
A very basic example for a loader that looks up templates on the file
system could look like this::
from jinja2 import BaseLoader, TemplateNotFound
from os.path import join, exists, getmtime
class MyLoader(BaseLoader):
def __init__(self, path):
self.path = path
def get_source(self, environment, template):
path = join(self.path, template)
if not exists(path):
raise TemplateNotFound(template)
mtime = getmtime(path)
with file(path) as f:
source = f.read().decode('utf-8')
return source, path, lambda: mtime == getmtime(path)
"""
#: if set to `False` it indicates that the loader cannot provide access
#: to the source of templates.
#:
#: .. versionadded:: 2.4
has_source_access = True
def get_source(self, environment, template):
"""Get the template source, filename and reload helper for a template.
It's passed the environment and template name and has to return a
tuple in the form ``(source, filename, uptodate)`` or raise a
`TemplateNotFound` error if it can't locate the template.
The source part of the returned tuple must be the source of the
template as unicode string or a ASCII bytestring. The filename should
be the name of the file on the filesystem if it was loaded from there,
otherwise `None`. The filename is used by python for the tracebacks
if no loader extension is used.
The last item in the tuple is the `uptodate` function. If auto
reloading is enabled it's always called to check if the template
changed. No arguments are passed so the function must store the
old state somewhere (for example in a closure). If it returns `False`
the template will be reloaded.
"""
if not self.has_source_access:
raise RuntimeError('%s cannot provide access to the source' %
self.__class__.__name__)
raise TemplateNotFound(template)
def list_templates(self):
"""Iterates over all templates. If the loader does not support that
it should raise a :exc:`TypeError` which is the default behavior.
"""
raise TypeError('this loader cannot iterate over all templates')
@internalcode
def load(self, environment, name, globals=None):
"""Loads a template. This method looks up the template in the cache
or loads one by calling :meth:`get_source`. Subclasses should not
override this method as loaders working on collections of other
loaders (such as :class:`PrefixLoader` or :class:`ChoiceLoader`)
will not call this method but `get_source` directly.
"""
code = None
if globals is None:
globals = {}
# first we try to get the source for this template together
# with the filename and the uptodate function.
source, filename, uptodate = self.get_source(environment, name)
# try to load the code from the bytecode cache if there is a
# bytecode cache configured.
bcc = environment.bytecode_cache
if bcc is not None:
bucket = bcc.get_bucket(environment, name, filename, source)
code = bucket.code
# if we don't have code so far (not cached, no longer up to
# date) etc. we compile the template
if code is None:
code = environment.compile(source, name, filename)
# if the bytecode cache is available and the bucket doesn't
# have a code so far, we give the bucket the new code and put
# it back to the bytecode cache.
if bcc is not None and bucket.code is None:
bucket.code = code
bcc.set_bucket(bucket)
return environment.template_class.from_code(environment, code,
globals, uptodate)
class FileSystemLoader(BaseLoader):
"""Loads templates from the file system. This loader can find templates
in folders on the file system and is the preferred way to load them.
The loader takes the path to the templates as string, or if multiple
locations are wanted a list of them which is then looked up in the
given order:
>>> loader = FileSystemLoader('/path/to/templates')
>>> loader = FileSystemLoader(['/path/to/templates', '/other/path'])
Per default the template encoding is ``'utf-8'`` which can be changed
by setting the `encoding` parameter to something else.
"""
def __init__(self, searchpath, encoding='utf-8'):
if isinstance(searchpath, string_types):
searchpath = [searchpath]
self.searchpath = list(searchpath)
self.encoding = encoding
def get_source(self, environment, template):
pieces = split_template_path(template)
for searchpath in self.searchpath:
filename = path.join(searchpath, *pieces)
f = open_if_exists(filename)
if f is None:
continue
try:
contents = f.read().decode(self.encoding)
finally:
f.close()
mtime = path.getmtime(filename)
def uptodate():
try:
return path.getmtime(filename) == mtime
except OSError:
return False
return contents, filename, uptodate
raise TemplateNotFound(template)
def list_templates(self):
found = set()
for searchpath in self.searchpath:
for dirpath, dirnames, filenames in os.walk(searchpath):
for filename in filenames:
template = os.path.join(dirpath, filename) \
[len(searchpath):].strip(os.path.sep) \
.replace(os.path.sep, '/')
if template[:2] == './':
template = template[2:]
if template not in found:
found.add(template)
return sorted(found)
class PackageLoader(BaseLoader):
"""Load templates from python eggs or packages. It is constructed with
the name of the python package and the path to the templates in that
package::
loader = PackageLoader('mypackage', 'views')
If the package path is not given, ``'templates'`` is assumed.
Per default the template encoding is ``'utf-8'`` which can be changed
by setting the `encoding` parameter to something else. Due to the nature
of eggs it's only possible to reload templates if the package was loaded
from the file system and not a zip file.
"""
def __init__(self, package_name, package_path='templates',
encoding='utf-8'):
from pkg_resources import DefaultProvider, ResourceManager, \
get_provider
provider = get_provider(package_name)
self.encoding = encoding
self.manager = ResourceManager()
self.filesystem_bound = isinstance(provider, DefaultProvider)
self.provider = provider
self.package_path = package_path
def get_source(self, environment, template):
pieces = split_template_path(template)
p = '/'.join((self.package_path,) + tuple(pieces))
if not self.provider.has_resource(p):
raise TemplateNotFound(template)
filename = uptodate = None
if self.filesystem_bound:
filename = self.provider.get_resource_filename(self.manager, p)
mtime = path.getmtime(filename)
def uptodate():
try:
return path.getmtime(filename) == mtime
except OSError:
return False
source = self.provider.get_resource_string(self.manager, p)
return source.decode(self.encoding), filename, uptodate
def list_templates(self):
path = self.package_path
if path[:2] == './':
path = path[2:]
elif path == '.':
path = ''
offset = len(path)
results = []
def _walk(path):
for filename in self.provider.resource_listdir(path):
fullname = path + '/' + filename
if self.provider.resource_isdir(fullname):
_walk(fullname)
else:
results.append(fullname[offset:].lstrip('/'))
_walk(path)
results.sort()
return results
class DictLoader(BaseLoader):
"""Loads a template from a python dict. It's passed a dict of unicode
strings bound to template names. This loader is useful for unittesting:
>>> loader = DictLoader({'index.html': 'source here'})
Because auto reloading is rarely useful this is disabled per default.
"""
def __init__(self, mapping):
self.mapping = mapping
def get_source(self, environment, template):
if template in self.mapping:
source = self.mapping[template]
return source, None, lambda: source == self.mapping.get(template)
raise TemplateNotFound(template)
def list_templates(self):
return sorted(self.mapping)
class FunctionLoader(BaseLoader):
"""A loader that is passed a function which does the loading. The
function becomes the name of the template passed and has to return either
an unicode string with the template source, a tuple in the form ``(source,
filename, uptodatefunc)`` or `None` if the template does not exist.
>>> def load_template(name):
... if name == 'index.html':
... return '...'
...
>>> loader = FunctionLoader(load_template)
The `uptodatefunc` is a function that is called if autoreload is enabled
and has to return `True` if the template is still up to date. For more
details have a look at :meth:`BaseLoader.get_source` which has the same
return value.
"""
def __init__(self, load_func):
self.load_func = load_func
def get_source(self, environment, template):
rv = self.load_func(template)
if rv is None:
raise TemplateNotFound(template)
elif isinstance(rv, string_types):
return rv, None, None
return rv
class PrefixLoader(BaseLoader):
"""A loader that is passed a dict of loaders where each loader is bound
to a prefix. The prefix is delimited from the template by a slash per
default, which can be changed by setting the `delimiter` argument to
something else::
loader = PrefixLoader({
'app1': PackageLoader('mypackage.app1'),
'app2': PackageLoader('mypackage.app2')
})
By loading ``'app1/index.html'`` the file from the app1 package is loaded,
by loading ``'app2/index.html'`` the file from the second.
"""
def __init__(self, mapping, delimiter='/'):
self.mapping = mapping
self.delimiter = delimiter
def get_loader(self, template):
try:
prefix, name = template.split(self.delimiter, 1)
loader = self.mapping[prefix]
except (ValueError, KeyError):
raise TemplateNotFound(template)
return loader, name
def get_source(self, environment, template):
loader, name = self.get_loader(template)
try:
return loader.get_source(environment, name)
except TemplateNotFound:
# re-raise the exception with the correct fileame here.
# (the one that includes the prefix)
raise TemplateNotFound(template)
@internalcode
def load(self, environment, name, globals=None):
loader, local_name = self.get_loader(name)
try:
return loader.load(environment, local_name)
except TemplateNotFound:
# re-raise the exception with the correct fileame here.
# (the one that includes the prefix)
raise TemplateNotFound(name)
def list_templates(self):
result = []
for prefix, loader in iteritems(self.mapping):
for template in loader.list_templates():
result.append(prefix + self.delimiter + template)
return result
class ChoiceLoader(BaseLoader):
"""This loader works like the `PrefixLoader` just that no prefix is
specified. If a template could not be found by one loader the next one
is tried.
>>> loader = ChoiceLoader([
... FileSystemLoader('/path/to/user/templates'),
... FileSystemLoader('/path/to/system/templates')
... ])
This is useful if you want to allow users to override builtin templates
from a different location.
"""
def __init__(self, loaders):
self.loaders = loaders
def get_source(self, environment, template):
for loader in self.loaders:
try:
return loader.get_source(environment, template)
except TemplateNotFound:
pass
raise TemplateNotFound(template)
@internalcode
def load(self, environment, name, globals=None):
for loader in self.loaders:
try:
return loader.load(environment, name, globals)
except TemplateNotFound:
pass
raise TemplateNotFound(name)
def list_templates(self):
found = set()
for loader in self.loaders:
found.update(loader.list_templates())
return sorted(found)
class _TemplateModule(ModuleType):
"""Like a normal module but with support for weak references"""
class ModuleLoader(BaseLoader):
"""This loader loads templates from precompiled templates.
Example usage:
>>> loader = ChoiceLoader([
... ModuleLoader('/path/to/compiled/templates'),
... FileSystemLoader('/path/to/templates')
... ])
Templates can be precompiled with :meth:`Environment.compile_templates`.
"""
has_source_access = False
def __init__(self, path):
package_name = '_jinja2_module_templates_%x' % id(self)
# create a fake module that looks for the templates in the
# path given.
mod = _TemplateModule(package_name)
if isinstance(path, string_types):
path = [path]
else:
path = list(path)
mod.__path__ = path
sys.modules[package_name] = weakref.proxy(mod,
lambda x: sys.modules.pop(package_name, None))
# the only strong reference, the sys.modules entry is weak
# so that the garbage collector can remove it once the
# loader that created it goes out of business.
self.module = mod
self.package_name = package_name
@staticmethod
def get_template_key(name):
return 'tmpl_' + sha1(name.encode('utf-8')).hexdigest()
@staticmethod
def get_module_filename(name):
return ModuleLoader.get_template_key(name) + '.py'
@internalcode
def load(self, environment, name, globals=None):
key = self.get_template_key(name)
module = '%s.%s' % (self.package_name, key)
mod = getattr(self.module, module, None)
if mod is None:
try:
mod = __import__(module, None, None, ['root'])
except ImportError:
raise TemplateNotFound(name)
# remove the entry from sys.modules, we only want the attribute
# on the module object we have stored on the loader.
sys.modules.pop(module, None)
return environment.template_class.from_module_dict(
environment, mod.__dict__, globals)
+234
View File
@@ -0,0 +1,234 @@
# -*- coding: utf-8 -*-
"""
markupsafe
~~~~~~~~~~
Implements a Markup string.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import re
from ._compat import text_type, string_types, int_types, \
unichr, PY2
__all__ = ['Markup', 'soft_unicode', 'escape', 'escape_silent']
_striptags_re = re.compile(r'(<!--.*?-->|<[^>]*>)')
_entity_re = re.compile(r'&([^;]+);')
class Markup(text_type):
r"""Marks a string as being safe for inclusion in HTML/XML output without
needing to be escaped. This implements the `__html__` interface a couple
of frameworks and web applications use. :class:`Markup` is a direct
subclass of `unicode` and provides all the methods of `unicode` just that
it escapes arguments passed and always returns `Markup`.
The `escape` function returns markup objects so that double escaping can't
happen.
The constructor of the :class:`Markup` class can be used for three
different things: When passed an unicode object it's assumed to be safe,
when passed an object with an HTML representation (has an `__html__`
method) that representation is used, otherwise the object passed is
converted into a unicode string and then assumed to be safe:
>>> Markup("Hello <em>World</em>!")
Markup(u'Hello <em>World</em>!')
>>> class Foo(object):
... def __html__(self):
... return '<a href="#">foo</a>'
...
>>> Markup(Foo())
Markup(u'<a href="#">foo</a>')
If you want object passed being always treated as unsafe you can use the
:meth:`escape` classmethod to create a :class:`Markup` object:
>>> Markup.escape("Hello <em>World</em>!")
Markup(u'Hello &lt;em&gt;World&lt;/em&gt;!')
Operations on a markup string are markup aware which means that all
arguments are passed through the :func:`escape` function:
>>> em = Markup("<em>%s</em>")
>>> em % "foo & bar"
Markup(u'<em>foo &amp; bar</em>')
>>> strong = Markup("<strong>%(text)s</strong>")
>>> strong % {'text': '<blink>hacker here</blink>'}
Markup(u'<strong>&lt;blink&gt;hacker here&lt;/blink&gt;</strong>')
>>> Markup("<em>Hello</em> ") + "<foo>"
Markup(u'<em>Hello</em> &lt;foo&gt;')
"""
__slots__ = ()
def __new__(cls, base=u'', encoding=None, errors='strict'):
if hasattr(base, '__html__'):
base = base.__html__()
if encoding is None:
return text_type.__new__(cls, base)
return text_type.__new__(cls, base, encoding, errors)
def __html__(self):
return self
def __add__(self, other):
if isinstance(other, string_types) or hasattr(other, '__html__'):
return self.__class__(super(Markup, self).__add__(self.escape(other)))
return NotImplemented
def __radd__(self, other):
if hasattr(other, '__html__') or isinstance(other, string_types):
return self.escape(other).__add__(self)
return NotImplemented
def __mul__(self, num):
if isinstance(num, int_types):
return self.__class__(text_type.__mul__(self, num))
return NotImplemented
__rmul__ = __mul__
def __mod__(self, arg):
if isinstance(arg, tuple):
arg = tuple(_MarkupEscapeHelper(x, self.escape) for x in arg)
else:
arg = _MarkupEscapeHelper(arg, self.escape)
return self.__class__(text_type.__mod__(self, arg))
def __repr__(self):
return '%s(%s)' % (
self.__class__.__name__,
text_type.__repr__(self)
)
def join(self, seq):
return self.__class__(text_type.join(self, map(self.escape, seq)))
join.__doc__ = text_type.join.__doc__
def split(self, *args, **kwargs):
return list(map(self.__class__, text_type.split(self, *args, **kwargs)))
split.__doc__ = text_type.split.__doc__
def rsplit(self, *args, **kwargs):
return list(map(self.__class__, text_type.rsplit(self, *args, **kwargs)))
rsplit.__doc__ = text_type.rsplit.__doc__
def splitlines(self, *args, **kwargs):
return list(map(self.__class__, text_type.splitlines(self, *args, **kwargs)))
splitlines.__doc__ = text_type.splitlines.__doc__
def unescape(self):
r"""Unescape markup again into an text_type string. This also resolves
known HTML4 and XHTML entities:
>>> Markup("Main &raquo; <em>About</em>").unescape()
u'Main \xbb <em>About</em>'
"""
from _constants import HTML_ENTITIES
def handle_match(m):
name = m.group(1)
if name in HTML_ENTITIES:
return unichr(HTML_ENTITIES[name])
try:
if name[:2] in ('#x', '#X'):
return unichr(int(name[2:], 16))
elif name.startswith('#'):
return unichr(int(name[1:]))
except ValueError:
pass
return u''
return _entity_re.sub(handle_match, text_type(self))
def striptags(self):
r"""Unescape markup into an text_type string and strip all tags. This
also resolves known HTML4 and XHTML entities. Whitespace is
normalized to one:
>>> Markup("Main &raquo; <em>About</em>").striptags()
u'Main \xbb About'
"""
stripped = u' '.join(_striptags_re.sub('', self).split())
return Markup(stripped).unescape()
@classmethod
def escape(cls, s):
"""Escape the string. Works like :func:`escape` with the difference
that for subclasses of :class:`Markup` this function would return the
correct subclass.
"""
rv = escape(s)
if rv.__class__ is not cls:
return cls(rv)
return rv
def make_wrapper(name):
orig = getattr(text_type, name)
def func(self, *args, **kwargs):
args = _escape_argspec(list(args), enumerate(args), self.escape)
#_escape_argspec(kwargs, kwargs.iteritems(), None)
return self.__class__(orig(self, *args, **kwargs))
func.__name__ = orig.__name__
func.__doc__ = orig.__doc__
return func
for method in '__getitem__', 'capitalize', \
'title', 'lower', 'upper', 'replace', 'ljust', \
'rjust', 'lstrip', 'rstrip', 'center', 'strip', \
'translate', 'expandtabs', 'swapcase', 'zfill':
locals()[method] = make_wrapper(method)
# new in python 2.5
if hasattr(text_type, 'partition'):
def partition(self, sep):
return tuple(map(self.__class__,
text_type.partition(self, self.escape(sep))))
def rpartition(self, sep):
return tuple(map(self.__class__,
text_type.rpartition(self, self.escape(sep))))
# new in python 2.6
if hasattr(text_type, 'format'):
format = make_wrapper('format')
# not in python 3
if hasattr(text_type, '__getslice__'):
__getslice__ = make_wrapper('__getslice__')
del method, make_wrapper
def _escape_argspec(obj, iterable, escape):
"""Helper for various string-wrapped functions."""
for key, value in iterable:
if hasattr(value, '__html__') or isinstance(value, string_types):
obj[key] = escape(value)
return obj
class _MarkupEscapeHelper(object):
"""Helper for Markup.__mod__"""
def __init__(self, obj, escape):
self.obj = obj
self.escape = escape
__getitem__ = lambda s, x: _MarkupEscapeHelper(s.obj[x], s.escape)
__unicode__ = __str__ = lambda s: text_type(s.escape(s.obj))
__repr__ = lambda s: str(s.escape(repr(s.obj)))
__int__ = lambda s: int(s.obj)
__float__ = lambda s: float(s.obj)
# we have to import it down here as the speedups and native
# modules imports the markup type which is define above.
try:
from _speedups import escape, escape_silent, soft_unicode
except ImportError:
from ._native import escape, escape_silent, soft_unicode
if not PY2:
soft_str = soft_unicode
__all__.append('soft_str')
+24
View File
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
"""
markupsafe._compat
~~~~~~~~~~~~~~~~~~
Compatibility module for different Python versions.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
PY2 = sys.version_info[0] == 2
if not PY2:
text_type = str
string_types = (str,)
unichr = chr
int_types = (int,)
else:
text_type = unicode
string_types = (str, unicode)
unichr = unichr
int_types = (int, long)
+267
View File
@@ -0,0 +1,267 @@
# -*- coding: utf-8 -*-
"""
markupsafe._constants
~~~~~~~~~~~~~~~~~~~~~
Highlevel implementation of the Markup string.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
HTML_ENTITIES = {
'AElig': 198,
'Aacute': 193,
'Acirc': 194,
'Agrave': 192,
'Alpha': 913,
'Aring': 197,
'Atilde': 195,
'Auml': 196,
'Beta': 914,
'Ccedil': 199,
'Chi': 935,
'Dagger': 8225,
'Delta': 916,
'ETH': 208,
'Eacute': 201,
'Ecirc': 202,
'Egrave': 200,
'Epsilon': 917,
'Eta': 919,
'Euml': 203,
'Gamma': 915,
'Iacute': 205,
'Icirc': 206,
'Igrave': 204,
'Iota': 921,
'Iuml': 207,
'Kappa': 922,
'Lambda': 923,
'Mu': 924,
'Ntilde': 209,
'Nu': 925,
'OElig': 338,
'Oacute': 211,
'Ocirc': 212,
'Ograve': 210,
'Omega': 937,
'Omicron': 927,
'Oslash': 216,
'Otilde': 213,
'Ouml': 214,
'Phi': 934,
'Pi': 928,
'Prime': 8243,
'Psi': 936,
'Rho': 929,
'Scaron': 352,
'Sigma': 931,
'THORN': 222,
'Tau': 932,
'Theta': 920,
'Uacute': 218,
'Ucirc': 219,
'Ugrave': 217,
'Upsilon': 933,
'Uuml': 220,
'Xi': 926,
'Yacute': 221,
'Yuml': 376,
'Zeta': 918,
'aacute': 225,
'acirc': 226,
'acute': 180,
'aelig': 230,
'agrave': 224,
'alefsym': 8501,
'alpha': 945,
'amp': 38,
'and': 8743,
'ang': 8736,
'apos': 39,
'aring': 229,
'asymp': 8776,
'atilde': 227,
'auml': 228,
'bdquo': 8222,
'beta': 946,
'brvbar': 166,
'bull': 8226,
'cap': 8745,
'ccedil': 231,
'cedil': 184,
'cent': 162,
'chi': 967,
'circ': 710,
'clubs': 9827,
'cong': 8773,
'copy': 169,
'crarr': 8629,
'cup': 8746,
'curren': 164,
'dArr': 8659,
'dagger': 8224,
'darr': 8595,
'deg': 176,
'delta': 948,
'diams': 9830,
'divide': 247,
'eacute': 233,
'ecirc': 234,
'egrave': 232,
'empty': 8709,
'emsp': 8195,
'ensp': 8194,
'epsilon': 949,
'equiv': 8801,
'eta': 951,
'eth': 240,
'euml': 235,
'euro': 8364,
'exist': 8707,
'fnof': 402,
'forall': 8704,
'frac12': 189,
'frac14': 188,
'frac34': 190,
'frasl': 8260,
'gamma': 947,
'ge': 8805,
'gt': 62,
'hArr': 8660,
'harr': 8596,
'hearts': 9829,
'hellip': 8230,
'iacute': 237,
'icirc': 238,
'iexcl': 161,
'igrave': 236,
'image': 8465,
'infin': 8734,
'int': 8747,
'iota': 953,
'iquest': 191,
'isin': 8712,
'iuml': 239,
'kappa': 954,
'lArr': 8656,
'lambda': 955,
'lang': 9001,
'laquo': 171,
'larr': 8592,
'lceil': 8968,
'ldquo': 8220,
'le': 8804,
'lfloor': 8970,
'lowast': 8727,
'loz': 9674,
'lrm': 8206,
'lsaquo': 8249,
'lsquo': 8216,
'lt': 60,
'macr': 175,
'mdash': 8212,
'micro': 181,
'middot': 183,
'minus': 8722,
'mu': 956,
'nabla': 8711,
'nbsp': 160,
'ndash': 8211,
'ne': 8800,
'ni': 8715,
'not': 172,
'notin': 8713,
'nsub': 8836,
'ntilde': 241,
'nu': 957,
'oacute': 243,
'ocirc': 244,
'oelig': 339,
'ograve': 242,
'oline': 8254,
'omega': 969,
'omicron': 959,
'oplus': 8853,
'or': 8744,
'ordf': 170,
'ordm': 186,
'oslash': 248,
'otilde': 245,
'otimes': 8855,
'ouml': 246,
'para': 182,
'part': 8706,
'permil': 8240,
'perp': 8869,
'phi': 966,
'pi': 960,
'piv': 982,
'plusmn': 177,
'pound': 163,
'prime': 8242,
'prod': 8719,
'prop': 8733,
'psi': 968,
'quot': 34,
'rArr': 8658,
'radic': 8730,
'rang': 9002,
'raquo': 187,
'rarr': 8594,
'rceil': 8969,
'rdquo': 8221,
'real': 8476,
'reg': 174,
'rfloor': 8971,
'rho': 961,
'rlm': 8207,
'rsaquo': 8250,
'rsquo': 8217,
'sbquo': 8218,
'scaron': 353,
'sdot': 8901,
'sect': 167,
'shy': 173,
'sigma': 963,
'sigmaf': 962,
'sim': 8764,
'spades': 9824,
'sub': 8834,
'sube': 8838,
'sum': 8721,
'sup': 8835,
'sup1': 185,
'sup2': 178,
'sup3': 179,
'supe': 8839,
'szlig': 223,
'tau': 964,
'there4': 8756,
'theta': 952,
'thetasym': 977,
'thinsp': 8201,
'thorn': 254,
'tilde': 732,
'times': 215,
'trade': 8482,
'uArr': 8657,
'uacute': 250,
'uarr': 8593,
'ucirc': 251,
'ugrave': 249,
'uml': 168,
'upsih': 978,
'upsilon': 965,
'uuml': 252,
'weierp': 8472,
'xi': 958,
'yacute': 253,
'yen': 165,
'yuml': 255,
'zeta': 950,
'zwj': 8205,
'zwnj': 8204
}
+45
View File
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
"""
markupsafe._native
~~~~~~~~~~~~~~~~~~
Native Python implementation the C module is not compiled.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from ._compat import text_type
def escape(s):
"""Convert the characters &, <, >, ' and " in string s to HTML-safe
sequences. Use this if you need to display text that might contain
such characters in HTML. Marks return value as markup string.
"""
if hasattr(s, '__html__'):
return s.__html__()
return Markup(text_type(s)
.replace('&', '&amp;')
.replace('>', '&gt;')
.replace('<', '&lt;')
.replace("'", '&#39;')
.replace('"', '&#34;')
)
def escape_silent(s):
"""Like :func:`escape` but converts `None` into an empty
markup string.
"""
if s is None:
return Markup()
return escape(s)
def soft_unicode(s):
"""Make a string unicode if it isn't already. That way a markup
string is not converted back to unicode.
"""
if not isinstance(s, text_type):
s = text_type(s)
return s
+103
View File
@@ -0,0 +1,103 @@
# -*- coding: utf-8 -*-
"""
jinja2.meta
~~~~~~~~~~~
This module implements various functions that exposes information about
templates that might be interesting for various kinds of applications.
:copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from jinja2 import nodes
from jinja2.compiler import CodeGenerator
from jinja2._compat import string_types
class TrackingCodeGenerator(CodeGenerator):
"""We abuse the code generator for introspection."""
def __init__(self, environment):
CodeGenerator.__init__(self, environment, '<introspection>',
'<introspection>')
self.undeclared_identifiers = set()
def write(self, x):
"""Don't write."""
def pull_locals(self, frame):
"""Remember all undeclared identifiers."""
self.undeclared_identifiers.update(frame.identifiers.undeclared)
def find_undeclared_variables(ast):
"""Returns a set of all variables in the AST that will be looked up from
the context at runtime. Because at compile time it's not known which
variables will be used depending on the path the execution takes at
runtime, all variables are returned.
>>> from jinja2 import Environment, meta
>>> env = Environment()
>>> ast = env.parse('{% set foo = 42 %}{{ bar + foo }}')
>>> meta.find_undeclared_variables(ast)
set(['bar'])
.. admonition:: Implementation
Internally the code generator is used for finding undeclared variables.
This is good to know because the code generator might raise a
:exc:`TemplateAssertionError` during compilation and as a matter of
fact this function can currently raise that exception as well.
"""
codegen = TrackingCodeGenerator(ast.environment)
codegen.visit(ast)
return codegen.undeclared_identifiers
def find_referenced_templates(ast):
"""Finds all the referenced templates from the AST. This will return an
iterator over all the hardcoded template extensions, inclusions and
imports. If dynamic inheritance or inclusion is used, `None` will be
yielded.
>>> from jinja2 import Environment, meta
>>> env = Environment()
>>> ast = env.parse('{% extends "layout.html" %}{% include helper %}')
>>> list(meta.find_referenced_templates(ast))
['layout.html', None]
This function is useful for dependency tracking. For example if you want
to rebuild parts of the website after a layout template has changed.
"""
for node in ast.find_all((nodes.Extends, nodes.FromImport, nodes.Import,
nodes.Include)):
if not isinstance(node.template, nodes.Const):
# a tuple with some non consts in there
if isinstance(node.template, (nodes.Tuple, nodes.List)):
for template_name in node.template.items:
# something const, only yield the strings and ignore
# non-string consts that really just make no sense
if isinstance(template_name, nodes.Const):
if isinstance(template_name.value, string_types):
yield template_name.value
# something dynamic in there
else:
yield None
# something dynamic we don't know about here
else:
yield None
continue
# constant is a basestring, direct template name
if isinstance(node.template.value, string_types):
yield node.template.value
# a tuple or list (latter *should* not happen) made of consts,
# yield the consts that are strings. We could warn here for
# non string values
elif isinstance(node, nodes.Include) and \
isinstance(node.template.value, (tuple, list)):
for template_name in node.template.value:
if isinstance(template_name, string_types):
yield template_name
# something else we don't care about, we could warn here
else:
yield None
+914
View File
@@ -0,0 +1,914 @@
# -*- coding: utf-8 -*-
"""
jinja2.nodes
~~~~~~~~~~~~
This module implements additional nodes derived from the ast base node.
It also provides some node tree helper functions like `in_lineno` and
`get_nodes` used by the parser and translator in order to normalize
python and jinja nodes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import operator
from collections import deque
from jinja2.utils import Markup
from jinja2._compat import next, izip, with_metaclass, text_type, \
method_type, function_type
#: the types we support for context functions
_context_function_types = (function_type, method_type)
_binop_to_func = {
'*': operator.mul,
'/': operator.truediv,
'//': operator.floordiv,
'**': operator.pow,
'%': operator.mod,
'+': operator.add,
'-': operator.sub
}
_uaop_to_func = {
'not': operator.not_,
'+': operator.pos,
'-': operator.neg
}
_cmpop_to_func = {
'eq': operator.eq,
'ne': operator.ne,
'gt': operator.gt,
'gteq': operator.ge,
'lt': operator.lt,
'lteq': operator.le,
'in': lambda a, b: a in b,
'notin': lambda a, b: a not in b
}
class Impossible(Exception):
"""Raised if the node could not perform a requested action."""
class NodeType(type):
"""A metaclass for nodes that handles the field and attribute
inheritance. fields and attributes from the parent class are
automatically forwarded to the child."""
def __new__(cls, name, bases, d):
for attr in 'fields', 'attributes':
storage = []
storage.extend(getattr(bases[0], attr, ()))
storage.extend(d.get(attr, ()))
assert len(bases) == 1, 'multiple inheritance not allowed'
assert len(storage) == len(set(storage)), 'layout conflict'
d[attr] = tuple(storage)
d.setdefault('abstract', False)
return type.__new__(cls, name, bases, d)
class EvalContext(object):
"""Holds evaluation time information. Custom attributes can be attached
to it in extensions.
"""
def __init__(self, environment, template_name=None):
self.environment = environment
if callable(environment.autoescape):
self.autoescape = environment.autoescape(template_name)
else:
self.autoescape = environment.autoescape
self.volatile = False
def save(self):
return self.__dict__.copy()
def revert(self, old):
self.__dict__.clear()
self.__dict__.update(old)
def get_eval_context(node, ctx):
if ctx is None:
if node.environment is None:
raise RuntimeError('if no eval context is passed, the '
'node must have an attached '
'environment.')
return EvalContext(node.environment)
return ctx
class Node(with_metaclass(NodeType, object)):
"""Baseclass for all Jinja2 nodes. There are a number of nodes available
of different types. There are four major types:
- :class:`Stmt`: statements
- :class:`Expr`: expressions
- :class:`Helper`: helper nodes
- :class:`Template`: the outermost wrapper node
All nodes have fields and attributes. Fields may be other nodes, lists,
or arbitrary values. Fields are passed to the constructor as regular
positional arguments, attributes as keyword arguments. Each node has
two attributes: `lineno` (the line number of the node) and `environment`.
The `environment` attribute is set at the end of the parsing process for
all nodes automatically.
"""
fields = ()
attributes = ('lineno', 'environment')
abstract = True
def __init__(self, *fields, **attributes):
if self.abstract:
raise TypeError('abstract nodes are not instanciable')
if fields:
if len(fields) != len(self.fields):
if not self.fields:
raise TypeError('%r takes 0 arguments' %
self.__class__.__name__)
raise TypeError('%r takes 0 or %d argument%s' % (
self.__class__.__name__,
len(self.fields),
len(self.fields) != 1 and 's' or ''
))
for name, arg in izip(self.fields, fields):
setattr(self, name, arg)
for attr in self.attributes:
setattr(self, attr, attributes.pop(attr, None))
if attributes:
raise TypeError('unknown attribute %r' %
next(iter(attributes)))
def iter_fields(self, exclude=None, only=None):
"""This method iterates over all fields that are defined and yields
``(key, value)`` tuples. Per default all fields are returned, but
it's possible to limit that to some fields by providing the `only`
parameter or to exclude some using the `exclude` parameter. Both
should be sets or tuples of field names.
"""
for name in self.fields:
if (exclude is only is None) or \
(exclude is not None and name not in exclude) or \
(only is not None and name in only):
try:
yield name, getattr(self, name)
except AttributeError:
pass
def iter_child_nodes(self, exclude=None, only=None):
"""Iterates over all direct child nodes of the node. This iterates
over all fields and yields the values of they are nodes. If the value
of a field is a list all the nodes in that list are returned.
"""
for field, item in self.iter_fields(exclude, only):
if isinstance(item, list):
for n in item:
if isinstance(n, Node):
yield n
elif isinstance(item, Node):
yield item
def find(self, node_type):
"""Find the first node of a given type. If no such node exists the
return value is `None`.
"""
for result in self.find_all(node_type):
return result
def find_all(self, node_type):
"""Find all the nodes of a given type. If the type is a tuple,
the check is performed for any of the tuple items.
"""
for child in self.iter_child_nodes():
if isinstance(child, node_type):
yield child
for result in child.find_all(node_type):
yield result
def set_ctx(self, ctx):
"""Reset the context of a node and all child nodes. Per default the
parser will all generate nodes that have a 'load' context as it's the
most common one. This method is used in the parser to set assignment
targets and other nodes to a store context.
"""
todo = deque([self])
while todo:
node = todo.popleft()
if 'ctx' in node.fields:
node.ctx = ctx
todo.extend(node.iter_child_nodes())
return self
def set_lineno(self, lineno, override=False):
"""Set the line numbers of the node and children."""
todo = deque([self])
while todo:
node = todo.popleft()
if 'lineno' in node.attributes:
if node.lineno is None or override:
node.lineno = lineno
todo.extend(node.iter_child_nodes())
return self
def set_environment(self, environment):
"""Set the environment for all nodes."""
todo = deque([self])
while todo:
node = todo.popleft()
node.environment = environment
todo.extend(node.iter_child_nodes())
return self
def __eq__(self, other):
return type(self) is type(other) and \
tuple(self.iter_fields()) == tuple(other.iter_fields())
def __ne__(self, other):
return not self.__eq__(other)
# Restore Python 2 hashing behavior on Python 3
__hash__ = object.__hash__
def __repr__(self):
return '%s(%s)' % (
self.__class__.__name__,
', '.join('%s=%r' % (arg, getattr(self, arg, None)) for
arg in self.fields)
)
class Stmt(Node):
"""Base node for all statements."""
abstract = True
class Helper(Node):
"""Nodes that exist in a specific context only."""
abstract = True
class Template(Node):
"""Node that represents a template. This must be the outermost node that
is passed to the compiler.
"""
fields = ('body',)
class Output(Stmt):
"""A node that holds multiple expressions which are then printed out.
This is used both for the `print` statement and the regular template data.
"""
fields = ('nodes',)
class Extends(Stmt):
"""Represents an extends statement."""
fields = ('template',)
class For(Stmt):
"""The for loop. `target` is the target for the iteration (usually a
:class:`Name` or :class:`Tuple`), `iter` the iterable. `body` is a list
of nodes that are used as loop-body, and `else_` a list of nodes for the
`else` block. If no else node exists it has to be an empty list.
For filtered nodes an expression can be stored as `test`, otherwise `None`.
"""
fields = ('target', 'iter', 'body', 'else_', 'test', 'recursive')
class If(Stmt):
"""If `test` is true, `body` is rendered, else `else_`."""
fields = ('test', 'body', 'else_')
class Macro(Stmt):
"""A macro definition. `name` is the name of the macro, `args` a list of
arguments and `defaults` a list of defaults if there are any. `body` is
a list of nodes for the macro body.
"""
fields = ('name', 'args', 'defaults', 'body')
class CallBlock(Stmt):
"""Like a macro without a name but a call instead. `call` is called with
the unnamed macro as `caller` argument this node holds.
"""
fields = ('call', 'args', 'defaults', 'body')
class FilterBlock(Stmt):
"""Node for filter sections."""
fields = ('body', 'filter')
class Block(Stmt):
"""A node that represents a block."""
fields = ('name', 'body', 'scoped')
class Include(Stmt):
"""A node that represents the include tag."""
fields = ('template', 'with_context', 'ignore_missing')
class Import(Stmt):
"""A node that represents the import tag."""
fields = ('template', 'target', 'with_context')
class FromImport(Stmt):
"""A node that represents the from import tag. It's important to not
pass unsafe names to the name attribute. The compiler translates the
attribute lookups directly into getattr calls and does *not* use the
subscript callback of the interface. As exported variables may not
start with double underscores (which the parser asserts) this is not a
problem for regular Jinja code, but if this node is used in an extension
extra care must be taken.
The list of names may contain tuples if aliases are wanted.
"""
fields = ('template', 'names', 'with_context')
class ExprStmt(Stmt):
"""A statement that evaluates an expression and discards the result."""
fields = ('node',)
class Assign(Stmt):
"""Assigns an expression to a target."""
fields = ('target', 'node')
class Expr(Node):
"""Baseclass for all expressions."""
abstract = True
def as_const(self, eval_ctx=None):
"""Return the value of the expression as constant or raise
:exc:`Impossible` if this was not possible.
An :class:`EvalContext` can be provided, if none is given
a default context is created which requires the nodes to have
an attached environment.
.. versionchanged:: 2.4
the `eval_ctx` parameter was added.
"""
raise Impossible()
def can_assign(self):
"""Check if it's possible to assign something to this node."""
return False
class BinExpr(Expr):
"""Baseclass for all binary expressions."""
fields = ('left', 'right')
operator = None
abstract = True
def as_const(self, eval_ctx=None):
eval_ctx = get_eval_context(self, eval_ctx)
# intercepted operators cannot be folded at compile time
if self.environment.sandboxed and \
self.operator in self.environment.intercepted_binops:
raise Impossible()
f = _binop_to_func[self.operator]
try:
return f(self.left.as_const(eval_ctx), self.right.as_const(eval_ctx))
except Exception:
raise Impossible()
class UnaryExpr(Expr):
"""Baseclass for all unary expressions."""
fields = ('node',)
operator = None
abstract = True
def as_const(self, eval_ctx=None):
eval_ctx = get_eval_context(self, eval_ctx)
# intercepted operators cannot be folded at compile time
if self.environment.sandboxed and \
self.operator in self.environment.intercepted_unops:
raise Impossible()
f = _uaop_to_func[self.operator]
try:
return f(self.node.as_const(eval_ctx))
except Exception:
raise Impossible()
class Name(Expr):
"""Looks up a name or stores a value in a name.
The `ctx` of the node can be one of the following values:
- `store`: store a value in the name
- `load`: load that name
- `param`: like `store` but if the name was defined as function parameter.
"""
fields = ('name', 'ctx')
def can_assign(self):
return self.name not in ('true', 'false', 'none',
'True', 'False', 'None')
class Literal(Expr):
"""Baseclass for literals."""
abstract = True
class Const(Literal):
"""All constant values. The parser will return this node for simple
constants such as ``42`` or ``"foo"`` but it can be used to store more
complex values such as lists too. Only constants with a safe
representation (objects where ``eval(repr(x)) == x`` is true).
"""
fields = ('value',)
def as_const(self, eval_ctx=None):
return self.value
@classmethod
def from_untrusted(cls, value, lineno=None, environment=None):
"""Return a const object if the value is representable as
constant value in the generated code, otherwise it will raise
an `Impossible` exception.
"""
from .compiler import has_safe_repr
if not has_safe_repr(value):
raise Impossible()
return cls(value, lineno=lineno, environment=environment)
class TemplateData(Literal):
"""A constant template string."""
fields = ('data',)
def as_const(self, eval_ctx=None):
eval_ctx = get_eval_context(self, eval_ctx)
if eval_ctx.volatile:
raise Impossible()
if eval_ctx.autoescape:
return Markup(self.data)
return self.data
class Tuple(Literal):
"""For loop unpacking and some other things like multiple arguments
for subscripts. Like for :class:`Name` `ctx` specifies if the tuple
is used for loading the names or storing.
"""
fields = ('items', 'ctx')
def as_const(self, eval_ctx=None):
eval_ctx = get_eval_context(self, eval_ctx)
return tuple(x.as_const(eval_ctx) for x in self.items)
def can_assign(self):
for item in self.items:
if not item.can_assign():
return False
return True
class List(Literal):
"""Any list literal such as ``[1, 2, 3]``"""
fields = ('items',)
def as_const(self, eval_ctx=None):
eval_ctx = get_eval_context(self, eval_ctx)
return [x.as_const(eval_ctx) for x in self.items]
class Dict(Literal):
"""Any dict literal such as ``{1: 2, 3: 4}``. The items must be a list of
:class:`Pair` nodes.
"""
fields = ('items',)
def as_const(self, eval_ctx=None):
eval_ctx = get_eval_context(self, eval_ctx)
return dict(x.as_const(eval_ctx) for x in self.items)
class Pair(Helper):
"""A key, value pair for dicts."""
fields = ('key', 'value')
def as_const(self, eval_ctx=None):
eval_ctx = get_eval_context(self, eval_ctx)
return self.key.as_const(eval_ctx), self.value.as_const(eval_ctx)
class Keyword(Helper):
"""A key, value pair for keyword arguments where key is a string."""
fields = ('key', 'value')
def as_const(self, eval_ctx=None):
eval_ctx = get_eval_context(self, eval_ctx)
return self.key, self.value.as_const(eval_ctx)
class CondExpr(Expr):
"""A conditional expression (inline if expression). (``{{
foo if bar else baz }}``)
"""
fields = ('test', 'expr1', 'expr2')
def as_const(self, eval_ctx=None):
eval_ctx = get_eval_context(self, eval_ctx)
if self.test.as_const(eval_ctx):
return self.expr1.as_const(eval_ctx)
# if we evaluate to an undefined object, we better do that at runtime
if self.expr2 is None:
raise Impossible()
return self.expr2.as_const(eval_ctx)
class Filter(Expr):
"""This node applies a filter on an expression. `name` is the name of
the filter, the rest of the fields are the same as for :class:`Call`.
If the `node` of a filter is `None` the contents of the last buffer are
filtered. Buffers are created by macros and filter blocks.
"""
fields = ('node', 'name', 'args', 'kwargs', 'dyn_args', 'dyn_kwargs')
def as_const(self, eval_ctx=None):
eval_ctx = get_eval_context(self, eval_ctx)
if eval_ctx.volatile or self.node is None:
raise Impossible()
# we have to be careful here because we call filter_ below.
# if this variable would be called filter, 2to3 would wrap the
# call in a list beause it is assuming we are talking about the
# builtin filter function here which no longer returns a list in
# python 3. because of that, do not rename filter_ to filter!
filter_ = self.environment.filters.get(self.name)
if filter_ is None or getattr(filter_, 'contextfilter', False):
raise Impossible()
obj = self.node.as_const(eval_ctx)
args = [x.as_const(eval_ctx) for x in self.args]
if getattr(filter_, 'evalcontextfilter', False):
args.insert(0, eval_ctx)
elif getattr(filter_, 'environmentfilter', False):
args.insert(0, self.environment)
kwargs = dict(x.as_const(eval_ctx) for x in self.kwargs)
if self.dyn_args is not None:
try:
args.extend(self.dyn_args.as_const(eval_ctx))
except Exception:
raise Impossible()
if self.dyn_kwargs is not None:
try:
kwargs.update(self.dyn_kwargs.as_const(eval_ctx))
except Exception:
raise Impossible()
try:
return filter_(obj, *args, **kwargs)
except Exception:
raise Impossible()
class Test(Expr):
"""Applies a test on an expression. `name` is the name of the test, the
rest of the fields are the same as for :class:`Call`.
"""
fields = ('node', 'name', 'args', 'kwargs', 'dyn_args', 'dyn_kwargs')
class Call(Expr):
"""Calls an expression. `args` is a list of arguments, `kwargs` a list
of keyword arguments (list of :class:`Keyword` nodes), and `dyn_args`
and `dyn_kwargs` has to be either `None` or a node that is used as
node for dynamic positional (``*args``) or keyword (``**kwargs``)
arguments.
"""
fields = ('node', 'args', 'kwargs', 'dyn_args', 'dyn_kwargs')
def as_const(self, eval_ctx=None):
eval_ctx = get_eval_context(self, eval_ctx)
if eval_ctx.volatile:
raise Impossible()
obj = self.node.as_const(eval_ctx)
# don't evaluate context functions
args = [x.as_const(eval_ctx) for x in self.args]
if isinstance(obj, _context_function_types):
if getattr(obj, 'contextfunction', False):
raise Impossible()
elif getattr(obj, 'evalcontextfunction', False):
args.insert(0, eval_ctx)
elif getattr(obj, 'environmentfunction', False):
args.insert(0, self.environment)
kwargs = dict(x.as_const(eval_ctx) for x in self.kwargs)
if self.dyn_args is not None:
try:
args.extend(self.dyn_args.as_const(eval_ctx))
except Exception:
raise Impossible()
if self.dyn_kwargs is not None:
try:
kwargs.update(self.dyn_kwargs.as_const(eval_ctx))
except Exception:
raise Impossible()
try:
return obj(*args, **kwargs)
except Exception:
raise Impossible()
class Getitem(Expr):
"""Get an attribute or item from an expression and prefer the item."""
fields = ('node', 'arg', 'ctx')
def as_const(self, eval_ctx=None):
eval_ctx = get_eval_context(self, eval_ctx)
if self.ctx != 'load':
raise Impossible()
try:
return self.environment.getitem(self.node.as_const(eval_ctx),
self.arg.as_const(eval_ctx))
except Exception:
raise Impossible()
def can_assign(self):
return False
class Getattr(Expr):
"""Get an attribute or item from an expression that is a ascii-only
bytestring and prefer the attribute.
"""
fields = ('node', 'attr', 'ctx')
def as_const(self, eval_ctx=None):
if self.ctx != 'load':
raise Impossible()
try:
eval_ctx = get_eval_context(self, eval_ctx)
return self.environment.getattr(self.node.as_const(eval_ctx),
self.attr)
except Exception:
raise Impossible()
def can_assign(self):
return False
class Slice(Expr):
"""Represents a slice object. This must only be used as argument for
:class:`Subscript`.
"""
fields = ('start', 'stop', 'step')
def as_const(self, eval_ctx=None):
eval_ctx = get_eval_context(self, eval_ctx)
def const(obj):
if obj is None:
return None
return obj.as_const(eval_ctx)
return slice(const(self.start), const(self.stop), const(self.step))
class Concat(Expr):
"""Concatenates the list of expressions provided after converting them to
unicode.
"""
fields = ('nodes',)
def as_const(self, eval_ctx=None):
eval_ctx = get_eval_context(self, eval_ctx)
return ''.join(text_type(x.as_const(eval_ctx)) for x in self.nodes)
class Compare(Expr):
"""Compares an expression with some other expressions. `ops` must be a
list of :class:`Operand`\s.
"""
fields = ('expr', 'ops')
def as_const(self, eval_ctx=None):
eval_ctx = get_eval_context(self, eval_ctx)
result = value = self.expr.as_const(eval_ctx)
try:
for op in self.ops:
new_value = op.expr.as_const(eval_ctx)
result = _cmpop_to_func[op.op](value, new_value)
value = new_value
except Exception:
raise Impossible()
return result
class Operand(Helper):
"""Holds an operator and an expression."""
fields = ('op', 'expr')
if __debug__:
Operand.__doc__ += '\nThe following operators are available: ' + \
', '.join(sorted('``%s``' % x for x in set(_binop_to_func) |
set(_uaop_to_func) | set(_cmpop_to_func)))
class Mul(BinExpr):
"""Multiplies the left with the right node."""
operator = '*'
class Div(BinExpr):
"""Divides the left by the right node."""
operator = '/'
class FloorDiv(BinExpr):
"""Divides the left by the right node and truncates conver the
result into an integer by truncating.
"""
operator = '//'
class Add(BinExpr):
"""Add the left to the right node."""
operator = '+'
class Sub(BinExpr):
"""Substract the right from the left node."""
operator = '-'
class Mod(BinExpr):
"""Left modulo right."""
operator = '%'
class Pow(BinExpr):
"""Left to the power of right."""
operator = '**'
class And(BinExpr):
"""Short circuited AND."""
operator = 'and'
def as_const(self, eval_ctx=None):
eval_ctx = get_eval_context(self, eval_ctx)
return self.left.as_const(eval_ctx) and self.right.as_const(eval_ctx)
class Or(BinExpr):
"""Short circuited OR."""
operator = 'or'
def as_const(self, eval_ctx=None):
eval_ctx = get_eval_context(self, eval_ctx)
return self.left.as_const(eval_ctx) or self.right.as_const(eval_ctx)
class Not(UnaryExpr):
"""Negate the expression."""
operator = 'not'
class Neg(UnaryExpr):
"""Make the expression negative."""
operator = '-'
class Pos(UnaryExpr):
"""Make the expression positive (noop for most expressions)"""
operator = '+'
# Helpers for extensions
class EnvironmentAttribute(Expr):
"""Loads an attribute from the environment object. This is useful for
extensions that want to call a callback stored on the environment.
"""
fields = ('name',)
class ExtensionAttribute(Expr):
"""Returns the attribute of an extension bound to the environment.
The identifier is the identifier of the :class:`Extension`.
This node is usually constructed by calling the
:meth:`~jinja2.ext.Extension.attr` method on an extension.
"""
fields = ('identifier', 'name')
class ImportedName(Expr):
"""If created with an import name the import name is returned on node
access. For example ``ImportedName('cgi.escape')`` returns the `escape`
function from the cgi module on evaluation. Imports are optimized by the
compiler so there is no need to assign them to local variables.
"""
fields = ('importname',)
class InternalName(Expr):
"""An internal name in the compiler. You cannot create these nodes
yourself but the parser provides a
:meth:`~jinja2.parser.Parser.free_identifier` method that creates
a new identifier for you. This identifier is not available from the
template and is not threated specially by the compiler.
"""
fields = ('name',)
def __init__(self):
raise TypeError('Can\'t create internal names. Use the '
'`free_identifier` method on a parser.')
class MarkSafe(Expr):
"""Mark the wrapped expression as safe (wrap it as `Markup`)."""
fields = ('expr',)
def as_const(self, eval_ctx=None):
eval_ctx = get_eval_context(self, eval_ctx)
return Markup(self.expr.as_const(eval_ctx))
class MarkSafeIfAutoescape(Expr):
"""Mark the wrapped expression as safe (wrap it as `Markup`) but
only if autoescaping is active.
.. versionadded:: 2.5
"""
fields = ('expr',)
def as_const(self, eval_ctx=None):
eval_ctx = get_eval_context(self, eval_ctx)
if eval_ctx.volatile:
raise Impossible()
expr = self.expr.as_const(eval_ctx)
if eval_ctx.autoescape:
return Markup(expr)
return expr
class ContextReference(Expr):
"""Returns the current template context. It can be used like a
:class:`Name` node, with a ``'load'`` ctx and will return the
current :class:`~jinja2.runtime.Context` object.
Here an example that assigns the current template name to a
variable named `foo`::
Assign(Name('foo', ctx='store'),
Getattr(ContextReference(), 'name'))
"""
class Continue(Stmt):
"""Continue a loop."""
class Break(Stmt):
"""Break a loop."""
class Scope(Stmt):
"""An artificial scope."""
fields = ('body',)
class EvalContextModifier(Stmt):
"""Modifies the eval context. For each option that should be modified,
a :class:`Keyword` has to be added to the :attr:`options` list.
Example to change the `autoescape` setting::
EvalContextModifier(options=[Keyword('autoescape', Const(True))])
"""
fields = ('options',)
class ScopedEvalContextModifier(EvalContextModifier):
"""Modifies the eval context and reverts it later. Works exactly like
:class:`EvalContextModifier` but will only modify the
:class:`~jinja2.nodes.EvalContext` for nodes in the :attr:`body`.
"""
fields = ('body',)
# make sure nobody creates custom nodes
def _failing_new(*args, **kwargs):
raise TypeError('can\'t create custom node types')
NodeType.__new__ = staticmethod(_failing_new); del _failing_new
+68
View File
@@ -0,0 +1,68 @@
# -*- coding: utf-8 -*-
"""
jinja2.optimizer
~~~~~~~~~~~~~~~~
The jinja optimizer is currently trying to constant fold a few expressions
and modify the AST in place so that it should be easier to evaluate it.
Because the AST does not contain all the scoping information and the
compiler has to find that out, we cannot do all the optimizations we
want. For example loop unrolling doesn't work because unrolled loops would
have a different scoping.
The solution would be a second syntax tree that has the scoping rules stored.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2 import nodes
from jinja2.visitor import NodeTransformer
def optimize(node, environment):
"""The context hint can be used to perform an static optimization
based on the context given."""
optimizer = Optimizer(environment)
return optimizer.visit(node)
class Optimizer(NodeTransformer):
def __init__(self, environment):
self.environment = environment
def visit_If(self, node):
"""Eliminate dead code."""
# do not optimize ifs that have a block inside so that it doesn't
# break super().
if node.find(nodes.Block) is not None:
return self.generic_visit(node)
try:
val = self.visit(node.test).as_const()
except nodes.Impossible:
return self.generic_visit(node)
if val:
body = node.body
else:
body = node.else_
result = []
for node in body:
result.extend(self.visit_list(node))
return result
def fold(self, node):
"""Do constant folding."""
node = self.generic_visit(node)
try:
return nodes.Const.from_untrusted(node.as_const(),
lineno=node.lineno,
environment=self.environment)
except nodes.Impossible:
return node
visit_Add = visit_Sub = visit_Mul = visit_Div = visit_FloorDiv = \
visit_Pow = visit_Mod = visit_And = visit_Or = visit_Pos = visit_Neg = \
visit_Not = visit_Compare = visit_Getitem = visit_Getattr = visit_Call = \
visit_Filter = visit_Test = visit_CondExpr = fold
del fold
+895
View File
@@ -0,0 +1,895 @@
# -*- coding: utf-8 -*-
"""
jinja2.parser
~~~~~~~~~~~~~
Implements the template parser.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2 import nodes
from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError
from jinja2.lexer import describe_token, describe_token_expr
from jinja2._compat import next, imap
#: statements that callinto
_statement_keywords = frozenset(['for', 'if', 'block', 'extends', 'print',
'macro', 'include', 'from', 'import',
'set'])
_compare_operators = frozenset(['eq', 'ne', 'lt', 'lteq', 'gt', 'gteq'])
class Parser(object):
"""This is the central parsing class Jinja2 uses. It's passed to
extensions and can be used to parse expressions or statements.
"""
def __init__(self, environment, source, name=None, filename=None,
state=None):
self.environment = environment
self.stream = environment._tokenize(source, name, filename, state)
self.name = name
self.filename = filename
self.closed = False
self.extensions = {}
for extension in environment.iter_extensions():
for tag in extension.tags:
self.extensions[tag] = extension.parse
self._last_identifier = 0
self._tag_stack = []
self._end_token_stack = []
def fail(self, msg, lineno=None, exc=TemplateSyntaxError):
"""Convenience method that raises `exc` with the message, passed
line number or last line number as well as the current name and
filename.
"""
if lineno is None:
lineno = self.stream.current.lineno
raise exc(msg, lineno, self.name, self.filename)
def _fail_ut_eof(self, name, end_token_stack, lineno):
expected = []
for exprs in end_token_stack:
expected.extend(imap(describe_token_expr, exprs))
if end_token_stack:
currently_looking = ' or '.join(
"'%s'" % describe_token_expr(expr)
for expr in end_token_stack[-1])
else:
currently_looking = None
if name is None:
message = ['Unexpected end of template.']
else:
message = ['Encountered unknown tag \'%s\'.' % name]
if currently_looking:
if name is not None and name in expected:
message.append('You probably made a nesting mistake. Jinja '
'is expecting this tag, but currently looking '
'for %s.' % currently_looking)
else:
message.append('Jinja was looking for the following tags: '
'%s.' % currently_looking)
if self._tag_stack:
message.append('The innermost block that needs to be '
'closed is \'%s\'.' % self._tag_stack[-1])
self.fail(' '.join(message), lineno)
def fail_unknown_tag(self, name, lineno=None):
"""Called if the parser encounters an unknown tag. Tries to fail
with a human readable error message that could help to identify
the problem.
"""
return self._fail_ut_eof(name, self._end_token_stack, lineno)
def fail_eof(self, end_tokens=None, lineno=None):
"""Like fail_unknown_tag but for end of template situations."""
stack = list(self._end_token_stack)
if end_tokens is not None:
stack.append(end_tokens)
return self._fail_ut_eof(None, stack, lineno)
def is_tuple_end(self, extra_end_rules=None):
"""Are we at the end of a tuple?"""
if self.stream.current.type in ('variable_end', 'block_end', 'rparen'):
return True
elif extra_end_rules is not None:
return self.stream.current.test_any(extra_end_rules)
return False
def free_identifier(self, lineno=None):
"""Return a new free identifier as :class:`~jinja2.nodes.InternalName`."""
self._last_identifier += 1
rv = object.__new__(nodes.InternalName)
nodes.Node.__init__(rv, 'fi%d' % self._last_identifier, lineno=lineno)
return rv
def parse_statement(self):
"""Parse a single statement."""
token = self.stream.current
if token.type != 'name':
self.fail('tag name expected', token.lineno)
self._tag_stack.append(token.value)
pop_tag = True
try:
if token.value in _statement_keywords:
return getattr(self, 'parse_' + self.stream.current.value)()
if token.value == 'call':
return self.parse_call_block()
if token.value == 'filter':
return self.parse_filter_block()
ext = self.extensions.get(token.value)
if ext is not None:
return ext(self)
# did not work out, remove the token we pushed by accident
# from the stack so that the unknown tag fail function can
# produce a proper error message.
self._tag_stack.pop()
pop_tag = False
self.fail_unknown_tag(token.value, token.lineno)
finally:
if pop_tag:
self._tag_stack.pop()
def parse_statements(self, end_tokens, drop_needle=False):
"""Parse multiple statements into a list until one of the end tokens
is reached. This is used to parse the body of statements as it also
parses template data if appropriate. The parser checks first if the
current token is a colon and skips it if there is one. Then it checks
for the block end and parses until if one of the `end_tokens` is
reached. Per default the active token in the stream at the end of
the call is the matched end token. If this is not wanted `drop_needle`
can be set to `True` and the end token is removed.
"""
# the first token may be a colon for python compatibility
self.stream.skip_if('colon')
# in the future it would be possible to add whole code sections
# by adding some sort of end of statement token and parsing those here.
self.stream.expect('block_end')
result = self.subparse(end_tokens)
# we reached the end of the template too early, the subparser
# does not check for this, so we do that now
if self.stream.current.type == 'eof':
self.fail_eof(end_tokens)
if drop_needle:
next(self.stream)
return result
def parse_set(self):
"""Parse an assign statement."""
lineno = next(self.stream).lineno
target = self.parse_assign_target()
self.stream.expect('assign')
expr = self.parse_tuple()
return nodes.Assign(target, expr, lineno=lineno)
def parse_for(self):
"""Parse a for loop."""
lineno = self.stream.expect('name:for').lineno
target = self.parse_assign_target(extra_end_rules=('name:in',))
self.stream.expect('name:in')
iter = self.parse_tuple(with_condexpr=False,
extra_end_rules=('name:recursive',))
test = None
if self.stream.skip_if('name:if'):
test = self.parse_expression()
recursive = self.stream.skip_if('name:recursive')
body = self.parse_statements(('name:endfor', 'name:else'))
if next(self.stream).value == 'endfor':
else_ = []
else:
else_ = self.parse_statements(('name:endfor',), drop_needle=True)
return nodes.For(target, iter, body, else_, test,
recursive, lineno=lineno)
def parse_if(self):
"""Parse an if construct."""
node = result = nodes.If(lineno=self.stream.expect('name:if').lineno)
while 1:
node.test = self.parse_tuple(with_condexpr=False)
node.body = self.parse_statements(('name:elif', 'name:else',
'name:endif'))
token = next(self.stream)
if token.test('name:elif'):
new_node = nodes.If(lineno=self.stream.current.lineno)
node.else_ = [new_node]
node = new_node
continue
elif token.test('name:else'):
node.else_ = self.parse_statements(('name:endif',),
drop_needle=True)
else:
node.else_ = []
break
return result
def parse_block(self):
node = nodes.Block(lineno=next(self.stream).lineno)
node.name = self.stream.expect('name').value
node.scoped = self.stream.skip_if('name:scoped')
# common problem people encounter when switching from django
# to jinja. we do not support hyphens in block names, so let's
# raise a nicer error message in that case.
if self.stream.current.type == 'sub':
self.fail('Block names in Jinja have to be valid Python '
'identifiers and may not contain hyphens, use an '
'underscore instead.')
node.body = self.parse_statements(('name:endblock',), drop_needle=True)
self.stream.skip_if('name:' + node.name)
return node
def parse_extends(self):
node = nodes.Extends(lineno=next(self.stream).lineno)
node.template = self.parse_expression()
return node
def parse_import_context(self, node, default):
if self.stream.current.test_any('name:with', 'name:without') and \
self.stream.look().test('name:context'):
node.with_context = next(self.stream).value == 'with'
self.stream.skip()
else:
node.with_context = default
return node
def parse_include(self):
node = nodes.Include(lineno=next(self.stream).lineno)
node.template = self.parse_expression()
if self.stream.current.test('name:ignore') and \
self.stream.look().test('name:missing'):
node.ignore_missing = True
self.stream.skip(2)
else:
node.ignore_missing = False
return self.parse_import_context(node, True)
def parse_import(self):
node = nodes.Import(lineno=next(self.stream).lineno)
node.template = self.parse_expression()
self.stream.expect('name:as')
node.target = self.parse_assign_target(name_only=True).name
return self.parse_import_context(node, False)
def parse_from(self):
node = nodes.FromImport(lineno=next(self.stream).lineno)
node.template = self.parse_expression()
self.stream.expect('name:import')
node.names = []
def parse_context():
if self.stream.current.value in ('with', 'without') and \
self.stream.look().test('name:context'):
node.with_context = next(self.stream).value == 'with'
self.stream.skip()
return True
return False
while 1:
if node.names:
self.stream.expect('comma')
if self.stream.current.type == 'name':
if parse_context():
break
target = self.parse_assign_target(name_only=True)
if target.name.startswith('_'):
self.fail('names starting with an underline can not '
'be imported', target.lineno,
exc=TemplateAssertionError)
if self.stream.skip_if('name:as'):
alias = self.parse_assign_target(name_only=True)
node.names.append((target.name, alias.name))
else:
node.names.append(target.name)
if parse_context() or self.stream.current.type != 'comma':
break
else:
break
if not hasattr(node, 'with_context'):
node.with_context = False
self.stream.skip_if('comma')
return node
def parse_signature(self, node):
node.args = args = []
node.defaults = defaults = []
self.stream.expect('lparen')
while self.stream.current.type != 'rparen':
if args:
self.stream.expect('comma')
arg = self.parse_assign_target(name_only=True)
arg.set_ctx('param')
if self.stream.skip_if('assign'):
defaults.append(self.parse_expression())
args.append(arg)
self.stream.expect('rparen')
def parse_call_block(self):
node = nodes.CallBlock(lineno=next(self.stream).lineno)
if self.stream.current.type == 'lparen':
self.parse_signature(node)
else:
node.args = []
node.defaults = []
node.call = self.parse_expression()
if not isinstance(node.call, nodes.Call):
self.fail('expected call', node.lineno)
node.body = self.parse_statements(('name:endcall',), drop_needle=True)
return node
def parse_filter_block(self):
node = nodes.FilterBlock(lineno=next(self.stream).lineno)
node.filter = self.parse_filter(None, start_inline=True)
node.body = self.parse_statements(('name:endfilter',),
drop_needle=True)
return node
def parse_macro(self):
node = nodes.Macro(lineno=next(self.stream).lineno)
node.name = self.parse_assign_target(name_only=True).name
self.parse_signature(node)
node.body = self.parse_statements(('name:endmacro',),
drop_needle=True)
return node
def parse_print(self):
node = nodes.Output(lineno=next(self.stream).lineno)
node.nodes = []
while self.stream.current.type != 'block_end':
if node.nodes:
self.stream.expect('comma')
node.nodes.append(self.parse_expression())
return node
def parse_assign_target(self, with_tuple=True, name_only=False,
extra_end_rules=None):
"""Parse an assignment target. As Jinja2 allows assignments to
tuples, this function can parse all allowed assignment targets. Per
default assignments to tuples are parsed, that can be disable however
by setting `with_tuple` to `False`. If only assignments to names are
wanted `name_only` can be set to `True`. The `extra_end_rules`
parameter is forwarded to the tuple parsing function.
"""
if name_only:
token = self.stream.expect('name')
target = nodes.Name(token.value, 'store', lineno=token.lineno)
else:
if with_tuple:
target = self.parse_tuple(simplified=True,
extra_end_rules=extra_end_rules)
else:
target = self.parse_primary()
target.set_ctx('store')
if not target.can_assign():
self.fail('can\'t assign to %r' % target.__class__.
__name__.lower(), target.lineno)
return target
def parse_expression(self, with_condexpr=True):
"""Parse an expression. Per default all expressions are parsed, if
the optional `with_condexpr` parameter is set to `False` conditional
expressions are not parsed.
"""
if with_condexpr:
return self.parse_condexpr()
return self.parse_or()
def parse_condexpr(self):
lineno = self.stream.current.lineno
expr1 = self.parse_or()
while self.stream.skip_if('name:if'):
expr2 = self.parse_or()
if self.stream.skip_if('name:else'):
expr3 = self.parse_condexpr()
else:
expr3 = None
expr1 = nodes.CondExpr(expr2, expr1, expr3, lineno=lineno)
lineno = self.stream.current.lineno
return expr1
def parse_or(self):
lineno = self.stream.current.lineno
left = self.parse_and()
while self.stream.skip_if('name:or'):
right = self.parse_and()
left = nodes.Or(left, right, lineno=lineno)
lineno = self.stream.current.lineno
return left
def parse_and(self):
lineno = self.stream.current.lineno
left = self.parse_not()
while self.stream.skip_if('name:and'):
right = self.parse_not()
left = nodes.And(left, right, lineno=lineno)
lineno = self.stream.current.lineno
return left
def parse_not(self):
if self.stream.current.test('name:not'):
lineno = next(self.stream).lineno
return nodes.Not(self.parse_not(), lineno=lineno)
return self.parse_compare()
def parse_compare(self):
lineno = self.stream.current.lineno
expr = self.parse_add()
ops = []
while 1:
token_type = self.stream.current.type
if token_type in _compare_operators:
next(self.stream)
ops.append(nodes.Operand(token_type, self.parse_add()))
elif self.stream.skip_if('name:in'):
ops.append(nodes.Operand('in', self.parse_add()))
elif self.stream.current.test('name:not') and \
self.stream.look().test('name:in'):
self.stream.skip(2)
ops.append(nodes.Operand('notin', self.parse_add()))
else:
break
lineno = self.stream.current.lineno
if not ops:
return expr
return nodes.Compare(expr, ops, lineno=lineno)
def parse_add(self):
lineno = self.stream.current.lineno
left = self.parse_sub()
while self.stream.current.type == 'add':
next(self.stream)
right = self.parse_sub()
left = nodes.Add(left, right, lineno=lineno)
lineno = self.stream.current.lineno
return left
def parse_sub(self):
lineno = self.stream.current.lineno
left = self.parse_concat()
while self.stream.current.type == 'sub':
next(self.stream)
right = self.parse_concat()
left = nodes.Sub(left, right, lineno=lineno)
lineno = self.stream.current.lineno
return left
def parse_concat(self):
lineno = self.stream.current.lineno
args = [self.parse_mul()]
while self.stream.current.type == 'tilde':
next(self.stream)
args.append(self.parse_mul())
if len(args) == 1:
return args[0]
return nodes.Concat(args, lineno=lineno)
def parse_mul(self):
lineno = self.stream.current.lineno
left = self.parse_div()
while self.stream.current.type == 'mul':
next(self.stream)
right = self.parse_div()
left = nodes.Mul(left, right, lineno=lineno)
lineno = self.stream.current.lineno
return left
def parse_div(self):
lineno = self.stream.current.lineno
left = self.parse_floordiv()
while self.stream.current.type == 'div':
next(self.stream)
right = self.parse_floordiv()
left = nodes.Div(left, right, lineno=lineno)
lineno = self.stream.current.lineno
return left
def parse_floordiv(self):
lineno = self.stream.current.lineno
left = self.parse_mod()
while self.stream.current.type == 'floordiv':
next(self.stream)
right = self.parse_mod()
left = nodes.FloorDiv(left, right, lineno=lineno)
lineno = self.stream.current.lineno
return left
def parse_mod(self):
lineno = self.stream.current.lineno
left = self.parse_pow()
while self.stream.current.type == 'mod':
next(self.stream)
right = self.parse_pow()
left = nodes.Mod(left, right, lineno=lineno)
lineno = self.stream.current.lineno
return left
def parse_pow(self):
lineno = self.stream.current.lineno
left = self.parse_unary()
while self.stream.current.type == 'pow':
next(self.stream)
right = self.parse_unary()
left = nodes.Pow(left, right, lineno=lineno)
lineno = self.stream.current.lineno
return left
def parse_unary(self, with_filter=True):
token_type = self.stream.current.type
lineno = self.stream.current.lineno
if token_type == 'sub':
next(self.stream)
node = nodes.Neg(self.parse_unary(False), lineno=lineno)
elif token_type == 'add':
next(self.stream)
node = nodes.Pos(self.parse_unary(False), lineno=lineno)
else:
node = self.parse_primary()
node = self.parse_postfix(node)
if with_filter:
node = self.parse_filter_expr(node)
return node
def parse_primary(self):
token = self.stream.current
if token.type == 'name':
if token.value in ('true', 'false', 'True', 'False'):
node = nodes.Const(token.value in ('true', 'True'),
lineno=token.lineno)
elif token.value in ('none', 'None'):
node = nodes.Const(None, lineno=token.lineno)
else:
node = nodes.Name(token.value, 'load', lineno=token.lineno)
next(self.stream)
elif token.type == 'string':
next(self.stream)
buf = [token.value]
lineno = token.lineno
while self.stream.current.type == 'string':
buf.append(self.stream.current.value)
next(self.stream)
node = nodes.Const(''.join(buf), lineno=lineno)
elif token.type in ('integer', 'float'):
next(self.stream)
node = nodes.Const(token.value, lineno=token.lineno)
elif token.type == 'lparen':
next(self.stream)
node = self.parse_tuple(explicit_parentheses=True)
self.stream.expect('rparen')
elif token.type == 'lbracket':
node = self.parse_list()
elif token.type == 'lbrace':
node = self.parse_dict()
else:
self.fail("unexpected '%s'" % describe_token(token), token.lineno)
return node
def parse_tuple(self, simplified=False, with_condexpr=True,
extra_end_rules=None, explicit_parentheses=False):
"""Works like `parse_expression` but if multiple expressions are
delimited by a comma a :class:`~jinja2.nodes.Tuple` node is created.
This method could also return a regular expression instead of a tuple
if no commas where found.
The default parsing mode is a full tuple. If `simplified` is `True`
only names and literals are parsed. The `no_condexpr` parameter is
forwarded to :meth:`parse_expression`.
Because tuples do not require delimiters and may end in a bogus comma
an extra hint is needed that marks the end of a tuple. For example
for loops support tuples between `for` and `in`. In that case the
`extra_end_rules` is set to ``['name:in']``.
`explicit_parentheses` is true if the parsing was triggered by an
expression in parentheses. This is used to figure out if an empty
tuple is a valid expression or not.
"""
lineno = self.stream.current.lineno
if simplified:
parse = self.parse_primary
elif with_condexpr:
parse = self.parse_expression
else:
parse = lambda: self.parse_expression(with_condexpr=False)
args = []
is_tuple = False
while 1:
if args:
self.stream.expect('comma')
if self.is_tuple_end(extra_end_rules):
break
args.append(parse())
if self.stream.current.type == 'comma':
is_tuple = True
else:
break
lineno = self.stream.current.lineno
if not is_tuple:
if args:
return args[0]
# if we don't have explicit parentheses, an empty tuple is
# not a valid expression. This would mean nothing (literally
# nothing) in the spot of an expression would be an empty
# tuple.
if not explicit_parentheses:
self.fail('Expected an expression, got \'%s\'' %
describe_token(self.stream.current))
return nodes.Tuple(args, 'load', lineno=lineno)
def parse_list(self):
token = self.stream.expect('lbracket')
items = []
while self.stream.current.type != 'rbracket':
if items:
self.stream.expect('comma')
if self.stream.current.type == 'rbracket':
break
items.append(self.parse_expression())
self.stream.expect('rbracket')
return nodes.List(items, lineno=token.lineno)
def parse_dict(self):
token = self.stream.expect('lbrace')
items = []
while self.stream.current.type != 'rbrace':
if items:
self.stream.expect('comma')
if self.stream.current.type == 'rbrace':
break
key = self.parse_expression()
self.stream.expect('colon')
value = self.parse_expression()
items.append(nodes.Pair(key, value, lineno=key.lineno))
self.stream.expect('rbrace')
return nodes.Dict(items, lineno=token.lineno)
def parse_postfix(self, node):
while 1:
token_type = self.stream.current.type
if token_type == 'dot' or token_type == 'lbracket':
node = self.parse_subscript(node)
# calls are valid both after postfix expressions (getattr
# and getitem) as well as filters and tests
elif token_type == 'lparen':
node = self.parse_call(node)
else:
break
return node
def parse_filter_expr(self, node):
while 1:
token_type = self.stream.current.type
if token_type == 'pipe':
node = self.parse_filter(node)
elif token_type == 'name' and self.stream.current.value == 'is':
node = self.parse_test(node)
# calls are valid both after postfix expressions (getattr
# and getitem) as well as filters and tests
elif token_type == 'lparen':
node = self.parse_call(node)
else:
break
return node
def parse_subscript(self, node):
token = next(self.stream)
if token.type == 'dot':
attr_token = self.stream.current
next(self.stream)
if attr_token.type == 'name':
return nodes.Getattr(node, attr_token.value, 'load',
lineno=token.lineno)
elif attr_token.type != 'integer':
self.fail('expected name or number', attr_token.lineno)
arg = nodes.Const(attr_token.value, lineno=attr_token.lineno)
return nodes.Getitem(node, arg, 'load', lineno=token.lineno)
if token.type == 'lbracket':
args = []
while self.stream.current.type != 'rbracket':
if args:
self.stream.expect('comma')
args.append(self.parse_subscribed())
self.stream.expect('rbracket')
if len(args) == 1:
arg = args[0]
else:
arg = nodes.Tuple(args, 'load', lineno=token.lineno)
return nodes.Getitem(node, arg, 'load', lineno=token.lineno)
self.fail('expected subscript expression', self.lineno)
def parse_subscribed(self):
lineno = self.stream.current.lineno
if self.stream.current.type == 'colon':
next(self.stream)
args = [None]
else:
node = self.parse_expression()
if self.stream.current.type != 'colon':
return node
next(self.stream)
args = [node]
if self.stream.current.type == 'colon':
args.append(None)
elif self.stream.current.type not in ('rbracket', 'comma'):
args.append(self.parse_expression())
else:
args.append(None)
if self.stream.current.type == 'colon':
next(self.stream)
if self.stream.current.type not in ('rbracket', 'comma'):
args.append(self.parse_expression())
else:
args.append(None)
else:
args.append(None)
return nodes.Slice(lineno=lineno, *args)
def parse_call(self, node):
token = self.stream.expect('lparen')
args = []
kwargs = []
dyn_args = dyn_kwargs = None
require_comma = False
def ensure(expr):
if not expr:
self.fail('invalid syntax for function call expression',
token.lineno)
while self.stream.current.type != 'rparen':
if require_comma:
self.stream.expect('comma')
# support for trailing comma
if self.stream.current.type == 'rparen':
break
if self.stream.current.type == 'mul':
ensure(dyn_args is None and dyn_kwargs is None)
next(self.stream)
dyn_args = self.parse_expression()
elif self.stream.current.type == 'pow':
ensure(dyn_kwargs is None)
next(self.stream)
dyn_kwargs = self.parse_expression()
else:
ensure(dyn_args is None and dyn_kwargs is None)
if self.stream.current.type == 'name' and \
self.stream.look().type == 'assign':
key = self.stream.current.value
self.stream.skip(2)
value = self.parse_expression()
kwargs.append(nodes.Keyword(key, value,
lineno=value.lineno))
else:
ensure(not kwargs)
args.append(self.parse_expression())
require_comma = True
self.stream.expect('rparen')
if node is None:
return args, kwargs, dyn_args, dyn_kwargs
return nodes.Call(node, args, kwargs, dyn_args, dyn_kwargs,
lineno=token.lineno)
def parse_filter(self, node, start_inline=False):
while self.stream.current.type == 'pipe' or start_inline:
if not start_inline:
next(self.stream)
token = self.stream.expect('name')
name = token.value
while self.stream.current.type == 'dot':
next(self.stream)
name += '.' + self.stream.expect('name').value
if self.stream.current.type == 'lparen':
args, kwargs, dyn_args, dyn_kwargs = self.parse_call(None)
else:
args = []
kwargs = []
dyn_args = dyn_kwargs = None
node = nodes.Filter(node, name, args, kwargs, dyn_args,
dyn_kwargs, lineno=token.lineno)
start_inline = False
return node
def parse_test(self, node):
token = next(self.stream)
if self.stream.current.test('name:not'):
next(self.stream)
negated = True
else:
negated = False
name = self.stream.expect('name').value
while self.stream.current.type == 'dot':
next(self.stream)
name += '.' + self.stream.expect('name').value
dyn_args = dyn_kwargs = None
kwargs = []
if self.stream.current.type == 'lparen':
args, kwargs, dyn_args, dyn_kwargs = self.parse_call(None)
elif self.stream.current.type in ('name', 'string', 'integer',
'float', 'lparen', 'lbracket',
'lbrace') and not \
self.stream.current.test_any('name:else', 'name:or',
'name:and'):
if self.stream.current.test('name:is'):
self.fail('You cannot chain multiple tests with is')
args = [self.parse_expression()]
else:
args = []
node = nodes.Test(node, name, args, kwargs, dyn_args,
dyn_kwargs, lineno=token.lineno)
if negated:
node = nodes.Not(node, lineno=token.lineno)
return node
def subparse(self, end_tokens=None):
body = []
data_buffer = []
add_data = data_buffer.append
if end_tokens is not None:
self._end_token_stack.append(end_tokens)
def flush_data():
if data_buffer:
lineno = data_buffer[0].lineno
body.append(nodes.Output(data_buffer[:], lineno=lineno))
del data_buffer[:]
try:
while self.stream:
token = self.stream.current
if token.type == 'data':
if token.value:
add_data(nodes.TemplateData(token.value,
lineno=token.lineno))
next(self.stream)
elif token.type == 'variable_begin':
next(self.stream)
add_data(self.parse_tuple(with_condexpr=True))
self.stream.expect('variable_end')
elif token.type == 'block_begin':
flush_data()
next(self.stream)
if end_tokens is not None and \
self.stream.current.test_any(*end_tokens):
return body
rv = self.parse_statement()
if isinstance(rv, list):
body.extend(rv)
else:
body.append(rv)
self.stream.expect('block_end')
else:
raise AssertionError('internal parsing error')
flush_data()
finally:
if end_tokens is not None:
self._end_token_stack.pop()
return body
def parse(self):
"""Parse the whole template into a `Template` node."""
result = nodes.Template(self.subparse(), lineno=1)
result.set_environment(self.environment)
return result
+581
View File
@@ -0,0 +1,581 @@
# -*- coding: utf-8 -*-
"""
jinja2.runtime
~~~~~~~~~~~~~~
Runtime helpers.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from itertools import chain
from jinja2.nodes import EvalContext, _context_function_types
from jinja2.utils import Markup, soft_unicode, escape, missing, concat, \
internalcode, object_type_repr
from jinja2.exceptions import UndefinedError, TemplateRuntimeError, \
TemplateNotFound
from jinja2._compat import next, imap, text_type, iteritems, \
implements_iterator, implements_to_string, string_types, PY2
# these variables are exported to the template runtime
__all__ = ['LoopContext', 'TemplateReference', 'Macro', 'Markup',
'TemplateRuntimeError', 'missing', 'concat', 'escape',
'markup_join', 'unicode_join', 'to_string', 'identity',
'TemplateNotFound']
#: the name of the function that is used to convert something into
#: a string. We can just use the text type here.
to_string = text_type
#: the identity function. Useful for certain things in the environment
identity = lambda x: x
_last_iteration = object()
def markup_join(seq):
"""Concatenation that escapes if necessary and converts to unicode."""
buf = []
iterator = imap(soft_unicode, seq)
for arg in iterator:
buf.append(arg)
if hasattr(arg, '__html__'):
return Markup(u'').join(chain(buf, iterator))
return concat(buf)
def unicode_join(seq):
"""Simple args to unicode conversion and concatenation."""
return concat(imap(text_type, seq))
def new_context(environment, template_name, blocks, vars=None,
shared=None, globals=None, locals=None):
"""Internal helper to for context creation."""
if vars is None:
vars = {}
if shared:
parent = vars
else:
parent = dict(globals or (), **vars)
if locals:
# if the parent is shared a copy should be created because
# we don't want to modify the dict passed
if shared:
parent = dict(parent)
for key, value in iteritems(locals):
if key[:2] == 'l_' and value is not missing:
parent[key[2:]] = value
return Context(environment, parent, template_name, blocks)
class TemplateReference(object):
"""The `self` in templates."""
def __init__(self, context):
self.__context = context
def __getitem__(self, name):
blocks = self.__context.blocks[name]
return BlockReference(name, self.__context, blocks, 0)
def __repr__(self):
return '<%s %r>' % (
self.__class__.__name__,
self.__context.name
)
class Context(object):
"""The template context holds the variables of a template. It stores the
values passed to the template and also the names the template exports.
Creating instances is neither supported nor useful as it's created
automatically at various stages of the template evaluation and should not
be created by hand.
The context is immutable. Modifications on :attr:`parent` **must not**
happen and modifications on :attr:`vars` are allowed from generated
template code only. Template filters and global functions marked as
:func:`contextfunction`\s get the active context passed as first argument
and are allowed to access the context read-only.
The template context supports read only dict operations (`get`,
`keys`, `values`, `items`, `iterkeys`, `itervalues`, `iteritems`,
`__getitem__`, `__contains__`). Additionally there is a :meth:`resolve`
method that doesn't fail with a `KeyError` but returns an
:class:`Undefined` object for missing variables.
"""
__slots__ = ('parent', 'vars', 'environment', 'eval_ctx', 'exported_vars',
'name', 'blocks', '__weakref__')
def __init__(self, environment, parent, name, blocks):
self.parent = parent
self.vars = {}
self.environment = environment
self.eval_ctx = EvalContext(self.environment, name)
self.exported_vars = set()
self.name = name
# create the initial mapping of blocks. Whenever template inheritance
# takes place the runtime will update this mapping with the new blocks
# from the template.
self.blocks = dict((k, [v]) for k, v in iteritems(blocks))
def super(self, name, current):
"""Render a parent block."""
try:
blocks = self.blocks[name]
index = blocks.index(current) + 1
blocks[index]
except LookupError:
return self.environment.undefined('there is no parent block '
'called %r.' % name,
name='super')
return BlockReference(name, self, blocks, index)
def get(self, key, default=None):
"""Returns an item from the template context, if it doesn't exist
`default` is returned.
"""
try:
return self[key]
except KeyError:
return default
def resolve(self, key):
"""Looks up a variable like `__getitem__` or `get` but returns an
:class:`Undefined` object with the name of the name looked up.
"""
if key in self.vars:
return self.vars[key]
if key in self.parent:
return self.parent[key]
return self.environment.undefined(name=key)
def get_exported(self):
"""Get a new dict with the exported variables."""
return dict((k, self.vars[k]) for k in self.exported_vars)
def get_all(self):
"""Return a copy of the complete context as dict including the
exported variables.
"""
return dict(self.parent, **self.vars)
@internalcode
def call(__self, __obj, *args, **kwargs):
"""Call the callable with the arguments and keyword arguments
provided but inject the active context or environment as first
argument if the callable is a :func:`contextfunction` or
:func:`environmentfunction`.
"""
if __debug__:
__traceback_hide__ = True
# Allow callable classes to take a context
fn = __obj.__call__
for fn_type in ('contextfunction',
'evalcontextfunction',
'environmentfunction'):
if hasattr(fn, fn_type):
__obj = fn
break
if isinstance(__obj, _context_function_types):
if getattr(__obj, 'contextfunction', 0):
args = (__self,) + args
elif getattr(__obj, 'evalcontextfunction', 0):
args = (__self.eval_ctx,) + args
elif getattr(__obj, 'environmentfunction', 0):
args = (__self.environment,) + args
try:
return __obj(*args, **kwargs)
except StopIteration:
return __self.environment.undefined('value was undefined because '
'a callable raised a '
'StopIteration exception')
def derived(self, locals=None):
"""Internal helper function to create a derived context."""
context = new_context(self.environment, self.name, {},
self.parent, True, None, locals)
context.vars.update(self.vars)
context.eval_ctx = self.eval_ctx
context.blocks.update((k, list(v)) for k, v in iteritems(self.blocks))
return context
def _all(meth):
proxy = lambda self: getattr(self.get_all(), meth)()
proxy.__doc__ = getattr(dict, meth).__doc__
proxy.__name__ = meth
return proxy
keys = _all('keys')
values = _all('values')
items = _all('items')
# not available on python 3
if PY2:
iterkeys = _all('iterkeys')
itervalues = _all('itervalues')
iteritems = _all('iteritems')
del _all
def __contains__(self, name):
return name in self.vars or name in self.parent
def __getitem__(self, key):
"""Lookup a variable or raise `KeyError` if the variable is
undefined.
"""
item = self.resolve(key)
if isinstance(item, Undefined):
raise KeyError(key)
return item
def __repr__(self):
return '<%s %s of %r>' % (
self.__class__.__name__,
repr(self.get_all()),
self.name
)
# register the context as mapping if possible
try:
from collections import Mapping
Mapping.register(Context)
except ImportError:
pass
class BlockReference(object):
"""One block on a template reference."""
def __init__(self, name, context, stack, depth):
self.name = name
self._context = context
self._stack = stack
self._depth = depth
@property
def super(self):
"""Super the block."""
if self._depth + 1 >= len(self._stack):
return self._context.environment. \
undefined('there is no parent block called %r.' %
self.name, name='super')
return BlockReference(self.name, self._context, self._stack,
self._depth + 1)
@internalcode
def __call__(self):
rv = concat(self._stack[self._depth](self._context))
if self._context.eval_ctx.autoescape:
rv = Markup(rv)
return rv
class LoopContext(object):
"""A loop context for dynamic iteration."""
def __init__(self, iterable, recurse=None, depth0=0):
self._iterator = iter(iterable)
self._recurse = recurse
self._after = self._safe_next()
self.index0 = -1
self.depth0 = depth0
# try to get the length of the iterable early. This must be done
# here because there are some broken iterators around where there
# __len__ is the number of iterations left (i'm looking at your
# listreverseiterator!).
try:
self._length = len(iterable)
except (TypeError, AttributeError):
self._length = None
def cycle(self, *args):
"""Cycles among the arguments with the current loop index."""
if not args:
raise TypeError('no items for cycling given')
return args[self.index0 % len(args)]
first = property(lambda x: x.index0 == 0)
last = property(lambda x: x._after is _last_iteration)
index = property(lambda x: x.index0 + 1)
revindex = property(lambda x: x.length - x.index0)
revindex0 = property(lambda x: x.length - x.index)
depth = property(lambda x: x.depth0 + 1)
def __len__(self):
return self.length
def __iter__(self):
return LoopContextIterator(self)
def _safe_next(self):
try:
return next(self._iterator)
except StopIteration:
return _last_iteration
@internalcode
def loop(self, iterable):
if self._recurse is None:
raise TypeError('Tried to call non recursive loop. Maybe you '
"forgot the 'recursive' modifier.")
return self._recurse(iterable, self._recurse, self.depth0 + 1)
# a nifty trick to enhance the error message if someone tried to call
# the the loop without or with too many arguments.
__call__ = loop
del loop
@property
def length(self):
if self._length is None:
# if was not possible to get the length of the iterator when
# the loop context was created (ie: iterating over a generator)
# we have to convert the iterable into a sequence and use the
# length of that.
iterable = tuple(self._iterator)
self._iterator = iter(iterable)
self._length = len(iterable) + self.index0 + 1
return self._length
def __repr__(self):
return '<%s %r/%r>' % (
self.__class__.__name__,
self.index,
self.length
)
@implements_iterator
class LoopContextIterator(object):
"""The iterator for a loop context."""
__slots__ = ('context',)
def __init__(self, context):
self.context = context
def __iter__(self):
return self
def __next__(self):
ctx = self.context
ctx.index0 += 1
if ctx._after is _last_iteration:
raise StopIteration()
next_elem = ctx._after
ctx._after = ctx._safe_next()
return next_elem, ctx
class Macro(object):
"""Wraps a macro function."""
def __init__(self, environment, func, name, arguments, defaults,
catch_kwargs, catch_varargs, caller):
self._environment = environment
self._func = func
self._argument_count = len(arguments)
self.name = name
self.arguments = arguments
self.defaults = defaults
self.catch_kwargs = catch_kwargs
self.catch_varargs = catch_varargs
self.caller = caller
@internalcode
def __call__(self, *args, **kwargs):
# try to consume the positional arguments
arguments = list(args[:self._argument_count])
off = len(arguments)
# if the number of arguments consumed is not the number of
# arguments expected we start filling in keyword arguments
# and defaults.
if off != self._argument_count:
for idx, name in enumerate(self.arguments[len(arguments):]):
try:
value = kwargs.pop(name)
except KeyError:
try:
value = self.defaults[idx - self._argument_count + off]
except IndexError:
value = self._environment.undefined(
'parameter %r was not provided' % name, name=name)
arguments.append(value)
# it's important that the order of these arguments does not change
# if not also changed in the compiler's `function_scoping` method.
# the order is caller, keyword arguments, positional arguments!
if self.caller:
caller = kwargs.pop('caller', None)
if caller is None:
caller = self._environment.undefined('No caller defined',
name='caller')
arguments.append(caller)
if self.catch_kwargs:
arguments.append(kwargs)
elif kwargs:
raise TypeError('macro %r takes no keyword argument %r' %
(self.name, next(iter(kwargs))))
if self.catch_varargs:
arguments.append(args[self._argument_count:])
elif len(args) > self._argument_count:
raise TypeError('macro %r takes not more than %d argument(s)' %
(self.name, len(self.arguments)))
return self._func(*arguments)
def __repr__(self):
return '<%s %s>' % (
self.__class__.__name__,
self.name is None and 'anonymous' or repr(self.name)
)
@implements_to_string
class Undefined(object):
"""The default undefined type. This undefined type can be printed and
iterated over, but every other access will raise an :exc:`UndefinedError`:
>>> foo = Undefined(name='foo')
>>> str(foo)
''
>>> not foo
True
>>> foo + 42
Traceback (most recent call last):
...
UndefinedError: 'foo' is undefined
"""
__slots__ = ('_undefined_hint', '_undefined_obj', '_undefined_name',
'_undefined_exception')
def __init__(self, hint=None, obj=missing, name=None, exc=UndefinedError):
self._undefined_hint = hint
self._undefined_obj = obj
self._undefined_name = name
self._undefined_exception = exc
@internalcode
def _fail_with_undefined_error(self, *args, **kwargs):
"""Regular callback function for undefined objects that raises an
`UndefinedError` on call.
"""
if self._undefined_hint is None:
if self._undefined_obj is missing:
hint = '%r is undefined' % self._undefined_name
elif not isinstance(self._undefined_name, string_types):
hint = '%s has no element %r' % (
object_type_repr(self._undefined_obj),
self._undefined_name
)
else:
hint = '%r has no attribute %r' % (
object_type_repr(self._undefined_obj),
self._undefined_name
)
else:
hint = self._undefined_hint
raise self._undefined_exception(hint)
@internalcode
def __getattr__(self, name):
if name[:2] == '__':
raise AttributeError(name)
return self._fail_with_undefined_error()
__add__ = __radd__ = __mul__ = __rmul__ = __div__ = __rdiv__ = \
__truediv__ = __rtruediv__ = __floordiv__ = __rfloordiv__ = \
__mod__ = __rmod__ = __pos__ = __neg__ = __call__ = \
__getitem__ = __lt__ = __le__ = __gt__ = __ge__ = __int__ = \
__float__ = __complex__ = __pow__ = __rpow__ = \
_fail_with_undefined_error
def __eq__(self, other):
return type(self) is type(other)
def __ne__(self, other):
return not self.__eq__(other)
def __hash__(self):
return id(type(self))
def __str__(self):
return u''
def __len__(self):
return 0
def __iter__(self):
if 0:
yield None
def __nonzero__(self):
return False
def __repr__(self):
return 'Undefined'
@implements_to_string
class DebugUndefined(Undefined):
"""An undefined that returns the debug info when printed.
>>> foo = DebugUndefined(name='foo')
>>> str(foo)
'{{ foo }}'
>>> not foo
True
>>> foo + 42
Traceback (most recent call last):
...
UndefinedError: 'foo' is undefined
"""
__slots__ = ()
def __str__(self):
if self._undefined_hint is None:
if self._undefined_obj is missing:
return u'{{ %s }}' % self._undefined_name
return '{{ no such element: %s[%r] }}' % (
object_type_repr(self._undefined_obj),
self._undefined_name
)
return u'{{ undefined value printed: %s }}' % self._undefined_hint
@implements_to_string
class StrictUndefined(Undefined):
"""An undefined that barks on print and iteration as well as boolean
tests and all kinds of comparisons. In other words: you can do nothing
with it except checking if it's defined using the `defined` test.
>>> foo = StrictUndefined(name='foo')
>>> str(foo)
Traceback (most recent call last):
...
UndefinedError: 'foo' is undefined
>>> not foo
Traceback (most recent call last):
...
UndefinedError: 'foo' is undefined
>>> foo + 42
Traceback (most recent call last):
...
UndefinedError: 'foo' is undefined
"""
__slots__ = ()
__iter__ = __str__ = __len__ = __nonzero__ = __eq__ = \
__ne__ = __bool__ = __hash__ = \
Undefined._fail_with_undefined_error
# remove remaining slots attributes, after the metaclass did the magic they
# are unneeded and irritating as they contain wrong data for the subclasses.
del Undefined.__slots__, DebugUndefined.__slots__, StrictUndefined.__slots__
+368
View File
@@ -0,0 +1,368 @@
# -*- coding: utf-8 -*-
"""
jinja2.sandbox
~~~~~~~~~~~~~~
Adds a sandbox layer to Jinja as it was the default behavior in the old
Jinja 1 releases. This sandbox is slightly different from Jinja 1 as the
default behavior is easier to use.
The behavior can be changed by subclassing the environment.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
import operator
from jinja2.environment import Environment
from jinja2.exceptions import SecurityError
from jinja2._compat import string_types, function_type, method_type, \
traceback_type, code_type, frame_type, generator_type, PY2
#: maximum number of items a range may produce
MAX_RANGE = 100000
#: attributes of function objects that are considered unsafe.
UNSAFE_FUNCTION_ATTRIBUTES = set(['func_closure', 'func_code', 'func_dict',
'func_defaults', 'func_globals'])
#: unsafe method attributes. function attributes are unsafe for methods too
UNSAFE_METHOD_ATTRIBUTES = set(['im_class', 'im_func', 'im_self'])
#: unsafe generator attirbutes.
UNSAFE_GENERATOR_ATTRIBUTES = set(['gi_frame', 'gi_code'])
# On versions > python 2 the special attributes on functions are gone,
# but they remain on methods and generators for whatever reason.
if not PY2:
UNSAFE_FUNCTION_ATTRIBUTES = set()
import warnings
# make sure we don't warn in python 2.6 about stuff we don't care about
warnings.filterwarnings('ignore', 'the sets module', DeprecationWarning,
module='jinja2.sandbox')
from collections import deque
_mutable_set_types = (set,)
_mutable_mapping_types = (dict,)
_mutable_sequence_types = (list,)
# on python 2.x we can register the user collection types
try:
from UserDict import UserDict, DictMixin
from UserList import UserList
_mutable_mapping_types += (UserDict, DictMixin)
_mutable_set_types += (UserList,)
except ImportError:
pass
# if sets is still available, register the mutable set from there as well
try:
from sets import Set
_mutable_set_types += (Set,)
except ImportError:
pass
#: register Python 2.6 abstract base classes
try:
from collections import MutableSet, MutableMapping, MutableSequence
_mutable_set_types += (MutableSet,)
_mutable_mapping_types += (MutableMapping,)
_mutable_sequence_types += (MutableSequence,)
except ImportError:
pass
_mutable_spec = (
(_mutable_set_types, frozenset([
'add', 'clear', 'difference_update', 'discard', 'pop', 'remove',
'symmetric_difference_update', 'update'
])),
(_mutable_mapping_types, frozenset([
'clear', 'pop', 'popitem', 'setdefault', 'update'
])),
(_mutable_sequence_types, frozenset([
'append', 'reverse', 'insert', 'sort', 'extend', 'remove'
])),
(deque, frozenset([
'append', 'appendleft', 'clear', 'extend', 'extendleft', 'pop',
'popleft', 'remove', 'rotate'
]))
)
def safe_range(*args):
"""A range that can't generate ranges with a length of more than
MAX_RANGE items.
"""
rng = range(*args)
if len(rng) > MAX_RANGE:
raise OverflowError('range too big, maximum size for range is %d' %
MAX_RANGE)
return rng
def unsafe(f):
"""Marks a function or method as unsafe.
::
@unsafe
def delete(self):
pass
"""
f.unsafe_callable = True
return f
def is_internal_attribute(obj, attr):
"""Test if the attribute given is an internal python attribute. For
example this function returns `True` for the `func_code` attribute of
python objects. This is useful if the environment method
:meth:`~SandboxedEnvironment.is_safe_attribute` is overridden.
>>> from jinja2.sandbox import is_internal_attribute
>>> is_internal_attribute(lambda: None, "func_code")
True
>>> is_internal_attribute((lambda x:x).func_code, 'co_code')
True
>>> is_internal_attribute(str, "upper")
False
"""
if isinstance(obj, function_type):
if attr in UNSAFE_FUNCTION_ATTRIBUTES:
return True
elif isinstance(obj, method_type):
if attr in UNSAFE_FUNCTION_ATTRIBUTES or \
attr in UNSAFE_METHOD_ATTRIBUTES:
return True
elif isinstance(obj, type):
if attr == 'mro':
return True
elif isinstance(obj, (code_type, traceback_type, frame_type)):
return True
elif isinstance(obj, generator_type):
if attr in UNSAFE_GENERATOR_ATTRIBUTES:
return True
return attr.startswith('__')
def modifies_known_mutable(obj, attr):
"""This function checks if an attribute on a builtin mutable object
(list, dict, set or deque) would modify it if called. It also supports
the "user"-versions of the objects (`sets.Set`, `UserDict.*` etc.) and
with Python 2.6 onwards the abstract base classes `MutableSet`,
`MutableMapping`, and `MutableSequence`.
>>> modifies_known_mutable({}, "clear")
True
>>> modifies_known_mutable({}, "keys")
False
>>> modifies_known_mutable([], "append")
True
>>> modifies_known_mutable([], "index")
False
If called with an unsupported object (such as unicode) `False` is
returned.
>>> modifies_known_mutable("foo", "upper")
False
"""
for typespec, unsafe in _mutable_spec:
if isinstance(obj, typespec):
return attr in unsafe
return False
class SandboxedEnvironment(Environment):
"""The sandboxed environment. It works like the regular environment but
tells the compiler to generate sandboxed code. Additionally subclasses of
this environment may override the methods that tell the runtime what
attributes or functions are safe to access.
If the template tries to access insecure code a :exc:`SecurityError` is
raised. However also other exceptions may occour during the rendering so
the caller has to ensure that all exceptions are catched.
"""
sandboxed = True
#: default callback table for the binary operators. A copy of this is
#: available on each instance of a sandboxed environment as
#: :attr:`binop_table`
default_binop_table = {
'+': operator.add,
'-': operator.sub,
'*': operator.mul,
'/': operator.truediv,
'//': operator.floordiv,
'**': operator.pow,
'%': operator.mod
}
#: default callback table for the unary operators. A copy of this is
#: available on each instance of a sandboxed environment as
#: :attr:`unop_table`
default_unop_table = {
'+': operator.pos,
'-': operator.neg
}
#: a set of binary operators that should be intercepted. Each operator
#: that is added to this set (empty by default) is delegated to the
#: :meth:`call_binop` method that will perform the operator. The default
#: operator callback is specified by :attr:`binop_table`.
#:
#: The following binary operators are interceptable:
#: ``//``, ``%``, ``+``, ``*``, ``-``, ``/``, and ``**``
#:
#: The default operation form the operator table corresponds to the
#: builtin function. Intercepted calls are always slower than the native
#: operator call, so make sure only to intercept the ones you are
#: interested in.
#:
#: .. versionadded:: 2.6
intercepted_binops = frozenset()
#: a set of unary operators that should be intercepted. Each operator
#: that is added to this set (empty by default) is delegated to the
#: :meth:`call_unop` method that will perform the operator. The default
#: operator callback is specified by :attr:`unop_table`.
#:
#: The following unary operators are interceptable: ``+``, ``-``
#:
#: The default operation form the operator table corresponds to the
#: builtin function. Intercepted calls are always slower than the native
#: operator call, so make sure only to intercept the ones you are
#: interested in.
#:
#: .. versionadded:: 2.6
intercepted_unops = frozenset()
def intercept_unop(self, operator):
"""Called during template compilation with the name of a unary
operator to check if it should be intercepted at runtime. If this
method returns `True`, :meth:`call_unop` is excuted for this unary
operator. The default implementation of :meth:`call_unop` will use
the :attr:`unop_table` dictionary to perform the operator with the
same logic as the builtin one.
The following unary operators are interceptable: ``+`` and ``-``
Intercepted calls are always slower than the native operator call,
so make sure only to intercept the ones you are interested in.
.. versionadded:: 2.6
"""
return False
def __init__(self, *args, **kwargs):
Environment.__init__(self, *args, **kwargs)
self.globals['range'] = safe_range
self.binop_table = self.default_binop_table.copy()
self.unop_table = self.default_unop_table.copy()
def is_safe_attribute(self, obj, attr, value):
"""The sandboxed environment will call this method to check if the
attribute of an object is safe to access. Per default all attributes
starting with an underscore are considered private as well as the
special attributes of internal python objects as returned by the
:func:`is_internal_attribute` function.
"""
return not (attr.startswith('_') or is_internal_attribute(obj, attr))
def is_safe_callable(self, obj):
"""Check if an object is safely callable. Per default a function is
considered safe unless the `unsafe_callable` attribute exists and is
True. Override this method to alter the behavior, but this won't
affect the `unsafe` decorator from this module.
"""
return not (getattr(obj, 'unsafe_callable', False) or
getattr(obj, 'alters_data', False))
def call_binop(self, context, operator, left, right):
"""For intercepted binary operator calls (:meth:`intercepted_binops`)
this function is executed instead of the builtin operator. This can
be used to fine tune the behavior of certain operators.
.. versionadded:: 2.6
"""
return self.binop_table[operator](left, right)
def call_unop(self, context, operator, arg):
"""For intercepted unary operator calls (:meth:`intercepted_unops`)
this function is executed instead of the builtin operator. This can
be used to fine tune the behavior of certain operators.
.. versionadded:: 2.6
"""
return self.unop_table[operator](arg)
def getitem(self, obj, argument):
"""Subscribe an object from sandboxed code."""
try:
return obj[argument]
except (TypeError, LookupError):
if isinstance(argument, string_types):
try:
attr = str(argument)
except Exception:
pass
else:
try:
value = getattr(obj, attr)
except AttributeError:
pass
else:
if self.is_safe_attribute(obj, argument, value):
return value
return self.unsafe_undefined(obj, argument)
return self.undefined(obj=obj, name=argument)
def getattr(self, obj, attribute):
"""Subscribe an object from sandboxed code and prefer the
attribute. The attribute passed *must* be a bytestring.
"""
try:
value = getattr(obj, attribute)
except AttributeError:
try:
return obj[attribute]
except (TypeError, LookupError):
pass
else:
if self.is_safe_attribute(obj, attribute, value):
return value
return self.unsafe_undefined(obj, attribute)
return self.undefined(obj=obj, name=attribute)
def unsafe_undefined(self, obj, attribute):
"""Return an undefined object for unsafe attributes."""
return self.undefined('access to attribute %r of %r '
'object is unsafe.' % (
attribute,
obj.__class__.__name__
), name=attribute, obj=obj, exc=SecurityError)
def call(__self, __context, __obj, *args, **kwargs):
"""Call an object from sandboxed code."""
# the double prefixes are to avoid double keyword argument
# errors when proxying the call.
if not __self.is_safe_callable(__obj):
raise SecurityError('%r is not safely callable' % (__obj,))
return __context.call(__obj, *args, **kwargs)
class ImmutableSandboxedEnvironment(SandboxedEnvironment):
"""Works exactly like the regular `SandboxedEnvironment` but does not
permit modifications on the builtin mutable objects `list`, `set`, and
`dict` by using the :func:`modifies_known_mutable` function.
"""
def is_safe_attribute(self, obj, attr, value):
if not SandboxedEnvironment.is_safe_attribute(self, obj, attr, value):
return False
return not modifies_known_mutable(obj, attr)
+149
View File
@@ -0,0 +1,149 @@
# -*- coding: utf-8 -*-
"""
jinja2.tests
~~~~~~~~~~~~
Jinja test functions. Used with the "is" operator.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
from jinja2.runtime import Undefined
from jinja2._compat import text_type, string_types, mapping_types
number_re = re.compile(r'^-?\d+(\.\d+)?$')
regex_type = type(number_re)
test_callable = callable
def test_odd(value):
"""Return true if the variable is odd."""
return value % 2 == 1
def test_even(value):
"""Return true if the variable is even."""
return value % 2 == 0
def test_divisibleby(value, num):
"""Check if a variable is divisible by a number."""
return value % num == 0
def test_defined(value):
"""Return true if the variable is defined:
.. sourcecode:: jinja
{% if variable is defined %}
value of variable: {{ variable }}
{% else %}
variable is not defined
{% endif %}
See the :func:`default` filter for a simple way to set undefined
variables.
"""
return not isinstance(value, Undefined)
def test_undefined(value):
"""Like :func:`defined` but the other way round."""
return isinstance(value, Undefined)
def test_none(value):
"""Return true if the variable is none."""
return value is None
def test_lower(value):
"""Return true if the variable is lowercased."""
return text_type(value).islower()
def test_upper(value):
"""Return true if the variable is uppercased."""
return text_type(value).isupper()
def test_string(value):
"""Return true if the object is a string."""
return isinstance(value, string_types)
def test_mapping(value):
"""Return true if the object is a mapping (dict etc.).
.. versionadded:: 2.6
"""
return isinstance(value, mapping_types)
def test_number(value):
"""Return true if the variable is a number."""
return isinstance(value, (int, float, complex))
def test_sequence(value):
"""Return true if the variable is a sequence. Sequences are variables
that are iterable.
"""
try:
len(value)
value.__getitem__
except:
return False
return True
def test_sameas(value, other):
"""Check if an object points to the same memory address than another
object:
.. sourcecode:: jinja
{% if foo.attribute is sameas false %}
the foo attribute really is the `False` singleton
{% endif %}
"""
return value is other
def test_iterable(value):
"""Check if it's possible to iterate over an object."""
try:
iter(value)
except TypeError:
return False
return True
def test_escaped(value):
"""Check if the value is escaped."""
return hasattr(value, '__html__')
TESTS = {
'odd': test_odd,
'even': test_even,
'divisibleby': test_divisibleby,
'defined': test_defined,
'undefined': test_undefined,
'none': test_none,
'lower': test_lower,
'upper': test_upper,
'string': test_string,
'mapping': test_mapping,
'number': test_number,
'sequence': test_sequence,
'iterable': test_iterable,
'callable': test_callable,
'sameas': test_sameas,
'escaped': test_escaped
}
+520
View File
@@ -0,0 +1,520 @@
# -*- coding: utf-8 -*-
"""
jinja2.utils
~~~~~~~~~~~~
Utility functions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import errno
from collections import deque
from jinja2._compat import text_type, string_types, implements_iterator, \
allocate_lock, url_quote
_word_split_re = re.compile(r'(\s+)')
_punctuation_re = re.compile(
'^(?P<lead>(?:%s)*)(?P<middle>.*?)(?P<trail>(?:%s)*)$' % (
'|'.join(map(re.escape, ('(', '<', '&lt;'))),
'|'.join(map(re.escape, ('.', ',', ')', '>', '\n', '&gt;')))
)
)
_simple_email_re = re.compile(r'^\S+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+$')
_striptags_re = re.compile(r'(<!--.*?-->|<[^>]*>)')
_entity_re = re.compile(r'&([^;]+);')
_letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
_digits = '0123456789'
# special singleton representing missing values for the runtime
missing = type('MissingType', (), {'__repr__': lambda x: 'missing'})()
# internal code
internal_code = set()
concat = u''.join
def contextfunction(f):
"""This decorator can be used to mark a function or method context callable.
A context callable is passed the active :class:`Context` as first argument when
called from the template. This is useful if a function wants to get access
to the context or functions provided on the context object. For example
a function that returns a sorted list of template variables the current
template exports could look like this::
@contextfunction
def get_exported_names(context):
return sorted(context.exported_vars)
"""
f.contextfunction = True
return f
def evalcontextfunction(f):
"""This decorator can be used to mark a function or method as an eval
context callable. This is similar to the :func:`contextfunction`
but instead of passing the context, an evaluation context object is
passed. For more information about the eval context, see
:ref:`eval-context`.
.. versionadded:: 2.4
"""
f.evalcontextfunction = True
return f
def environmentfunction(f):
"""This decorator can be used to mark a function or method as environment
callable. This decorator works exactly like the :func:`contextfunction`
decorator just that the first argument is the active :class:`Environment`
and not context.
"""
f.environmentfunction = True
return f
def internalcode(f):
"""Marks the function as internally used"""
internal_code.add(f.__code__)
return f
def is_undefined(obj):
"""Check if the object passed is undefined. This does nothing more than
performing an instance check against :class:`Undefined` but looks nicer.
This can be used for custom filters or tests that want to react to
undefined variables. For example a custom default filter can look like
this::
def default(var, default=''):
if is_undefined(var):
return default
return var
"""
from jinja2.runtime import Undefined
return isinstance(obj, Undefined)
def consume(iterable):
"""Consumes an iterable without doing anything with it."""
for event in iterable:
pass
def clear_caches():
"""Jinja2 keeps internal caches for environments and lexers. These are
used so that Jinja2 doesn't have to recreate environments and lexers all
the time. Normally you don't have to care about that but if you are
messuring memory consumption you may want to clean the caches.
"""
from jinja2.environment import _spontaneous_environments
from jinja2.lexer import _lexer_cache
_spontaneous_environments.clear()
_lexer_cache.clear()
def import_string(import_name, silent=False):
"""Imports an object based on a string. This is useful if you want to
use import paths as endpoints or something similar. An import path can
be specified either in dotted notation (``xml.sax.saxutils.escape``)
or with a colon as object delimiter (``xml.sax.saxutils:escape``).
If the `silent` is True the return value will be `None` if the import
fails.
:return: imported object
"""
try:
if ':' in import_name:
module, obj = import_name.split(':', 1)
elif '.' in import_name:
items = import_name.split('.')
module = '.'.join(items[:-1])
obj = items[-1]
else:
return __import__(import_name)
return getattr(__import__(module, None, None, [obj]), obj)
except (ImportError, AttributeError):
if not silent:
raise
def open_if_exists(filename, mode='rb'):
"""Returns a file descriptor for the filename if that file exists,
otherwise `None`.
"""
try:
return open(filename, mode)
except IOError as e:
if e.errno not in (errno.ENOENT, errno.EISDIR):
raise
def object_type_repr(obj):
"""Returns the name of the object's type. For some recognized
singletons the name of the object is returned instead. (For
example for `None` and `Ellipsis`).
"""
if obj is None:
return 'None'
elif obj is Ellipsis:
return 'Ellipsis'
# __builtin__ in 2.x, builtins in 3.x
if obj.__class__.__module__ in ('__builtin__', 'builtins'):
name = obj.__class__.__name__
else:
name = obj.__class__.__module__ + '.' + obj.__class__.__name__
return '%s object' % name
def pformat(obj, verbose=False):
"""Prettyprint an object. Either use the `pretty` library or the
builtin `pprint`.
"""
try:
from pretty import pretty
return pretty(obj, verbose=verbose)
except ImportError:
from pprint import pformat
return pformat(obj)
def urlize(text, trim_url_limit=None, nofollow=False):
"""Converts any URLs in text into clickable links. Works on http://,
https:// and www. links. Links can have trailing punctuation (periods,
commas, close-parens) and leading punctuation (opening parens) and
it'll still do the right thing.
If trim_url_limit is not None, the URLs in link text will be limited
to trim_url_limit characters.
If nofollow is True, the URLs in link text will get a rel="nofollow"
attribute.
"""
trim_url = lambda x, limit=trim_url_limit: limit is not None \
and (x[:limit] + (len(x) >=limit and '...'
or '')) or x
words = _word_split_re.split(text_type(escape(text)))
nofollow_attr = nofollow and ' rel="nofollow"' or ''
for i, word in enumerate(words):
match = _punctuation_re.match(word)
if match:
lead, middle, trail = match.groups()
if middle.startswith('www.') or (
'@' not in middle and
not middle.startswith('http://') and
not middle.startswith('https://') and
len(middle) > 0 and
middle[0] in _letters + _digits and (
middle.endswith('.org') or
middle.endswith('.net') or
middle.endswith('.com')
)):
middle = '<a href="http://%s"%s>%s</a>' % (middle,
nofollow_attr, trim_url(middle))
if middle.startswith('http://') or \
middle.startswith('https://'):
middle = '<a href="%s"%s>%s</a>' % (middle,
nofollow_attr, trim_url(middle))
if '@' in middle and not middle.startswith('www.') and \
not ':' in middle and _simple_email_re.match(middle):
middle = '<a href="mailto:%s">%s</a>' % (middle, middle)
if lead + middle + trail != word:
words[i] = lead + middle + trail
return u''.join(words)
def generate_lorem_ipsum(n=5, html=True, min=20, max=100):
"""Generate some lorem impsum for the template."""
from jinja2.constants import LOREM_IPSUM_WORDS
from random import choice, randrange
words = LOREM_IPSUM_WORDS.split()
result = []
for _ in range(n):
next_capitalized = True
last_comma = last_fullstop = 0
word = None
last = None
p = []
# each paragraph contains out of 20 to 100 words.
for idx, _ in enumerate(range(randrange(min, max))):
while True:
word = choice(words)
if word != last:
last = word
break
if next_capitalized:
word = word.capitalize()
next_capitalized = False
# add commas
if idx - randrange(3, 8) > last_comma:
last_comma = idx
last_fullstop += 2
word += ','
# add end of sentences
if idx - randrange(10, 20) > last_fullstop:
last_comma = last_fullstop = idx
word += '.'
next_capitalized = True
p.append(word)
# ensure that the paragraph ends with a dot.
p = u' '.join(p)
if p.endswith(','):
p = p[:-1] + '.'
elif not p.endswith('.'):
p += '.'
result.append(p)
if not html:
return u'\n\n'.join(result)
return Markup(u'\n'.join(u'<p>%s</p>' % escape(x) for x in result))
def unicode_urlencode(obj, charset='utf-8'):
"""URL escapes a single bytestring or unicode string with the
given charset if applicable to URL safe quoting under all rules
that need to be considered under all supported Python versions.
If non strings are provided they are converted to their unicode
representation first.
"""
if not isinstance(obj, string_types):
obj = text_type(obj)
if isinstance(obj, text_type):
obj = obj.encode(charset)
return text_type(url_quote(obj))
class LRUCache(object):
"""A simple LRU Cache implementation."""
# this is fast for small capacities (something below 1000) but doesn't
# scale. But as long as it's only used as storage for templates this
# won't do any harm.
def __init__(self, capacity):
self.capacity = capacity
self._mapping = {}
self._queue = deque()
self._postinit()
def _postinit(self):
# alias all queue methods for faster lookup
self._popleft = self._queue.popleft
self._pop = self._queue.pop
self._remove = self._queue.remove
self._wlock = allocate_lock()
self._append = self._queue.append
def __getstate__(self):
return {
'capacity': self.capacity,
'_mapping': self._mapping,
'_queue': self._queue
}
def __setstate__(self, d):
self.__dict__.update(d)
self._postinit()
def __getnewargs__(self):
return (self.capacity,)
def copy(self):
"""Return a shallow copy of the instance."""
rv = self.__class__(self.capacity)
rv._mapping.update(self._mapping)
rv._queue = deque(self._queue)
return rv
def get(self, key, default=None):
"""Return an item from the cache dict or `default`"""
try:
return self[key]
except KeyError:
return default
def setdefault(self, key, default=None):
"""Set `default` if the key is not in the cache otherwise
leave unchanged. Return the value of this key.
"""
self._wlock.acquire()
try:
try:
return self[key]
except KeyError:
self[key] = default
return default
finally:
self._wlock.release()
def clear(self):
"""Clear the cache."""
self._wlock.acquire()
try:
self._mapping.clear()
self._queue.clear()
finally:
self._wlock.release()
def __contains__(self, key):
"""Check if a key exists in this cache."""
return key in self._mapping
def __len__(self):
"""Return the current size of the cache."""
return len(self._mapping)
def __repr__(self):
return '<%s %r>' % (
self.__class__.__name__,
self._mapping
)
def __getitem__(self, key):
"""Get an item from the cache. Moves the item up so that it has the
highest priority then.
Raise a `KeyError` if it does not exist.
"""
self._wlock.acquire()
try:
rv = self._mapping[key]
if self._queue[-1] != key:
try:
self._remove(key)
except ValueError:
# if something removed the key from the container
# when we read, ignore the ValueError that we would
# get otherwise.
pass
self._append(key)
return rv
finally:
self._wlock.release()
def __setitem__(self, key, value):
"""Sets the value for an item. Moves the item up so that it
has the highest priority then.
"""
self._wlock.acquire()
try:
if key in self._mapping:
self._remove(key)
elif len(self._mapping) == self.capacity:
del self._mapping[self._popleft()]
self._append(key)
self._mapping[key] = value
finally:
self._wlock.release()
def __delitem__(self, key):
"""Remove an item from the cache dict.
Raise a `KeyError` if it does not exist.
"""
self._wlock.acquire()
try:
del self._mapping[key]
try:
self._remove(key)
except ValueError:
# __getitem__ is not locked, it might happen
pass
finally:
self._wlock.release()
def items(self):
"""Return a list of items."""
result = [(key, self._mapping[key]) for key in list(self._queue)]
result.reverse()
return result
def iteritems(self):
"""Iterate over all items."""
return iter(self.items())
def values(self):
"""Return a list of all values."""
return [x[1] for x in self.items()]
def itervalue(self):
"""Iterate over all values."""
return iter(self.values())
def keys(self):
"""Return a list of all keys ordered by most recent usage."""
return list(self)
def iterkeys(self):
"""Iterate over all keys in the cache dict, ordered by
the most recent usage.
"""
return reversed(tuple(self._queue))
__iter__ = iterkeys
def __reversed__(self):
"""Iterate over the values in the cache dict, oldest items
coming first.
"""
return iter(tuple(self._queue))
__copy__ = copy
# register the LRU cache as mutable mapping if possible
try:
from collections import MutableMapping
MutableMapping.register(LRUCache)
except ImportError:
pass
@implements_iterator
class Cycler(object):
"""A cycle helper for templates."""
def __init__(self, *items):
if not items:
raise RuntimeError('at least one item has to be provided')
self.items = items
self.reset()
def reset(self):
"""Resets the cycle."""
self.pos = 0
@property
def current(self):
"""Returns the current item."""
return self.items[self.pos]
def __next__(self):
"""Goes one item ahead and returns it."""
rv = self.current
self.pos = (self.pos + 1) % len(self.items)
return rv
class Joiner(object):
"""A joining helper for templates."""
def __init__(self, sep=u', '):
self.sep = sep
self.used = False
def __call__(self):
if not self.used:
self.used = True
return u''
return self.sep
# Imported here because that's where it was in the past
from .markupsafe import Markup, escape, soft_unicode
+87
View File
@@ -0,0 +1,87 @@
# -*- coding: utf-8 -*-
"""
jinja2.visitor
~~~~~~~~~~~~~~
This module implements a visitor for the nodes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2.nodes import Node
class NodeVisitor(object):
"""Walks the abstract syntax tree and call visitor functions for every
node found. The visitor functions may return values which will be
forwarded by the `visit` method.
Per default the visitor functions for the nodes are ``'visit_'`` +
class name of the node. So a `TryFinally` node visit function would
be `visit_TryFinally`. This behavior can be changed by overriding
the `get_visitor` function. If no visitor function exists for a node
(return value `None`) the `generic_visit` visitor is used instead.
"""
def get_visitor(self, node):
"""Return the visitor function for this node or `None` if no visitor
exists for this node. In that case the generic visit function is
used instead.
"""
method = 'visit_' + node.__class__.__name__
return getattr(self, method, None)
def visit(self, node, *args, **kwargs):
"""Visit a node."""
f = self.get_visitor(node)
if f is not None:
return f(node, *args, **kwargs)
return self.generic_visit(node, *args, **kwargs)
def generic_visit(self, node, *args, **kwargs):
"""Called if no explicit visitor function exists for a node."""
for node in node.iter_child_nodes():
self.visit(node, *args, **kwargs)
class NodeTransformer(NodeVisitor):
"""Walks the abstract syntax tree and allows modifications of nodes.
The `NodeTransformer` will walk the AST and use the return value of the
visitor functions to replace or remove the old node. If the return
value of the visitor function is `None` the node will be removed
from the previous location otherwise it's replaced with the return
value. The return value may be the original node in which case no
replacement takes place.
"""
def generic_visit(self, node, *args, **kwargs):
for field, old_value in node.iter_fields():
if isinstance(old_value, list):
new_values = []
for value in old_value:
if isinstance(value, Node):
value = self.visit(value, *args, **kwargs)
if value is None:
continue
elif not isinstance(value, Node):
new_values.extend(value)
continue
new_values.append(value)
old_value[:] = new_values
elif isinstance(old_value, Node):
new_node = self.visit(old_value, *args, **kwargs)
if new_node is None:
delattr(node, field)
else:
setattr(node, field, new_node)
return node
def visit_list(self, node, *args, **kwargs):
"""As transformers may return lists in some places this method
can be used to enforce a list as return value.
"""
rv = self.visit(node, *args, **kwargs)
if not isinstance(rv, list):
rv = [rv]
return rv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3 -2
View File
@@ -24,7 +24,8 @@ if(WIN32 AND NOT MINGW)
endif(WIN32 AND NOT MINGW)
ocv_warnings_disable(CMAKE_C_FLAGS -Wno-implicit-function-declaration -Wno-uninitialized -Wmissing-prototypes
-Wno-unused-but-set-parameter -Wmissing-declarations -Wunused -Wshadow -Wsign-compare)
-Wno-unused-but-set-parameter -Wmissing-declarations -Wunused -Wshadow
-Wsign-compare -Wstrict-overflow)
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
ocv_warnings_disable(CMAKE_C_FLAGS /wd4013 /wd4018 /wd4101 /wd4244 /wd4267 /wd4715) # vs2005
@@ -46,5 +47,5 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${JASPER_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
ocv_install_target(${JASPER_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
endif()
+8 -1
View File
@@ -9,6 +9,12 @@ ocv_include_directories(${CMAKE_CURRENT_SOURCE_DIR})
file(GLOB lib_srcs *.c)
file(GLOB lib_hdrs *.h)
if(ANDROID OR IOS OR APPLE)
ocv_list_filterout(lib_srcs jmemansi.c)
else()
ocv_list_filterout(lib_srcs jmemnobs.c)
endif()
# ----------------------------------------------------------------------------------
# Define the library target:
# ----------------------------------------------------------------------------------
@@ -27,6 +33,7 @@ endif()
ocv_warnings_disable(CMAKE_C_FLAGS -Wcast-align -Wshadow -Wunused)
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
ocv_warnings_disable(CMAKE_C_FLAGS /wd4013 /wd4244 /wd4267) # vs2005
set_target_properties(${JPEG_LIBRARY}
PROPERTIES OUTPUT_NAME ${JPEG_LIBRARY}
@@ -39,5 +46,5 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()
if(NOT BUILD_SHARED_LIBS)
ocv_install_target(${JPEG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
ocv_install_target(${JPEG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
endif()
+143 -178
View File
@@ -1,24 +1,20 @@
The Independent JPEG Group's JPEG software
==========================================
README for release 6b of 27-Mar-1998
====================================
README for release 9 of 13-Jan-2013
===================================
This distribution contains the sixth public release of the Independent JPEG
This distribution contains the ninth public release of the Independent JPEG
Group's free JPEG software. You are welcome to redistribute this software and
to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
Serious users of this software (particularly those incorporating it into
larger programs) should contact IJG at jpeg-info@uunet.uu.net to be added to
our electronic mailing list. Mailing list members are notified of updates
and have a chance to participate in technical discussions, etc.
This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,
Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,
Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,
and other members of the Independent JPEG Group.
This software is the work of Tom Lane, Philip Gladstone, Jim Boucher,
Lee Crocker, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi,
Guido Vollbeding, Ge' Weijers, and other members of the Independent JPEG
Group.
IJG is not affiliated with the official ISO JPEG standards committee.
IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee
(also known as JPEG, together with ITU-T SG16).
DOCUMENTATION ROADMAP
@@ -30,27 +26,27 @@ OVERVIEW General description of JPEG and the IJG software.
LEGAL ISSUES Copyright, lack of warranty, terms of distribution.
REFERENCES Where to learn more about JPEG.
ARCHIVE LOCATIONS Where to find newer versions of this software.
RELATED SOFTWARE Other stuff you should get.
ACKNOWLEDGMENTS Special thanks.
FILE FORMAT WARS Software *not* to get.
TO DO Plans for future IJG releases.
Other documentation files in the distribution are:
User documentation:
install.doc How to configure and install the IJG software.
usage.doc Usage instructions for cjpeg, djpeg, jpegtran,
install.txt How to configure and install the IJG software.
usage.txt Usage instructions for cjpeg, djpeg, jpegtran,
rdjpgcom, and wrjpgcom.
*.1 Unix-style man pages for programs (same info as usage.doc).
wizard.doc Advanced usage instructions for JPEG wizards only.
*.1 Unix-style man pages for programs (same info as usage.txt).
wizard.txt Advanced usage instructions for JPEG wizards only.
change.log Version-to-version change highlights.
Programmer and internal documentation:
libjpeg.doc How to use the JPEG library in your own programs.
libjpeg.txt How to use the JPEG library in your own programs.
example.c Sample code for calling the JPEG library.
structure.doc Overview of the JPEG library's internal structure.
filelist.doc Road map of IJG files.
coderules.doc Coding style rules --- please read if you contribute code.
structure.txt Overview of the JPEG library's internal structure.
filelist.txt Road map of IJG files.
coderules.txt Coding style rules --- please read if you contribute code.
Please read at least the files install.doc and usage.doc. Useful information
Please read at least the files install.txt and usage.txt. Some information
can also be found in the JPEG FAQ (Frequently Asked Questions) article. See
ARCHIVE LOCATIONS below to find out where to obtain the FAQ article.
@@ -62,24 +58,15 @@ the order listed) before diving into the code.
OVERVIEW
========
This package contains C software to implement JPEG image compression and
decompression. JPEG (pronounced "jay-peg") is a standardized compression
method for full-color and gray-scale images. JPEG is intended for compressing
"real-world" scenes; line drawings, cartoons and other non-realistic images
are not its strong suit. JPEG is lossy, meaning that the output image is not
exactly identical to the input image. Hence you must not use JPEG if you
have to have identical output bits. However, on typical photographic images,
very good compression levels can be obtained with no visible change, and
remarkably high compression levels are possible if you can tolerate a
low-quality image. For more details, see the references, or just experiment
with various compression settings.
This package contains C software to implement JPEG image encoding, decoding,
and transcoding. JPEG (pronounced "jay-peg") is a standardized compression
method for full-color and gray-scale images.
This software implements JPEG baseline, extended-sequential, and progressive
compression processes. Provision is made for supporting all variants of these
processes, although some uncommon parameter settings aren't implemented yet.
For legal reasons, we are not distributing code for the arithmetic-coding
variants of JPEG; see LEGAL ISSUES. We have made no provision for supporting
the hierarchical or lossless processes defined in the standard.
We have made no provision for supporting the hierarchical or lossless
processes defined in the standard.
We provide a set of library routines for reading and writing JPEG image files,
plus two sample applications "cjpeg" and "djpeg", which use the library to
@@ -91,10 +78,11 @@ considerable functionality beyond the bare JPEG coding/decoding capability;
for example, the color quantization modules are not strictly part of JPEG
decoding, but they are essential for output to colormapped file formats or
colormapped displays. These extra functions can be compiled out of the
library if not required for a particular application. We have also included
"jpegtran", a utility for lossless transcoding between different JPEG
processes, and "rdjpgcom" and "wrjpgcom", two simple applications for
inserting and extracting textual comments in JFIF files.
library if not required for a particular application.
We have also included "jpegtran", a utility for lossless transcoding between
different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple
applications for inserting and extracting textual comments in JFIF files.
The emphasis in designing this software has been on achieving portability and
flexibility, while also making it fast enough to be useful. In particular,
@@ -127,7 +115,7 @@ with respect to this software, its quality, accuracy, merchantability, or
fitness for a particular purpose. This software is provided "AS IS", and you,
its user, assume the entire risk as to its quality and accuracy.
This software is copyright (C) 1991-1998, Thomas G. Lane.
This software is copyright (C) 1991-2013, Thomas G. Lane, Guido Vollbeding.
All Rights Reserved except as specified below.
Permission is hereby granted to use, copy, modify, and distribute this
@@ -158,29 +146,11 @@ commercial products, provided that all warranty or liability claims are
assumed by the product vendor.
ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
ansi2knr.c is NOT covered by the above copyright and conditions, but instead
by the usual distribution terms of the Free Software Foundation; principally,
that you must include source code if you redistribute it. (See the file
ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part
of any program generated from the IJG code, this does not limit you more than
the foregoing paragraphs do.
The Unix configuration script "configure" was produced with GNU Autoconf.
It is copyright by the Free Software Foundation but is freely distributable.
The same holds for its supporting scripts (config.guess, config.sub,
ltconfig, ltmain.sh). Another support script, install-sh, is copyright
by M.I.T. but is also freely distributable.
It appears that the arithmetic coding option of the JPEG spec is covered by
patents owned by IBM, AT&T, and Mitsubishi. Hence arithmetic coding cannot
legally be used without obtaining one or more licenses. For this reason,
support for arithmetic coding has been removed from the free JPEG software.
(Since arithmetic coding provides only a marginal gain over the unpatented
Huffman mode, it is unlikely that very many implementations will support it.)
So far as we are aware, there are no patent restrictions on the remaining
code.
ltmain.sh). Another support script, install-sh, is copyright by X Consortium
but is also freely distributable.
The IJG distribution formerly included code to read and write GIF files.
To avoid entanglement with the Unisys LZW patent, GIF reading support has
@@ -198,7 +168,7 @@ We are required to state that
REFERENCES
==========
We highly recommend reading one or more of these references before trying to
We recommend reading one or more of these references before trying to
understand the innards of the JPEG software.
The best short technical introduction to the JPEG compression algorithm is
@@ -207,7 +177,7 @@ The best short technical introduction to the JPEG compression algorithm is
(Adjacent articles in that issue discuss MPEG motion picture compression,
applications of JPEG, and related topics.) If you don't have the CACM issue
handy, a PostScript file containing a revised version of Wallace's article is
available at ftp://ftp.uu.net/graphics/jpeg/wallace.ps.gz. The file (actually
available at http://www.ijg.org/files/wallace.ps.gz. The file (actually
a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
omits the sample images that appeared in CACM, but it includes corrections
and some added material. Note: the Wallace article is copyright ACM and IEEE,
@@ -222,82 +192,71 @@ code but don't know much about data compression in general. The book's JPEG
sample code is far from industrial-strength, but when you are ready to look
at a full implementation, you've got one here...
The best full description of JPEG is the textbook "JPEG Still Image Data
Compression Standard" by William B. Pennebaker and Joan L. Mitchell, published
by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. Price US$59.95, 638 pp.
The book includes the complete text of the ISO JPEG standards (DIS 10918-1
and draft DIS 10918-2). This is by far the most complete exposition of JPEG
in existence, and we highly recommend it.
The best currently available description of JPEG is the textbook "JPEG Still
Image Data Compression Standard" by William B. Pennebaker and Joan L.
Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.
Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG
standards (DIS 10918-1 and draft DIS 10918-2).
Although this is by far the most detailed and comprehensive exposition of
JPEG publicly available, we point out that it is still missing an explanation
of the most essential properties and algorithms of the underlying DCT
technology.
If you think that you know about DCT-based JPEG after reading this book,
then you are in delusion. The real fundamentals and corresponding potential
of DCT-based JPEG are not publicly known so far, and that is the reason for
all the mistaken developments taking place in the image coding domain.
The JPEG standard itself is not available electronically; you must order a
paper copy through ISO or ITU. (Unless you feel a need to own a certified
official copy, we recommend buying the Pennebaker and Mitchell book instead;
it's much cheaper and includes a great deal of useful explanatory material.)
In the USA, copies of the standard may be ordered from ANSI Sales at (212)
642-4900, or from Global Engineering Documents at (800) 854-7179. (ANSI
doesn't take credit card orders, but Global does.) It's not cheap: as of
1992, ANSI was charging $95 for Part 1 and $47 for Part 2, plus 7%
shipping/handling. The standard is divided into two parts, Part 1 being the
actual specification, while Part 2 covers compliance testing methods. Part 1
is titled "Digital Compression and Coding of Continuous-tone Still Images,
The original JPEG standard is divided into two parts, Part 1 being the actual
specification, while Part 2 covers compliance testing methods. Part 1 is
titled "Digital Compression and Coding of Continuous-tone Still Images,
Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of
Continuous-tone Still Images, Part 2: Compliance testing" and has document
numbers ISO/IEC IS 10918-2, ITU-T T.83.
Some extensions to the original JPEG standard are defined in JPEG Part 3,
a newer ISO standard numbered ISO/IEC IS 10918-3 and ITU-T T.84. IJG
currently does not support any Part 3 extensions.
IJG JPEG 8 introduced an implementation of the JPEG SmartScale extension
which is specified in two documents: A contributed document at ITU and ISO
with title "ITU-T JPEG-Plus Proposal for Extending ITU-T T.81 for Advanced
Image Coding", April 2006, Geneva, Switzerland. The latest version of this
document is Revision 3. And a contributed document ISO/IEC JTC1/SC29/WG1 N
5799 with title "Evolution of JPEG", June/July 2011, Berlin, Germany.
IJG JPEG 9 introduces a reversible color transform for improved lossless
compression which is described in a contributed document ISO/IEC JTC1/SC29/
WG1 N 6080 with title "JPEG 9 Lossless Coding", June/July 2012, Paris,
France.
The JPEG standard does not specify all details of an interchangeable file
format. For the omitted details we follow the "JFIF" conventions, revision
1.02. A copy of the JFIF spec is available from:
Literature Department
C-Cube Microsystems, Inc.
1778 McCarthy Blvd.
Milpitas, CA 95035
phone (408) 944-6300, fax (408) 944-6314
A PostScript version of this document is available by FTP at
ftp://ftp.uu.net/graphics/jpeg/jfif.ps.gz. There is also a plain text
version at ftp://ftp.uu.net/graphics/jpeg/jfif.txt.gz, but it is missing
the figures.
1.02. JFIF 1.02 has been adopted as an Ecma International Technical Report
and thus received a formal publication status. It is available as a free
download in PDF format from
http://www.ecma-international.org/publications/techreports/E-TR-098.htm.
A PostScript version of the JFIF document is available at
http://www.ijg.org/files/jfif.ps.gz. There is also a plain text version at
http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures.
The TIFF 6.0 file format specification can be obtained by FTP from
ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme
found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
(Compression tag 7). Copies of this Note can be obtained from ftp.sgi.com or
from ftp://ftp.uu.net/graphics/jpeg/. It is expected that the next revision
(Compression tag 7). Copies of this Note can be obtained from
http://www.ijg.org/files/. It is expected that the next revision
of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
Although IJG's own code does not support TIFF/JPEG, the free libtiff library
uses our library to implement TIFF/JPEG per the Note. libtiff is available
from ftp://ftp.sgi.com/graphics/tiff/.
uses our library to implement TIFF/JPEG per the Note.
ARCHIVE LOCATIONS
=================
The "official" archive site for this software is ftp.uu.net (Internet
address 192.48.96.9). The most recent released version can always be found
there in directory graphics/jpeg. This particular version will be archived
as ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz. If you don't have
direct Internet access, UUNET's archives are also available via UUCP; contact
help@uunet.uu.net for information on retrieving files that way.
The "official" archive site for this software is www.ijg.org.
The most recent released version can always be found there in
directory "files". This particular version will be archived as
http://www.ijg.org/files/jpegsrc.v9.tar.gz, and in Windows-compatible
"zip" archive format as http://www.ijg.org/files/jpegsr9.zip.
Numerous Internet sites maintain copies of the UUNET files. However, only
ftp.uu.net is guaranteed to have the latest official version.
You can also obtain this software in DOS-compatible "zip" archive format from
the SimTel archives (ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/), or
on CompuServe in the Graphics Support forum (GO CIS:GRAPHSUP), library 12
"JPEG Tools". Again, these versions may sometimes lag behind the ftp.uu.net
release.
The JPEG FAQ (Frequently Asked Questions) article is a useful source of
general information about JPEG. It is updated constantly and therefore is
not included in this distribution. The FAQ is posted every two weeks to
Usenet newsgroups comp.graphics.misc, news.answers, and other groups.
The JPEG FAQ (Frequently Asked Questions) article is a source of some
general information about JPEG.
It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
and other news.answers archive sites, including the official news.answers
archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
@@ -307,79 +266,85 @@ with body
send usenet/news.answers/jpeg-faq/part2
RELATED SOFTWARE
================
ACKNOWLEDGMENTS
===============
Numerous viewing and image manipulation programs now support JPEG. (Quite a
few of them use this library to do so.) The JPEG FAQ described above lists
some of the more popular free and shareware viewers, and tells where to
obtain them on Internet.
Thank to Juergen Bruder for providing me with a copy of the common DCT
algorithm article, only to find out that I had come to the same result
in a more direct and comprehensible way with a more generative approach.
If you are on a Unix machine, we highly recommend Jef Poskanzer's free
PBMPLUS software, which provides many useful operations on PPM-format image
files. In particular, it can convert PPM images to and from a wide range of
other formats, thus making cjpeg/djpeg considerably more useful. The latest
version is distributed by the NetPBM group, and is available from numerous
sites, notably ftp://wuarchive.wustl.edu/graphics/graphics/packages/NetPBM/.
Unfortunately PBMPLUS/NETPBM is not nearly as portable as the IJG software is;
you are likely to have difficulty making it work on any non-Unix machine.
Thank to Istvan Sebestyen and Joan L. Mitchell for inviting me to the
ITU JPEG (Study Group 16) meeting in Geneva, Switzerland.
A different free JPEG implementation, written by the PVRG group at Stanford,
is available from ftp://havefun.stanford.edu/pub/jpeg/. This program
is designed for research and experimentation rather than production use;
it is slower, harder to use, and less portable than the IJG code, but it
is easier to read and modify. Also, the PVRG code supports lossless JPEG,
which we do not. (On the other hand, it doesn't do progressive JPEG.)
Thank to Thomas Wiegand and Gary Sullivan for inviting me to the
Joint Video Team (MPEG & ITU) meeting in Geneva, Switzerland.
Thank to Thomas Richter and Daniel Lee for inviting me to the
ISO/IEC JTC1/SC29/WG1 (also known as JPEG, together with ITU-T SG16)
meeting in Berlin, Germany.
Thank to John Korejwa and Massimo Ballerini for inviting me to
fruitful consultations in Boston, MA and Milan, Italy.
Thank to Hendrik Elstner, Roland Fassauer, Simone Zuck, Guenther
Maier-Gerber, Walter Stoeber, Fred Schmitz, and Norbert Braunagel
for corresponding business development.
Thank to Nico Zschach and Dirk Stelling of the technical support team
at the Digital Images company in Halle for providing me with extra
equipment for configuration tests.
Thank to Richard F. Lyon (then of Foveon Inc.) for fruitful
communication about JPEG configuration in Sigma Photo Pro software.
Thank to Andrew Finkenstadt for hosting the ijg.org site.
Last but not least special thank to Thomas G. Lane for the original
design and development of this singular software package.
FILE FORMAT WARS
================
Some JPEG programs produce files that are not compatible with our library.
The root of the problem is that the ISO JPEG committee failed to specify a
concrete file format. Some vendors "filled in the blanks" on their own,
creating proprietary formats that no one else could read. (For example, none
of the early commercial JPEG implementations for the Macintosh were able to
exchange compressed files.)
The ISO/IEC JTC1/SC29/WG1 standards committee (also known as JPEG, together
with ITU-T SG16) currently promotes different formats containing the name
"JPEG" which is misleading because these formats are incompatible with
original DCT-based JPEG and are based on faulty technologies.
IJG therefore does not and will not support such momentary mistakes
(see REFERENCES).
There exist also distributions under the name "OpenJPEG" promoting such
kind of formats which is misleading because they don't support original
JPEG images.
We have no sympathy for the promotion of inferior formats. Indeed, one of
the original reasons for developing this free software was to help force
convergence on common, interoperable format standards for JPEG files.
Don't use an incompatible file format!
(In any case, our decoder will remain capable of reading existing JPEG
image files indefinitely.)
The file format we have adopted is called JFIF (see REFERENCES). This format
has been agreed to by a number of major commercial JPEG vendors, and it has
become the de facto standard. JFIF is a minimal or "low end" representation.
We recommend the use of TIFF/JPEG (TIFF revision 6.0 as modified by TIFF
Technical Note #2) for "high end" applications that need to record a lot of
additional data about an image. TIFF/JPEG is fairly new and not yet widely
supported, unfortunately.
Furthermore, the ISO committee pretends to be "responsible for the popular
JPEG" in their public reports which is not true because they don't respond to
actual requirements for the maintenance of the original JPEG specification.
The upcoming JPEG Part 3 standard defines a file format called SPIFF.
SPIFF is interoperable with JFIF, in the sense that most JFIF decoders should
be able to read the most common variant of SPIFF. SPIFF has some technical
advantages over JFIF, but its major claim to fame is simply that it is an
official standard rather than an informal one. At this point it is unclear
whether SPIFF will supersede JFIF or whether JFIF will remain the de-facto
standard. IJG intends to support SPIFF once the standard is frozen, but we
have not decided whether it should become our default output format or not.
(In any case, our decoder will remain capable of reading JFIF indefinitely.)
Various proprietary file formats incorporating JPEG compression also exist.
We have little or no sympathy for the existence of these formats. Indeed,
one of the original reasons for developing this free software was to help
force convergence on common, open format standards for JPEG files. Don't
use a proprietary file format!
There are currently different distributions in circulation containing the
name "libjpeg" which is misleading because they don't have the features and
are incompatible with formats supported by actual IJG libjpeg distributions.
One of those fakes is released by members of the ISO committee and just uses
the name of libjpeg for misdirection of people, similar to the abuse of the
name JPEG as described above, while having nothing in common with actual IJG
libjpeg distributions.
The other one claims to be a "derivative" or "fork" of the original libjpeg
and violates the license conditions as described under LEGAL ISSUES above.
We have no sympathy for the release of misleading and illegal distributions
derived from obsolete code bases.
Don't use an obsolete code base!
TO DO
=====
The major thrust for v7 will probably be improvement of visual quality.
The current method for scaling the quantization tables is known not to be
very good at low Q values. We also intend to investigate block boundary
smoothing, "poor man's variable quantization", and other means of improving
quality-vs-file-size performance without sacrificing compatibility.
Version 9 is the second release of a new generation JPEG standard
to overcome the limitations of the original JPEG specification.
More features are being prepared for coming releases...
In future versions, we are considering supporting some of the upcoming JPEG
Part 3 extensions --- principally, variable quantization and the SPIFF file
format.
As always, speeding things up is of great interest.
Please send bug reports, offers of help, etc. to jpeg-info@uunet.uu.net.
Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.
+382
View File
@@ -0,0 +1,382 @@
CHANGE LOG for Independent JPEG Group's JPEG software
Version 9 13-Jan-2013
----------------------
Add cjpeg -rgb1 option to create an RGB JPEG file, and insert
a simple reversible color transform into the processing which
significantly improves the compression.
The recommended command for lossless coding of RGB images is now
cjpeg -rgb1 -block 1 -arithmetic.
As said, this option improves the compression significantly, but
the files are not compatible with JPEG decoders prior to IJG v9
due to the included color transform.
The used color transform and marker signaling is compatible with
other JPEG standards (e.g., JPEG-LS part 2).
Remove the automatic de-ANSI-fication support (Automake 1.12).
Thank also to Nitin A Kamble for suggestion.
Add remark for jpeg_mem_dest() in jdatadst.c.
Thank to Elie-Gregoire Khoury for the hint.
Support files with invalid component identifiers (created
by Adobe PDF). Thank to Robin Watts for the suggestion.
Adapt full buffer case in jcmainct.c for use with scaled DCT.
Thank to Sergii Biloshytskyi for the suggestion.
Add type identifier for declaration of noreturn functions.
Thank to Brett L. Moore for the suggestion.
Correct argument type in format string, avoid compiler warnings.
Thank to Vincent Torri for hint.
Add missing #include directives in configuration checks, avoid
configuration errors. Thank to John Spencer for the hint.
Version 8d 15-Jan-2012
-----------------------
Add cjpeg -rgb option to create RGB JPEG files.
Using this switch suppresses the conversion from RGB
colorspace input to the default YCbCr JPEG colorspace.
This feature allows true lossless JPEG coding of RGB color images.
The recommended command for this purpose is currently
cjpeg -rgb -block 1 -arithmetic.
SmartScale capable decoder (introduced with IJG JPEG 8) required.
Thank to Michael Koch for the initial suggestion.
Add option to disable the region adjustment in the transupp crop code.
Thank to Jeffrey Friedl for the suggestion.
Thank to Richard Jones and Edd Dawson for various minor corrections.
Thank to Akim Demaille for configure.ac cleanup.
Version 8c 16-Jan-2011
-----------------------
Add option to compression library and cjpeg (-block N) to use
different DCT block size.
All N from 1 to 16 are possible. Default is 8 (baseline format).
Larger values produce higher compression,
smaller values produce higher quality.
SmartScale capable decoder (introduced with IJG JPEG 8) required.
Version 8b 16-May-2010
-----------------------
Repair problem in new memory source manager with corrupt JPEG data.
Thank to Ted Campbell and Samuel Chun for the report.
Repair problem in Makefile.am test target.
Thank to anonymous user for the report.
Support MinGW installation with automatic configure.
Thank to Volker Grabsch for the suggestion.
Version 8a 28-Feb-2010
-----------------------
Writing tables-only datastreams via jpeg_write_tables works again.
Support 32-bit BMPs (RGB image with Alpha channel) for read in cjpeg.
Thank to Brett Blackham for the suggestion.
Improve accuracy in floating point IDCT calculation.
Thank to Robert Hooke for the hint.
Version 8 10-Jan-2010
----------------------
jpegtran now supports the same -scale option as djpeg for "lossless" resize.
An implementation of the JPEG SmartScale extension is required for this
feature. A (draft) specification of the JPEG SmartScale extension is
available as a contributed document at ITU and ISO. Revision 2 or later
of the document is required (latest document version is Revision 3).
The SmartScale extension will enable more features beside lossless resize
in future implementations, as described in the document (new compression
options).
Add sanity check in BMP reader module to avoid cjpeg crash for empty input
image (thank to Isaev Ildar of ISP RAS, Moscow, RU for reporting this error).
Add data source and destination managers for read from and write to
memory buffers. New API functions jpeg_mem_src and jpeg_mem_dest.
Thank to Roberto Boni from Italy for the suggestion.
Version 7 27-Jun-2009
----------------------
New scaled DCTs implemented.
djpeg now supports scalings N/8 with all N from 1 to 16.
cjpeg now supports scalings 8/N with all N from 1 to 16.
Scaled DCTs with size larger than 8 are now also used for resolving the
common 2x2 chroma subsampling case without additional spatial resampling.
Separate spatial resampling for those kind of files is now only necessary
for N>8 scaling cases.
Furthermore, separate scaled DCT functions are provided for direct resolving
of the common asymmetric subsampling cases (2x1 and 1x2) without additional
spatial resampling.
cjpeg -quality option has been extended for support of separate quality
settings for luminance and chrominance (or in general, for every provided
quantization table slot).
New API function jpeg_default_qtables() and q_scale_factor array in library.
Added -nosmooth option to cjpeg, complementary to djpeg.
New variable "do_fancy_downsampling" in library, complement to fancy
upsampling. Fancy upsampling now uses direct DCT scaling with sizes
larger than 8. The old method is not reversible and has been removed.
Support arithmetic entropy encoding and decoding.
Added files jaricom.c, jcarith.c, jdarith.c.
Straighten the file structure:
Removed files jidctred.c, jcphuff.c, jchuff.h, jdphuff.c, jdhuff.h.
jpegtran has a new "lossless" cropping feature.
Implement -perfect option in jpegtran, new API function
jtransform_perfect_transform() in transupp. (DP 204_perfect.dpatch)
Better error messages for jpegtran fopen failure.
(DP 203_jpegtran_errmsg.dpatch)
Fix byte order issue with 16bit PPM/PGM files in rdppm.c/wrppm.c:
according to Netpbm, the de facto standard implementation of the PNM formats,
the most significant byte is first. (DP 203_rdppm.dpatch)
Add -raw option to rdjpgcom not to mangle the output.
(DP 205_rdjpgcom_raw.dpatch)
Make rdjpgcom locale aware. (DP 201_rdjpgcom_locale.dpatch)
Add extern "C" to jpeglib.h.
This avoids the need to put extern "C" { ... } around #include "jpeglib.h"
in your C++ application. Defining the symbol DONT_USE_EXTERN_C in the
configuration prevents this. (DP 202_jpeglib.h_c++.dpatch)
Version 6b 27-Mar-1998
-----------------------
jpegtran has new features for lossless image transformations (rotation
and flipping) as well as "lossless" reduction to grayscale.
jpegtran now copies comments by default; it has a -copy switch to enable
copying all APPn blocks as well, or to suppress comments. (Formerly it
always suppressed comments and APPn blocks.) jpegtran now also preserves
JFIF version and resolution information.
New decompressor library feature: COM and APPn markers found in the input
file can be saved in memory for later use by the application. (Before,
you had to code this up yourself with a custom marker processor.)
There is an unused field "void * client_data" now in compress and decompress
parameter structs; this may be useful in some applications.
JFIF version number information is now saved by the decoder and accepted by
the encoder. jpegtran uses this to copy the source file's version number,
to ensure "jpegtran -copy all" won't create bogus files that contain JFXX
extensions but claim to be version 1.01. Applications that generate their
own JFXX extension markers also (finally) have a supported way to cause the
encoder to emit JFIF version number 1.02.
djpeg's trace mode reports JFIF 1.02 thumbnail images as such, rather
than as unknown APP0 markers.
In -verbose mode, djpeg and rdjpgcom will try to print the contents of
APP12 markers as text. Some digital cameras store useful text information
in APP12 markers.
Handling of truncated data streams is more robust: blocks beyond the one in
which the error occurs will be output as uniform gray, or left unchanged
if decoding a progressive JPEG. The appearance no longer depends on the
Huffman tables being used.
Huffman tables are checked for validity much more carefully than before.
To avoid the Unisys LZW patent, djpeg's GIF output capability has been
changed to produce "uncompressed GIFs", and cjpeg's GIF input capability
has been removed altogether. We're not happy about it either, but there
seems to be no good alternative.
The configure script now supports building libjpeg as a shared library
on many flavors of Unix (all the ones that GNU libtool knows how to
build shared libraries for). Use "./configure --enable-shared" to
try this out.
New jconfig file and makefiles for Microsoft Visual C++ and Developer Studio.
Also, a jconfig file and a build script for Metrowerks CodeWarrior
on Apple Macintosh. makefile.dj has been updated for DJGPP v2, and there
are miscellaneous other minor improvements in the makefiles.
jmemmac.c now knows how to create temporary files following Mac System 7
conventions.
djpeg's -map switch is now able to read raw-format PPM files reliably.
cjpeg -progressive -restart no longer generates any unnecessary DRI markers.
Multiple calls to jpeg_simple_progression for a single JPEG object
no longer leak memory.
Version 6a 7-Feb-96
--------------------
Library initialization sequence modified to detect version mismatches
and struct field packing mismatches between library and calling application.
This change requires applications to be recompiled, but does not require
any application source code change.
All routine declarations changed to the style "GLOBAL(type) name ...",
that is, GLOBAL, LOCAL, METHODDEF, EXTERN are now macros taking the
routine's return type as an argument. This makes it possible to add
Microsoft-style linkage keywords to all the routines by changing just
these macros. Note that any application code that was using these macros
will have to be changed.
DCT coefficient quantization tables are now stored in normal array order
rather than zigzag order. Application code that calls jpeg_add_quant_table,
or otherwise manipulates quantization tables directly, will need to be
changed. If you need to make such code work with either older or newer
versions of the library, a test like "#if JPEG_LIB_VERSION >= 61" is
recommended.
djpeg's trace capability now dumps DQT tables in natural order, not zigzag
order. This allows the trace output to be made into a "-qtables" file
more easily.
New system-dependent memory manager module for use on Apple Macintosh.
Fix bug in cjpeg's -smooth option: last one or two scanlines would be
duplicates of the prior line unless the image height mod 16 was 1 or 2.
Repair minor problems in VMS, BCC, MC6 makefiles.
New configure script based on latest GNU Autoconf.
Correct the list of include files needed by MetroWerks C for ccommand().
Numerous small documentation updates.
Version 6 2-Aug-95
-------------------
Progressive JPEG support: library can read and write full progressive JPEG
files. A "buffered image" mode supports incremental decoding for on-the-fly
display of progressive images. Simply recompiling an existing IJG-v5-based
decoder with v6 should allow it to read progressive files, though of course
without any special progressive display.
New "jpegtran" application performs lossless transcoding between different
JPEG formats; primarily, it can be used to convert baseline to progressive
JPEG and vice versa. In support of jpegtran, the library now allows lossless
reading and writing of JPEG files as DCT coefficient arrays. This ability
may be of use in other applications.
Notes for programmers:
* We changed jpeg_start_decompress() to be able to suspend; this makes all
decoding modes available to suspending-input applications. However,
existing applications that use suspending input will need to be changed
to check the return value from jpeg_start_decompress(). You don't need to
do anything if you don't use a suspending data source.
* We changed the interface to the virtual array routines: access_virt_array
routines now take a count of the number of rows to access this time. The
last parameter to request_virt_array routines is now interpreted as the
maximum number of rows that may be accessed at once, but not necessarily
the height of every access.
Version 5b 15-Mar-95
---------------------
Correct bugs with grayscale images having v_samp_factor > 1.
jpeg_write_raw_data() now supports output suspension.
Correct bugs in "configure" script for case of compiling in
a directory other than the one containing the source files.
Repair bug in jquant1.c: sometimes didn't use as many colors as it could.
Borland C makefile and jconfig file work under either MS-DOS or OS/2.
Miscellaneous improvements to documentation.
Version 5a 7-Dec-94
--------------------
Changed color conversion roundoff behavior so that grayscale values are
represented exactly. (This causes test image files to change.)
Make ordered dither use 16x16 instead of 4x4 pattern for a small quality
improvement.
New configure script based on latest GNU Autoconf.
Fix configure script to handle CFLAGS correctly.
Rename *.auto files to *.cfg, so that configure script still works if
file names have been truncated for DOS.
Fix bug in rdbmp.c: didn't allow for extra data between header and image.
Modify rdppm.c/wrppm.c to handle 2-byte raw PPM/PGM formats for 12-bit data.
Fix several bugs in rdrle.c.
NEED_SHORT_EXTERNAL_NAMES option was broken.
Revise jerror.h/jerror.c for more flexibility in message table.
Repair oversight in jmemname.c NO_MKTEMP case: file could be there
but unreadable.
Version 5 24-Sep-94
--------------------
Version 5 represents a nearly complete redesign and rewrite of the IJG
software. Major user-visible changes include:
* Automatic configuration simplifies installation for most Unix systems.
* A range of speed vs. image quality tradeoffs are supported.
This includes resizing of an image during decompression: scaling down
by a factor of 1/2, 1/4, or 1/8 is handled very efficiently.
* New programs rdjpgcom and wrjpgcom allow insertion and extraction
of text comments in a JPEG file.
The application programmer's interface to the library has changed completely.
Notable improvements include:
* We have eliminated the use of callback routines for handling the
uncompressed image data. The application now sees the library as a
set of routines that it calls to read or write image data on a
scanline-by-scanline basis.
* The application image data is represented in a conventional interleaved-
pixel format, rather than as a separate array for each color channel.
This can save a copying step in many programs.
* The handling of compressed data has been cleaned up: the application can
supply routines to source or sink the compressed data. It is possible to
suspend processing on source/sink buffer overrun, although this is not
supported in all operating modes.
* All static state has been eliminated from the library, so that multiple
instances of compression or decompression can be active concurrently.
* JPEG abbreviated datastream formats are supported, ie, quantization and
Huffman tables can be stored separately from the image data.
* And not only that, but the documentation of the library has improved
considerably!
The last widely used release before the version 5 rewrite was version 4A of
18-Feb-93. Change logs before that point have been discarded, since they
are not of much interest after the rewrite.
+153
View File
@@ -0,0 +1,153 @@
/*
* jaricom.c
*
* Developed 1997-2011 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains probability estimation tables for common use in
* arithmetic entropy encoding and decoding routines.
*
* This data represents Table D.3 in the JPEG spec (D.2 in the draft),
* ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81, and Table 24
* in the JBIG spec, ISO/IEC IS 11544 and CCITT Recommendation ITU-T T.82.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
/* The following #define specifies the packing of the four components
* into the compact INT32 representation.
* Note that this formula must match the actual arithmetic encoder
* and decoder implementation. The implementation has to be changed
* if this formula is changed.
* The current organization is leaned on Markus Kuhn's JBIG
* implementation (jbig_tab.c).
*/
#define V(i,a,b,c,d) (((INT32)a << 16) | ((INT32)c << 8) | ((INT32)d << 7) | b)
const INT32 jpeg_aritab[113+1] = {
/*
* Index, Qe_Value, Next_Index_LPS, Next_Index_MPS, Switch_MPS
*/
V( 0, 0x5a1d, 1, 1, 1 ),
V( 1, 0x2586, 14, 2, 0 ),
V( 2, 0x1114, 16, 3, 0 ),
V( 3, 0x080b, 18, 4, 0 ),
V( 4, 0x03d8, 20, 5, 0 ),
V( 5, 0x01da, 23, 6, 0 ),
V( 6, 0x00e5, 25, 7, 0 ),
V( 7, 0x006f, 28, 8, 0 ),
V( 8, 0x0036, 30, 9, 0 ),
V( 9, 0x001a, 33, 10, 0 ),
V( 10, 0x000d, 35, 11, 0 ),
V( 11, 0x0006, 9, 12, 0 ),
V( 12, 0x0003, 10, 13, 0 ),
V( 13, 0x0001, 12, 13, 0 ),
V( 14, 0x5a7f, 15, 15, 1 ),
V( 15, 0x3f25, 36, 16, 0 ),
V( 16, 0x2cf2, 38, 17, 0 ),
V( 17, 0x207c, 39, 18, 0 ),
V( 18, 0x17b9, 40, 19, 0 ),
V( 19, 0x1182, 42, 20, 0 ),
V( 20, 0x0cef, 43, 21, 0 ),
V( 21, 0x09a1, 45, 22, 0 ),
V( 22, 0x072f, 46, 23, 0 ),
V( 23, 0x055c, 48, 24, 0 ),
V( 24, 0x0406, 49, 25, 0 ),
V( 25, 0x0303, 51, 26, 0 ),
V( 26, 0x0240, 52, 27, 0 ),
V( 27, 0x01b1, 54, 28, 0 ),
V( 28, 0x0144, 56, 29, 0 ),
V( 29, 0x00f5, 57, 30, 0 ),
V( 30, 0x00b7, 59, 31, 0 ),
V( 31, 0x008a, 60, 32, 0 ),
V( 32, 0x0068, 62, 33, 0 ),
V( 33, 0x004e, 63, 34, 0 ),
V( 34, 0x003b, 32, 35, 0 ),
V( 35, 0x002c, 33, 9, 0 ),
V( 36, 0x5ae1, 37, 37, 1 ),
V( 37, 0x484c, 64, 38, 0 ),
V( 38, 0x3a0d, 65, 39, 0 ),
V( 39, 0x2ef1, 67, 40, 0 ),
V( 40, 0x261f, 68, 41, 0 ),
V( 41, 0x1f33, 69, 42, 0 ),
V( 42, 0x19a8, 70, 43, 0 ),
V( 43, 0x1518, 72, 44, 0 ),
V( 44, 0x1177, 73, 45, 0 ),
V( 45, 0x0e74, 74, 46, 0 ),
V( 46, 0x0bfb, 75, 47, 0 ),
V( 47, 0x09f8, 77, 48, 0 ),
V( 48, 0x0861, 78, 49, 0 ),
V( 49, 0x0706, 79, 50, 0 ),
V( 50, 0x05cd, 48, 51, 0 ),
V( 51, 0x04de, 50, 52, 0 ),
V( 52, 0x040f, 50, 53, 0 ),
V( 53, 0x0363, 51, 54, 0 ),
V( 54, 0x02d4, 52, 55, 0 ),
V( 55, 0x025c, 53, 56, 0 ),
V( 56, 0x01f8, 54, 57, 0 ),
V( 57, 0x01a4, 55, 58, 0 ),
V( 58, 0x0160, 56, 59, 0 ),
V( 59, 0x0125, 57, 60, 0 ),
V( 60, 0x00f6, 58, 61, 0 ),
V( 61, 0x00cb, 59, 62, 0 ),
V( 62, 0x00ab, 61, 63, 0 ),
V( 63, 0x008f, 61, 32, 0 ),
V( 64, 0x5b12, 65, 65, 1 ),
V( 65, 0x4d04, 80, 66, 0 ),
V( 66, 0x412c, 81, 67, 0 ),
V( 67, 0x37d8, 82, 68, 0 ),
V( 68, 0x2fe8, 83, 69, 0 ),
V( 69, 0x293c, 84, 70, 0 ),
V( 70, 0x2379, 86, 71, 0 ),
V( 71, 0x1edf, 87, 72, 0 ),
V( 72, 0x1aa9, 87, 73, 0 ),
V( 73, 0x174e, 72, 74, 0 ),
V( 74, 0x1424, 72, 75, 0 ),
V( 75, 0x119c, 74, 76, 0 ),
V( 76, 0x0f6b, 74, 77, 0 ),
V( 77, 0x0d51, 75, 78, 0 ),
V( 78, 0x0bb6, 77, 79, 0 ),
V( 79, 0x0a40, 77, 48, 0 ),
V( 80, 0x5832, 80, 81, 1 ),
V( 81, 0x4d1c, 88, 82, 0 ),
V( 82, 0x438e, 89, 83, 0 ),
V( 83, 0x3bdd, 90, 84, 0 ),
V( 84, 0x34ee, 91, 85, 0 ),
V( 85, 0x2eae, 92, 86, 0 ),
V( 86, 0x299a, 93, 87, 0 ),
V( 87, 0x2516, 86, 71, 0 ),
V( 88, 0x5570, 88, 89, 1 ),
V( 89, 0x4ca9, 95, 90, 0 ),
V( 90, 0x44d9, 96, 91, 0 ),
V( 91, 0x3e22, 97, 92, 0 ),
V( 92, 0x3824, 99, 93, 0 ),
V( 93, 0x32b4, 99, 94, 0 ),
V( 94, 0x2e17, 93, 86, 0 ),
V( 95, 0x56a8, 95, 96, 1 ),
V( 96, 0x4f46, 101, 97, 0 ),
V( 97, 0x47e5, 102, 98, 0 ),
V( 98, 0x41cf, 103, 99, 0 ),
V( 99, 0x3c3d, 104, 100, 0 ),
V( 100, 0x375e, 99, 93, 0 ),
V( 101, 0x5231, 105, 102, 0 ),
V( 102, 0x4c0f, 106, 103, 0 ),
V( 103, 0x4639, 107, 104, 0 ),
V( 104, 0x415e, 103, 99, 0 ),
V( 105, 0x5627, 105, 106, 1 ),
V( 106, 0x50e7, 108, 107, 0 ),
V( 107, 0x4b85, 109, 103, 0 ),
V( 108, 0x5597, 110, 109, 0 ),
V( 109, 0x504f, 111, 107, 0 ),
V( 110, 0x5a10, 110, 111, 1 ),
V( 111, 0x5522, 112, 109, 0 ),
V( 112, 0x59eb, 112, 111, 1 ),
/*
* This last entry is used for fixed probability estimate of 0.5
* as suggested in Section 10.3 Table 5 of ITU-T Rec. T.851.
*/
V( 113, 0x5a1d, 113, 113, 0 )
};
+15 -7
View File
@@ -2,6 +2,7 @@
* jcapimin.c
*
* Copyright (C) 1994-1998, Thomas G. Lane.
* Modified 2003-2010 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -37,7 +38,7 @@ jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize)
ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
if (structsize != SIZEOF(struct jpeg_compress_struct))
ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
(int) SIZEOF(struct jpeg_compress_struct), (int) structsize);
(int) SIZEOF(struct jpeg_compress_struct), (int) structsize);
/* For debugging purposes, we zero the whole master structure.
* But the application has already set the err pointer, and may have set
@@ -63,14 +64,21 @@ jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize)
cinfo->comp_info = NULL;
for (i = 0; i < NUM_QUANT_TBLS; i++)
for (i = 0; i < NUM_QUANT_TBLS; i++) {
cinfo->quant_tbl_ptrs[i] = NULL;
cinfo->q_scale_factor[i] = 100;
}
for (i = 0; i < NUM_HUFF_TBLS; i++) {
cinfo->dc_huff_tbl_ptrs[i] = NULL;
cinfo->ac_huff_tbl_ptrs[i] = NULL;
}
/* Must do it here for emit_dqt in case jpeg_write_tables is used */
cinfo->block_size = DCTSIZE;
cinfo->natural_order = jpeg_natural_order;
cinfo->lim_Se = DCTSIZE2-1;
cinfo->script_space = NULL;
cinfo->input_gamma = 1.0; /* in case application forgets */
@@ -161,15 +169,15 @@ jpeg_finish_compress (j_compress_ptr cinfo)
(*cinfo->master->prepare_for_pass) (cinfo);
for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) {
if (cinfo->progress != NULL) {
cinfo->progress->pass_counter = (long) iMCU_row;
cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows;
(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
cinfo->progress->pass_counter = (long) iMCU_row;
cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows;
(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
}
/* We bypass the main controller and invoke coef controller directly;
* all work is being done from the coefficient buffer.
*/
if (! (*cinfo->coef->compress_data) (cinfo, (JSAMPIMAGE) NULL))
ERREXIT(cinfo, JERR_CANT_SUSPEND);
ERREXIT(cinfo, JERR_CANT_SUSPEND);
}
(*cinfo->master->finish_pass) (cinfo);
}
@@ -190,7 +198,7 @@ jpeg_finish_compress (j_compress_ptr cinfo)
GLOBAL(void)
jpeg_write_marker (j_compress_ptr cinfo, int marker,
const JOCTET *dataptr, unsigned int datalen)
const JOCTET *dataptr, unsigned int datalen)
{
JMETHOD(void, write_marker_byte, (j_compress_ptr info, int val));
+2 -2
View File
@@ -75,7 +75,7 @@ jpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables)
GLOBAL(JDIMENSION)
jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines,
JDIMENSION num_lines)
JDIMENSION num_lines)
{
JDIMENSION row_ctr, rows_left;
@@ -118,7 +118,7 @@ jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines,
GLOBAL(JDIMENSION)
jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data,
JDIMENSION num_lines)
JDIMENSION num_lines)
{
JDIMENSION lines_per_iMCU_row;
+943
View File
@@ -0,0 +1,943 @@
/*
* jcarith.c
*
* Developed 1997-2012 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains portable arithmetic entropy encoding routines for JPEG
* (implementing the ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81).
*
* Both sequential and progressive modes are supported in this single module.
*
* Suspension is not currently supported in this module.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
/* Expanded entropy encoder object for arithmetic encoding. */
typedef struct {
struct jpeg_entropy_encoder pub; /* public fields */
INT32 c; /* C register, base of coding interval, layout as in sec. D.1.3 */
INT32 a; /* A register, normalized size of coding interval */
INT32 sc; /* counter for stacked 0xFF values which might overflow */
INT32 zc; /* counter for pending 0x00 output values which might *
* be discarded at the end ("Pacman" termination) */
int ct; /* bit shift counter, determines when next byte will be written */
int buffer; /* buffer for most recent output byte != 0xFF */
int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
int dc_context[MAX_COMPS_IN_SCAN]; /* context index for DC conditioning */
unsigned int restarts_to_go; /* MCUs left in this restart interval */
int next_restart_num; /* next restart number to write (0-7) */
/* Pointers to statistics areas (these workspaces have image lifespan) */
unsigned char * dc_stats[NUM_ARITH_TBLS];
unsigned char * ac_stats[NUM_ARITH_TBLS];
/* Statistics bin for coding with fixed probability 0.5 */
unsigned char fixed_bin[4];
} arith_entropy_encoder;
typedef arith_entropy_encoder * arith_entropy_ptr;
/* The following two definitions specify the allocation chunk size
* for the statistics area.
* According to sections F.1.4.4.1.3 and F.1.4.4.2, we need at least
* 49 statistics bins for DC, and 245 statistics bins for AC coding.
*
* We use a compact representation with 1 byte per statistics bin,
* thus the numbers directly represent byte sizes.
* This 1 byte per statistics bin contains the meaning of the MPS
* (more probable symbol) in the highest bit (mask 0x80), and the
* index into the probability estimation state machine table
* in the lower bits (mask 0x7F).
*/
#define DC_STAT_BINS 64
#define AC_STAT_BINS 256
/* NOTE: Uncomment the following #define if you want to use the
* given formula for calculating the AC conditioning parameter Kx
* for spectral selection progressive coding in section G.1.3.2
* of the spec (Kx = Kmin + SRL (8 + Se - Kmin) 4).
* Although the spec and P&M authors claim that this "has proven
* to give good results for 8 bit precision samples", I'm not
* convinced yet that this is really beneficial.
* Early tests gave only very marginal compression enhancements
* (a few - around 5 or so - bytes even for very large files),
* which would turn out rather negative if we'd suppress the
* DAC (Define Arithmetic Conditioning) marker segments for
* the default parameters in the future.
* Note that currently the marker writing module emits 12-byte
* DAC segments for a full-component scan in a color image.
* This is not worth worrying about IMHO. However, since the
* spec defines the default values to be used if the tables
* are omitted (unlike Huffman tables, which are required
* anyway), one might optimize this behaviour in the future,
* and then it would be disadvantageous to use custom tables if
* they don't provide sufficient gain to exceed the DAC size.
*
* On the other hand, I'd consider it as a reasonable result
* that the conditioning has no significant influence on the
* compression performance. This means that the basic
* statistical model is already rather stable.
*
* Thus, at the moment, we use the default conditioning values
* anyway, and do not use the custom formula.
*
#define CALCULATE_SPECTRAL_CONDITIONING
*/
/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32.
* We assume that int right shift is unsigned if INT32 right shift is,
* which should be safe.
*/
#ifdef RIGHT_SHIFT_IS_UNSIGNED
#define ISHIFT_TEMPS int ishift_temp;
#define IRIGHT_SHIFT(x,shft) \
((ishift_temp = (x)) < 0 ? \
(ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \
(ishift_temp >> (shft)))
#else
#define ISHIFT_TEMPS
#define IRIGHT_SHIFT(x,shft) ((x) >> (shft))
#endif
LOCAL(void)
emit_byte (int val, j_compress_ptr cinfo)
/* Write next output byte; we do not support suspension in this module. */
{
struct jpeg_destination_mgr * dest = cinfo->dest;
*dest->next_output_byte++ = (JOCTET) val;
if (--dest->free_in_buffer == 0)
if (! (*dest->empty_output_buffer) (cinfo))
ERREXIT(cinfo, JERR_CANT_SUSPEND);
}
/*
* Finish up at the end of an arithmetic-compressed scan.
*/
METHODDEF(void)
finish_pass (j_compress_ptr cinfo)
{
arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;
INT32 temp;
/* Section D.1.8: Termination of encoding */
/* Find the e->c in the coding interval with the largest
* number of trailing zero bits */
if ((temp = (e->a - 1 + e->c) & 0xFFFF0000L) < e->c)
e->c = temp + 0x8000L;
else
e->c = temp;
/* Send remaining bytes to output */
e->c <<= e->ct;
if (e->c & 0xF8000000L) {
/* One final overflow has to be handled */
if (e->buffer >= 0) {
if (e->zc)
do emit_byte(0x00, cinfo);
while (--e->zc);
emit_byte(e->buffer + 1, cinfo);
if (e->buffer + 1 == 0xFF)
emit_byte(0x00, cinfo);
}
e->zc += e->sc; /* carry-over converts stacked 0xFF bytes to 0x00 */
e->sc = 0;
} else {
if (e->buffer == 0)
++e->zc;
else if (e->buffer >= 0) {
if (e->zc)
do emit_byte(0x00, cinfo);
while (--e->zc);
emit_byte(e->buffer, cinfo);
}
if (e->sc) {
if (e->zc)
do emit_byte(0x00, cinfo);
while (--e->zc);
do {
emit_byte(0xFF, cinfo);
emit_byte(0x00, cinfo);
} while (--e->sc);
}
}
/* Output final bytes only if they are not 0x00 */
if (e->c & 0x7FFF800L) {
if (e->zc) /* output final pending zero bytes */
do emit_byte(0x00, cinfo);
while (--e->zc);
emit_byte((e->c >> 19) & 0xFF, cinfo);
if (((e->c >> 19) & 0xFF) == 0xFF)
emit_byte(0x00, cinfo);
if (e->c & 0x7F800L) {
emit_byte((e->c >> 11) & 0xFF, cinfo);
if (((e->c >> 11) & 0xFF) == 0xFF)
emit_byte(0x00, cinfo);
}
}
}
/*
* The core arithmetic encoding routine (common in JPEG and JBIG).
* This needs to go as fast as possible.
* Machine-dependent optimization facilities
* are not utilized in this portable implementation.
* However, this code should be fairly efficient and
* may be a good base for further optimizations anyway.
*
* Parameter 'val' to be encoded may be 0 or 1 (binary decision).
*
* Note: I've added full "Pacman" termination support to the
* byte output routines, which is equivalent to the optional
* Discard_final_zeros procedure (Figure D.15) in the spec.
* Thus, we always produce the shortest possible output
* stream compliant to the spec (no trailing zero bytes,
* except for FF stuffing).
*
* I've also introduced a new scheme for accessing
* the probability estimation state machine table,
* derived from Markus Kuhn's JBIG implementation.
*/
LOCAL(void)
arith_encode (j_compress_ptr cinfo, unsigned char *st, int val)
{
register arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;
register unsigned char nl, nm;
register INT32 qe, temp;
register int sv;
/* Fetch values from our compact representation of Table D.3(D.2):
* Qe values and probability estimation state machine
*/
sv = *st;
qe = jpeg_aritab[sv & 0x7F]; /* => Qe_Value */
nl = qe & 0xFF; qe >>= 8; /* Next_Index_LPS + Switch_MPS */
nm = qe & 0xFF; qe >>= 8; /* Next_Index_MPS */
/* Encode & estimation procedures per sections D.1.4 & D.1.5 */
e->a -= qe;
if (val != (sv >> 7)) {
/* Encode the less probable symbol */
if (e->a >= qe) {
/* If the interval size (qe) for the less probable symbol (LPS)
* is larger than the interval size for the MPS, then exchange
* the two symbols for coding efficiency, otherwise code the LPS
* as usual: */
e->c += e->a;
e->a = qe;
}
*st = (sv & 0x80) ^ nl; /* Estimate_after_LPS */
} else {
/* Encode the more probable symbol */
if (e->a >= 0x8000L)
return; /* A >= 0x8000 -> ready, no renormalization required */
if (e->a < qe) {
/* If the interval size (qe) for the less probable symbol (LPS)
* is larger than the interval size for the MPS, then exchange
* the two symbols for coding efficiency: */
e->c += e->a;
e->a = qe;
}
*st = (sv & 0x80) ^ nm; /* Estimate_after_MPS */
}
/* Renormalization & data output per section D.1.6 */
do {
e->a <<= 1;
e->c <<= 1;
if (--e->ct == 0) {
/* Another byte is ready for output */
temp = e->c >> 19;
if (temp > 0xFF) {
/* Handle overflow over all stacked 0xFF bytes */
if (e->buffer >= 0) {
if (e->zc)
do emit_byte(0x00, cinfo);
while (--e->zc);
emit_byte(e->buffer + 1, cinfo);
if (e->buffer + 1 == 0xFF)
emit_byte(0x00, cinfo);
}
e->zc += e->sc; /* carry-over converts stacked 0xFF bytes to 0x00 */
e->sc = 0;
/* Note: The 3 spacer bits in the C register guarantee
* that the new buffer byte can't be 0xFF here
* (see page 160 in the P&M JPEG book). */
e->buffer = temp & 0xFF; /* new output byte, might overflow later */
} else if (temp == 0xFF) {
++e->sc; /* stack 0xFF byte (which might overflow later) */
} else {
/* Output all stacked 0xFF bytes, they will not overflow any more */
if (e->buffer == 0)
++e->zc;
else if (e->buffer >= 0) {
if (e->zc)
do emit_byte(0x00, cinfo);
while (--e->zc);
emit_byte(e->buffer, cinfo);
}
if (e->sc) {
if (e->zc)
do emit_byte(0x00, cinfo);
while (--e->zc);
do {
emit_byte(0xFF, cinfo);
emit_byte(0x00, cinfo);
} while (--e->sc);
}
e->buffer = temp & 0xFF; /* new output byte (can still overflow) */
}
e->c &= 0x7FFFFL;
e->ct += 8;
}
} while (e->a < 0x8000L);
}
/*
* Emit a restart marker & resynchronize predictions.
*/
LOCAL(void)
emit_restart (j_compress_ptr cinfo, int restart_num)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
int ci;
jpeg_component_info * compptr;
finish_pass(cinfo);
emit_byte(0xFF, cinfo);
emit_byte(JPEG_RST0 + restart_num, cinfo);
/* Re-initialize statistics areas */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
/* DC needs no table for refinement scan */
if (cinfo->Ss == 0 && cinfo->Ah == 0) {
MEMZERO(entropy->dc_stats[compptr->dc_tbl_no], DC_STAT_BINS);
/* Reset DC predictions to 0 */
entropy->last_dc_val[ci] = 0;
entropy->dc_context[ci] = 0;
}
/* AC needs no table when not present */
if (cinfo->Se) {
MEMZERO(entropy->ac_stats[compptr->ac_tbl_no], AC_STAT_BINS);
}
}
/* Reset arithmetic encoding variables */
entropy->c = 0;
entropy->a = 0x10000L;
entropy->sc = 0;
entropy->zc = 0;
entropy->ct = 11;
entropy->buffer = -1; /* empty */
}
/*
* MCU encoding for DC initial scan (either spectral selection,
* or first pass of successive approximation).
*/
METHODDEF(boolean)
encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
JBLOCKROW block;
unsigned char *st;
int blkn, ci, tbl;
int v, v2, m;
ISHIFT_TEMPS
/* Emit restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0) {
emit_restart(cinfo, entropy->next_restart_num);
entropy->restarts_to_go = cinfo->restart_interval;
entropy->next_restart_num++;
entropy->next_restart_num &= 7;
}
entropy->restarts_to_go--;
}
/* Encode the MCU data blocks */
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
block = MCU_data[blkn];
ci = cinfo->MCU_membership[blkn];
tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;
/* Compute the DC value after the required point transform by Al.
* This is simply an arithmetic right shift.
*/
m = IRIGHT_SHIFT((int) ((*block)[0]), cinfo->Al);
/* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */
/* Table F.4: Point to statistics bin S0 for DC coefficient coding */
st = entropy->dc_stats[tbl] + entropy->dc_context[ci];
/* Figure F.4: Encode_DC_DIFF */
if ((v = m - entropy->last_dc_val[ci]) == 0) {
arith_encode(cinfo, st, 0);
entropy->dc_context[ci] = 0; /* zero diff category */
} else {
entropy->last_dc_val[ci] = m;
arith_encode(cinfo, st, 1);
/* Figure F.6: Encoding nonzero value v */
/* Figure F.7: Encoding the sign of v */
if (v > 0) {
arith_encode(cinfo, st + 1, 0); /* Table F.4: SS = S0 + 1 */
st += 2; /* Table F.4: SP = S0 + 2 */
entropy->dc_context[ci] = 4; /* small positive diff category */
} else {
v = -v;
arith_encode(cinfo, st + 1, 1); /* Table F.4: SS = S0 + 1 */
st += 3; /* Table F.4: SN = S0 + 3 */
entropy->dc_context[ci] = 8; /* small negative diff category */
}
/* Figure F.8: Encoding the magnitude category of v */
m = 0;
if (v -= 1) {
arith_encode(cinfo, st, 1);
m = 1;
v2 = v;
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
while (v2 >>= 1) {
arith_encode(cinfo, st, 1);
m <<= 1;
st += 1;
}
}
arith_encode(cinfo, st, 0);
/* Section F.1.4.4.1.2: Establish dc_context conditioning category */
if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))
entropy->dc_context[ci] = 0; /* zero diff category */
else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))
entropy->dc_context[ci] += 8; /* large diff category */
/* Figure F.9: Encoding the magnitude bit pattern of v */
st += 14;
while (m >>= 1)
arith_encode(cinfo, st, (m & v) ? 1 : 0);
}
}
return TRUE;
}
/*
* MCU encoding for AC initial scan (either spectral selection,
* or first pass of successive approximation).
*/
METHODDEF(boolean)
encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
JBLOCKROW block;
unsigned char *st;
int tbl, k, ke;
int v, v2, m;
const int * natural_order;
/* Emit restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0) {
emit_restart(cinfo, entropy->next_restart_num);
entropy->restarts_to_go = cinfo->restart_interval;
entropy->next_restart_num++;
entropy->next_restart_num &= 7;
}
entropy->restarts_to_go--;
}
natural_order = cinfo->natural_order;
/* Encode the MCU data block */
block = MCU_data[0];
tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
/* Sections F.1.4.2 & F.1.4.4.2: Encoding of AC coefficients */
/* Establish EOB (end-of-block) index */
ke = cinfo->Se;
do {
/* We must apply the point transform by Al. For AC coefficients this
* is an integer division with rounding towards 0. To do this portably
* in C, we shift after obtaining the absolute value.
*/
if ((v = (*block)[natural_order[ke]]) >= 0) {
if (v >>= cinfo->Al) break;
} else {
v = -v;
if (v >>= cinfo->Al) break;
}
} while (--ke);
/* Figure F.5: Encode_AC_Coefficients */
for (k = cinfo->Ss - 1; k < ke;) {
st = entropy->ac_stats[tbl] + 3 * k;
arith_encode(cinfo, st, 0); /* EOB decision */
for (;;) {
if ((v = (*block)[natural_order[++k]]) >= 0) {
if (v >>= cinfo->Al) {
arith_encode(cinfo, st + 1, 1);
arith_encode(cinfo, entropy->fixed_bin, 0);
break;
}
} else {
v = -v;
if (v >>= cinfo->Al) {
arith_encode(cinfo, st + 1, 1);
arith_encode(cinfo, entropy->fixed_bin, 1);
break;
}
}
arith_encode(cinfo, st + 1, 0);
st += 3;
}
st += 2;
/* Figure F.8: Encoding the magnitude category of v */
m = 0;
if (v -= 1) {
arith_encode(cinfo, st, 1);
m = 1;
v2 = v;
if (v2 >>= 1) {
arith_encode(cinfo, st, 1);
m <<= 1;
st = entropy->ac_stats[tbl] +
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
while (v2 >>= 1) {
arith_encode(cinfo, st, 1);
m <<= 1;
st += 1;
}
}
}
arith_encode(cinfo, st, 0);
/* Figure F.9: Encoding the magnitude bit pattern of v */
st += 14;
while (m >>= 1)
arith_encode(cinfo, st, (m & v) ? 1 : 0);
}
/* Encode EOB decision only if k < cinfo->Se */
if (k < cinfo->Se) {
st = entropy->ac_stats[tbl] + 3 * k;
arith_encode(cinfo, st, 1);
}
return TRUE;
}
/*
* MCU encoding for DC successive approximation refinement scan.
*/
METHODDEF(boolean)
encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
unsigned char *st;
int Al, blkn;
/* Emit restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0) {
emit_restart(cinfo, entropy->next_restart_num);
entropy->restarts_to_go = cinfo->restart_interval;
entropy->next_restart_num++;
entropy->next_restart_num &= 7;
}
entropy->restarts_to_go--;
}
st = entropy->fixed_bin; /* use fixed probability estimation */
Al = cinfo->Al;
/* Encode the MCU data blocks */
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
/* We simply emit the Al'th bit of the DC coefficient value. */
arith_encode(cinfo, st, (MCU_data[blkn][0][0] >> Al) & 1);
}
return TRUE;
}
/*
* MCU encoding for AC successive approximation refinement scan.
*/
METHODDEF(boolean)
encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
JBLOCKROW block;
unsigned char *st;
int tbl, k, ke, kex;
int v;
const int * natural_order;
/* Emit restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0) {
emit_restart(cinfo, entropy->next_restart_num);
entropy->restarts_to_go = cinfo->restart_interval;
entropy->next_restart_num++;
entropy->next_restart_num &= 7;
}
entropy->restarts_to_go--;
}
natural_order = cinfo->natural_order;
/* Encode the MCU data block */
block = MCU_data[0];
tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
/* Section G.1.3.3: Encoding of AC coefficients */
/* Establish EOB (end-of-block) index */
ke = cinfo->Se;
do {
/* We must apply the point transform by Al. For AC coefficients this
* is an integer division with rounding towards 0. To do this portably
* in C, we shift after obtaining the absolute value.
*/
if ((v = (*block)[natural_order[ke]]) >= 0) {
if (v >>= cinfo->Al) break;
} else {
v = -v;
if (v >>= cinfo->Al) break;
}
} while (--ke);
/* Establish EOBx (previous stage end-of-block) index */
for (kex = ke; kex > 0; kex--)
if ((v = (*block)[natural_order[kex]]) >= 0) {
if (v >>= cinfo->Ah) break;
} else {
v = -v;
if (v >>= cinfo->Ah) break;
}
/* Figure G.10: Encode_AC_Coefficients_SA */
for (k = cinfo->Ss - 1; k < ke;) {
st = entropy->ac_stats[tbl] + 3 * k;
if (k >= kex)
arith_encode(cinfo, st, 0); /* EOB decision */
for (;;) {
if ((v = (*block)[natural_order[++k]]) >= 0) {
if (v >>= cinfo->Al) {
if (v >> 1) /* previously nonzero coef */
arith_encode(cinfo, st + 2, (v & 1));
else { /* newly nonzero coef */
arith_encode(cinfo, st + 1, 1);
arith_encode(cinfo, entropy->fixed_bin, 0);
}
break;
}
} else {
v = -v;
if (v >>= cinfo->Al) {
if (v >> 1) /* previously nonzero coef */
arith_encode(cinfo, st + 2, (v & 1));
else { /* newly nonzero coef */
arith_encode(cinfo, st + 1, 1);
arith_encode(cinfo, entropy->fixed_bin, 1);
}
break;
}
}
arith_encode(cinfo, st + 1, 0);
st += 3;
}
}
/* Encode EOB decision only if k < cinfo->Se */
if (k < cinfo->Se) {
st = entropy->ac_stats[tbl] + 3 * k;
arith_encode(cinfo, st, 1);
}
return TRUE;
}
/*
* Encode and output one MCU's worth of arithmetic-compressed coefficients.
*/
METHODDEF(boolean)
encode_mcu (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
jpeg_component_info * compptr;
JBLOCKROW block;
unsigned char *st;
int blkn, ci, tbl, k, ke;
int v, v2, m;
const int * natural_order;
/* Emit restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0) {
emit_restart(cinfo, entropy->next_restart_num);
entropy->restarts_to_go = cinfo->restart_interval;
entropy->next_restart_num++;
entropy->next_restart_num &= 7;
}
entropy->restarts_to_go--;
}
natural_order = cinfo->natural_order;
/* Encode the MCU data blocks */
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
block = MCU_data[blkn];
ci = cinfo->MCU_membership[blkn];
compptr = cinfo->cur_comp_info[ci];
/* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */
tbl = compptr->dc_tbl_no;
/* Table F.4: Point to statistics bin S0 for DC coefficient coding */
st = entropy->dc_stats[tbl] + entropy->dc_context[ci];
/* Figure F.4: Encode_DC_DIFF */
if ((v = (*block)[0] - entropy->last_dc_val[ci]) == 0) {
arith_encode(cinfo, st, 0);
entropy->dc_context[ci] = 0; /* zero diff category */
} else {
entropy->last_dc_val[ci] = (*block)[0];
arith_encode(cinfo, st, 1);
/* Figure F.6: Encoding nonzero value v */
/* Figure F.7: Encoding the sign of v */
if (v > 0) {
arith_encode(cinfo, st + 1, 0); /* Table F.4: SS = S0 + 1 */
st += 2; /* Table F.4: SP = S0 + 2 */
entropy->dc_context[ci] = 4; /* small positive diff category */
} else {
v = -v;
arith_encode(cinfo, st + 1, 1); /* Table F.4: SS = S0 + 1 */
st += 3; /* Table F.4: SN = S0 + 3 */
entropy->dc_context[ci] = 8; /* small negative diff category */
}
/* Figure F.8: Encoding the magnitude category of v */
m = 0;
if (v -= 1) {
arith_encode(cinfo, st, 1);
m = 1;
v2 = v;
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
while (v2 >>= 1) {
arith_encode(cinfo, st, 1);
m <<= 1;
st += 1;
}
}
arith_encode(cinfo, st, 0);
/* Section F.1.4.4.1.2: Establish dc_context conditioning category */
if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))
entropy->dc_context[ci] = 0; /* zero diff category */
else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))
entropy->dc_context[ci] += 8; /* large diff category */
/* Figure F.9: Encoding the magnitude bit pattern of v */
st += 14;
while (m >>= 1)
arith_encode(cinfo, st, (m & v) ? 1 : 0);
}
/* Sections F.1.4.2 & F.1.4.4.2: Encoding of AC coefficients */
if ((ke = cinfo->lim_Se) == 0) continue;
tbl = compptr->ac_tbl_no;
/* Establish EOB (end-of-block) index */
do {
if ((*block)[natural_order[ke]]) break;
} while (--ke);
/* Figure F.5: Encode_AC_Coefficients */
for (k = 0; k < ke;) {
st = entropy->ac_stats[tbl] + 3 * k;
arith_encode(cinfo, st, 0); /* EOB decision */
while ((v = (*block)[natural_order[++k]]) == 0) {
arith_encode(cinfo, st + 1, 0);
st += 3;
}
arith_encode(cinfo, st + 1, 1);
/* Figure F.6: Encoding nonzero value v */
/* Figure F.7: Encoding the sign of v */
if (v > 0) {
arith_encode(cinfo, entropy->fixed_bin, 0);
} else {
v = -v;
arith_encode(cinfo, entropy->fixed_bin, 1);
}
st += 2;
/* Figure F.8: Encoding the magnitude category of v */
m = 0;
if (v -= 1) {
arith_encode(cinfo, st, 1);
m = 1;
v2 = v;
if (v2 >>= 1) {
arith_encode(cinfo, st, 1);
m <<= 1;
st = entropy->ac_stats[tbl] +
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
while (v2 >>= 1) {
arith_encode(cinfo, st, 1);
m <<= 1;
st += 1;
}
}
}
arith_encode(cinfo, st, 0);
/* Figure F.9: Encoding the magnitude bit pattern of v */
st += 14;
while (m >>= 1)
arith_encode(cinfo, st, (m & v) ? 1 : 0);
}
/* Encode EOB decision only if k < cinfo->lim_Se */
if (k < cinfo->lim_Se) {
st = entropy->ac_stats[tbl] + 3 * k;
arith_encode(cinfo, st, 1);
}
}
return TRUE;
}
/*
* Initialize for an arithmetic-compressed scan.
*/
METHODDEF(void)
start_pass (j_compress_ptr cinfo, boolean gather_statistics)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
int ci, tbl;
jpeg_component_info * compptr;
if (gather_statistics)
/* Make sure to avoid that in the master control logic!
* We are fully adaptive here and need no extra
* statistics gathering pass!
*/
ERREXIT(cinfo, JERR_NOT_COMPILED);
/* We assume jcmaster.c already validated the progressive scan parameters. */
/* Select execution routines */
if (cinfo->progressive_mode) {
if (cinfo->Ah == 0) {
if (cinfo->Ss == 0)
entropy->pub.encode_mcu = encode_mcu_DC_first;
else
entropy->pub.encode_mcu = encode_mcu_AC_first;
} else {
if (cinfo->Ss == 0)
entropy->pub.encode_mcu = encode_mcu_DC_refine;
else
entropy->pub.encode_mcu = encode_mcu_AC_refine;
}
} else
entropy->pub.encode_mcu = encode_mcu;
/* Allocate & initialize requested statistics areas */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
/* DC needs no table for refinement scan */
if (cinfo->Ss == 0 && cinfo->Ah == 0) {
tbl = compptr->dc_tbl_no;
if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
if (entropy->dc_stats[tbl] == NULL)
entropy->dc_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, DC_STAT_BINS);
MEMZERO(entropy->dc_stats[tbl], DC_STAT_BINS);
/* Initialize DC predictions to 0 */
entropy->last_dc_val[ci] = 0;
entropy->dc_context[ci] = 0;
}
/* AC needs no table when not present */
if (cinfo->Se) {
tbl = compptr->ac_tbl_no;
if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
if (entropy->ac_stats[tbl] == NULL)
entropy->ac_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, AC_STAT_BINS);
MEMZERO(entropy->ac_stats[tbl], AC_STAT_BINS);
#ifdef CALCULATE_SPECTRAL_CONDITIONING
if (cinfo->progressive_mode)
/* Section G.1.3.2: Set appropriate arithmetic conditioning value Kx */
cinfo->arith_ac_K[tbl] = cinfo->Ss + ((8 + cinfo->Se - cinfo->Ss) >> 4);
#endif
}
}
/* Initialize arithmetic encoding variables */
entropy->c = 0;
entropy->a = 0x10000L;
entropy->sc = 0;
entropy->zc = 0;
entropy->ct = 11;
entropy->buffer = -1; /* empty */
/* Initialize restart stuff */
entropy->restarts_to_go = cinfo->restart_interval;
entropy->next_restart_num = 0;
}
/*
* Module initialization routine for arithmetic entropy encoding.
*/
GLOBAL(void)
jinit_arith_encoder (j_compress_ptr cinfo)
{
arith_entropy_ptr entropy;
int i;
entropy = (arith_entropy_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(arith_entropy_encoder));
cinfo->entropy = &entropy->pub;
entropy->pub.start_pass = start_pass;
entropy->pub.finish_pass = finish_pass;
/* Mark tables unallocated */
for (i = 0; i < NUM_ARITH_TBLS; i++) {
entropy->dc_stats[i] = NULL;
entropy->ac_stats[i] = NULL;
}
/* Initialize index for fixed probability estimation */
entropy->fixed_bin[0] = 113;
}
+85 -80
View File
@@ -2,6 +2,7 @@
* jccoefct.c
*
* Copyright (C) 1994-1997, Thomas G. Lane.
* Modified 2003-2011 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -149,12 +150,13 @@ compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
int blkn, bi, ci, yindex, yoffset, blockcnt;
JDIMENSION ypos, xpos;
jpeg_component_info *compptr;
forward_DCT_ptr forward_DCT;
/* Loop to write as much as one whole iMCU row */
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
yoffset++) {
for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col;
MCU_col_num++) {
MCU_col_num++) {
/* Determine where data comes from in input_buf and do the DCT thing.
* Each call on forward_DCT processes a horizontal row of DCT blocks
* as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks
@@ -166,46 +168,48 @@ compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
*/
blkn = 0;
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
: compptr->last_col_width;
xpos = MCU_col_num * compptr->MCU_sample_width;
ypos = yoffset * DCTSIZE; /* ypos == (yoffset+yindex) * DCTSIZE */
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
if (coef->iMCU_row_num < last_iMCU_row ||
yoffset+yindex < compptr->last_row_height) {
(*cinfo->fdct->forward_DCT) (cinfo, compptr,
input_buf[compptr->component_index],
coef->MCU_buffer[blkn],
ypos, xpos, (JDIMENSION) blockcnt);
if (blockcnt < compptr->MCU_width) {
/* Create some dummy blocks at the right edge of the image. */
jzero_far((void FAR *) coef->MCU_buffer[blkn + blockcnt],
(compptr->MCU_width - blockcnt) * SIZEOF(JBLOCK));
for (bi = blockcnt; bi < compptr->MCU_width; bi++) {
coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn+bi-1][0][0];
compptr = cinfo->cur_comp_info[ci];
forward_DCT = cinfo->fdct->forward_DCT[compptr->component_index];
blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
: compptr->last_col_width;
xpos = MCU_col_num * compptr->MCU_sample_width;
ypos = yoffset * compptr->DCT_v_scaled_size;
/* ypos == (yoffset+yindex) * DCTSIZE */
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
if (coef->iMCU_row_num < last_iMCU_row ||
yoffset+yindex < compptr->last_row_height) {
(*forward_DCT) (cinfo, compptr,
input_buf[compptr->component_index],
coef->MCU_buffer[blkn],
ypos, xpos, (JDIMENSION) blockcnt);
if (blockcnt < compptr->MCU_width) {
/* Create some dummy blocks at the right edge of the image. */
FMEMZERO((void FAR *) coef->MCU_buffer[blkn + blockcnt],
(compptr->MCU_width - blockcnt) * SIZEOF(JBLOCK));
for (bi = blockcnt; bi < compptr->MCU_width; bi++) {
coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn+bi-1][0][0];
}
}
} else {
/* Create a row of dummy blocks at the bottom of the image. */
FMEMZERO((void FAR *) coef->MCU_buffer[blkn],
compptr->MCU_width * SIZEOF(JBLOCK));
for (bi = 0; bi < compptr->MCU_width; bi++) {
coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn-1][0][0];
}
}
blkn += compptr->MCU_width;
ypos += compptr->DCT_v_scaled_size;
}
} else {
/* Create a row of dummy blocks at the bottom of the image. */
jzero_far((void FAR *) coef->MCU_buffer[blkn],
compptr->MCU_width * SIZEOF(JBLOCK));
for (bi = 0; bi < compptr->MCU_width; bi++) {
coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn-1][0][0];
}
}
blkn += compptr->MCU_width;
ypos += DCTSIZE;
}
}
/* Try to write the MCU. In event of a suspension failure, we will
* re-DCT the MCU on restart (a bit inefficient, could be fixed...)
*/
if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
coef->mcu_ctr = MCU_col_num;
return FALSE;
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
coef->mcu_ctr = MCU_col_num;
return FALSE;
}
}
/* Completed an MCU row, but perhaps not an iMCU row */
@@ -252,6 +256,7 @@ compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
jpeg_component_info *compptr;
JBLOCKARRAY buffer;
JBLOCKROW thisblockrow, lastblockrow;
forward_DCT_ptr forward_DCT;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
@@ -274,23 +279,23 @@ compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
ndummy = (int) (blocks_across % h_samp_factor);
if (ndummy > 0)
ndummy = h_samp_factor - ndummy;
forward_DCT = cinfo->fdct->forward_DCT[ci];
/* Perform DCT for all non-dummy blocks in this iMCU row. Each call
* on forward_DCT processes a complete horizontal row of DCT blocks.
*/
for (block_row = 0; block_row < block_rows; block_row++) {
thisblockrow = buffer[block_row];
(*cinfo->fdct->forward_DCT) (cinfo, compptr,
input_buf[ci], thisblockrow,
(JDIMENSION) (block_row * DCTSIZE),
(JDIMENSION) 0, blocks_across);
(*forward_DCT) (cinfo, compptr, input_buf[ci], thisblockrow,
(JDIMENSION) (block_row * compptr->DCT_v_scaled_size),
(JDIMENSION) 0, blocks_across);
if (ndummy > 0) {
/* Create dummy blocks at the right edge of the image. */
thisblockrow += blocks_across; /* => first dummy block */
jzero_far((void FAR *) thisblockrow, ndummy * SIZEOF(JBLOCK));
lastDC = thisblockrow[-1][0];
for (bi = 0; bi < ndummy; bi++) {
thisblockrow[bi][0] = lastDC;
}
/* Create dummy blocks at the right edge of the image. */
thisblockrow += blocks_across; /* => first dummy block */
FMEMZERO((void FAR *) thisblockrow, ndummy * SIZEOF(JBLOCK));
lastDC = thisblockrow[-1][0];
for (bi = 0; bi < ndummy; bi++) {
thisblockrow[bi][0] = lastDC;
}
}
}
/* If at end of image, create dummy block rows as needed.
@@ -302,19 +307,19 @@ compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
blocks_across += ndummy; /* include lower right corner */
MCUs_across = blocks_across / h_samp_factor;
for (block_row = block_rows; block_row < compptr->v_samp_factor;
block_row++) {
thisblockrow = buffer[block_row];
lastblockrow = buffer[block_row-1];
jzero_far((void FAR *) thisblockrow,
(size_t) (blocks_across * SIZEOF(JBLOCK)));
for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) {
lastDC = lastblockrow[h_samp_factor-1][0];
for (bi = 0; bi < h_samp_factor; bi++) {
thisblockrow[bi][0] = lastDC;
}
thisblockrow += h_samp_factor; /* advance to next MCU in row */
lastblockrow += h_samp_factor;
}
block_row++) {
thisblockrow = buffer[block_row];
lastblockrow = buffer[block_row-1];
FMEMZERO((void FAR *) thisblockrow,
(size_t) (blocks_across * SIZEOF(JBLOCK)));
for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) {
lastDC = lastblockrow[h_samp_factor-1][0];
for (bi = 0; bi < h_samp_factor; bi++) {
thisblockrow[bi][0] = lastDC;
}
thisblockrow += h_samp_factor; /* advance to next MCU in row */
lastblockrow += h_samp_factor;
}
}
}
}
@@ -364,25 +369,25 @@ compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
yoffset++) {
for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
MCU_col_num++) {
MCU_col_num++) {
/* Construct list of pointers to DCT blocks belonging to this MCU */
blkn = 0; /* index of current DCT block within MCU */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
start_col = MCU_col_num * compptr->MCU_width;
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
coef->MCU_buffer[blkn++] = buffer_ptr++;
}
}
compptr = cinfo->cur_comp_info[ci];
start_col = MCU_col_num * compptr->MCU_width;
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
coef->MCU_buffer[blkn++] = buffer_ptr++;
}
}
}
/* Try to write the MCU. */
if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
coef->mcu_ctr = MCU_col_num;
return FALSE;
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
coef->mcu_ctr = MCU_col_num;
return FALSE;
}
}
/* Completed an MCU row, but perhaps not an iMCU row */
@@ -408,7 +413,7 @@ jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer)
coef = (my_coef_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_coef_controller));
SIZEOF(my_coef_controller));
cinfo->coef = (struct jpeg_c_coef_controller *) coef;
coef->pub.start_pass = start_pass_coef;
@@ -421,14 +426,14 @@ jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer)
jpeg_component_info *compptr;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
ci++, compptr++) {
coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
(JDIMENSION) jround_up((long) compptr->width_in_blocks,
(long) compptr->h_samp_factor),
(JDIMENSION) jround_up((long) compptr->height_in_blocks,
(long) compptr->v_samp_factor),
(JDIMENSION) compptr->v_samp_factor);
((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
(JDIMENSION) jround_up((long) compptr->width_in_blocks,
(long) compptr->h_samp_factor),
(JDIMENSION) jround_up((long) compptr->height_in_blocks,
(long) compptr->v_samp_factor),
(JDIMENSION) compptr->v_samp_factor);
}
#else
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
@@ -440,7 +445,7 @@ jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer)
buffer = (JBLOCKROW)
(*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
coef->MCU_buffer[i] = buffer + i;
}
+135 -53
View File
@@ -2,6 +2,7 @@
* jccolor.c
*
* Copyright (C) 1991-1996, Thomas G. Lane.
* Modified 2011-2012 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -92,7 +93,7 @@ rgb_ycc_start (j_compress_ptr cinfo)
/* Allocate and fill in the conversion tables. */
cconvert->rgb_ycc_tab = rgb_ycc_tab = (INT32 *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(TABLE_SIZE * SIZEOF(INT32)));
(TABLE_SIZE * SIZEOF(INT32)));
for (i = 0; i <= MAXJSAMPLE; i++) {
rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i;
@@ -128,12 +129,12 @@ rgb_ycc_start (j_compress_ptr cinfo)
METHODDEF(void)
rgb_ycc_convert (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows)
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
register int r, g, b;
register INT32 * ctab = cconvert->rgb_ycc_tab;
register int r, g, b;
register JSAMPROW inptr;
register JSAMPROW outptr0, outptr1, outptr2;
register JDIMENSION col;
@@ -149,7 +150,6 @@ rgb_ycc_convert (j_compress_ptr cinfo,
r = GETJSAMPLE(inptr[RGB_RED]);
g = GETJSAMPLE(inptr[RGB_GREEN]);
b = GETJSAMPLE(inptr[RGB_BLUE]);
inptr += RGB_PIXELSIZE;
/* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
* must be too; we do not need an explicit range-limiting operation.
* Hence the value being shifted is never negative, and we don't
@@ -157,16 +157,17 @@ rgb_ycc_convert (j_compress_ptr cinfo,
*/
/* Y */
outptr0[col] = (JSAMPLE)
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
>> SCALEBITS);
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
>> SCALEBITS);
/* Cb */
outptr1[col] = (JSAMPLE)
((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
>> SCALEBITS);
((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
>> SCALEBITS);
/* Cr */
outptr2[col] = (JSAMPLE)
((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
>> SCALEBITS);
((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
>> SCALEBITS);
inptr += RGB_PIXELSIZE;
}
}
}
@@ -184,12 +185,12 @@ rgb_ycc_convert (j_compress_ptr cinfo,
METHODDEF(void)
rgb_gray_convert (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows)
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
register int r, g, b;
register INT32 * ctab = cconvert->rgb_ycc_tab;
register int r, g, b;
register JSAMPROW inptr;
register JSAMPROW outptr;
register JDIMENSION col;
@@ -197,17 +198,16 @@ rgb_gray_convert (j_compress_ptr cinfo,
while (--num_rows >= 0) {
inptr = *input_buf++;
outptr = output_buf[0][output_row];
output_row++;
outptr = output_buf[0][output_row++];
for (col = 0; col < num_cols; col++) {
r = GETJSAMPLE(inptr[RGB_RED]);
g = GETJSAMPLE(inptr[RGB_GREEN]);
b = GETJSAMPLE(inptr[RGB_BLUE]);
inptr += RGB_PIXELSIZE;
/* Y */
outptr[col] = (JSAMPLE)
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
>> SCALEBITS);
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
>> SCALEBITS);
inptr += RGB_PIXELSIZE;
}
}
}
@@ -223,12 +223,12 @@ rgb_gray_convert (j_compress_ptr cinfo,
METHODDEF(void)
cmyk_ycck_convert (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows)
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
register int r, g, b;
register INT32 * ctab = cconvert->rgb_ycc_tab;
register int r, g, b;
register JSAMPROW inptr;
register JSAMPROW outptr0, outptr1, outptr2, outptr3;
register JDIMENSION col;
@@ -247,7 +247,6 @@ cmyk_ycck_convert (j_compress_ptr cinfo,
b = MAXJSAMPLE - GETJSAMPLE(inptr[2]);
/* K passes through as-is */
outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */
inptr += 4;
/* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
* must be too; we do not need an explicit range-limiting operation.
* Hence the value being shifted is never negative, and we don't
@@ -255,16 +254,56 @@ cmyk_ycck_convert (j_compress_ptr cinfo,
*/
/* Y */
outptr0[col] = (JSAMPLE)
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
>> SCALEBITS);
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
>> SCALEBITS);
/* Cb */
outptr1[col] = (JSAMPLE)
((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
>> SCALEBITS);
((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
>> SCALEBITS);
/* Cr */
outptr2[col] = (JSAMPLE)
((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
>> SCALEBITS);
((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
>> SCALEBITS);
inptr += 4;
}
}
}
/*
* Convert some rows of samples to the JPEG colorspace.
* [R,G,B] to [R-G,G,B-G] conversion with modulo calculation
* (forward reversible color transform).
*/
METHODDEF(void)
rgb_rgb1_convert (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows)
{
register int r, g, b;
register JSAMPROW inptr;
register JSAMPROW outptr0, outptr1, outptr2;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->image_width;
while (--num_rows >= 0) {
inptr = *input_buf++;
outptr0 = output_buf[0][output_row];
outptr1 = output_buf[1][output_row];
outptr2 = output_buf[2][output_row];
output_row++;
for (col = 0; col < num_cols; col++) {
r = GETJSAMPLE(inptr[RGB_RED]);
g = GETJSAMPLE(inptr[RGB_GREEN]);
b = GETJSAMPLE(inptr[RGB_BLUE]);
/* Assume that MAXJSAMPLE+1 is a power of 2, so that the MOD
* (modulo) operator is equivalent to the bitmask operator AND.
*/
outptr0[col] = (JSAMPLE) ((r - g + CENTERJSAMPLE) & MAXJSAMPLE);
outptr1[col] = (JSAMPLE) g;
outptr2[col] = (JSAMPLE) ((b - g + CENTERJSAMPLE) & MAXJSAMPLE);
inptr += RGB_PIXELSIZE;
}
}
}
@@ -278,19 +317,18 @@ cmyk_ycck_convert (j_compress_ptr cinfo,
METHODDEF(void)
grayscale_convert (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows)
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows)
{
int instride = cinfo->input_components;
register JSAMPROW inptr;
register JSAMPROW outptr;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->image_width;
int instride = cinfo->input_components;
while (--num_rows >= 0) {
inptr = *input_buf++;
outptr = output_buf[0][output_row];
output_row++;
outptr = output_buf[0][output_row++];
for (col = 0; col < num_cols; col++) {
outptr[col] = inptr[0]; /* don't need GETJSAMPLE() here */
inptr += instride;
@@ -299,6 +337,39 @@ grayscale_convert (j_compress_ptr cinfo,
}
/*
* Convert some rows of samples to the JPEG colorspace.
* No colorspace conversion, but change from interleaved
* to separate-planes representation.
*/
METHODDEF(void)
rgb_convert (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows)
{
register JSAMPROW inptr;
register JSAMPROW outptr0, outptr1, outptr2;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->image_width;
while (--num_rows >= 0) {
inptr = *input_buf++;
outptr0 = output_buf[0][output_row];
outptr1 = output_buf[1][output_row];
outptr2 = output_buf[2][output_row];
output_row++;
for (col = 0; col < num_cols; col++) {
/* We can dispense with GETJSAMPLE() here */
outptr0[col] = inptr[RGB_RED];
outptr1[col] = inptr[RGB_GREEN];
outptr2[col] = inptr[RGB_BLUE];
inptr += RGB_PIXELSIZE;
}
}
}
/*
* Convert some rows of samples to the JPEG colorspace.
* This version handles multi-component colorspaces without conversion.
@@ -307,24 +378,24 @@ grayscale_convert (j_compress_ptr cinfo,
METHODDEF(void)
null_convert (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows)
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
JDIMENSION output_row, int num_rows)
{
int ci;
register int nc = cinfo->num_components;
register JSAMPROW inptr;
register JSAMPROW outptr;
register JDIMENSION col;
register int ci;
int nc = cinfo->num_components;
JDIMENSION num_cols = cinfo->image_width;
while (--num_rows >= 0) {
/* It seems fastest to make a separate pass for each component. */
for (ci = 0; ci < nc; ci++) {
inptr = *input_buf;
inptr = input_buf[0] + ci;
outptr = output_buf[ci][output_row];
for (col = 0; col < num_cols; col++) {
outptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */
inptr += nc;
*outptr++ = *inptr; /* don't need GETJSAMPLE() here */
inptr += nc;
}
}
input_buf++;
@@ -355,8 +426,8 @@ jinit_color_converter (j_compress_ptr cinfo)
cconvert = (my_cconvert_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_color_converter));
cinfo->cconvert = (struct jpeg_color_converter *) cconvert;
SIZEOF(my_color_converter));
cinfo->cconvert = &cconvert->pub;
/* set start_pass to null method until we find out differently */
cconvert->pub.start_pass = null_method;
@@ -368,11 +439,9 @@ jinit_color_converter (j_compress_ptr cinfo)
break;
case JCS_RGB:
#if RGB_PIXELSIZE != 3
if (cinfo->input_components != RGB_PIXELSIZE)
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
break;
#endif /* else share code with YCbCr */
case JCS_YCbCr:
if (cinfo->input_components != 3)
@@ -391,28 +460,41 @@ jinit_color_converter (j_compress_ptr cinfo)
break;
}
/* Support color transform only for RGB colorspace */
if (cinfo->color_transform && cinfo->jpeg_color_space != JCS_RGB)
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
/* Check num_components, set conversion method based on requested space */
switch (cinfo->jpeg_color_space) {
case JCS_GRAYSCALE:
if (cinfo->num_components != 1)
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
if (cinfo->in_color_space == JCS_GRAYSCALE)
if (cinfo->in_color_space == JCS_GRAYSCALE ||
cinfo->in_color_space == JCS_YCbCr)
cconvert->pub.color_convert = grayscale_convert;
else if (cinfo->in_color_space == JCS_RGB) {
cconvert->pub.start_pass = rgb_ycc_start;
cconvert->pub.color_convert = rgb_gray_convert;
} else if (cinfo->in_color_space == JCS_YCbCr)
cconvert->pub.color_convert = grayscale_convert;
else
} else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break;
case JCS_RGB:
if (cinfo->num_components != 3)
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
if (cinfo->in_color_space == JCS_RGB && RGB_PIXELSIZE == 3)
cconvert->pub.color_convert = null_convert;
else
if (cinfo->in_color_space == JCS_RGB) {
switch (cinfo->color_transform) {
case JCT_NONE:
cconvert->pub.color_convert = rgb_convert;
break;
case JCT_SUBTRACT_GREEN:
cconvert->pub.color_convert = rgb_rgb1_convert;
break;
default:
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break;
}
} else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break;
@@ -451,7 +533,7 @@ jinit_color_converter (j_compress_ptr cinfo)
default: /* allow null conversion of JCS_UNKNOWN */
if (cinfo->jpeg_color_space != cinfo->in_color_space ||
cinfo->num_components != cinfo->input_components)
cinfo->num_components != cinfo->input_components)
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
cconvert->pub.color_convert = null_convert;
break;
+357 -262
View File
@@ -23,7 +23,7 @@ typedef struct {
struct jpeg_forward_dct pub; /* public fields */
/* Pointer to the DCT routine actually in use */
forward_DCT_method_ptr do_dct;
forward_DCT_method_ptr do_dct[MAX_COMPONENTS];
/* The actual post-DCT divisors --- not identical to the quant table
* entries, because of scaling (especially for an unnormalized DCT).
@@ -33,7 +33,7 @@ typedef struct {
#ifdef DCT_FLOAT_SUPPORTED
/* Same as above for the floating-point case. */
float_DCT_method_ptr do_float_dct;
float_DCT_method_ptr do_float_dct[MAX_COMPONENTS];
FAST_FLOAT * float_divisors[NUM_QUANT_TBLS];
#endif
} my_fdct_controller;
@@ -41,6 +41,132 @@ typedef struct {
typedef my_fdct_controller * my_fdct_ptr;
/* The current scaled-DCT routines require ISLOW-style divisor tables,
* so be sure to compile that code if either ISLOW or SCALING is requested.
*/
#ifdef DCT_ISLOW_SUPPORTED
#define PROVIDE_ISLOW_TABLES
#else
#ifdef DCT_SCALING_SUPPORTED
#define PROVIDE_ISLOW_TABLES
#endif
#endif
/*
* Perform forward DCT on one or more blocks of a component.
*
* The input samples are taken from the sample_data[] array starting at
* position start_row/start_col, and moving to the right for any additional
* blocks. The quantized coefficients are returned in coef_blocks[].
*/
METHODDEF(void)
forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
JDIMENSION start_row, JDIMENSION start_col,
JDIMENSION num_blocks)
/* This version is used for integer DCT implementations. */
{
/* This routine is heavily used, so it's worth coding it tightly. */
my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
forward_DCT_method_ptr do_dct = fdct->do_dct[compptr->component_index];
DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no];
DCTELEM workspace[DCTSIZE2]; /* work area for FDCT subroutine */
JDIMENSION bi;
sample_data += start_row; /* fold in the vertical offset once */
for (bi = 0; bi < num_blocks; bi++, start_col += compptr->DCT_h_scaled_size) {
/* Perform the DCT */
(*do_dct) (workspace, sample_data, start_col);
/* Quantize/descale the coefficients, and store into coef_blocks[] */
{ register DCTELEM temp, qval;
register int i;
register JCOEFPTR output_ptr = coef_blocks[bi];
for (i = 0; i < DCTSIZE2; i++) {
qval = divisors[i];
temp = workspace[i];
/* Divide the coefficient value by qval, ensuring proper rounding.
* Since C does not specify the direction of rounding for negative
* quotients, we have to force the dividend positive for portability.
*
* In most files, at least half of the output values will be zero
* (at default quantization settings, more like three-quarters...)
* so we should ensure that this case is fast. On many machines,
* a comparison is enough cheaper than a divide to make a special test
* a win. Since both inputs will be nonnegative, we need only test
* for a < b to discover whether a/b is 0.
* If your machine's division is fast enough, define FAST_DIVIDE.
*/
#ifdef FAST_DIVIDE
#define DIVIDE_BY(a,b) a /= b
#else
#define DIVIDE_BY(a,b) if (a >= b) a /= b; else a = 0
#endif
if (temp < 0) {
temp = -temp;
temp += qval>>1; /* for rounding */
DIVIDE_BY(temp, qval);
temp = -temp;
} else {
temp += qval>>1; /* for rounding */
DIVIDE_BY(temp, qval);
}
output_ptr[i] = (JCOEF) temp;
}
}
}
}
#ifdef DCT_FLOAT_SUPPORTED
METHODDEF(void)
forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
JDIMENSION start_row, JDIMENSION start_col,
JDIMENSION num_blocks)
/* This version is used for floating-point DCT implementations. */
{
/* This routine is heavily used, so it's worth coding it tightly. */
my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
float_DCT_method_ptr do_dct = fdct->do_float_dct[compptr->component_index];
FAST_FLOAT * divisors = fdct->float_divisors[compptr->quant_tbl_no];
FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */
JDIMENSION bi;
sample_data += start_row; /* fold in the vertical offset once */
for (bi = 0; bi < num_blocks; bi++, start_col += compptr->DCT_h_scaled_size) {
/* Perform the DCT */
(*do_dct) (workspace, sample_data, start_col);
/* Quantize/descale the coefficients, and store into coef_blocks[] */
{ register FAST_FLOAT temp;
register int i;
register JCOEFPTR output_ptr = coef_blocks[bi];
for (i = 0; i < DCTSIZE2; i++) {
/* Apply the quantization and scaling factor */
temp = workspace[i] * divisors[i];
/* Round to nearest integer.
* Since C does not specify the direction of rounding for negative
* quotients, we have to force the dividend positive for portability.
* The maximum coefficient size is +-16K (for 12-bit data), so this
* code should work for either 16-bit or 32-bit ints.
*/
output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384);
}
}
}
}
#endif /* DCT_FLOAT_SUPPORTED */
/*
* Initialize for a processing pass.
* Verify that all referenced Q-tables are present, and set up
@@ -56,108 +182,270 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
int ci, qtblno, i;
jpeg_component_info *compptr;
int method = 0;
JQUANT_TBL * qtbl;
DCTELEM * dtbl;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
/* Select the proper DCT routine for this component's scaling */
switch ((compptr->DCT_h_scaled_size << 8) + compptr->DCT_v_scaled_size) {
#ifdef DCT_SCALING_SUPPORTED
case ((1 << 8) + 1):
fdct->do_dct[ci] = jpeg_fdct_1x1;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((2 << 8) + 2):
fdct->do_dct[ci] = jpeg_fdct_2x2;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((3 << 8) + 3):
fdct->do_dct[ci] = jpeg_fdct_3x3;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((4 << 8) + 4):
fdct->do_dct[ci] = jpeg_fdct_4x4;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((5 << 8) + 5):
fdct->do_dct[ci] = jpeg_fdct_5x5;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((6 << 8) + 6):
fdct->do_dct[ci] = jpeg_fdct_6x6;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((7 << 8) + 7):
fdct->do_dct[ci] = jpeg_fdct_7x7;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((9 << 8) + 9):
fdct->do_dct[ci] = jpeg_fdct_9x9;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((10 << 8) + 10):
fdct->do_dct[ci] = jpeg_fdct_10x10;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((11 << 8) + 11):
fdct->do_dct[ci] = jpeg_fdct_11x11;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((12 << 8) + 12):
fdct->do_dct[ci] = jpeg_fdct_12x12;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((13 << 8) + 13):
fdct->do_dct[ci] = jpeg_fdct_13x13;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((14 << 8) + 14):
fdct->do_dct[ci] = jpeg_fdct_14x14;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((15 << 8) + 15):
fdct->do_dct[ci] = jpeg_fdct_15x15;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((16 << 8) + 16):
fdct->do_dct[ci] = jpeg_fdct_16x16;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((16 << 8) + 8):
fdct->do_dct[ci] = jpeg_fdct_16x8;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((14 << 8) + 7):
fdct->do_dct[ci] = jpeg_fdct_14x7;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((12 << 8) + 6):
fdct->do_dct[ci] = jpeg_fdct_12x6;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((10 << 8) + 5):
fdct->do_dct[ci] = jpeg_fdct_10x5;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((8 << 8) + 4):
fdct->do_dct[ci] = jpeg_fdct_8x4;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((6 << 8) + 3):
fdct->do_dct[ci] = jpeg_fdct_6x3;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((4 << 8) + 2):
fdct->do_dct[ci] = jpeg_fdct_4x2;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((2 << 8) + 1):
fdct->do_dct[ci] = jpeg_fdct_2x1;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((8 << 8) + 16):
fdct->do_dct[ci] = jpeg_fdct_8x16;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((7 << 8) + 14):
fdct->do_dct[ci] = jpeg_fdct_7x14;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((6 << 8) + 12):
fdct->do_dct[ci] = jpeg_fdct_6x12;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((5 << 8) + 10):
fdct->do_dct[ci] = jpeg_fdct_5x10;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((4 << 8) + 8):
fdct->do_dct[ci] = jpeg_fdct_4x8;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((3 << 8) + 6):
fdct->do_dct[ci] = jpeg_fdct_3x6;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((2 << 8) + 4):
fdct->do_dct[ci] = jpeg_fdct_2x4;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((1 << 8) + 2):
fdct->do_dct[ci] = jpeg_fdct_1x2;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
#endif
case ((DCTSIZE << 8) + DCTSIZE):
switch (cinfo->dct_method) {
#ifdef DCT_ISLOW_SUPPORTED
case JDCT_ISLOW:
fdct->do_dct[ci] = jpeg_fdct_islow;
method = JDCT_ISLOW;
break;
#endif
#ifdef DCT_IFAST_SUPPORTED
case JDCT_IFAST:
fdct->do_dct[ci] = jpeg_fdct_ifast;
method = JDCT_IFAST;
break;
#endif
#ifdef DCT_FLOAT_SUPPORTED
case JDCT_FLOAT:
fdct->do_float_dct[ci] = jpeg_fdct_float;
method = JDCT_FLOAT;
break;
#endif
default:
ERREXIT(cinfo, JERR_NOT_COMPILED);
break;
}
break;
default:
ERREXIT2(cinfo, JERR_BAD_DCTSIZE,
compptr->DCT_h_scaled_size, compptr->DCT_v_scaled_size);
break;
}
qtblno = compptr->quant_tbl_no;
/* Make sure specified quantization table is present */
if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||
cinfo->quant_tbl_ptrs[qtblno] == NULL)
cinfo->quant_tbl_ptrs[qtblno] == NULL)
ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
qtbl = cinfo->quant_tbl_ptrs[qtblno];
/* Compute divisors for this quant table */
/* We may do this more than once for same table, but it's not a big deal */
switch (cinfo->dct_method) {
#ifdef DCT_ISLOW_SUPPORTED
switch (method) {
#ifdef PROVIDE_ISLOW_TABLES
case JDCT_ISLOW:
/* For LL&M IDCT method, divisors are equal to raw quantization
* coefficients multiplied by 8 (to counteract scaling).
*/
if (fdct->divisors[qtblno] == NULL) {
fdct->divisors[qtblno] = (DCTELEM *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
DCTSIZE2 * SIZEOF(DCTELEM));
fdct->divisors[qtblno] = (DCTELEM *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
DCTSIZE2 * SIZEOF(DCTELEM));
}
dtbl = fdct->divisors[qtblno];
for (i = 0; i < DCTSIZE2; i++) {
dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3;
dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3;
}
fdct->pub.forward_DCT[ci] = forward_DCT;
break;
#endif
#ifdef DCT_IFAST_SUPPORTED
case JDCT_IFAST:
{
/* For AA&N IDCT method, divisors are equal to quantization
* coefficients scaled by scalefactor[row]*scalefactor[col], where
* scalefactor[0] = 1
* scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
* We apply a further scale factor of 8.
*/
/* For AA&N IDCT method, divisors are equal to quantization
* coefficients scaled by scalefactor[row]*scalefactor[col], where
* scalefactor[0] = 1
* scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
* We apply a further scale factor of 8.
*/
#define CONST_BITS 14
static const INT16 aanscales[DCTSIZE2] = {
/* precomputed values scaled up by 14 bits */
16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270,
21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906,
19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315,
16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552,
8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446,
4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247
};
SHIFT_TEMPS
static const INT16 aanscales[DCTSIZE2] = {
/* precomputed values scaled up by 14 bits */
16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270,
21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906,
19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315,
16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552,
8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446,
4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247
};
SHIFT_TEMPS
if (fdct->divisors[qtblno] == NULL) {
fdct->divisors[qtblno] = (DCTELEM *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
DCTSIZE2 * SIZEOF(DCTELEM));
}
dtbl = fdct->divisors[qtblno];
for (i = 0; i < DCTSIZE2; i++) {
dtbl[i] = (DCTELEM)
DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
(INT32) aanscales[i]),
CONST_BITS-3);
}
if (fdct->divisors[qtblno] == NULL) {
fdct->divisors[qtblno] = (DCTELEM *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
DCTSIZE2 * SIZEOF(DCTELEM));
}
dtbl = fdct->divisors[qtblno];
for (i = 0; i < DCTSIZE2; i++) {
dtbl[i] = (DCTELEM)
DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
(INT32) aanscales[i]),
CONST_BITS-3);
}
}
fdct->pub.forward_DCT[ci] = forward_DCT;
break;
#endif
#ifdef DCT_FLOAT_SUPPORTED
case JDCT_FLOAT:
{
/* For float AA&N IDCT method, divisors are equal to quantization
* coefficients scaled by scalefactor[row]*scalefactor[col], where
* scalefactor[0] = 1
* scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
* We apply a further scale factor of 8.
* What's actually stored is 1/divisor so that the inner loop can
* use a multiplication rather than a division.
*/
FAST_FLOAT * fdtbl;
int row, col;
static const double aanscalefactor[DCTSIZE] = {
1.0, 1.387039845, 1.306562965, 1.175875602,
1.0, 0.785694958, 0.541196100, 0.275899379
};
/* For float AA&N IDCT method, divisors are equal to quantization
* coefficients scaled by scalefactor[row]*scalefactor[col], where
* scalefactor[0] = 1
* scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
* We apply a further scale factor of 8.
* What's actually stored is 1/divisor so that the inner loop can
* use a multiplication rather than a division.
*/
FAST_FLOAT * fdtbl;
int row, col;
static const double aanscalefactor[DCTSIZE] = {
1.0, 1.387039845, 1.306562965, 1.175875602,
1.0, 0.785694958, 0.541196100, 0.275899379
};
if (fdct->float_divisors[qtblno] == NULL) {
fdct->float_divisors[qtblno] = (FAST_FLOAT *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
DCTSIZE2 * SIZEOF(FAST_FLOAT));
}
fdtbl = fdct->float_divisors[qtblno];
i = 0;
for (row = 0; row < DCTSIZE; row++) {
for (col = 0; col < DCTSIZE; col++) {
fdtbl[i] = (FAST_FLOAT)
(1.0 / (((double) qtbl->quantval[i] *
aanscalefactor[row] * aanscalefactor[col] * 8.0)));
i++;
}
}
if (fdct->float_divisors[qtblno] == NULL) {
fdct->float_divisors[qtblno] = (FAST_FLOAT *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
DCTSIZE2 * SIZEOF(FAST_FLOAT));
}
fdtbl = fdct->float_divisors[qtblno];
i = 0;
for (row = 0; row < DCTSIZE; row++) {
for (col = 0; col < DCTSIZE; col++) {
fdtbl[i] = (FAST_FLOAT)
(1.0 / (((double) qtbl->quantval[i] *
aanscalefactor[row] * aanscalefactor[col] * 8.0)));
i++;
}
}
}
fdct->pub.forward_DCT[ci] = forward_DCT_float;
break;
#endif
default:
@@ -168,175 +456,6 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
}
/*
* Perform forward DCT on one or more blocks of a component.
*
* The input samples are taken from the sample_data[] array starting at
* position start_row/start_col, and moving to the right for any additional
* blocks. The quantized coefficients are returned in coef_blocks[].
*/
METHODDEF(void)
forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
JDIMENSION start_row, JDIMENSION start_col,
JDIMENSION num_blocks)
/* This version is used for integer DCT implementations. */
{
/* This routine is heavily used, so it's worth coding it tightly. */
my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
forward_DCT_method_ptr do_dct = fdct->do_dct;
DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no];
DCTELEM workspace[DCTSIZE2]; /* work area for FDCT subroutine */
JDIMENSION bi;
sample_data += start_row; /* fold in the vertical offset once */
for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {
/* Load data into workspace, applying unsigned->signed conversion */
{ register DCTELEM *workspaceptr;
register JSAMPROW elemptr;
register int elemr;
workspaceptr = workspace;
for (elemr = 0; elemr < DCTSIZE; elemr++) {
elemptr = sample_data[elemr] + start_col;
#if DCTSIZE == 8 /* unroll the inner loop */
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
#else
{ register int elemc;
for (elemc = DCTSIZE; elemc > 0; elemc--) {
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
}
}
#endif
}
}
/* Perform the DCT */
(*do_dct) (workspace);
/* Quantize/descale the coefficients, and store into coef_blocks[] */
{ register DCTELEM temp, qval;
register int i;
register JCOEFPTR output_ptr = coef_blocks[bi];
for (i = 0; i < DCTSIZE2; i++) {
qval = divisors[i];
temp = workspace[i];
/* Divide the coefficient value by qval, ensuring proper rounding.
* Since C does not specify the direction of rounding for negative
* quotients, we have to force the dividend positive for portability.
*
* In most files, at least half of the output values will be zero
* (at default quantization settings, more like three-quarters...)
* so we should ensure that this case is fast. On many machines,
* a comparison is enough cheaper than a divide to make a special test
* a win. Since both inputs will be nonnegative, we need only test
* for a < b to discover whether a/b is 0.
* If your machine's division is fast enough, define FAST_DIVIDE.
*/
#ifdef FAST_DIVIDE
#define DIVIDE_BY(a,b) a /= b
#else
#define DIVIDE_BY(a,b) if (a >= b) a /= b; else a = 0
#endif
if (temp < 0) {
temp = -temp;
temp += qval>>1; /* for rounding */
DIVIDE_BY(temp, qval);
temp = -temp;
} else {
temp += qval>>1; /* for rounding */
DIVIDE_BY(temp, qval);
}
output_ptr[i] = (JCOEF) temp;
}
}
}
}
#ifdef DCT_FLOAT_SUPPORTED
METHODDEF(void)
forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
JDIMENSION start_row, JDIMENSION start_col,
JDIMENSION num_blocks)
/* This version is used for floating-point DCT implementations. */
{
/* This routine is heavily used, so it's worth coding it tightly. */
my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
float_DCT_method_ptr do_dct = fdct->do_float_dct;
FAST_FLOAT * divisors = fdct->float_divisors[compptr->quant_tbl_no];
FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */
JDIMENSION bi;
sample_data += start_row; /* fold in the vertical offset once */
for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {
/* Load data into workspace, applying unsigned->signed conversion */
{ register FAST_FLOAT *workspaceptr;
register JSAMPROW elemptr;
register int elemr;
workspaceptr = workspace;
for (elemr = 0; elemr < DCTSIZE; elemr++) {
elemptr = sample_data[elemr] + start_col;
#if DCTSIZE == 8 /* unroll the inner loop */
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
#else
{ register int elemc;
for (elemc = DCTSIZE; elemc > 0; elemc--) {
*workspaceptr++ = (FAST_FLOAT)
(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
}
}
#endif
}
}
/* Perform the DCT */
(*do_dct) (workspace);
/* Quantize/descale the coefficients, and store into coef_blocks[] */
{ register FAST_FLOAT temp;
register int i;
register JCOEFPTR output_ptr = coef_blocks[bi];
for (i = 0; i < DCTSIZE2; i++) {
/* Apply the quantization and scaling factor */
temp = workspace[i] * divisors[i];
/* Round to nearest integer.
* Since C does not specify the direction of rounding for negative
* quotients, we have to force the dividend positive for portability.
* The maximum coefficient size is +-16K (for 12-bit data), so this
* code should work for either 16-bit or 32-bit ints.
*/
output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384);
}
}
}
}
#endif /* DCT_FLOAT_SUPPORTED */
/*
* Initialize FDCT manager.
*/
@@ -349,34 +468,10 @@ jinit_forward_dct (j_compress_ptr cinfo)
fdct = (my_fdct_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_fdct_controller));
SIZEOF(my_fdct_controller));
cinfo->fdct = (struct jpeg_forward_dct *) fdct;
fdct->pub.start_pass = start_pass_fdctmgr;
switch (cinfo->dct_method) {
#ifdef DCT_ISLOW_SUPPORTED
case JDCT_ISLOW:
fdct->pub.forward_DCT = forward_DCT;
fdct->do_dct = jpeg_fdct_islow;
break;
#endif
#ifdef DCT_IFAST_SUPPORTED
case JDCT_IFAST:
fdct->pub.forward_DCT = forward_DCT;
fdct->do_dct = jpeg_fdct_ifast;
break;
#endif
#ifdef DCT_FLOAT_SUPPORTED
case JDCT_FLOAT:
fdct->pub.forward_DCT = forward_DCT_float;
fdct->do_float_dct = jpeg_fdct_float;
break;
#endif
default:
ERREXIT(cinfo, JERR_NOT_COMPILED);
break;
}
/* Mark divisor tables unallocated */
for (i = 0; i < NUM_QUANT_TBLS; i++) {
fdct->divisors[i] = NULL;
+875 -208
View File
File diff suppressed because it is too large Load Diff
-47
View File
@@ -1,47 +0,0 @@
/*
* jchuff.h
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains declarations for Huffman entropy encoding routines
* that are shared between the sequential encoder (jchuff.c) and the
* progressive encoder (jcphuff.c). No other modules need to see these.
*/
/* The legal range of a DCT coefficient is
* -1024 .. +1023 for 8-bit data;
* -16384 .. +16383 for 12-bit data.
* Hence the magnitude should always fit in 10 or 14 bits respectively.
*/
#if BITS_IN_JSAMPLE == 8
#define MAX_COEF_BITS 10
#else
#define MAX_COEF_BITS 14
#endif
/* Derived data constructed for each Huffman table */
typedef struct {
unsigned int ehufco[256]; /* code for each symbol */
char ehufsi[256]; /* length of code for each symbol */
/* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */
} c_derived_tbl;
/* Short forms of external names for systems with brain-damaged linkers. */
#ifdef NEED_SHORT_EXTERNAL_NAMES
#define jpeg_make_c_derived_tbl jMkCDerived
#define jpeg_gen_optimal_table jGenOptTbl
#endif /* NEED_SHORT_EXTERNAL_NAMES */
/* Expand a Huffman table definition into the derived format */
EXTERN(void) jpeg_make_c_derived_tbl
JPP((j_compress_ptr cinfo, boolean isDC, int tblno,
c_derived_tbl ** pdtbl));
/* Generate an optimal table definition given the specified counts */
EXTERN(void) jpeg_gen_optimal_table
JPP((j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]));
+5 -12
View File
@@ -41,22 +41,15 @@ jinit_compress_master (j_compress_ptr cinfo)
/* Forward DCT */
jinit_forward_dct(cinfo);
/* Entropy encoding: either Huffman or arithmetic coding. */
if (cinfo->arith_code) {
ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
} else {
if (cinfo->progressive_mode) {
#ifdef C_PROGRESSIVE_SUPPORTED
jinit_phuff_encoder(cinfo);
#else
ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif
} else
jinit_huff_encoder(cinfo);
if (cinfo->arith_code)
jinit_arith_encoder(cinfo);
else {
jinit_huff_encoder(cinfo);
}
/* Need a full-image coefficient buffer in any multi-pass mode. */
jinit_c_coef_controller(cinfo,
(boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding));
(boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding));
jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */);
jinit_marker_writer(cinfo);
+94 -90
View File
@@ -2,11 +2,12 @@
* jcmainct.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2003-2012 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains the main_ptr buffer controller for compression.
* The main_ptr buffer lies between the pre-processor and the JPEG
* This file contains the main buffer controller for compression.
* The main buffer lies between the pre-processor and the JPEG
* compressor proper; it holds downsampled data in the JPEG colorspace.
*/
@@ -52,12 +53,12 @@ typedef my_main_controller * my_main_ptr;
/* Forward declarations */
METHODDEF(void) process_data_simple_main
JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));
JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));
#ifdef FULL_MAIN_BUFFER_SUPPORTED
METHODDEF(void) process_data_buffer_main
JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));
JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));
#endif
@@ -68,32 +69,32 @@ METHODDEF(void) process_data_buffer_main
METHODDEF(void)
start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
{
my_main_ptr main_ptr = (my_main_ptr) cinfo->main;
my_main_ptr mainp = (my_main_ptr) cinfo->main;
/* Do nothing in raw-data mode. */
if (cinfo->raw_data_in)
return;
main_ptr->cur_iMCU_row = 0; /* initialize counters */
main_ptr->rowgroup_ctr = 0;
main_ptr->suspended = FALSE;
main_ptr->pass_mode = pass_mode; /* save mode for use by process_data */
mainp->cur_iMCU_row = 0; /* initialize counters */
mainp->rowgroup_ctr = 0;
mainp->suspended = FALSE;
mainp->pass_mode = pass_mode; /* save mode for use by process_data */
switch (pass_mode) {
case JBUF_PASS_THRU:
#ifdef FULL_MAIN_BUFFER_SUPPORTED
if (main_ptr->whole_image[0] != NULL)
if (mainp->whole_image[0] != NULL)
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
#endif
main_ptr->pub.process_data = process_data_simple_main;
mainp->pub.process_data = process_data_simple_main;
break;
#ifdef FULL_MAIN_BUFFER_SUPPORTED
case JBUF_SAVE_SOURCE:
case JBUF_CRANK_DEST:
case JBUF_SAVE_AND_PASS:
if (main_ptr->whole_image[0] == NULL)
if (mainp->whole_image[0] == NULL)
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
main_ptr->pub.process_data = process_data_buffer_main;
mainp->pub.process_data = process_data_buffer_main;
break;
#endif
default:
@@ -111,49 +112,49 @@ start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
METHODDEF(void)
process_data_simple_main (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
JDIMENSION in_rows_avail)
JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
JDIMENSION in_rows_avail)
{
my_main_ptr main_ptr = (my_main_ptr) cinfo->main;
my_main_ptr mainp = (my_main_ptr) cinfo->main;
while (main_ptr->cur_iMCU_row < cinfo->total_iMCU_rows) {
/* Read input data if we haven't filled the main_ptr buffer yet */
if (main_ptr->rowgroup_ctr < DCTSIZE)
while (mainp->cur_iMCU_row < cinfo->total_iMCU_rows) {
/* Read input data if we haven't filled the main buffer yet */
if (mainp->rowgroup_ctr < (JDIMENSION) cinfo->min_DCT_v_scaled_size)
(*cinfo->prep->pre_process_data) (cinfo,
input_buf, in_row_ctr, in_rows_avail,
main_ptr->buffer, &main_ptr->rowgroup_ctr,
(JDIMENSION) DCTSIZE);
input_buf, in_row_ctr, in_rows_avail,
mainp->buffer, &mainp->rowgroup_ctr,
(JDIMENSION) cinfo->min_DCT_v_scaled_size);
/* If we don't have a full iMCU row buffered, return to application for
* more data. Note that preprocessor will always pad to fill the iMCU row
* at the bottom of the image.
*/
if (main_ptr->rowgroup_ctr != DCTSIZE)
if (mainp->rowgroup_ctr != (JDIMENSION) cinfo->min_DCT_v_scaled_size)
return;
/* Send the completed row to the compressor */
if (! (*cinfo->coef->compress_data) (cinfo, main_ptr->buffer)) {
if (! (*cinfo->coef->compress_data) (cinfo, mainp->buffer)) {
/* If compressor did not consume the whole row, then we must need to
* suspend processing and return to the application. In this situation
* we pretend we didn't yet consume the last input row; otherwise, if
* it happened to be the last row of the image, the application would
* think we were done.
*/
if (! main_ptr->suspended) {
(*in_row_ctr)--;
main_ptr->suspended = TRUE;
if (! mainp->suspended) {
(*in_row_ctr)--;
mainp->suspended = TRUE;
}
return;
}
/* We did finish the row. Undo our little suspension hack if a previous
* call suspended; then mark the main_ptr buffer empty.
* call suspended; then mark the main buffer empty.
*/
if (main_ptr->suspended) {
if (mainp->suspended) {
(*in_row_ctr)++;
main_ptr->suspended = FALSE;
mainp->suspended = FALSE;
}
main_ptr->rowgroup_ctr = 0;
main_ptr->cur_iMCU_row++;
mainp->rowgroup_ctr = 0;
mainp->cur_iMCU_row++;
}
}
@@ -167,28 +168,30 @@ process_data_simple_main (j_compress_ptr cinfo,
METHODDEF(void)
process_data_buffer_main (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
JDIMENSION in_rows_avail)
JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
JDIMENSION in_rows_avail)
{
my_main_ptr main_ptr = (my_main_ptr) cinfo->main;
my_main_ptr mainp = (my_main_ptr) cinfo->main;
int ci;
jpeg_component_info *compptr;
boolean writing = (main_ptr->pass_mode != JBUF_CRANK_DEST);
boolean writing = (mainp->pass_mode != JBUF_CRANK_DEST);
while (main_ptr->cur_iMCU_row < cinfo->total_iMCU_rows) {
while (mainp->cur_iMCU_row < cinfo->total_iMCU_rows) {
/* Realign the virtual buffers if at the start of an iMCU row. */
if (main_ptr->rowgroup_ctr == 0) {
if (mainp->rowgroup_ctr == 0) {
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
main_ptr->buffer[ci] = (*cinfo->mem->access_virt_sarray)
((j_common_ptr) cinfo, main_ptr->whole_image[ci],
main_ptr->cur_iMCU_row * (compptr->v_samp_factor * DCTSIZE),
(JDIMENSION) (compptr->v_samp_factor * DCTSIZE), writing);
ci++, compptr++) {
mainp->buffer[ci] = (*cinfo->mem->access_virt_sarray)
((j_common_ptr) cinfo, mainp->whole_image[ci], mainp->cur_iMCU_row *
((JDIMENSION) (compptr->v_samp_factor * cinfo->min_DCT_v_scaled_size)),
(JDIMENSION) (compptr->v_samp_factor * cinfo->min_DCT_v_scaled_size),
writing);
}
/* In a read pass, pretend we just read some source data. */
if (! writing) {
*in_row_ctr += cinfo->max_v_samp_factor * DCTSIZE;
main_ptr->rowgroup_ctr = DCTSIZE;
*in_row_ctr += (JDIMENSION)
(cinfo->max_v_samp_factor * cinfo->min_DCT_v_scaled_size);
mainp->rowgroup_ctr = (JDIMENSION) cinfo->min_DCT_v_scaled_size;
}
}
@@ -196,41 +199,41 @@ process_data_buffer_main (j_compress_ptr cinfo,
/* Note: preprocessor will pad if necessary to fill the last iMCU row. */
if (writing) {
(*cinfo->prep->pre_process_data) (cinfo,
input_buf, in_row_ctr, in_rows_avail,
main_ptr->buffer, &main_ptr->rowgroup_ctr,
(JDIMENSION) DCTSIZE);
input_buf, in_row_ctr, in_rows_avail,
mainp->buffer, &mainp->rowgroup_ctr,
(JDIMENSION) cinfo->min_DCT_v_scaled_size);
/* Return to application if we need more data to fill the iMCU row. */
if (main_ptr->rowgroup_ctr < DCTSIZE)
return;
if (mainp->rowgroup_ctr < (JDIMENSION) cinfo->min_DCT_v_scaled_size)
return;
}
/* Emit data, unless this is a sink-only pass. */
if (main_ptr->pass_mode != JBUF_SAVE_SOURCE) {
if (! (*cinfo->coef->compress_data) (cinfo, main_ptr->buffer)) {
/* If compressor did not consume the whole row, then we must need to
* suspend processing and return to the application. In this situation
* we pretend we didn't yet consume the last input row; otherwise, if
* it happened to be the last row of the image, the application would
* think we were done.
*/
if (! main_ptr->suspended) {
(*in_row_ctr)--;
main_ptr->suspended = TRUE;
}
return;
if (mainp->pass_mode != JBUF_SAVE_SOURCE) {
if (! (*cinfo->coef->compress_data) (cinfo, mainp->buffer)) {
/* If compressor did not consume the whole row, then we must need to
* suspend processing and return to the application. In this situation
* we pretend we didn't yet consume the last input row; otherwise, if
* it happened to be the last row of the image, the application would
* think we were done.
*/
if (! mainp->suspended) {
(*in_row_ctr)--;
mainp->suspended = TRUE;
}
return;
}
/* We did finish the row. Undo our little suspension hack if a previous
* call suspended; then mark the main_ptr buffer empty.
* call suspended; then mark the main buffer empty.
*/
if (main_ptr->suspended) {
(*in_row_ctr)++;
main_ptr->suspended = FALSE;
if (mainp->suspended) {
(*in_row_ctr)++;
mainp->suspended = FALSE;
}
}
/* If get here, we are done with this iMCU row. Mark buffer empty. */
main_ptr->rowgroup_ctr = 0;
main_ptr->cur_iMCU_row++;
mainp->rowgroup_ctr = 0;
mainp->cur_iMCU_row++;
}
}
@@ -238,21 +241,21 @@ process_data_buffer_main (j_compress_ptr cinfo,
/*
* Initialize main_ptr buffer controller.
* Initialize main buffer controller.
*/
GLOBAL(void)
jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer)
{
my_main_ptr main_ptr;
my_main_ptr mainp;
int ci;
jpeg_component_info *compptr;
main_ptr = (my_main_ptr)
mainp = (my_main_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_main_controller));
cinfo->main = (struct jpeg_c_main_controller *) main_ptr;
main_ptr->pub.start_pass = start_pass_main;
SIZEOF(my_main_controller));
cinfo->main = &mainp->pub;
mainp->pub.start_pass = start_pass_main;
/* We don't need to create a buffer in raw-data mode. */
if (cinfo->raw_data_in)
@@ -266,28 +269,29 @@ jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer)
/* Allocate a full-image virtual array for each component */
/* Note we pad the bottom to a multiple of the iMCU height */
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
main_ptr->whole_image[ci] = (*cinfo->mem->request_virt_sarray)
((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
compptr->width_in_blocks * DCTSIZE,
(JDIMENSION) jround_up((long) compptr->height_in_blocks,
(long) compptr->v_samp_factor) * DCTSIZE,
(JDIMENSION) (compptr->v_samp_factor * DCTSIZE));
ci++, compptr++) {
mainp->whole_image[ci] = (*cinfo->mem->request_virt_sarray)
((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
compptr->width_in_blocks * ((JDIMENSION) compptr->DCT_h_scaled_size),
((JDIMENSION) jround_up((long) compptr->height_in_blocks,
(long) compptr->v_samp_factor)) *
((JDIMENSION) cinfo->min_DCT_v_scaled_size),
(JDIMENSION) (compptr->v_samp_factor * compptr->DCT_v_scaled_size));
}
#else
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
#endif
} else {
#ifdef FULL_MAIN_BUFFER_SUPPORTED
main_ptr->whole_image[0] = NULL; /* flag for no virtual arrays */
mainp->whole_image[0] = NULL; /* flag for no virtual arrays */
#endif
/* Allocate a strip buffer for each component */
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
main_ptr->buffer[ci] = (*cinfo->mem->alloc_sarray)
((j_common_ptr) cinfo, JPOOL_IMAGE,
compptr->width_in_blocks * DCTSIZE,
(JDIMENSION) (compptr->v_samp_factor * DCTSIZE));
ci++, compptr++) {
mainp->buffer[ci] = (*cinfo->mem->alloc_sarray)
((j_common_ptr) cinfo, JPOOL_IMAGE,
compptr->width_in_blocks * ((JDIMENSION) compptr->DCT_h_scaled_size),
(JDIMENSION) (compptr->v_samp_factor * compptr->DCT_v_scaled_size));
}
}
}
+114 -59
View File
@@ -2,6 +2,7 @@
* jcmarker.c
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2003-2012 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -72,6 +73,7 @@ typedef enum { /* JPEG marker codes */
M_APP15 = 0xef,
M_JPG0 = 0xf0,
M_JPG8 = 0xf8,
M_JPG13 = 0xfd,
M_COM = 0xfe,
@@ -153,23 +155,24 @@ emit_dqt (j_compress_ptr cinfo, int index)
ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, index);
prec = 0;
for (i = 0; i < DCTSIZE2; i++) {
if (qtbl->quantval[i] > 255)
for (i = 0; i <= cinfo->lim_Se; i++) {
if (qtbl->quantval[cinfo->natural_order[i]] > 255)
prec = 1;
}
if (! qtbl->sent_table) {
emit_marker(cinfo, M_DQT);
emit_2bytes(cinfo, prec ? DCTSIZE2*2 + 1 + 2 : DCTSIZE2 + 1 + 2);
emit_2bytes(cinfo,
prec ? cinfo->lim_Se * 2 + 2 + 1 + 2 : cinfo->lim_Se + 1 + 1 + 2);
emit_byte(cinfo, index + (prec<<4));
for (i = 0; i < DCTSIZE2; i++) {
for (i = 0; i <= cinfo->lim_Se; i++) {
/* The table entries must be emitted in zigzag order. */
unsigned int qval = qtbl->quantval[jpeg_natural_order[i]];
unsigned int qval = qtbl->quantval[cinfo->natural_order[i]];
if (prec)
emit_byte(cinfo, (int) (qval >> 8));
emit_byte(cinfo, (int) (qval >> 8));
emit_byte(cinfo, (int) (qval & 0xFF));
}
@@ -235,26 +238,32 @@ emit_dac (j_compress_ptr cinfo)
for (i = 0; i < cinfo->comps_in_scan; i++) {
compptr = cinfo->cur_comp_info[i];
dc_in_use[compptr->dc_tbl_no] = 1;
ac_in_use[compptr->ac_tbl_no] = 1;
/* DC needs no table for refinement scan */
if (cinfo->Ss == 0 && cinfo->Ah == 0)
dc_in_use[compptr->dc_tbl_no] = 1;
/* AC needs no table when not present */
if (cinfo->Se)
ac_in_use[compptr->ac_tbl_no] = 1;
}
length = 0;
for (i = 0; i < NUM_ARITH_TBLS; i++)
length += dc_in_use[i] + ac_in_use[i];
emit_marker(cinfo, M_DAC);
if (length) {
emit_marker(cinfo, M_DAC);
emit_2bytes(cinfo, length*2 + 2);
emit_2bytes(cinfo, length*2 + 2);
for (i = 0; i < NUM_ARITH_TBLS; i++) {
if (dc_in_use[i]) {
emit_byte(cinfo, i);
emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4));
}
if (ac_in_use[i]) {
emit_byte(cinfo, i + 0x10);
emit_byte(cinfo, cinfo->arith_ac_K[i]);
for (i = 0; i < NUM_ARITH_TBLS; i++) {
if (dc_in_use[i]) {
emit_byte(cinfo, i);
emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4));
}
if (ac_in_use[i]) {
emit_byte(cinfo, i + 0x10);
emit_byte(cinfo, cinfo->arith_ac_K[i]);
}
}
}
#endif /* C_ARITH_CODING_SUPPORTED */
@@ -273,6 +282,37 @@ emit_dri (j_compress_ptr cinfo)
}
LOCAL(void)
emit_lse_ict (j_compress_ptr cinfo)
/* Emit an LSE inverse color transform specification marker */
{
/* Support only 1 transform */
if (cinfo->color_transform != JCT_SUBTRACT_GREEN ||
cinfo->num_components < 3)
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
emit_marker(cinfo, M_JPG8);
emit_2bytes(cinfo, 24); /* fixed length */
emit_byte(cinfo, 0x0D); /* ID inverse transform specification */
emit_2bytes(cinfo, MAXJSAMPLE); /* MAXTRANS */
emit_byte(cinfo, 3); /* Nt=3 */
emit_byte(cinfo, cinfo->comp_info[1].component_id);
emit_byte(cinfo, cinfo->comp_info[0].component_id);
emit_byte(cinfo, cinfo->comp_info[2].component_id);
emit_byte(cinfo, 0x80); /* F1: CENTER1=1, NORM1=0 */
emit_2bytes(cinfo, 0); /* A(1,1)=0 */
emit_2bytes(cinfo, 0); /* A(1,2)=0 */
emit_byte(cinfo, 0); /* F2: CENTER2=0, NORM2=0 */
emit_2bytes(cinfo, 1); /* A(2,1)=1 */
emit_2bytes(cinfo, 0); /* A(2,2)=0 */
emit_byte(cinfo, 0); /* F3: CENTER3=0, NORM3=0 */
emit_2bytes(cinfo, 1); /* A(3,1)=1 */
emit_2bytes(cinfo, 0); /* A(3,2)=0 */
}
LOCAL(void)
emit_sof (j_compress_ptr cinfo, JPEG_MARKER code)
/* Emit a SOF marker */
@@ -285,13 +325,13 @@ emit_sof (j_compress_ptr cinfo, JPEG_MARKER code)
emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */
/* Make sure image isn't bigger than SOF field can handle */
if ((long) cinfo->image_height > 65535L ||
(long) cinfo->image_width > 65535L)
if ((long) cinfo->jpeg_height > 65535L ||
(long) cinfo->jpeg_width > 65535L)
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) 65535);
emit_byte(cinfo, cinfo->data_precision);
emit_2bytes(cinfo, (int) cinfo->image_height);
emit_2bytes(cinfo, (int) cinfo->image_width);
emit_2bytes(cinfo, (int) cinfo->jpeg_height);
emit_2bytes(cinfo, (int) cinfo->jpeg_width);
emit_byte(cinfo, cinfo->num_components);
@@ -320,22 +360,16 @@ emit_sos (j_compress_ptr cinfo)
for (i = 0; i < cinfo->comps_in_scan; i++) {
compptr = cinfo->cur_comp_info[i];
emit_byte(cinfo, compptr->component_id);
td = compptr->dc_tbl_no;
ta = compptr->ac_tbl_no;
if (cinfo->progressive_mode) {
/* Progressive mode: only DC or only AC tables are used in one scan;
* furthermore, Huffman coding of DC refinement uses no table at all.
* We emit 0 for unused field(s); this is recommended by the P&M text
* but does not seem to be specified in the standard.
*/
if (cinfo->Ss == 0) {
ta = 0; /* DC scan */
if (cinfo->Ah != 0 && !cinfo->arith_code)
td = 0; /* no DC table either */
} else {
td = 0; /* AC scan */
}
}
/* We emit 0 for unused field(s); this is recommended by the P&M text
* but does not seem to be specified in the standard.
*/
/* DC needs no table for refinement scan */
td = cinfo->Ss == 0 && cinfo->Ah == 0 ? compptr->dc_tbl_no : 0;
/* AC needs no table when not present */
ta = cinfo->Se ? compptr->ac_tbl_no : 0;
emit_byte(cinfo, (td << 4) + ta);
}
@@ -345,6 +379,22 @@ emit_sos (j_compress_ptr cinfo)
}
LOCAL(void)
emit_pseudo_sos (j_compress_ptr cinfo)
/* Emit a pseudo SOS marker */
{
emit_marker(cinfo, M_SOS);
emit_2bytes(cinfo, 2 + 1 + 3); /* length */
emit_byte(cinfo, 0); /* Ns */
emit_byte(cinfo, 0); /* Ss */
emit_byte(cinfo, cinfo->block_size * cinfo->block_size - 1); /* Se */
emit_byte(cinfo, 0); /* Ah/Al */
}
LOCAL(void)
emit_jfif_app0 (j_compress_ptr cinfo)
/* Emit a JFIF-compliant APP0 marker */
@@ -484,7 +534,8 @@ write_file_header (j_compress_ptr cinfo)
/*
* Write frame header.
* This consists of DQT and SOFn markers.
* This consists of DQT and SOFn markers,
* a conditional LSE marker and a conditional pseudo SOS marker.
* Note that we do not emit the SOF until we have emitted the DQT(s).
* This avoids compatibility problems with incorrect implementations that
* try to error-check the quant table numbers as soon as they see the SOF.
@@ -511,14 +562,14 @@ write_frame_header (j_compress_ptr cinfo)
* Note we assume that Huffman table numbers won't be changed later.
*/
if (cinfo->arith_code || cinfo->progressive_mode ||
cinfo->data_precision != 8) {
cinfo->data_precision != 8 || cinfo->block_size != DCTSIZE) {
is_baseline = FALSE;
} else {
is_baseline = TRUE;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
ci++, compptr++) {
if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1)
is_baseline = FALSE;
is_baseline = FALSE;
}
if (prec && is_baseline) {
is_baseline = FALSE;
@@ -529,7 +580,10 @@ write_frame_header (j_compress_ptr cinfo)
/* Emit the proper SOF marker */
if (cinfo->arith_code) {
emit_sof(cinfo, M_SOF9); /* SOF code for arithmetic coding */
if (cinfo->progressive_mode)
emit_sof(cinfo, M_SOF10); /* SOF code for progressive arithmetic */
else
emit_sof(cinfo, M_SOF9); /* SOF code for sequential arithmetic */
} else {
if (cinfo->progressive_mode)
emit_sof(cinfo, M_SOF2); /* SOF code for progressive Huffman */
@@ -538,6 +592,14 @@ write_frame_header (j_compress_ptr cinfo)
else
emit_sof(cinfo, M_SOF1); /* SOF code for non-baseline Huffman file */
}
/* Check to emit LSE inverse color transform specification marker */
if (cinfo->color_transform)
emit_lse_ict(cinfo);
/* Check to emit pseudo SOS marker */
if (cinfo->progressive_mode && cinfo->block_size != DCTSIZE)
emit_pseudo_sos(cinfo);
}
@@ -566,19 +628,12 @@ write_scan_header (j_compress_ptr cinfo)
*/
for (i = 0; i < cinfo->comps_in_scan; i++) {
compptr = cinfo->cur_comp_info[i];
if (cinfo->progressive_mode) {
/* Progressive mode: only DC or only AC tables are used in one scan */
if (cinfo->Ss == 0) {
if (cinfo->Ah == 0) /* DC needs no table for refinement scan */
/* DC needs no table for refinement scan */
if (cinfo->Ss == 0 && cinfo->Ah == 0)
emit_dht(cinfo, compptr->dc_tbl_no, FALSE);
} else {
emit_dht(cinfo, compptr->ac_tbl_no, TRUE);
}
} else {
/* Sequential mode: need both DC and AC tables */
emit_dht(cinfo, compptr->dc_tbl_no, FALSE);
emit_dht(cinfo, compptr->ac_tbl_no, TRUE);
}
/* AC needs no table when not present */
if (cinfo->Se)
emit_dht(cinfo, compptr->ac_tbl_no, TRUE);
}
}
@@ -627,9 +682,9 @@ write_tables_only (j_compress_ptr cinfo)
if (! cinfo->arith_code) {
for (i = 0; i < NUM_HUFF_TBLS; i++) {
if (cinfo->dc_huff_tbl_ptrs[i] != NULL)
emit_dht(cinfo, i, FALSE);
emit_dht(cinfo, i, FALSE);
if (cinfo->ac_huff_tbl_ptrs[i] != NULL)
emit_dht(cinfo, i, TRUE);
emit_dht(cinfo, i, TRUE);
}
}
@@ -649,8 +704,8 @@ jinit_marker_writer (j_compress_ptr cinfo)
/* Create the subobject */
marker = (my_marker_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_marker_writer));
cinfo->marker = (struct jpeg_marker_writer *) marker;
SIZEOF(my_marker_writer));
cinfo->marker = &marker->pub;
/* Initialize method pointers */
marker->pub.write_file_header = write_file_header;
marker->pub.write_frame_header = write_frame_header;
+350 -82
View File
@@ -2,6 +2,7 @@
* jcmaster.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2003-2011 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -19,9 +20,9 @@
/* Private state */
typedef enum {
main_pass, /* input data, also do first output step */
huff_opt_pass, /* Huffman code optimization pass */
output_pass /* data output pass */
main_pass, /* input data, also do first output step */
huff_opt_pass, /* Huffman code optimization pass */
output_pass /* data output pass */
} c_pass_type;
typedef struct {
@@ -42,23 +43,220 @@ typedef my_comp_master * my_master_ptr;
* Support routines that do various essential calculations.
*/
LOCAL(void)
initial_setup (j_compress_ptr cinfo)
/*
* Compute JPEG image dimensions and related values.
* NOTE: this is exported for possible use by application.
* Hence it mustn't do anything that can't be done twice.
*/
GLOBAL(void)
jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo)
/* Do computations that are needed before master selection phase */
{
int ci;
#ifdef DCT_SCALING_SUPPORTED
/* Sanity check on input image dimensions to prevent overflow in
* following calculation.
* We do check jpeg_width and jpeg_height in initial_setup below,
* but image_width and image_height can come from arbitrary data,
* and we need some space for multiplication by block_size.
*/
if (((long) cinfo->image_width >> 24) || ((long) cinfo->image_height >> 24))
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
/* Compute actual JPEG image dimensions and DCT scaling choices. */
if (cinfo->scale_num >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/1 scaling */
cinfo->jpeg_width = cinfo->image_width * cinfo->block_size;
cinfo->jpeg_height = cinfo->image_height * cinfo->block_size;
cinfo->min_DCT_h_scaled_size = 1;
cinfo->min_DCT_v_scaled_size = 1;
} else if (cinfo->scale_num * 2 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/2 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 2L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 2L);
cinfo->min_DCT_h_scaled_size = 2;
cinfo->min_DCT_v_scaled_size = 2;
} else if (cinfo->scale_num * 3 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/3 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 3L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 3L);
cinfo->min_DCT_h_scaled_size = 3;
cinfo->min_DCT_v_scaled_size = 3;
} else if (cinfo->scale_num * 4 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/4 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 4L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 4L);
cinfo->min_DCT_h_scaled_size = 4;
cinfo->min_DCT_v_scaled_size = 4;
} else if (cinfo->scale_num * 5 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/5 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 5L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 5L);
cinfo->min_DCT_h_scaled_size = 5;
cinfo->min_DCT_v_scaled_size = 5;
} else if (cinfo->scale_num * 6 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/6 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 6L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 6L);
cinfo->min_DCT_h_scaled_size = 6;
cinfo->min_DCT_v_scaled_size = 6;
} else if (cinfo->scale_num * 7 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/7 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 7L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 7L);
cinfo->min_DCT_h_scaled_size = 7;
cinfo->min_DCT_v_scaled_size = 7;
} else if (cinfo->scale_num * 8 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/8 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 8L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 8L);
cinfo->min_DCT_h_scaled_size = 8;
cinfo->min_DCT_v_scaled_size = 8;
} else if (cinfo->scale_num * 9 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/9 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 9L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 9L);
cinfo->min_DCT_h_scaled_size = 9;
cinfo->min_DCT_v_scaled_size = 9;
} else if (cinfo->scale_num * 10 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/10 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 10L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 10L);
cinfo->min_DCT_h_scaled_size = 10;
cinfo->min_DCT_v_scaled_size = 10;
} else if (cinfo->scale_num * 11 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/11 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 11L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 11L);
cinfo->min_DCT_h_scaled_size = 11;
cinfo->min_DCT_v_scaled_size = 11;
} else if (cinfo->scale_num * 12 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/12 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 12L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 12L);
cinfo->min_DCT_h_scaled_size = 12;
cinfo->min_DCT_v_scaled_size = 12;
} else if (cinfo->scale_num * 13 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/13 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 13L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 13L);
cinfo->min_DCT_h_scaled_size = 13;
cinfo->min_DCT_v_scaled_size = 13;
} else if (cinfo->scale_num * 14 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/14 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 14L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 14L);
cinfo->min_DCT_h_scaled_size = 14;
cinfo->min_DCT_v_scaled_size = 14;
} else if (cinfo->scale_num * 15 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/15 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 15L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 15L);
cinfo->min_DCT_h_scaled_size = 15;
cinfo->min_DCT_v_scaled_size = 15;
} else {
/* Provide block_size/16 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 16L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 16L);
cinfo->min_DCT_h_scaled_size = 16;
cinfo->min_DCT_v_scaled_size = 16;
}
#else /* !DCT_SCALING_SUPPORTED */
/* Hardwire it to "no scaling" */
cinfo->jpeg_width = cinfo->image_width;
cinfo->jpeg_height = cinfo->image_height;
cinfo->min_DCT_h_scaled_size = DCTSIZE;
cinfo->min_DCT_v_scaled_size = DCTSIZE;
#endif /* DCT_SCALING_SUPPORTED */
}
LOCAL(void)
jpeg_calc_trans_dimensions (j_compress_ptr cinfo)
{
if (cinfo->min_DCT_h_scaled_size != cinfo->min_DCT_v_scaled_size)
ERREXIT2(cinfo, JERR_BAD_DCTSIZE,
cinfo->min_DCT_h_scaled_size, cinfo->min_DCT_v_scaled_size);
cinfo->block_size = cinfo->min_DCT_h_scaled_size;
}
LOCAL(void)
initial_setup (j_compress_ptr cinfo, boolean transcode_only)
/* Do computations that are needed before master selection phase */
{
int ci, ssize;
jpeg_component_info *compptr;
long samplesperrow;
JDIMENSION jd_samplesperrow;
if (transcode_only)
jpeg_calc_trans_dimensions(cinfo);
else
jpeg_calc_jpeg_dimensions(cinfo);
/* Sanity check on block_size */
if (cinfo->block_size < 1 || cinfo->block_size > 16)
ERREXIT2(cinfo, JERR_BAD_DCTSIZE, cinfo->block_size, cinfo->block_size);
/* Derive natural_order from block_size */
switch (cinfo->block_size) {
case 2: cinfo->natural_order = jpeg_natural_order2; break;
case 3: cinfo->natural_order = jpeg_natural_order3; break;
case 4: cinfo->natural_order = jpeg_natural_order4; break;
case 5: cinfo->natural_order = jpeg_natural_order5; break;
case 6: cinfo->natural_order = jpeg_natural_order6; break;
case 7: cinfo->natural_order = jpeg_natural_order7; break;
default: cinfo->natural_order = jpeg_natural_order; break;
}
/* Derive lim_Se from block_size */
cinfo->lim_Se = cinfo->block_size < DCTSIZE ?
cinfo->block_size * cinfo->block_size - 1 : DCTSIZE2-1;
/* Sanity check on image dimensions */
if (cinfo->image_height <= 0 || cinfo->image_width <= 0
|| cinfo->num_components <= 0 || cinfo->input_components <= 0)
if (cinfo->jpeg_height <= 0 || cinfo->jpeg_width <= 0 ||
cinfo->num_components <= 0 || cinfo->input_components <= 0)
ERREXIT(cinfo, JERR_EMPTY_IMAGE);
/* Make sure image isn't bigger than I can handle */
if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION ||
(long) cinfo->image_width > (long) JPEG_MAX_DIMENSION)
if ((long) cinfo->jpeg_height > (long) JPEG_MAX_DIMENSION ||
(long) cinfo->jpeg_width > (long) JPEG_MAX_DIMENSION)
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
/* Width of an input scanline must be representable as JDIMENSION. */
@@ -74,7 +272,7 @@ initial_setup (j_compress_ptr cinfo)
/* Check that number of components won't exceed internal array sizes */
if (cinfo->num_components > MAX_COMPONENTS)
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
MAX_COMPONENTS);
MAX_COMPONENTS);
/* Compute maximum sampling factors; check factor validity */
cinfo->max_h_samp_factor = 1;
@@ -82,12 +280,12 @@ initial_setup (j_compress_ptr cinfo)
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||
compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)
compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)
ERREXIT(cinfo, JERR_BAD_SAMPLING);
cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
compptr->h_samp_factor);
compptr->h_samp_factor);
cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,
compptr->v_samp_factor);
compptr->v_samp_factor);
}
/* Compute dimensions of components */
@@ -95,22 +293,52 @@ initial_setup (j_compress_ptr cinfo)
ci++, compptr++) {
/* Fill in the correct component_index value; don't rely on application */
compptr->component_index = ci;
/* For compression, we never do DCT scaling. */
compptr->DCT_scaled_size = DCTSIZE;
/* In selecting the actual DCT scaling for each component, we try to
* scale down the chroma components via DCT scaling rather than downsampling.
* This saves time if the downsampler gets to use 1:1 scaling.
* Note this code adapts subsampling ratios which are powers of 2.
*/
ssize = 1;
#ifdef DCT_SCALING_SUPPORTED
while (cinfo->min_DCT_h_scaled_size * ssize <=
(cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) &&
(cinfo->max_h_samp_factor % (compptr->h_samp_factor * ssize * 2)) == 0) {
ssize = ssize * 2;
}
#endif
compptr->DCT_h_scaled_size = cinfo->min_DCT_h_scaled_size * ssize;
ssize = 1;
#ifdef DCT_SCALING_SUPPORTED
while (cinfo->min_DCT_v_scaled_size * ssize <=
(cinfo->do_fancy_downsampling ? DCTSIZE : DCTSIZE / 2) &&
(cinfo->max_v_samp_factor % (compptr->v_samp_factor * ssize * 2)) == 0) {
ssize = ssize * 2;
}
#endif
compptr->DCT_v_scaled_size = cinfo->min_DCT_v_scaled_size * ssize;
/* We don't support DCT ratios larger than 2. */
if (compptr->DCT_h_scaled_size > compptr->DCT_v_scaled_size * 2)
compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size * 2;
else if (compptr->DCT_v_scaled_size > compptr->DCT_h_scaled_size * 2)
compptr->DCT_v_scaled_size = compptr->DCT_h_scaled_size * 2;
/* Size in DCT blocks */
compptr->width_in_blocks = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
(long) (cinfo->max_h_samp_factor * DCTSIZE));
jdiv_round_up((long) cinfo->jpeg_width * (long) compptr->h_samp_factor,
(long) (cinfo->max_h_samp_factor * cinfo->block_size));
compptr->height_in_blocks = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
(long) (cinfo->max_v_samp_factor * DCTSIZE));
jdiv_round_up((long) cinfo->jpeg_height * (long) compptr->v_samp_factor,
(long) (cinfo->max_v_samp_factor * cinfo->block_size));
/* Size in samples */
compptr->downsampled_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,
(long) cinfo->max_h_samp_factor);
jdiv_round_up((long) cinfo->jpeg_width *
(long) (compptr->h_samp_factor * compptr->DCT_h_scaled_size),
(long) (cinfo->max_h_samp_factor * cinfo->block_size));
compptr->downsampled_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,
(long) cinfo->max_v_samp_factor);
jdiv_round_up((long) cinfo->jpeg_height *
(long) (compptr->v_samp_factor * compptr->DCT_v_scaled_size),
(long) (cinfo->max_v_samp_factor * cinfo->block_size));
/* Mark component needed (this flag isn't actually used for compression) */
compptr->component_needed = TRUE;
}
@@ -119,8 +347,8 @@ initial_setup (j_compress_ptr cinfo)
* main controller will call coefficient controller).
*/
cinfo->total_iMCU_rows = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height,
(long) (cinfo->max_v_samp_factor*DCTSIZE));
jdiv_round_up((long) cinfo->jpeg_height,
(long) (cinfo->max_v_samp_factor * cinfo->block_size));
}
@@ -155,7 +383,7 @@ validate_script (j_compress_ptr cinfo)
last_bitpos_ptr = & last_bitpos[0][0];
for (ci = 0; ci < cinfo->num_components; ci++)
for (coefi = 0; coefi < DCTSIZE2; coefi++)
*last_bitpos_ptr++ = -1;
*last_bitpos_ptr++ = -1;
#else
ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif
@@ -173,10 +401,10 @@ validate_script (j_compress_ptr cinfo)
for (ci = 0; ci < ncomps; ci++) {
thisi = scanptr->component_index[ci];
if (thisi < 0 || thisi >= cinfo->num_components)
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
/* Components must appear in SOF order within each scan */
if (ci > 0 && thisi <= scanptr->component_index[ci-1])
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
}
/* Validate progression parameters */
Ss = scanptr->Ss;
@@ -198,43 +426,43 @@ validate_script (j_compress_ptr cinfo)
#define MAX_AH_AL 13
#endif
if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 ||
Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL)
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL)
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
if (Ss == 0) {
if (Se != 0) /* DC and AC together not OK */
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
if (Se != 0) /* DC and AC together not OK */
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
} else {
if (ncomps != 1) /* AC scans must be for only one component */
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
if (ncomps != 1) /* AC scans must be for only one component */
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
}
for (ci = 0; ci < ncomps; ci++) {
last_bitpos_ptr = & last_bitpos[scanptr->component_index[ci]][0];
if (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
for (coefi = Ss; coefi <= Se; coefi++) {
if (last_bitpos_ptr[coefi] < 0) {
/* first scan of this coefficient */
if (Ah != 0)
last_bitpos_ptr = & last_bitpos[scanptr->component_index[ci]][0];
if (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
} else {
/* not first scan */
if (Ah != last_bitpos_ptr[coefi] || Al != Ah-1)
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
}
last_bitpos_ptr[coefi] = Al;
}
for (coefi = Ss; coefi <= Se; coefi++) {
if (last_bitpos_ptr[coefi] < 0) {
/* first scan of this coefficient */
if (Ah != 0)
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
} else {
/* not first scan */
if (Ah != last_bitpos_ptr[coefi] || Al != Ah-1)
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
}
last_bitpos_ptr[coefi] = Al;
}
}
#endif
} else {
/* For sequential JPEG, all progression parameters must be these: */
if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0)
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
/* Make sure components are not sent twice */
for (ci = 0; ci < ncomps; ci++) {
thisi = scanptr->component_index[ci];
if (component_sent[thisi])
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
component_sent[thisi] = TRUE;
thisi = scanptr->component_index[ci];
if (component_sent[thisi])
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
component_sent[thisi] = TRUE;
}
}
}
@@ -249,17 +477,50 @@ validate_script (j_compress_ptr cinfo)
*/
for (ci = 0; ci < cinfo->num_components; ci++) {
if (last_bitpos[ci][0] < 0)
ERREXIT(cinfo, JERR_MISSING_DATA);
ERREXIT(cinfo, JERR_MISSING_DATA);
}
#endif
} else {
for (ci = 0; ci < cinfo->num_components; ci++) {
if (! component_sent[ci])
ERREXIT(cinfo, JERR_MISSING_DATA);
ERREXIT(cinfo, JERR_MISSING_DATA);
}
}
}
LOCAL(void)
reduce_script (j_compress_ptr cinfo)
/* Adapt scan script for use with reduced block size;
* assume that script has been validated before.
*/
{
jpeg_scan_info * scanptr;
int idxout, idxin;
/* Circumvent const declaration for this function */
scanptr = (jpeg_scan_info *) cinfo->scan_info;
idxout = 0;
for (idxin = 0; idxin < cinfo->num_scans; idxin++) {
/* After skipping, idxout becomes smaller than idxin */
if (idxin != idxout)
/* Copy rest of data;
* note we stay in given chunk of allocated memory.
*/
scanptr[idxout] = scanptr[idxin];
if (scanptr[idxout].Ss > cinfo->lim_Se)
/* Entire scan out of range - skip this entry */
continue;
if (scanptr[idxout].Se > cinfo->lim_Se)
/* Limit scan to end of block */
scanptr[idxout].Se = cinfo->lim_Se;
idxout++;
}
cinfo->num_scans = idxout;
}
#endif /* C_MULTISCAN_FILES_SUPPORTED */
@@ -278,12 +539,15 @@ select_scan_parameters (j_compress_ptr cinfo)
cinfo->comps_in_scan = scanptr->comps_in_scan;
for (ci = 0; ci < scanptr->comps_in_scan; ci++) {
cinfo->cur_comp_info[ci] =
&cinfo->comp_info[scanptr->component_index[ci]];
&cinfo->comp_info[scanptr->component_index[ci]];
}
if (cinfo->progressive_mode) {
cinfo->Ss = scanptr->Ss;
cinfo->Se = scanptr->Se;
cinfo->Ah = scanptr->Ah;
cinfo->Al = scanptr->Al;
return;
}
cinfo->Ss = scanptr->Ss;
cinfo->Se = scanptr->Se;
cinfo->Ah = scanptr->Ah;
cinfo->Al = scanptr->Al;
}
else
#endif
@@ -291,16 +555,16 @@ select_scan_parameters (j_compress_ptr cinfo)
/* Prepare for single sequential-JPEG scan containing all components */
if (cinfo->num_components > MAX_COMPS_IN_SCAN)
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
MAX_COMPS_IN_SCAN);
MAX_COMPS_IN_SCAN);
cinfo->comps_in_scan = cinfo->num_components;
for (ci = 0; ci < cinfo->num_components; ci++) {
cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci];
}
cinfo->Ss = 0;
cinfo->Se = DCTSIZE2-1;
cinfo->Ah = 0;
cinfo->Al = 0;
}
cinfo->Ss = 0;
cinfo->Se = cinfo->block_size * cinfo->block_size - 1;
cinfo->Ah = 0;
cinfo->Al = 0;
}
@@ -325,7 +589,7 @@ per_scan_setup (j_compress_ptr cinfo)
compptr->MCU_width = 1;
compptr->MCU_height = 1;
compptr->MCU_blocks = 1;
compptr->MCU_sample_width = DCTSIZE;
compptr->MCU_sample_width = compptr->DCT_h_scaled_size;
compptr->last_col_width = 1;
/* For noninterleaved scans, it is convenient to define last_row_height
* as the number of block rows present in the last iMCU row.
@@ -343,15 +607,15 @@ per_scan_setup (j_compress_ptr cinfo)
/* Interleaved (multi-component) scan */
if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
MAX_COMPS_IN_SCAN);
MAX_COMPS_IN_SCAN);
/* Overall image size in MCUs */
cinfo->MCUs_per_row = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width,
(long) (cinfo->max_h_samp_factor*DCTSIZE));
jdiv_round_up((long) cinfo->jpeg_width,
(long) (cinfo->max_h_samp_factor * cinfo->block_size));
cinfo->MCU_rows_in_scan = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height,
(long) (cinfo->max_v_samp_factor*DCTSIZE));
jdiv_round_up((long) cinfo->jpeg_height,
(long) (cinfo->max_v_samp_factor * cinfo->block_size));
cinfo->blocks_in_MCU = 0;
@@ -361,7 +625,7 @@ per_scan_setup (j_compress_ptr cinfo)
compptr->MCU_width = compptr->h_samp_factor;
compptr->MCU_height = compptr->v_samp_factor;
compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;
compptr->MCU_sample_width = compptr->MCU_width * DCTSIZE;
compptr->MCU_sample_width = compptr->MCU_width * compptr->DCT_h_scaled_size;
/* Figure number of non-dummy blocks in last MCU column & row */
tmp = (int) (compptr->width_in_blocks % compptr->MCU_width);
if (tmp == 0) tmp = compptr->MCU_width;
@@ -372,9 +636,9 @@ per_scan_setup (j_compress_ptr cinfo)
/* Prepare array describing MCU composition */
mcublks = compptr->MCU_blocks;
if (cinfo->blocks_in_MCU + mcublks > C_MAX_BLOCKS_IN_MCU)
ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
while (mcublks-- > 0) {
cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
}
}
@@ -417,8 +681,8 @@ prepare_for_pass (j_compress_ptr cinfo)
(*cinfo->fdct->start_pass) (cinfo);
(*cinfo->entropy->start_pass) (cinfo, cinfo->optimize_coding);
(*cinfo->coef->start_pass) (cinfo,
(master->total_passes > 1 ?
JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
(master->total_passes > 1 ?
JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
(*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);
if (cinfo->optimize_coding) {
/* No immediate data output; postpone writing frame/scan headers */
@@ -433,7 +697,7 @@ prepare_for_pass (j_compress_ptr cinfo)
/* Do Huffman optimization for a scan after the first one. */
select_scan_parameters(cinfo);
per_scan_setup(cinfo);
if (cinfo->Ss != 0 || cinfo->Ah == 0 || cinfo->arith_code) {
if (cinfo->Ss != 0 || cinfo->Ah == 0) {
(*cinfo->entropy->start_pass) (cinfo, TRUE);
(*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);
master->pub.call_pass_startup = FALSE;
@@ -546,7 +810,7 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
master = (my_master_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_comp_master));
SIZEOF(my_comp_master));
cinfo->master = (struct jpeg_comp_master *) master;
master->pub.prepare_for_pass = prepare_for_pass;
master->pub.pass_startup = pass_startup;
@@ -554,11 +818,13 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
master->pub.is_last_pass = FALSE;
/* Validate parameters, determine derived values */
initial_setup(cinfo);
initial_setup(cinfo, transcode_only);
if (cinfo->scan_info != NULL) {
#ifdef C_MULTISCAN_FILES_SUPPORTED
validate_script(cinfo);
if (cinfo->block_size < DCTSIZE)
reduce_script(cinfo);
#else
ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif
@@ -567,8 +833,10 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
cinfo->num_scans = 1;
}
if (cinfo->progressive_mode) /* TEMPORARY HACK ??? */
cinfo->optimize_coding = TRUE; /* assume default tables no good for progressive mode */
if ((cinfo->progressive_mode || cinfo->block_size < DCTSIZE) &&
!cinfo->arith_code) /* TEMPORARY HACK ??? */
/* assume default tables no good for progressive or downscale mode */
cinfo->optimize_coding = TRUE;
/* Initialize my private state */
if (transcode_only) {
+80 -11
View File
@@ -1,40 +1,83 @@
/* jconfig.h. Generated automatically by configure. */
/* jconfig.cfg --- source file edited by configure script */
/* see jconfig.doc for explanations */
#define HAVE_PROTOTYPES
#define HAVE_UNSIGNED_CHAR
#define HAVE_UNSIGNED_SHORT
/*#undef void*/
/*#undef const*/
/* Define this if an ordinary "char" type is unsigned.
* If you're not sure, leaving it undefined will work at some cost in speed.
* If you defined HAVE_UNSIGNED_CHAR then the speed difference is minimal.
*/
#undef CHAR_IS_UNSIGNED
#if defined __MINGW__ || defined __MINGW32__ || (!defined WIN32 && !defined _WIN32)
/* Define this if your system has an ANSI-conforming <stddef.h> file.
*/
#define HAVE_STDDEF_H
/* Define this if your system has an ANSI-conforming <stdlib.h> file.
*/
#define HAVE_STDLIB_H
#endif
/* Define this if your system does not have an ANSI/SysV <string.h>,
* but does have a BSD-style <strings.h>.
*/
#undef NEED_BSD_STRINGS
/* Define this if your system does not provide typedef size_t in any of the
* ANSI-standard places (stddef.h, stdlib.h, or stdio.h), but places it in
* <sys/types.h> instead.
*/
#undef NEED_SYS_TYPES_H
/* For 80x86 machines, you need to define NEED_FAR_POINTERS,
* unless you are using a large-data memory model or 80386 flat-memory mode.
* On less brain-damaged CPUs this symbol must not be defined.
* (Defining this symbol causes large data structures to be referenced through
* "far" pointers and to be allocated with a special version of malloc.)
*/
#undef NEED_FAR_POINTERS
/* Define this if your linker needs global names to be unique in less
* than the first 15 characters.
*/
#undef NEED_SHORT_EXTERNAL_NAMES
/* Define this if you get warnings about undefined structures. */
/* Although a real ANSI C compiler can deal perfectly well with pointers to
* unspecified structures (see "incomplete types" in the spec), a few pre-ANSI
* and pseudo-ANSI compilers get confused. To keep one of these bozos happy,
* define INCOMPLETE_TYPES_BROKEN. This is not recommended unless you
* actually get "missing structure definition" warnings or errors while
* compiling the JPEG code.
*/
#undef INCOMPLETE_TYPES_BROKEN
#if defined WIN32 || defined _WIN32
/* Define "boolean" as unsigned char, not int, per Windows custom */
/* Define "boolean" as unsigned char, not int, on Windows systems.
*/
#ifdef _WIN32
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
typedef unsigned char boolean;
#endif
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
#endif
/*
* The following options affect code selection within the JPEG library,
* but they don't need to be visible to applications using the library.
* To minimize application namespace pollution, the symbols won't be
* defined unless JPEG_INTERNALS has been defined.
*/
#ifdef JPEG_INTERNALS
/* Define this if your compiler implements ">>" on signed values as a logical
* (unsigned) shift; leave it undefined if ">>" is a signed (arithmetic) shift,
* which is the normal and rational definition.
*/
#undef RIGHT_SHIFT_IS_UNSIGNED
/* These are for configuring the JPEG memory manager. */
#define DEFAULT_MAX_MEM 1073741824
#define DEFAULT_MAX_MEM 1073741824 /*1Gb*/
#if !defined WIN32 && !defined _WIN32
#define INLINE __inline__
@@ -43,14 +86,28 @@ typedef unsigned char boolean;
#endif /* JPEG_INTERNALS */
/*
* The remaining options do not affect the JPEG library proper,
* but only the sample applications cjpeg/djpeg (see cjpeg.c, djpeg.c).
* Other applications can ignore these.
*/
#ifdef JPEG_CJPEG_DJPEG
/* These defines indicate which image (non-JPEG) file formats are allowed. */
#define BMP_SUPPORTED /* BMP image file format */
#define GIF_SUPPORTED /* GIF image file format */
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
#undef RLE_SUPPORTED /* Utah RLE image file format */
#define TARGA_SUPPORTED /* Targa image file format */
/* Define this if you want to name both input and output files on the command
* line, rather than using stdout and optionally stdin. You MUST do this if
* your system can't cope with binary I/O to stdin/stdout. See comments at
* head of cjpeg.c or djpeg.c.
*/
#if defined WIN32 || defined _WIN32
#define TWO_FILE_COMMANDLINE /* optional */
#define USE_SETMODE /* Microsoft has setmode() */
@@ -58,10 +115,22 @@ typedef unsigned char boolean;
#undef TWO_FILE_COMMANDLINE
#endif
/* Define this if your system needs explicit cleanup of temporary files.
* This is crucial under MS-DOS, where the temporary "files" may be areas
* of extended memory; on most other systems it's not as important.
*/
#undef NEED_SIGNAL_CATCHER
/* By default, we open image files with fopen(...,"rb") or fopen(...,"wb").
* This is necessary on systems that distinguish text files from binary files,
* and is harmless on most systems that don't. If you have one of the rare
* systems that complains about the "b" spec, define this symbol.
*/
#undef DONT_USE_B_MODE
/* Define this if you want percent-done progress reports from cjpeg/djpeg. */
/* Define this if you want percent-done progress reports from cjpeg/djpeg.
*/
#undef PROGRESS_REPORT
#endif /* JPEG_CJPEG_DJPEG */
+69 -42
View File
@@ -2,6 +2,7 @@
* jcparam.c
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2003-2012 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -21,8 +22,8 @@
GLOBAL(void)
jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
const unsigned int *basic_table,
int scale_factor, boolean force_baseline)
const unsigned int *basic_table,
int scale_factor, boolean force_baseline)
/* Define a quantization table equal to the basic_table times
* a scale factor (given as a percentage).
* If force_baseline is TRUE, the computed quantization table entries
@@ -60,45 +61,61 @@ jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
}
/* These are the sample quantization tables given in JPEG spec section K.1.
* The spec says that the values given produce "good" quality, and
* when divided by 2, "very good" quality.
*/
static const unsigned int std_luminance_quant_tbl[DCTSIZE2] = {
16, 11, 10, 16, 24, 40, 51, 61,
12, 12, 14, 19, 26, 58, 60, 55,
14, 13, 16, 24, 40, 57, 69, 56,
14, 17, 22, 29, 51, 87, 80, 62,
18, 22, 37, 56, 68, 109, 103, 77,
24, 35, 55, 64, 81, 104, 113, 92,
49, 64, 78, 87, 103, 121, 120, 101,
72, 92, 95, 98, 112, 100, 103, 99
};
static const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = {
17, 18, 24, 47, 99, 99, 99, 99,
18, 21, 26, 66, 99, 99, 99, 99,
24, 26, 56, 99, 99, 99, 99, 99,
47, 66, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99
};
GLOBAL(void)
jpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline)
/* Set or change the 'quality' (quantization) setting, using default tables
* and straight percentage-scaling quality scales.
* This entry point allows different scalings for luminance and chrominance.
*/
{
/* Set up two quantization tables using the specified scaling */
jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,
cinfo->q_scale_factor[0], force_baseline);
jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,
cinfo->q_scale_factor[1], force_baseline);
}
GLOBAL(void)
jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,
boolean force_baseline)
boolean force_baseline)
/* Set or change the 'quality' (quantization) setting, using default tables
* and a straight percentage-scaling quality scale. In most cases it's better
* to use jpeg_set_quality (below); this entry point is provided for
* applications that insist on a linear percentage scaling.
*/
{
/* These are the sample quantization tables given in JPEG spec section K.1.
* The spec says that the values given produce "good" quality, and
* when divided by 2, "very good" quality.
*/
static const unsigned int std_luminance_quant_tbl[DCTSIZE2] = {
16, 11, 10, 16, 24, 40, 51, 61,
12, 12, 14, 19, 26, 58, 60, 55,
14, 13, 16, 24, 40, 57, 69, 56,
14, 17, 22, 29, 51, 87, 80, 62,
18, 22, 37, 56, 68, 109, 103, 77,
24, 35, 55, 64, 81, 104, 113, 92,
49, 64, 78, 87, 103, 121, 120, 101,
72, 92, 95, 98, 112, 100, 103, 99
};
static const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = {
17, 18, 24, 47, 99, 99, 99, 99,
18, 21, 26, 66, 99, 99, 99, 99,
24, 26, 56, 99, 99, 99, 99, 99,
47, 66, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99
};
/* Set up two quantization tables using the specified scaling */
jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,
scale_factor, force_baseline);
scale_factor, force_baseline);
jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,
scale_factor, force_baseline);
scale_factor, force_baseline);
}
@@ -133,7 +150,7 @@ jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)
/* Set or change the 'quality' (quantization) setting, using default tables.
* This is the standard quality-adjusting entry point for typical user
* interfaces; only those who want detailed control over quantization tables
* would use the preceding three routines directly.
* would use the preceding routines directly.
*/
{
/* Convert user 0-100 rating to percentage scaling */
@@ -150,7 +167,7 @@ jpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)
LOCAL(void)
add_huff_table (j_compress_ptr cinfo,
JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
/* Define a Huffman table */
{
int nsymbols, len;
@@ -244,13 +261,13 @@ std_huff_tables (j_compress_ptr cinfo)
0xf9, 0xfa };
add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0],
bits_dc_luminance, val_dc_luminance);
bits_dc_luminance, val_dc_luminance);
add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0],
bits_ac_luminance, val_ac_luminance);
bits_ac_luminance, val_ac_luminance);
add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1],
bits_dc_chrominance, val_dc_chrominance);
bits_dc_chrominance, val_dc_chrominance);
add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1],
bits_ac_chrominance, val_ac_chrominance);
bits_ac_chrominance, val_ac_chrominance);
}
@@ -280,10 +297,12 @@ jpeg_set_defaults (j_compress_ptr cinfo)
if (cinfo->comp_info == NULL)
cinfo->comp_info = (jpeg_component_info *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
MAX_COMPONENTS * SIZEOF(jpeg_component_info));
MAX_COMPONENTS * SIZEOF(jpeg_component_info));
/* Initialize everything not dependent on the color space */
cinfo->scale_num = 1; /* 1:1 scaling */
cinfo->scale_denom = 1;
cinfo->data_precision = BITS_IN_JSAMPLE;
/* Set up two quantization tables using default quality of 75 */
jpeg_set_quality(cinfo, 75, TRUE);
@@ -320,6 +339,9 @@ jpeg_set_defaults (j_compress_ptr cinfo)
/* By default, use the simpler non-cosited sampling alignment */
cinfo->CCIR601_sampling = FALSE;
/* By default, apply fancy downsampling */
cinfo->do_fancy_downsampling = TRUE;
/* No input smoothing */
cinfo->smoothing_factor = 0;
@@ -345,6 +367,9 @@ jpeg_set_defaults (j_compress_ptr cinfo)
cinfo->X_density = 1; /* Pixel aspect ratio is square by default */
cinfo->Y_density = 1;
/* No color transform */
cinfo->color_transform = JCT_NONE;
/* Choose JPEG colorspace based on input space, set defaults accordingly */
jpeg_default_colorspace(cinfo);
@@ -426,7 +451,9 @@ jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */
cinfo->num_components = 3;
SET_COMP(0, 0x52 /* 'R' */, 1,1, 0, 0,0);
SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, 0,0);
SET_COMP(1, 0x47 /* 'G' */, 1,1, 0,
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0);
SET_COMP(2, 0x42 /* 'B' */, 1,1, 0, 0,0);
break;
case JCS_YCbCr:
@@ -458,7 +485,7 @@ jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
cinfo->num_components = cinfo->input_components;
if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS)
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
MAX_COMPONENTS);
MAX_COMPONENTS);
for (ci = 0; ci < cinfo->num_components; ci++) {
SET_COMP(ci, ci, 1,1, 0, 0,0);
}
@@ -473,7 +500,7 @@ jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
LOCAL(jpeg_scan_info *)
fill_a_scan (jpeg_scan_info * scanptr, int ci,
int Ss, int Se, int Ah, int Al)
int Ss, int Se, int Ah, int Al)
/* Support routine: generate one scan for specified component */
{
scanptr->comps_in_scan = 1;
@@ -488,7 +515,7 @@ fill_a_scan (jpeg_scan_info * scanptr, int ci,
LOCAL(jpeg_scan_info *)
fill_scans (jpeg_scan_info * scanptr, int ncomps,
int Ss, int Se, int Ah, int Al)
int Ss, int Se, int Ah, int Al)
/* Support routine: generate one scan for each component */
{
int ci;
@@ -567,7 +594,7 @@ jpeg_simple_progression (j_compress_ptr cinfo)
cinfo->script_space_size = MAX(nscans, 10);
cinfo->script_space = (jpeg_scan_info *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
cinfo->script_space_size * SIZEOF(jpeg_scan_info));
cinfo->script_space_size * SIZEOF(jpeg_scan_info));
}
scanptr = cinfo->script_space;
cinfo->scan_info = scanptr;
-833
View File
@@ -1,833 +0,0 @@
/*
* jcphuff.c
*
* Copyright (C) 1995-1997, Thomas G. Lane.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains Huffman entropy encoding routines for progressive JPEG.
*
* We do not support output suspension in this module, since the library
* currently does not allow multiple-scan files to be written with output
* suspension.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jchuff.h" /* Declarations shared with jchuff.c */
#ifdef C_PROGRESSIVE_SUPPORTED
/* Expanded entropy encoder object for progressive Huffman encoding. */
typedef struct {
struct jpeg_entropy_encoder pub; /* public fields */
/* Mode flag: TRUE for optimization, FALSE for actual data output */
boolean gather_statistics;
/* Bit-level coding status.
* next_output_byte/free_in_buffer are local copies of cinfo->dest fields.
*/
JOCTET * next_output_byte; /* => next byte to write in buffer */
size_t free_in_buffer; /* # of byte spaces remaining in buffer */
INT32 put_buffer; /* current bit-accumulation buffer */
int put_bits; /* # of bits now in it */
j_compress_ptr cinfo; /* link to cinfo (needed for dump_buffer) */
/* Coding status for DC components */
int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
/* Coding status for AC components */
int ac_tbl_no; /* the table number of the single component */
unsigned int EOBRUN; /* run length of EOBs */
unsigned int BE; /* # of buffered correction bits before MCU */
char * bit_buffer; /* buffer for correction bits (1 per char) */
/* packing correction bits tightly would save some space but cost time... */
unsigned int restarts_to_go; /* MCUs left in this restart interval */
int next_restart_num; /* next restart number to write (0-7) */
/* Pointers to derived tables (these workspaces have image lifespan).
* Since any one scan codes only DC or only AC, we only need one set
* of tables, not one for DC and one for AC.
*/
c_derived_tbl * derived_tbls[NUM_HUFF_TBLS];
/* Statistics tables for optimization; again, one set is enough */
long * count_ptrs[NUM_HUFF_TBLS];
} phuff_entropy_encoder;
typedef phuff_entropy_encoder * phuff_entropy_ptr;
/* MAX_CORR_BITS is the number of bits the AC refinement correction-bit
* buffer can hold. Larger sizes may slightly improve compression, but
* 1000 is already well into the realm of overkill.
* The minimum safe size is 64 bits.
*/
#define MAX_CORR_BITS 1000 /* Max # of correction bits I can buffer */
/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32.
* We assume that int right shift is unsigned if INT32 right shift is,
* which should be safe.
*/
#ifdef RIGHT_SHIFT_IS_UNSIGNED
#define ISHIFT_TEMPS int ishift_temp;
#define IRIGHT_SHIFT(x,shft) \
((ishift_temp = (x)) < 0 ? \
(ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \
(ishift_temp >> (shft)))
#else
#define ISHIFT_TEMPS
#define IRIGHT_SHIFT(x,shft) ((x) >> (shft))
#endif
/* Forward declarations */
METHODDEF(boolean) encode_mcu_DC_first JPP((j_compress_ptr cinfo,
JBLOCKROW *MCU_data));
METHODDEF(boolean) encode_mcu_AC_first JPP((j_compress_ptr cinfo,
JBLOCKROW *MCU_data));
METHODDEF(boolean) encode_mcu_DC_refine JPP((j_compress_ptr cinfo,
JBLOCKROW *MCU_data));
METHODDEF(boolean) encode_mcu_AC_refine JPP((j_compress_ptr cinfo,
JBLOCKROW *MCU_data));
METHODDEF(void) finish_pass_phuff JPP((j_compress_ptr cinfo));
METHODDEF(void) finish_pass_gather_phuff JPP((j_compress_ptr cinfo));
/*
* Initialize for a Huffman-compressed scan using progressive JPEG.
*/
METHODDEF(void)
start_pass_phuff (j_compress_ptr cinfo, boolean gather_statistics)
{
phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
boolean is_DC_band;
int ci, tbl;
jpeg_component_info * compptr;
entropy->cinfo = cinfo;
entropy->gather_statistics = gather_statistics;
is_DC_band = (cinfo->Ss == 0);
/* We assume jcmaster.c already validated the scan parameters. */
/* Select execution routines */
if (cinfo->Ah == 0) {
if (is_DC_band)
entropy->pub.encode_mcu = encode_mcu_DC_first;
else
entropy->pub.encode_mcu = encode_mcu_AC_first;
} else {
if (is_DC_band)
entropy->pub.encode_mcu = encode_mcu_DC_refine;
else {
entropy->pub.encode_mcu = encode_mcu_AC_refine;
/* AC refinement needs a correction bit buffer */
if (entropy->bit_buffer == NULL)
entropy->bit_buffer = (char *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
MAX_CORR_BITS * SIZEOF(char));
}
}
if (gather_statistics)
entropy->pub.finish_pass = finish_pass_gather_phuff;
else
entropy->pub.finish_pass = finish_pass_phuff;
/* Only DC coefficients may be interleaved, so cinfo->comps_in_scan = 1
* for AC coefficients.
*/
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
/* Initialize DC predictions to 0 */
entropy->last_dc_val[ci] = 0;
/* Get table index */
if (is_DC_band) {
if (cinfo->Ah != 0) /* DC refinement needs no table */
continue;
tbl = compptr->dc_tbl_no;
} else {
entropy->ac_tbl_no = tbl = compptr->ac_tbl_no;
}
if (gather_statistics) {
/* Check for invalid table index */
/* (make_c_derived_tbl does this in the other path) */
if (tbl < 0 || tbl >= NUM_HUFF_TBLS)
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl);
/* Allocate and zero the statistics tables */
/* Note that jpeg_gen_optimal_table expects 257 entries in each table! */
if (entropy->count_ptrs[tbl] == NULL)
entropy->count_ptrs[tbl] = (long *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
257 * SIZEOF(long));
MEMZERO(entropy->count_ptrs[tbl], 257 * SIZEOF(long));
} else {
/* Compute derived values for Huffman table */
/* We may do this more than once for a table, but it's not expensive */
jpeg_make_c_derived_tbl(cinfo, is_DC_band, tbl,
& entropy->derived_tbls[tbl]);
}
}
/* Initialize AC stuff */
entropy->EOBRUN = 0;
entropy->BE = 0;
/* Initialize bit buffer to empty */
entropy->put_buffer = 0;
entropy->put_bits = 0;
/* Initialize restart stuff */
entropy->restarts_to_go = cinfo->restart_interval;
entropy->next_restart_num = 0;
}
/* Outputting bytes to the file.
* NB: these must be called only when actually outputting,
* that is, entropy->gather_statistics == FALSE.
*/
/* Emit a byte */
#define emit_byte(entropy,val) \
{ *(entropy)->next_output_byte++ = (JOCTET) (val); \
if (--(entropy)->free_in_buffer == 0) \
dump_buffer(entropy); }
LOCAL(void)
dump_buffer (phuff_entropy_ptr entropy)
/* Empty the output buffer; we do not support suspension in this module. */
{
struct jpeg_destination_mgr * dest = entropy->cinfo->dest;
if (! (*dest->empty_output_buffer) (entropy->cinfo))
ERREXIT(entropy->cinfo, JERR_CANT_SUSPEND);
/* After a successful buffer dump, must reset buffer pointers */
entropy->next_output_byte = dest->next_output_byte;
entropy->free_in_buffer = dest->free_in_buffer;
}
/* Outputting bits to the file */
/* Only the right 24 bits of put_buffer are used; the valid bits are
* left-justified in this part. At most 16 bits can be passed to emit_bits
* in one call, and we never retain more than 7 bits in put_buffer
* between calls, so 24 bits are sufficient.
*/
INLINE
LOCAL(void)
emit_bits (phuff_entropy_ptr entropy, unsigned int code, int size)
/* Emit some bits, unless we are in gather mode */
{
/* This routine is heavily used, so it's worth coding tightly. */
register INT32 put_buffer = (INT32) code;
register int put_bits = entropy->put_bits;
/* if size is 0, caller used an invalid Huffman table entry */
if (size == 0)
ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);
if (entropy->gather_statistics)
return; /* do nothing if we're only getting stats */
put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */
put_bits += size; /* new number of bits in buffer */
put_buffer <<= 24 - put_bits; /* align incoming bits */
put_buffer |= entropy->put_buffer; /* and merge with old buffer contents */
while (put_bits >= 8) {
int c = (int) ((put_buffer >> 16) & 0xFF);
emit_byte(entropy, c);
if (c == 0xFF) { /* need to stuff a zero byte? */
emit_byte(entropy, 0);
}
put_buffer <<= 8;
put_bits -= 8;
}
entropy->put_buffer = put_buffer; /* update variables */
entropy->put_bits = put_bits;
}
LOCAL(void)
flush_bits (phuff_entropy_ptr entropy)
{
emit_bits(entropy, 0x7F, 7); /* fill any partial byte with ones */
entropy->put_buffer = 0; /* and reset bit-buffer to empty */
entropy->put_bits = 0;
}
/*
* Emit (or just count) a Huffman symbol.
*/
INLINE
LOCAL(void)
emit_symbol (phuff_entropy_ptr entropy, int tbl_no, int symbol)
{
if (entropy->gather_statistics)
entropy->count_ptrs[tbl_no][symbol]++;
else {
c_derived_tbl * tbl = entropy->derived_tbls[tbl_no];
emit_bits(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]);
}
}
/*
* Emit bits from a correction bit buffer.
*/
LOCAL(void)
emit_buffered_bits (phuff_entropy_ptr entropy, char * bufstart,
unsigned int nbits)
{
if (entropy->gather_statistics)
return; /* no real work */
while (nbits > 0) {
emit_bits(entropy, (unsigned int) (*bufstart), 1);
bufstart++;
nbits--;
}
}
/*
* Emit any pending EOBRUN symbol.
*/
LOCAL(void)
emit_eobrun (phuff_entropy_ptr entropy)
{
register int temp, nbits;
if (entropy->EOBRUN > 0) { /* if there is any pending EOBRUN */
temp = entropy->EOBRUN;
nbits = 0;
while ((temp >>= 1))
nbits++;
/* safety check: shouldn't happen given limited correction-bit buffer */
if (nbits > 14)
ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);
emit_symbol(entropy, entropy->ac_tbl_no, nbits << 4);
if (nbits)
emit_bits(entropy, entropy->EOBRUN, nbits);
entropy->EOBRUN = 0;
/* Emit any buffered correction bits */
emit_buffered_bits(entropy, entropy->bit_buffer, entropy->BE);
entropy->BE = 0;
}
}
/*
* Emit a restart marker & resynchronize predictions.
*/
LOCAL(void)
emit_restart (phuff_entropy_ptr entropy, int restart_num)
{
int ci;
emit_eobrun(entropy);
if (! entropy->gather_statistics) {
flush_bits(entropy);
emit_byte(entropy, 0xFF);
emit_byte(entropy, JPEG_RST0 + restart_num);
}
if (entropy->cinfo->Ss == 0) {
/* Re-initialize DC predictions to 0 */
for (ci = 0; ci < entropy->cinfo->comps_in_scan; ci++)
entropy->last_dc_val[ci] = 0;
} else {
/* Re-initialize all AC-related fields to 0 */
entropy->EOBRUN = 0;
entropy->BE = 0;
}
}
/*
* MCU encoding for DC initial scan (either spectral selection,
* or first pass of successive approximation).
*/
METHODDEF(boolean)
encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
register int temp, temp2;
register int nbits;
int blkn, ci;
int Al = cinfo->Al;
JBLOCKROW block;
jpeg_component_info * compptr;
ISHIFT_TEMPS
entropy->next_output_byte = cinfo->dest->next_output_byte;
entropy->free_in_buffer = cinfo->dest->free_in_buffer;
/* Emit restart marker if needed */
if (cinfo->restart_interval)
if (entropy->restarts_to_go == 0)
emit_restart(entropy, entropy->next_restart_num);
/* Encode the MCU data blocks */
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
block = MCU_data[blkn];
ci = cinfo->MCU_membership[blkn];
compptr = cinfo->cur_comp_info[ci];
/* Compute the DC value after the required point transform by Al.
* This is simply an arithmetic right shift.
*/
temp2 = IRIGHT_SHIFT((int) ((*block)[0]), Al);
/* DC differences are figured on the point-transformed values. */
temp = temp2 - entropy->last_dc_val[ci];
entropy->last_dc_val[ci] = temp2;
/* Encode the DC coefficient difference per section G.1.2.1 */
temp2 = temp;
if (temp < 0) {
temp = -temp; /* temp is abs value of input */
/* For a negative input, want temp2 = bitwise complement of abs(input) */
/* This code assumes we are on a two's complement machine */
temp2--;
}
/* Find the number of bits needed for the magnitude of the coefficient */
nbits = 0;
while (temp) {
nbits++;
temp >>= 1;
}
/* Check for out-of-range coefficient values.
* Since we're encoding a difference, the range limit is twice as much.
*/
if (nbits > MAX_COEF_BITS+1)
ERREXIT(cinfo, JERR_BAD_DCT_COEF);
/* Count/emit the Huffman-coded symbol for the number of bits */
emit_symbol(entropy, compptr->dc_tbl_no, nbits);
/* Emit that number of bits of the value, if positive, */
/* or the complement of its magnitude, if negative. */
if (nbits) /* emit_bits rejects calls with size 0 */
emit_bits(entropy, (unsigned int) temp2, nbits);
}
cinfo->dest->next_output_byte = entropy->next_output_byte;
cinfo->dest->free_in_buffer = entropy->free_in_buffer;
/* Update restart-interval state too */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0) {
entropy->restarts_to_go = cinfo->restart_interval;
entropy->next_restart_num++;
entropy->next_restart_num &= 7;
}
entropy->restarts_to_go--;
}
return TRUE;
}
/*
* MCU encoding for AC initial scan (either spectral selection,
* or first pass of successive approximation).
*/
METHODDEF(boolean)
encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
register int temp, temp2;
register int nbits;
register int r, k;
int Se = cinfo->Se;
int Al = cinfo->Al;
JBLOCKROW block;
entropy->next_output_byte = cinfo->dest->next_output_byte;
entropy->free_in_buffer = cinfo->dest->free_in_buffer;
/* Emit restart marker if needed */
if (cinfo->restart_interval)
if (entropy->restarts_to_go == 0)
emit_restart(entropy, entropy->next_restart_num);
/* Encode the MCU data block */
block = MCU_data[0];
/* Encode the AC coefficients per section G.1.2.2, fig. G.3 */
r = 0; /* r = run length of zeros */
for (k = cinfo->Ss; k <= Se; k++) {
if ((temp = (*block)[jpeg_natural_order[k]]) == 0) {
r++;
continue;
}
/* We must apply the point transform by Al. For AC coefficients this
* is an integer division with rounding towards 0. To do this portably
* in C, we shift after obtaining the absolute value; so the code is
* interwoven with finding the abs value (temp) and output bits (temp2).
*/
if (temp < 0) {
temp = -temp; /* temp is abs value of input */
temp >>= Al; /* apply the point transform */
/* For a negative coef, want temp2 = bitwise complement of abs(coef) */
temp2 = ~temp;
} else {
temp >>= Al; /* apply the point transform */
temp2 = temp;
}
/* Watch out for case that nonzero coef is zero after point transform */
if (temp == 0) {
r++;
continue;
}
/* Emit any pending EOBRUN */
if (entropy->EOBRUN > 0)
emit_eobrun(entropy);
/* if run length > 15, must emit special run-length-16 codes (0xF0) */
while (r > 15) {
emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);
r -= 16;
}
/* Find the number of bits needed for the magnitude of the coefficient */
nbits = 1; /* there must be at least one 1 bit */
while ((temp >>= 1))
nbits++;
/* Check for out-of-range coefficient values */
if (nbits > MAX_COEF_BITS)
ERREXIT(cinfo, JERR_BAD_DCT_COEF);
/* Count/emit Huffman symbol for run length / number of bits */
emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + nbits);
/* Emit that number of bits of the value, if positive, */
/* or the complement of its magnitude, if negative. */
emit_bits(entropy, (unsigned int) temp2, nbits);
r = 0; /* reset zero run length */
}
if (r > 0) { /* If there are trailing zeroes, */
entropy->EOBRUN++; /* count an EOB */
if (entropy->EOBRUN == 0x7FFF)
emit_eobrun(entropy); /* force it out to avoid overflow */
}
cinfo->dest->next_output_byte = entropy->next_output_byte;
cinfo->dest->free_in_buffer = entropy->free_in_buffer;
/* Update restart-interval state too */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0) {
entropy->restarts_to_go = cinfo->restart_interval;
entropy->next_restart_num++;
entropy->next_restart_num &= 7;
}
entropy->restarts_to_go--;
}
return TRUE;
}
/*
* MCU encoding for DC successive approximation refinement scan.
* Note: we assume such scans can be multi-component, although the spec
* is not very clear on the point.
*/
METHODDEF(boolean)
encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
register int temp;
int blkn;
int Al = cinfo->Al;
JBLOCKROW block;
entropy->next_output_byte = cinfo->dest->next_output_byte;
entropy->free_in_buffer = cinfo->dest->free_in_buffer;
/* Emit restart marker if needed */
if (cinfo->restart_interval)
if (entropy->restarts_to_go == 0)
emit_restart(entropy, entropy->next_restart_num);
/* Encode the MCU data blocks */
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
block = MCU_data[blkn];
/* We simply emit the Al'th bit of the DC coefficient value. */
temp = (*block)[0];
emit_bits(entropy, (unsigned int) (temp >> Al), 1);
}
cinfo->dest->next_output_byte = entropy->next_output_byte;
cinfo->dest->free_in_buffer = entropy->free_in_buffer;
/* Update restart-interval state too */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0) {
entropy->restarts_to_go = cinfo->restart_interval;
entropy->next_restart_num++;
entropy->next_restart_num &= 7;
}
entropy->restarts_to_go--;
}
return TRUE;
}
/*
* MCU encoding for AC successive approximation refinement scan.
*/
METHODDEF(boolean)
encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
register int temp;
register int r, k;
int EOB;
char *BR_buffer;
unsigned int BR;
int Se = cinfo->Se;
int Al = cinfo->Al;
JBLOCKROW block;
int absvalues[DCTSIZE2];
entropy->next_output_byte = cinfo->dest->next_output_byte;
entropy->free_in_buffer = cinfo->dest->free_in_buffer;
/* Emit restart marker if needed */
if (cinfo->restart_interval)
if (entropy->restarts_to_go == 0)
emit_restart(entropy, entropy->next_restart_num);
/* Encode the MCU data block */
block = MCU_data[0];
/* It is convenient to make a pre-pass to determine the transformed
* coefficients' absolute values and the EOB position.
*/
EOB = 0;
for (k = cinfo->Ss; k <= Se; k++) {
temp = (*block)[jpeg_natural_order[k]];
/* We must apply the point transform by Al. For AC coefficients this
* is an integer division with rounding towards 0. To do this portably
* in C, we shift after obtaining the absolute value.
*/
if (temp < 0)
temp = -temp; /* temp is abs value of input */
temp >>= Al; /* apply the point transform */
absvalues[k] = temp; /* save abs value for main pass */
if (temp == 1)
EOB = k; /* EOB = index of last newly-nonzero coef */
}
/* Encode the AC coefficients per section G.1.2.3, fig. G.7 */
r = 0; /* r = run length of zeros */
BR = 0; /* BR = count of buffered bits added now */
BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */
for (k = cinfo->Ss; k <= Se; k++) {
if ((temp = absvalues[k]) == 0) {
r++;
continue;
}
/* Emit any required ZRLs, but not if they can be folded into EOB */
while (r > 15 && k <= EOB) {
/* emit any pending EOBRUN and the BE correction bits */
emit_eobrun(entropy);
/* Emit ZRL */
emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);
r -= 16;
/* Emit buffered correction bits that must be associated with ZRL */
emit_buffered_bits(entropy, BR_buffer, BR);
BR_buffer = entropy->bit_buffer; /* BE bits are gone now */
BR = 0;
}
/* If the coef was previously nonzero, it only needs a correction bit.
* NOTE: a straight translation of the spec's figure G.7 would suggest
* that we also need to test r > 15. But if r > 15, we can only get here
* if k > EOB, which implies that this coefficient is not 1.
*/
if (temp > 1) {
/* The correction bit is the next bit of the absolute value. */
BR_buffer[BR++] = (char) (temp & 1);
continue;
}
/* Emit any pending EOBRUN and the BE correction bits */
emit_eobrun(entropy);
/* Count/emit Huffman symbol for run length / number of bits */
emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + 1);
/* Emit output bit for newly-nonzero coef */
temp = ((*block)[jpeg_natural_order[k]] < 0) ? 0 : 1;
emit_bits(entropy, (unsigned int) temp, 1);
/* Emit buffered correction bits that must be associated with this code */
emit_buffered_bits(entropy, BR_buffer, BR);
BR_buffer = entropy->bit_buffer; /* BE bits are gone now */
BR = 0;
r = 0; /* reset zero run length */
}
if (r > 0 || BR > 0) { /* If there are trailing zeroes, */
entropy->EOBRUN++; /* count an EOB */
entropy->BE += BR; /* concat my correction bits to older ones */
/* We force out the EOB if we risk either:
* 1. overflow of the EOB counter;
* 2. overflow of the correction bit buffer during the next MCU.
*/
if (entropy->EOBRUN == 0x7FFF || entropy->BE > (MAX_CORR_BITS-DCTSIZE2+1))
emit_eobrun(entropy);
}
cinfo->dest->next_output_byte = entropy->next_output_byte;
cinfo->dest->free_in_buffer = entropy->free_in_buffer;
/* Update restart-interval state too */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0) {
entropy->restarts_to_go = cinfo->restart_interval;
entropy->next_restart_num++;
entropy->next_restart_num &= 7;
}
entropy->restarts_to_go--;
}
return TRUE;
}
/*
* Finish up at the end of a Huffman-compressed progressive scan.
*/
METHODDEF(void)
finish_pass_phuff (j_compress_ptr cinfo)
{
phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
entropy->next_output_byte = cinfo->dest->next_output_byte;
entropy->free_in_buffer = cinfo->dest->free_in_buffer;
/* Flush out any buffered data */
emit_eobrun(entropy);
flush_bits(entropy);
cinfo->dest->next_output_byte = entropy->next_output_byte;
cinfo->dest->free_in_buffer = entropy->free_in_buffer;
}
/*
* Finish up a statistics-gathering pass and create the new Huffman tables.
*/
METHODDEF(void)
finish_pass_gather_phuff (j_compress_ptr cinfo)
{
phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
boolean is_DC_band;
int ci, tbl;
jpeg_component_info * compptr;
JHUFF_TBL **htblptr;
boolean did[NUM_HUFF_TBLS];
/* Flush out buffered data (all we care about is counting the EOB symbol) */
emit_eobrun(entropy);
is_DC_band = (cinfo->Ss == 0);
/* It's important not to apply jpeg_gen_optimal_table more than once
* per table, because it clobbers the input frequency counts!
*/
MEMZERO(did, SIZEOF(did));
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
if (is_DC_band) {
if (cinfo->Ah != 0) /* DC refinement needs no table */
continue;
tbl = compptr->dc_tbl_no;
} else {
tbl = compptr->ac_tbl_no;
}
if (! did[tbl]) {
if (is_DC_band)
htblptr = & cinfo->dc_huff_tbl_ptrs[tbl];
else
htblptr = & cinfo->ac_huff_tbl_ptrs[tbl];
if (*htblptr == NULL)
*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
jpeg_gen_optimal_table(cinfo, *htblptr, entropy->count_ptrs[tbl]);
did[tbl] = TRUE;
}
}
}
/*
* Module initialization routine for progressive Huffman entropy encoding.
*/
GLOBAL(void)
jinit_phuff_encoder (j_compress_ptr cinfo)
{
phuff_entropy_ptr entropy;
int i;
entropy = (phuff_entropy_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(phuff_entropy_encoder));
cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;
entropy->pub.start_pass = start_pass_phuff;
/* Mark tables unallocated */
for (i = 0; i < NUM_HUFF_TBLS; i++) {
entropy->derived_tbls[i] = NULL;
entropy->count_ptrs[i] = NULL;
}
entropy->bit_buffer = NULL; /* needed only in AC refinement scan */
}
#endif /* C_PROGRESSIVE_SUPPORTED */
+62 -58
View File
@@ -104,13 +104,13 @@ start_pass_prep (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
LOCAL(void)
expand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols,
int input_rows, int output_rows)
int input_rows, int output_rows)
{
register int row;
for (row = input_rows; row < output_rows; row++) {
jcopy_sample_rows(image_data, input_rows-1, image_data, row,
1, num_cols);
1, num_cols);
}
}
@@ -126,10 +126,10 @@ expand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols,
METHODDEF(void)
pre_process_data (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
JDIMENSION in_rows_avail,
JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
JDIMENSION out_row_groups_avail)
JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
JDIMENSION in_rows_avail,
JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
JDIMENSION out_row_groups_avail)
{
my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
int numrows, ci;
@@ -137,32 +137,32 @@ pre_process_data (j_compress_ptr cinfo,
jpeg_component_info * compptr;
while (*in_row_ctr < in_rows_avail &&
*out_row_group_ctr < out_row_groups_avail) {
*out_row_group_ctr < out_row_groups_avail) {
/* Do color conversion to fill the conversion buffer. */
inrows = in_rows_avail - *in_row_ctr;
numrows = cinfo->max_v_samp_factor - prep->next_buf_row;
numrows = (int) MIN((JDIMENSION) numrows, inrows);
(*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
prep->color_buf,
(JDIMENSION) prep->next_buf_row,
numrows);
prep->color_buf,
(JDIMENSION) prep->next_buf_row,
numrows);
*in_row_ctr += numrows;
prep->next_buf_row += numrows;
prep->rows_to_go -= numrows;
/* If at bottom of image, pad to fill the conversion buffer. */
if (prep->rows_to_go == 0 &&
prep->next_buf_row < cinfo->max_v_samp_factor) {
prep->next_buf_row < cinfo->max_v_samp_factor) {
for (ci = 0; ci < cinfo->num_components; ci++) {
expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
prep->next_buf_row, cinfo->max_v_samp_factor);
expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
prep->next_buf_row, cinfo->max_v_samp_factor);
}
prep->next_buf_row = cinfo->max_v_samp_factor;
}
/* If we've filled the conversion buffer, empty it. */
if (prep->next_buf_row == cinfo->max_v_samp_factor) {
(*cinfo->downsample->downsample) (cinfo,
prep->color_buf, (JDIMENSION) 0,
output_buf, *out_row_group_ctr);
prep->color_buf, (JDIMENSION) 0,
output_buf, *out_row_group_ctr);
prep->next_buf_row = 0;
(*out_row_group_ctr)++;
}
@@ -170,13 +170,15 @@ pre_process_data (j_compress_ptr cinfo,
* Note we assume the caller is providing a one-iMCU-height output buffer!
*/
if (prep->rows_to_go == 0 &&
*out_row_group_ctr < out_row_groups_avail) {
*out_row_group_ctr < out_row_groups_avail) {
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
expand_bottom_edge(output_buf[ci],
compptr->width_in_blocks * DCTSIZE,
(int) (*out_row_group_ctr * compptr->v_samp_factor),
(int) (out_row_groups_avail * compptr->v_samp_factor));
ci++, compptr++) {
numrows = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /
cinfo->min_DCT_v_scaled_size;
expand_bottom_edge(output_buf[ci],
compptr->width_in_blocks * compptr->DCT_h_scaled_size,
(int) (*out_row_group_ctr * numrows),
(int) (out_row_groups_avail * numrows));
}
*out_row_group_ctr = out_row_groups_avail;
break; /* can exit outer loop without test */
@@ -193,10 +195,10 @@ pre_process_data (j_compress_ptr cinfo,
METHODDEF(void)
pre_process_context (j_compress_ptr cinfo,
JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
JDIMENSION in_rows_avail,
JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
JDIMENSION out_row_groups_avail)
JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
JDIMENSION in_rows_avail,
JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
JDIMENSION out_row_groups_avail)
{
my_prep_ptr prep = (my_prep_ptr) cinfo->prep;
int numrows, ci;
@@ -210,19 +212,19 @@ pre_process_context (j_compress_ptr cinfo,
numrows = prep->next_buf_stop - prep->next_buf_row;
numrows = (int) MIN((JDIMENSION) numrows, inrows);
(*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
prep->color_buf,
(JDIMENSION) prep->next_buf_row,
numrows);
prep->color_buf,
(JDIMENSION) prep->next_buf_row,
numrows);
/* Pad at top of image, if first time through */
if (prep->rows_to_go == cinfo->image_height) {
for (ci = 0; ci < cinfo->num_components; ci++) {
int row;
for (row = 1; row <= cinfo->max_v_samp_factor; row++) {
jcopy_sample_rows(prep->color_buf[ci], 0,
prep->color_buf[ci], -row,
1, cinfo->image_width);
}
}
for (ci = 0; ci < cinfo->num_components; ci++) {
int row;
for (row = 1; row <= cinfo->max_v_samp_factor; row++) {
jcopy_sample_rows(prep->color_buf[ci], 0,
prep->color_buf[ci], -row,
1, cinfo->image_width);
}
}
}
*in_row_ctr += numrows;
prep->next_buf_row += numrows;
@@ -230,29 +232,29 @@ pre_process_context (j_compress_ptr cinfo,
} else {
/* Return for more data, unless we are at the bottom of the image. */
if (prep->rows_to_go != 0)
break;
break;
/* When at bottom of image, pad to fill the conversion buffer. */
if (prep->next_buf_row < prep->next_buf_stop) {
for (ci = 0; ci < cinfo->num_components; ci++) {
expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
prep->next_buf_row, prep->next_buf_stop);
}
prep->next_buf_row = prep->next_buf_stop;
for (ci = 0; ci < cinfo->num_components; ci++) {
expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
prep->next_buf_row, prep->next_buf_stop);
}
prep->next_buf_row = prep->next_buf_stop;
}
}
/* If we've gotten enough data, downsample a row group. */
if (prep->next_buf_row == prep->next_buf_stop) {
(*cinfo->downsample->downsample) (cinfo,
prep->color_buf,
(JDIMENSION) prep->this_row_group,
output_buf, *out_row_group_ctr);
prep->color_buf,
(JDIMENSION) prep->this_row_group,
output_buf, *out_row_group_ctr);
(*out_row_group_ctr)++;
/* Advance pointers with wraparound as necessary. */
prep->this_row_group += cinfo->max_v_samp_factor;
if (prep->this_row_group >= buf_height)
prep->this_row_group = 0;
prep->this_row_group = 0;
if (prep->next_buf_row >= buf_height)
prep->next_buf_row = 0;
prep->next_buf_row = 0;
prep->next_buf_stop = prep->next_buf_row + cinfo->max_v_samp_factor;
}
}
@@ -277,8 +279,8 @@ create_context_buffer (j_compress_ptr cinfo)
*/
fake_buffer = (JSAMPARRAY)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(cinfo->num_components * 5 * rgroup_height) *
SIZEOF(JSAMPROW));
(cinfo->num_components * 5 * rgroup_height) *
SIZEOF(JSAMPROW));
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
@@ -288,12 +290,13 @@ create_context_buffer (j_compress_ptr cinfo)
*/
true_buffer = (*cinfo->mem->alloc_sarray)
((j_common_ptr) cinfo, JPOOL_IMAGE,
(JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE *
cinfo->max_h_samp_factor) / compptr->h_samp_factor),
(JDIMENSION) (((long) compptr->width_in_blocks *
cinfo->min_DCT_h_scaled_size *
cinfo->max_h_samp_factor) / compptr->h_samp_factor),
(JDIMENSION) (3 * rgroup_height));
/* Copy true buffer row pointers into the middle of the fake row array */
MEMCOPY(fake_buffer + rgroup_height, true_buffer,
3 * rgroup_height * SIZEOF(JSAMPROW));
3 * rgroup_height * SIZEOF(JSAMPROW));
/* Fill in the above and below wraparound pointers */
for (i = 0; i < rgroup_height; i++) {
fake_buffer[i] = true_buffer[2 * rgroup_height + i];
@@ -323,7 +326,7 @@ jinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer)
prep = (my_prep_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_prep_controller));
SIZEOF(my_prep_controller));
cinfo->prep = (struct jpeg_c_prep_controller *) prep;
prep->pub.start_pass = start_pass_prep;
@@ -343,12 +346,13 @@ jinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer)
/* No context, just make it tall enough for one row group */
prep->pub.pre_process_data = pre_process_data;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
ci++, compptr++) {
prep->color_buf[ci] = (*cinfo->mem->alloc_sarray)
((j_common_ptr) cinfo, JPOOL_IMAGE,
(JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE *
cinfo->max_h_samp_factor) / compptr->h_samp_factor),
(JDIMENSION) cinfo->max_v_samp_factor);
((j_common_ptr) cinfo, JPOOL_IMAGE,
(JDIMENSION) (((long) compptr->width_in_blocks *
cinfo->min_DCT_h_scaled_size *
cinfo->max_h_samp_factor) / compptr->h_samp_factor),
(JDIMENSION) cinfo->max_v_samp_factor);
}
}
}
+111 -85
View File
@@ -52,8 +52,8 @@
/* Pointer to routine to downsample a single component */
typedef JMETHOD(void, downsample1_ptr,
(j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY input_data, JSAMPARRAY output_data));
(j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY input_data, JSAMPARRAY output_data));
/* Private subobject */
@@ -62,6 +62,15 @@ typedef struct {
/* Downsampling method pointers, one per component */
downsample1_ptr methods[MAX_COMPONENTS];
/* Height of an output row group for each component. */
int rowgroup_height[MAX_COMPONENTS];
/* These arrays save pixel expansion factors so that int_downsample need not
* recompute them each time. They are unused for other downsampling methods.
*/
UINT8 h_expand[MAX_COMPONENTS];
UINT8 v_expand[MAX_COMPONENTS];
} my_downsampler;
typedef my_downsampler * my_downsample_ptr;
@@ -85,7 +94,7 @@ start_pass_downsample (j_compress_ptr cinfo)
LOCAL(void)
expand_right_edge (JSAMPARRAY image_data, int num_rows,
JDIMENSION input_cols, JDIMENSION output_cols)
JDIMENSION input_cols, JDIMENSION output_cols)
{
register JSAMPROW ptr;
register JSAMPLE pixval;
@@ -98,7 +107,7 @@ expand_right_edge (JSAMPARRAY image_data, int num_rows,
ptr = image_data[row] + input_cols;
pixval = ptr[-1]; /* don't need GETJSAMPLE() here */
for (count = numcols; count > 0; count--)
*ptr++ = pixval;
*ptr++ = pixval;
}
}
}
@@ -112,8 +121,8 @@ expand_right_edge (JSAMPARRAY image_data, int num_rows,
METHODDEF(void)
sep_downsample (j_compress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION in_row_index,
JSAMPIMAGE output_buf, JDIMENSION out_row_group_index)
JSAMPIMAGE input_buf, JDIMENSION in_row_index,
JSAMPIMAGE output_buf, JDIMENSION out_row_group_index)
{
my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample;
int ci;
@@ -123,7 +132,8 @@ sep_downsample (j_compress_ptr cinfo,
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
in_ptr = input_buf[ci] + in_row_index;
out_ptr = output_buf[ci] + (out_row_group_index * compptr->v_samp_factor);
out_ptr = output_buf[ci] +
(out_row_group_index * downsample->rowgroup_height[ci]);
(*downsample->methods[ci]) (cinfo, compptr, in_ptr, out_ptr);
}
}
@@ -138,16 +148,17 @@ sep_downsample (j_compress_ptr cinfo,
METHODDEF(void)
int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY input_data, JSAMPARRAY output_data)
JSAMPARRAY input_data, JSAMPARRAY output_data)
{
my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample;
int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v;
JDIMENSION outcol, outcol_h; /* outcol_h == outcol*h_expand */
JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size;
JSAMPROW inptr, outptr;
INT32 outvalue;
h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor;
v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor;
h_expand = downsample->h_expand[compptr->component_index];
v_expand = downsample->v_expand[compptr->component_index];
numpix = h_expand * v_expand;
numpix2 = numpix/2;
@@ -156,23 +167,24 @@ int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
* efficient.
*/
expand_right_edge(input_data, cinfo->max_v_samp_factor,
cinfo->image_width, output_cols * h_expand);
cinfo->image_width, output_cols * h_expand);
inrow = 0;
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
inrow = outrow = 0;
while (inrow < cinfo->max_v_samp_factor) {
outptr = output_data[outrow];
for (outcol = 0, outcol_h = 0; outcol < output_cols;
outcol++, outcol_h += h_expand) {
outcol++, outcol_h += h_expand) {
outvalue = 0;
for (v = 0; v < v_expand; v++) {
inptr = input_data[inrow+v] + outcol_h;
for (h = 0; h < h_expand; h++) {
outvalue += (INT32) GETJSAMPLE(*inptr++);
}
inptr = input_data[inrow+v] + outcol_h;
for (h = 0; h < h_expand; h++) {
outvalue += (INT32) GETJSAMPLE(*inptr++);
}
}
*outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix);
}
inrow += v_expand;
outrow++;
}
}
@@ -185,14 +197,14 @@ int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
METHODDEF(void)
fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY input_data, JSAMPARRAY output_data)
JSAMPARRAY input_data, JSAMPARRAY output_data)
{
/* Copy the data */
jcopy_sample_rows(input_data, 0, output_data, 0,
cinfo->max_v_samp_factor, cinfo->image_width);
cinfo->max_v_samp_factor, cinfo->image_width);
/* Edge-expand */
expand_right_edge(output_data, cinfo->max_v_samp_factor,
cinfo->image_width, compptr->width_in_blocks * DCTSIZE);
expand_right_edge(output_data, cinfo->max_v_samp_factor, cinfo->image_width,
compptr->width_in_blocks * compptr->DCT_h_scaled_size);
}
@@ -210,11 +222,11 @@ fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
METHODDEF(void)
h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY input_data, JSAMPARRAY output_data)
JSAMPARRAY input_data, JSAMPARRAY output_data)
{
int outrow;
int inrow;
JDIMENSION outcol;
JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size;
register JSAMPROW inptr, outptr;
register int bias;
@@ -223,15 +235,15 @@ h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
* efficient.
*/
expand_right_edge(input_data, cinfo->max_v_samp_factor,
cinfo->image_width, output_cols * 2);
cinfo->image_width, output_cols * 2);
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
outptr = output_data[outrow];
inptr = input_data[outrow];
for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {
outptr = output_data[inrow];
inptr = input_data[inrow];
bias = 0; /* bias = 0,1,0,1,... for successive samples */
for (outcol = 0; outcol < output_cols; outcol++) {
*outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1])
+ bias) >> 1);
+ bias) >> 1);
bias ^= 1; /* 0=>1, 1=>0 */
inptr += 2;
}
@@ -247,11 +259,11 @@ h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
METHODDEF(void)
h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY input_data, JSAMPARRAY output_data)
JSAMPARRAY input_data, JSAMPARRAY output_data)
{
int inrow, outrow;
JDIMENSION outcol;
JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size;
register JSAMPROW inptr0, inptr1, outptr;
register int bias;
@@ -260,22 +272,23 @@ h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
* efficient.
*/
expand_right_edge(input_data, cinfo->max_v_samp_factor,
cinfo->image_width, output_cols * 2);
cinfo->image_width, output_cols * 2);
inrow = 0;
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
inrow = outrow = 0;
while (inrow < cinfo->max_v_samp_factor) {
outptr = output_data[outrow];
inptr0 = input_data[inrow];
inptr1 = input_data[inrow+1];
bias = 1; /* bias = 1,2,1,2,... for successive samples */
for (outcol = 0; outcol < output_cols; outcol++) {
*outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1])
+ bias) >> 2);
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1])
+ bias) >> 2);
bias ^= 3; /* 1=>2, 2=>1 */
inptr0 += 2; inptr1 += 2;
}
inrow += 2;
outrow++;
}
}
@@ -290,11 +303,11 @@ h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
METHODDEF(void)
h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY input_data, JSAMPARRAY output_data)
JSAMPARRAY input_data, JSAMPARRAY output_data)
{
int inrow, outrow;
JDIMENSION colctr;
JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size;
register JSAMPROW inptr0, inptr1, above_ptr, below_ptr, outptr;
INT32 membersum, neighsum, memberscale, neighscale;
@@ -303,7 +316,7 @@ h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
* efficient.
*/
expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,
cinfo->image_width, output_cols * 2);
cinfo->image_width, output_cols * 2);
/* We don't bother to form the individual "smoothed" input pixel values;
* we can directly compute the output which is the average of the four
@@ -321,8 +334,8 @@ h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
memberscale = 16384 - cinfo->smoothing_factor * 80; /* scaled (1-5*SF)/4 */
neighscale = cinfo->smoothing_factor * 16; /* scaled SF/4 */
inrow = 0;
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
inrow = outrow = 0;
while (inrow < cinfo->max_v_samp_factor) {
outptr = output_data[outrow];
inptr0 = input_data[inrow];
inptr1 = input_data[inrow+1];
@@ -331,14 +344,14 @@ h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
/* Special case for first column: pretend column -1 is same as column 0 */
membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[2]) +
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[2]);
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[2]) +
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[2]);
neighsum += neighsum;
neighsum += GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[2]) +
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]);
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]);
membersum = membersum * memberscale + neighsum * neighscale;
*outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;
@@ -346,17 +359,17 @@ h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
for (colctr = output_cols - 2; colctr > 0; colctr--) {
/* sum of pixels directly mapped to this output element */
membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
/* sum of edge-neighbor pixels */
neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[2]) +
GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[2]);
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[2]) +
GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[2]);
/* The edge-neighbors count twice as much as corner-neighbors */
neighsum += neighsum;
/* Add in the corner-neighbors */
neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[2]) +
GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[2]);
GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[2]);
/* form final output scaled up by 2^16 */
membersum = membersum * memberscale + neighsum * neighscale;
/* round, descale and output it */
@@ -366,18 +379,19 @@ h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
/* Special case for last column */
membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[1]) +
GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[1]);
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[1]) +
GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[1]);
neighsum += neighsum;
neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[1]) +
GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]);
GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]);
membersum = membersum * memberscale + neighsum * neighscale;
*outptr = (JSAMPLE) ((membersum + 32768) >> 16);
inrow += 2;
outrow++;
}
}
@@ -390,11 +404,11 @@ h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
METHODDEF(void)
fullsize_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
JSAMPARRAY input_data, JSAMPARRAY output_data)
JSAMPARRAY input_data, JSAMPARRAY output_data)
{
int outrow;
int inrow;
JDIMENSION colctr;
JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
JDIMENSION output_cols = compptr->width_in_blocks * compptr->DCT_h_scaled_size;
register JSAMPROW inptr, above_ptr, below_ptr, outptr;
INT32 membersum, neighsum, memberscale, neighscale;
int colsum, lastcolsum, nextcolsum;
@@ -404,7 +418,7 @@ fullsize_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
* efficient.
*/
expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,
cinfo->image_width, output_cols);
cinfo->image_width, output_cols);
/* Each of the eight neighbor pixels contributes a fraction SF to the
* smoothed pixel, while the main pixel contributes (1-8*SF). In order
@@ -415,18 +429,18 @@ fullsize_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
memberscale = 65536L - cinfo->smoothing_factor * 512L; /* scaled 1-8*SF */
neighscale = cinfo->smoothing_factor * 64; /* scaled SF */
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
outptr = output_data[outrow];
inptr = input_data[outrow];
above_ptr = input_data[outrow-1];
below_ptr = input_data[outrow+1];
for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {
outptr = output_data[inrow];
inptr = input_data[inrow];
above_ptr = input_data[inrow-1];
below_ptr = input_data[inrow+1];
/* Special case for first column */
colsum = GETJSAMPLE(*above_ptr++) + GETJSAMPLE(*below_ptr++) +
GETJSAMPLE(*inptr);
GETJSAMPLE(*inptr);
membersum = GETJSAMPLE(*inptr++);
nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
GETJSAMPLE(*inptr);
GETJSAMPLE(*inptr);
neighsum = colsum + (colsum - membersum) + nextcolsum;
membersum = membersum * memberscale + neighsum * neighscale;
*outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
@@ -436,7 +450,7 @@ fullsize_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,
membersum = GETJSAMPLE(*inptr++);
above_ptr++; below_ptr++;
nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
GETJSAMPLE(*inptr);
GETJSAMPLE(*inptr);
neighsum = lastcolsum + (colsum - membersum) + nextcolsum;
membersum = membersum * memberscale + neighsum * neighscale;
*outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);
@@ -467,10 +481,11 @@ jinit_downsampler (j_compress_ptr cinfo)
int ci;
jpeg_component_info * compptr;
boolean smoothok = TRUE;
int h_in_group, v_in_group, h_out_group, v_out_group;
downsample = (my_downsample_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_downsampler));
SIZEOF(my_downsampler));
cinfo->downsample = (struct jpeg_downsampler *) downsample;
downsample->pub.start_pass = start_pass_downsample;
downsample->pub.downsample = sep_downsample;
@@ -482,32 +497,43 @@ jinit_downsampler (j_compress_ptr cinfo)
/* Verify we can handle the sampling factors, and set up method pointers */
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
if (compptr->h_samp_factor == cinfo->max_h_samp_factor &&
compptr->v_samp_factor == cinfo->max_v_samp_factor) {
/* Compute size of an "output group" for DCT scaling. This many samples
* are to be converted from max_h_samp_factor * max_v_samp_factor pixels.
*/
h_out_group = (compptr->h_samp_factor * compptr->DCT_h_scaled_size) /
cinfo->min_DCT_h_scaled_size;
v_out_group = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /
cinfo->min_DCT_v_scaled_size;
h_in_group = cinfo->max_h_samp_factor;
v_in_group = cinfo->max_v_samp_factor;
downsample->rowgroup_height[ci] = v_out_group; /* save for use later */
if (h_in_group == h_out_group && v_in_group == v_out_group) {
#ifdef INPUT_SMOOTHING_SUPPORTED
if (cinfo->smoothing_factor) {
downsample->methods[ci] = fullsize_smooth_downsample;
downsample->pub.need_context_rows = TRUE;
downsample->methods[ci] = fullsize_smooth_downsample;
downsample->pub.need_context_rows = TRUE;
} else
#endif
downsample->methods[ci] = fullsize_downsample;
} else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&
compptr->v_samp_factor == cinfo->max_v_samp_factor) {
downsample->methods[ci] = fullsize_downsample;
} else if (h_in_group == h_out_group * 2 &&
v_in_group == v_out_group) {
smoothok = FALSE;
downsample->methods[ci] = h2v1_downsample;
} else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&
compptr->v_samp_factor * 2 == cinfo->max_v_samp_factor) {
} else if (h_in_group == h_out_group * 2 &&
v_in_group == v_out_group * 2) {
#ifdef INPUT_SMOOTHING_SUPPORTED
if (cinfo->smoothing_factor) {
downsample->methods[ci] = h2v2_smooth_downsample;
downsample->pub.need_context_rows = TRUE;
downsample->methods[ci] = h2v2_smooth_downsample;
downsample->pub.need_context_rows = TRUE;
} else
#endif
downsample->methods[ci] = h2v2_downsample;
} else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 &&
(cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) {
downsample->methods[ci] = h2v2_downsample;
} else if ((h_in_group % h_out_group) == 0 &&
(v_in_group % v_out_group) == 0) {
smoothok = FALSE;
downsample->methods[ci] = int_downsample;
downsample->h_expand[ci] = (UINT8) (h_in_group / h_out_group);
downsample->v_expand[ci] = (UINT8) (v_in_group / v_out_group);
} else
ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
}
+61 -64
View File
@@ -2,6 +2,7 @@
* jctrans.c
*
* Copyright (C) 1995-1998, Thomas G. Lane.
* Modified 2000-2012 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -17,9 +18,9 @@
/* Forward declarations */
LOCAL(void) transencode_master_selection
JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));
JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));
LOCAL(void) transencode_coef_controller
JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));
JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));
/*
@@ -61,7 +62,7 @@ jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)
GLOBAL(void)
jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
j_compress_ptr dstinfo)
j_compress_ptr dstinfo)
{
JQUANT_TBL ** qtblptr;
jpeg_component_info *incomp, *outcomp;
@@ -76,11 +77,18 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
dstinfo->image_height = srcinfo->image_height;
dstinfo->input_components = srcinfo->num_components;
dstinfo->in_color_space = srcinfo->jpeg_color_space;
dstinfo->jpeg_width = srcinfo->output_width;
dstinfo->jpeg_height = srcinfo->output_height;
dstinfo->min_DCT_h_scaled_size = srcinfo->min_DCT_h_scaled_size;
dstinfo->min_DCT_v_scaled_size = srcinfo->min_DCT_v_scaled_size;
/* Initialize all parameters to default values */
jpeg_set_defaults(dstinfo);
/* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB.
* Fix it to get the right header markers for the image colorspace.
* Note: Entropy table assignment in jpeg_set_colorspace depends
* on color_transform.
*/
dstinfo->color_transform = srcinfo->color_transform;
jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space);
dstinfo->data_precision = srcinfo->data_precision;
dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;
@@ -89,10 +97,10 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
if (srcinfo->quant_tbl_ptrs[tblno] != NULL) {
qtblptr = & dstinfo->quant_tbl_ptrs[tblno];
if (*qtblptr == NULL)
*qtblptr = jpeg_alloc_quant_table((j_common_ptr) dstinfo);
*qtblptr = jpeg_alloc_quant_table((j_common_ptr) dstinfo);
MEMCOPY((*qtblptr)->quantval,
srcinfo->quant_tbl_ptrs[tblno]->quantval,
SIZEOF((*qtblptr)->quantval));
srcinfo->quant_tbl_ptrs[tblno]->quantval,
SIZEOF((*qtblptr)->quantval));
(*qtblptr)->sent_table = FALSE;
}
}
@@ -102,7 +110,7 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
dstinfo->num_components = srcinfo->num_components;
if (dstinfo->num_components < 1 || dstinfo->num_components > MAX_COMPONENTS)
ERREXIT2(dstinfo, JERR_COMPONENT_COUNT, dstinfo->num_components,
MAX_COMPONENTS);
MAX_COMPONENTS);
for (ci = 0, incomp = srcinfo->comp_info, outcomp = dstinfo->comp_info;
ci < dstinfo->num_components; ci++, incomp++, outcomp++) {
outcomp->component_id = incomp->component_id;
@@ -115,17 +123,17 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
*/
tblno = outcomp->quant_tbl_no;
if (tblno < 0 || tblno >= NUM_QUANT_TBLS ||
srcinfo->quant_tbl_ptrs[tblno] == NULL)
srcinfo->quant_tbl_ptrs[tblno] == NULL)
ERREXIT1(dstinfo, JERR_NO_QUANT_TABLE, tblno);
slot_quant = srcinfo->quant_tbl_ptrs[tblno];
c_quant = incomp->quant_table;
if (c_quant != NULL) {
for (coefi = 0; coefi < DCTSIZE2; coefi++) {
if (c_quant->quantval[coefi] != slot_quant->quantval[coefi])
ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno);
if (c_quant->quantval[coefi] != slot_quant->quantval[coefi])
ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno);
}
}
/* Note: we do not copy the source's Huffman table assignments;
/* Note: we do not copy the source's entropy table assignments;
* instead we rely on jpeg_set_colorspace to have made a suitable choice.
*/
}
@@ -156,27 +164,16 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
LOCAL(void)
transencode_master_selection (j_compress_ptr cinfo,
jvirt_barray_ptr * coef_arrays)
jvirt_barray_ptr * coef_arrays)
{
/* Although we don't actually use input_components for transcoding,
* jcmaster.c's initial_setup will complain if input_components is 0.
*/
cinfo->input_components = 1;
/* Initialize master control (includes parameter checking/processing) */
jinit_c_master_control(cinfo, TRUE /* transcode only */);
/* Entropy encoding: either Huffman or arithmetic coding. */
if (cinfo->arith_code) {
ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
} else {
if (cinfo->progressive_mode) {
#ifdef C_PROGRESSIVE_SUPPORTED
jinit_phuff_encoder(cinfo);
#else
ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif
} else
jinit_huff_encoder(cinfo);
if (cinfo->arith_code)
jinit_arith_encoder(cinfo);
else {
jinit_huff_encoder(cinfo);
}
/* We need a special coefficient buffer controller. */
@@ -301,44 +298,44 @@ compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
yoffset++) {
for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
MCU_col_num++) {
MCU_col_num++) {
/* Construct list of pointers to DCT blocks belonging to this MCU */
blkn = 0; /* index of current DCT block within MCU */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
start_col = MCU_col_num * compptr->MCU_width;
blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
: compptr->last_col_width;
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
if (coef->iMCU_row_num < last_iMCU_row ||
yindex+yoffset < compptr->last_row_height) {
/* Fill in pointers to real blocks in this row */
buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
for (xindex = 0; xindex < blockcnt; xindex++)
MCU_buffer[blkn++] = buffer_ptr++;
} else {
/* At bottom of image, need a whole row of dummy blocks */
xindex = 0;
}
/* Fill in any dummy blocks needed in this row.
* Dummy blocks are filled in the same way as in jccoefct.c:
* all zeroes in the AC entries, DC entries equal to previous
* block's DC value. The init routine has already zeroed the
* AC entries, so we need only set the DC entries correctly.
*/
for (; xindex < compptr->MCU_width; xindex++) {
MCU_buffer[blkn] = coef->dummy_buffer[blkn];
MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0];
blkn++;
}
}
compptr = cinfo->cur_comp_info[ci];
start_col = MCU_col_num * compptr->MCU_width;
blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
: compptr->last_col_width;
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
if (coef->iMCU_row_num < last_iMCU_row ||
yindex+yoffset < compptr->last_row_height) {
/* Fill in pointers to real blocks in this row */
buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
for (xindex = 0; xindex < blockcnt; xindex++)
MCU_buffer[blkn++] = buffer_ptr++;
} else {
/* At bottom of image, need a whole row of dummy blocks */
xindex = 0;
}
/* Fill in any dummy blocks needed in this row.
* Dummy blocks are filled in the same way as in jccoefct.c:
* all zeroes in the AC entries, DC entries equal to previous
* block's DC value. The init routine has already zeroed the
* AC entries, so we need only set the DC entries correctly.
*/
for (; xindex < compptr->MCU_width; xindex++) {
MCU_buffer[blkn] = coef->dummy_buffer[blkn];
MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0];
blkn++;
}
}
}
/* Try to write the MCU. */
if (! (*cinfo->entropy->encode_mcu) (cinfo, MCU_buffer)) {
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
coef->mcu_ctr = MCU_col_num;
return FALSE;
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
coef->mcu_ctr = MCU_col_num;
return FALSE;
}
}
/* Completed an MCU row, but perhaps not an iMCU row */
@@ -361,7 +358,7 @@ compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
LOCAL(void)
transencode_coef_controller (j_compress_ptr cinfo,
jvirt_barray_ptr * coef_arrays)
jvirt_barray_ptr * coef_arrays)
{
my_coef_ptr coef;
JBLOCKROW buffer;
@@ -369,8 +366,8 @@ transencode_coef_controller (j_compress_ptr cinfo,
coef = (my_coef_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_coef_controller));
cinfo->coef = (struct jpeg_c_coef_controller *) coef;
SIZEOF(my_coef_controller));
cinfo->coef = &coef->pub;
coef->pub.start_pass = start_pass_coef;
coef->pub.compress_data = compress_output;
@@ -380,8 +377,8 @@ transencode_coef_controller (j_compress_ptr cinfo,
/* Allocate and pre-zero space for dummy DCT blocks. */
buffer = (JBLOCKROW)
(*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
jzero_far((void FAR *) buffer, C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
FMEMZERO((void FAR *) buffer, C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
coef->dummy_buffer[i] = buffer + i;
}
+22 -21
View File
@@ -2,6 +2,7 @@
* jdapimin.c
*
* Copyright (C) 1994-1998, Thomas G. Lane.
* Modified 2009 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -37,7 +38,7 @@ jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize)
ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
if (structsize != SIZEOF(struct jpeg_decompress_struct))
ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
(int) SIZEOF(struct jpeg_decompress_struct), (int) structsize);
(int) SIZEOF(struct jpeg_decompress_struct), (int) structsize);
/* For debugging purposes, we zero the whole master structure.
* But the application has already set the err pointer, and may have set
@@ -128,15 +129,15 @@ default_decompress_parms (j_decompress_ptr cinfo)
} else if (cinfo->saw_Adobe_marker) {
switch (cinfo->Adobe_transform) {
case 0:
cinfo->jpeg_color_space = JCS_RGB;
break;
cinfo->jpeg_color_space = JCS_RGB;
break;
case 1:
cinfo->jpeg_color_space = JCS_YCbCr;
break;
cinfo->jpeg_color_space = JCS_YCbCr;
break;
default:
WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
break;
WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
break;
}
} else {
/* Saw no special markers, try to guess from the component IDs */
@@ -145,12 +146,12 @@ default_decompress_parms (j_decompress_ptr cinfo)
int cid2 = cinfo->comp_info[2].component_id;
if (cid0 == 1 && cid1 == 2 && cid2 == 3)
cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */
cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */
else if (cid0 == 82 && cid1 == 71 && cid2 == 66)
cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */
cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */
else {
TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2);
cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2);
cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
}
}
/* Always guess RGB is proper output colorspace. */
@@ -161,15 +162,15 @@ default_decompress_parms (j_decompress_ptr cinfo)
if (cinfo->saw_Adobe_marker) {
switch (cinfo->Adobe_transform) {
case 0:
cinfo->jpeg_color_space = JCS_CMYK;
break;
cinfo->jpeg_color_space = JCS_CMYK;
break;
case 2:
cinfo->jpeg_color_space = JCS_YCCK;
break;
cinfo->jpeg_color_space = JCS_YCCK;
break;
default:
WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */
break;
WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */
break;
}
} else {
/* No special markers, assume straight CMYK. */
@@ -185,8 +186,8 @@ default_decompress_parms (j_decompress_ptr cinfo)
}
/* Set defaults for other decompression parameters. */
cinfo->scale_num = 1; /* 1:1 scaling */
cinfo->scale_denom = 1;
cinfo->scale_num = cinfo->block_size; /* 1:1 scaling */
cinfo->scale_denom = cinfo->block_size;
cinfo->output_gamma = 1.0;
cinfo->buffered_image = FALSE;
cinfo->raw_data_out = FALSE;
+27 -27
View File
@@ -52,24 +52,24 @@ jpeg_start_decompress (j_decompress_ptr cinfo)
if (cinfo->inputctl->has_multiple_scans) {
#ifdef D_MULTISCAN_FILES_SUPPORTED
for (;;) {
int retcode;
/* Call progress monitor hook if present */
if (cinfo->progress != NULL)
(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
/* Absorb some more input */
retcode = (*cinfo->inputctl->consume_input) (cinfo);
if (retcode == JPEG_SUSPENDED)
return FALSE;
if (retcode == JPEG_REACHED_EOI)
break;
/* Advance progress counter if appropriate */
if (cinfo->progress != NULL &&
(retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {
if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {
/* jdmaster underestimated number of scans; ratchet up one scan */
cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;
}
}
int retcode;
/* Call progress monitor hook if present */
if (cinfo->progress != NULL)
(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
/* Absorb some more input */
retcode = (*cinfo->inputctl->consume_input) (cinfo);
if (retcode == JPEG_SUSPENDED)
return FALSE;
if (retcode == JPEG_REACHED_EOI)
break;
/* Advance progress counter if appropriate */
if (cinfo->progress != NULL &&
(retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {
if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {
/* jdmaster underestimated number of scans; ratchet up one scan */
cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;
}
}
}
#else
ERREXIT(cinfo, JERR_NOT_COMPILED);
@@ -108,16 +108,16 @@ output_pass_setup (j_decompress_ptr cinfo)
JDIMENSION last_scanline;
/* Call progress monitor hook if present */
if (cinfo->progress != NULL) {
cinfo->progress->pass_counter = (long) cinfo->output_scanline;
cinfo->progress->pass_limit = (long) cinfo->output_height;
(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
cinfo->progress->pass_counter = (long) cinfo->output_scanline;
cinfo->progress->pass_limit = (long) cinfo->output_height;
(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
}
/* Process some data */
last_scanline = cinfo->output_scanline;
(*cinfo->main->process_data) (cinfo, (JSAMPARRAY) NULL,
&cinfo->output_scanline, (JDIMENSION) 0);
&cinfo->output_scanline, (JDIMENSION) 0);
if (cinfo->output_scanline == last_scanline)
return FALSE; /* No progress made, must suspend */
return FALSE; /* No progress made, must suspend */
}
/* Finish up dummy pass, and set up for another one */
(*cinfo->master->finish_output_pass) (cinfo);
@@ -150,7 +150,7 @@ output_pass_setup (j_decompress_ptr cinfo)
GLOBAL(JDIMENSION)
jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines,
JDIMENSION max_lines)
JDIMENSION max_lines)
{
JDIMENSION row_ctr;
@@ -183,7 +183,7 @@ jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines,
GLOBAL(JDIMENSION)
jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data,
JDIMENSION max_lines)
JDIMENSION max_lines)
{
JDIMENSION lines_per_iMCU_row;
@@ -202,7 +202,7 @@ jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data,
}
/* Verify that at least one iMCU row can be returned. */
lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->min_DCT_scaled_size;
lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->min_DCT_v_scaled_size;
if (max_lines < lines_per_iMCU_row)
ERREXIT(cinfo, JERR_BUFFER_SIZE);
@@ -264,7 +264,7 @@ jpeg_finish_output (j_decompress_ptr cinfo)
}
/* Read markers looking for SOS or EOI */
while (cinfo->input_scan_number <= cinfo->output_scan_number &&
! cinfo->inputctl->eoi_reached) {
! cinfo->inputctl->eoi_reached) {
if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
return FALSE; /* Suspend, come back later */
}
+782
View File
@@ -0,0 +1,782 @@
/*
* jdarith.c
*
* Developed 1997-2012 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains portable arithmetic entropy decoding routines for JPEG
* (implementing the ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81).
*
* Both sequential and progressive modes are supported in this single module.
*
* Suspension is not currently supported in this module.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
/* Expanded entropy decoder object for arithmetic decoding. */
typedef struct {
struct jpeg_entropy_decoder pub; /* public fields */
INT32 c; /* C register, base of coding interval + input bit buffer */
INT32 a; /* A register, normalized size of coding interval */
int ct; /* bit shift counter, # of bits left in bit buffer part of C */
/* init: ct = -16 */
/* run: ct = 0..7 */
/* error: ct = -1 */
int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
int dc_context[MAX_COMPS_IN_SCAN]; /* context index for DC conditioning */
unsigned int restarts_to_go; /* MCUs left in this restart interval */
/* Pointers to statistics areas (these workspaces have image lifespan) */
unsigned char * dc_stats[NUM_ARITH_TBLS];
unsigned char * ac_stats[NUM_ARITH_TBLS];
/* Statistics bin for coding with fixed probability 0.5 */
unsigned char fixed_bin[4];
} arith_entropy_decoder;
typedef arith_entropy_decoder * arith_entropy_ptr;
/* The following two definitions specify the allocation chunk size
* for the statistics area.
* According to sections F.1.4.4.1.3 and F.1.4.4.2, we need at least
* 49 statistics bins for DC, and 245 statistics bins for AC coding.
*
* We use a compact representation with 1 byte per statistics bin,
* thus the numbers directly represent byte sizes.
* This 1 byte per statistics bin contains the meaning of the MPS
* (more probable symbol) in the highest bit (mask 0x80), and the
* index into the probability estimation state machine table
* in the lower bits (mask 0x7F).
*/
#define DC_STAT_BINS 64
#define AC_STAT_BINS 256
LOCAL(int)
get_byte (j_decompress_ptr cinfo)
/* Read next input byte; we do not support suspension in this module. */
{
struct jpeg_source_mgr * src = cinfo->src;
if (src->bytes_in_buffer == 0)
if (! (*src->fill_input_buffer) (cinfo))
ERREXIT(cinfo, JERR_CANT_SUSPEND);
src->bytes_in_buffer--;
return GETJOCTET(*src->next_input_byte++);
}
/*
* The core arithmetic decoding routine (common in JPEG and JBIG).
* This needs to go as fast as possible.
* Machine-dependent optimization facilities
* are not utilized in this portable implementation.
* However, this code should be fairly efficient and
* may be a good base for further optimizations anyway.
*
* Return value is 0 or 1 (binary decision).
*
* Note: I've changed the handling of the code base & bit
* buffer register C compared to other implementations
* based on the standards layout & procedures.
* While it also contains both the actual base of the
* coding interval (16 bits) and the next-bits buffer,
* the cut-point between these two parts is floating
* (instead of fixed) with the bit shift counter CT.
* Thus, we also need only one (variable instead of
* fixed size) shift for the LPS/MPS decision, and
* we can get away with any renormalization update
* of C (except for new data insertion, of course).
*
* I've also introduced a new scheme for accessing
* the probability estimation state machine table,
* derived from Markus Kuhn's JBIG implementation.
*/
LOCAL(int)
arith_decode (j_decompress_ptr cinfo, unsigned char *st)
{
register arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;
register unsigned char nl, nm;
register INT32 qe, temp;
register int sv, data;
/* Renormalization & data input per section D.2.6 */
while (e->a < 0x8000L) {
if (--e->ct < 0) {
/* Need to fetch next data byte */
if (cinfo->unread_marker)
data = 0; /* stuff zero data */
else {
data = get_byte(cinfo); /* read next input byte */
if (data == 0xFF) { /* zero stuff or marker code */
do data = get_byte(cinfo);
while (data == 0xFF); /* swallow extra 0xFF bytes */
if (data == 0)
data = 0xFF; /* discard stuffed zero byte */
else {
/* Note: Different from the Huffman decoder, hitting
* a marker while processing the compressed data
* segment is legal in arithmetic coding.
* The convention is to supply zero data
* then until decoding is complete.
*/
cinfo->unread_marker = data;
data = 0;
}
}
}
e->c = (e->c << 8) | data; /* insert data into C register */
if ((e->ct += 8) < 0) /* update bit shift counter */
/* Need more initial bytes */
if (++e->ct == 0)
/* Got 2 initial bytes -> re-init A and exit loop */
e->a = 0x8000L; /* => e->a = 0x10000L after loop exit */
}
e->a <<= 1;
}
/* Fetch values from our compact representation of Table D.3(D.2):
* Qe values and probability estimation state machine
*/
sv = *st;
qe = jpeg_aritab[sv & 0x7F]; /* => Qe_Value */
nl = qe & 0xFF; qe >>= 8; /* Next_Index_LPS + Switch_MPS */
nm = qe & 0xFF; qe >>= 8; /* Next_Index_MPS */
/* Decode & estimation procedures per sections D.2.4 & D.2.5 */
temp = e->a - qe;
e->a = temp;
temp <<= e->ct;
if (e->c >= temp) {
e->c -= temp;
/* Conditional LPS (less probable symbol) exchange */
if (e->a < qe) {
e->a = qe;
*st = (sv & 0x80) ^ nm; /* Estimate_after_MPS */
} else {
e->a = qe;
*st = (sv & 0x80) ^ nl; /* Estimate_after_LPS */
sv ^= 0x80; /* Exchange LPS/MPS */
}
} else if (e->a < 0x8000L) {
/* Conditional MPS (more probable symbol) exchange */
if (e->a < qe) {
*st = (sv & 0x80) ^ nl; /* Estimate_after_LPS */
sv ^= 0x80; /* Exchange LPS/MPS */
} else {
*st = (sv & 0x80) ^ nm; /* Estimate_after_MPS */
}
}
return sv >> 7;
}
/*
* Check for a restart marker & resynchronize decoder.
*/
LOCAL(void)
process_restart (j_decompress_ptr cinfo)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
int ci;
jpeg_component_info * compptr;
/* Advance past the RSTn marker */
if (! (*cinfo->marker->read_restart_marker) (cinfo))
ERREXIT(cinfo, JERR_CANT_SUSPEND);
/* Re-initialize statistics areas */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
if (! cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) {
MEMZERO(entropy->dc_stats[compptr->dc_tbl_no], DC_STAT_BINS);
/* Reset DC predictions to 0 */
entropy->last_dc_val[ci] = 0;
entropy->dc_context[ci] = 0;
}
if ((! cinfo->progressive_mode && cinfo->lim_Se) ||
(cinfo->progressive_mode && cinfo->Ss)) {
MEMZERO(entropy->ac_stats[compptr->ac_tbl_no], AC_STAT_BINS);
}
}
/* Reset arithmetic decoding variables */
entropy->c = 0;
entropy->a = 0;
entropy->ct = -16; /* force reading 2 initial bytes to fill C */
/* Reset restart counter */
entropy->restarts_to_go = cinfo->restart_interval;
}
/*
* Arithmetic MCU decoding.
* Each of these routines decodes and returns one MCU's worth of
* arithmetic-compressed coefficients.
* The coefficients are reordered from zigzag order into natural array order,
* but are not dequantized.
*
* The i'th block of the MCU is stored into the block pointed to by
* MCU_data[i]. WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER.
*/
/*
* MCU decoding for DC initial scan (either spectral selection,
* or first pass of successive approximation).
*/
METHODDEF(boolean)
decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
JBLOCKROW block;
unsigned char *st;
int blkn, ci, tbl, sign;
int v, m;
/* Process restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0)
process_restart(cinfo);
entropy->restarts_to_go--;
}
if (entropy->ct == -1) return TRUE; /* if error do nothing */
/* Outer loop handles each block in the MCU */
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
block = MCU_data[blkn];
ci = cinfo->MCU_membership[blkn];
tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;
/* Sections F.2.4.1 & F.1.4.4.1: Decoding of DC coefficients */
/* Table F.4: Point to statistics bin S0 for DC coefficient coding */
st = entropy->dc_stats[tbl] + entropy->dc_context[ci];
/* Figure F.19: Decode_DC_DIFF */
if (arith_decode(cinfo, st) == 0)
entropy->dc_context[ci] = 0;
else {
/* Figure F.21: Decoding nonzero value v */
/* Figure F.22: Decoding the sign of v */
sign = arith_decode(cinfo, st + 1);
st += 2; st += sign;
/* Figure F.23: Decoding the magnitude category of v */
if ((m = arith_decode(cinfo, st)) != 0) {
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
while (arith_decode(cinfo, st)) {
if ((m <<= 1) == 0x8000) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* magnitude overflow */
return TRUE;
}
st += 1;
}
}
/* Section F.1.4.4.1.2: Establish dc_context conditioning category */
if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))
entropy->dc_context[ci] = 0; /* zero diff category */
else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))
entropy->dc_context[ci] = 12 + (sign * 4); /* large diff category */
else
entropy->dc_context[ci] = 4 + (sign * 4); /* small diff category */
v = m;
/* Figure F.24: Decoding the magnitude bit pattern of v */
st += 14;
while (m >>= 1)
if (arith_decode(cinfo, st)) v |= m;
v += 1; if (sign) v = -v;
entropy->last_dc_val[ci] += v;
}
/* Scale and output the DC coefficient (assumes jpeg_natural_order[0]=0) */
(*block)[0] = (JCOEF) (entropy->last_dc_val[ci] << cinfo->Al);
}
return TRUE;
}
/*
* MCU decoding for AC initial scan (either spectral selection,
* or first pass of successive approximation).
*/
METHODDEF(boolean)
decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
JBLOCKROW block;
unsigned char *st;
int tbl, sign, k;
int v, m;
const int * natural_order;
/* Process restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0)
process_restart(cinfo);
entropy->restarts_to_go--;
}
if (entropy->ct == -1) return TRUE; /* if error do nothing */
natural_order = cinfo->natural_order;
/* There is always only one block per MCU */
block = MCU_data[0];
tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
/* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */
/* Figure F.20: Decode_AC_coefficients */
k = cinfo->Ss - 1;
do {
st = entropy->ac_stats[tbl] + 3 * k;
if (arith_decode(cinfo, st)) break; /* EOB flag */
for (;;) {
k++;
if (arith_decode(cinfo, st + 1)) break;
st += 3;
if (k >= cinfo->Se) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* spectral overflow */
return TRUE;
}
}
/* Figure F.21: Decoding nonzero value v */
/* Figure F.22: Decoding the sign of v */
sign = arith_decode(cinfo, entropy->fixed_bin);
st += 2;
/* Figure F.23: Decoding the magnitude category of v */
if ((m = arith_decode(cinfo, st)) != 0) {
if (arith_decode(cinfo, st)) {
m <<= 1;
st = entropy->ac_stats[tbl] +
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
while (arith_decode(cinfo, st)) {
if ((m <<= 1) == 0x8000) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* magnitude overflow */
return TRUE;
}
st += 1;
}
}
}
v = m;
/* Figure F.24: Decoding the magnitude bit pattern of v */
st += 14;
while (m >>= 1)
if (arith_decode(cinfo, st)) v |= m;
v += 1; if (sign) v = -v;
/* Scale and output coefficient in natural (dezigzagged) order */
(*block)[natural_order[k]] = (JCOEF) (v << cinfo->Al);
} while (k < cinfo->Se);
return TRUE;
}
/*
* MCU decoding for DC successive approximation refinement scan.
*/
METHODDEF(boolean)
decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
unsigned char *st;
int p1, blkn;
/* Process restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0)
process_restart(cinfo);
entropy->restarts_to_go--;
}
st = entropy->fixed_bin; /* use fixed probability estimation */
p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
/* Outer loop handles each block in the MCU */
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
/* Encoded data is simply the next bit of the two's-complement DC value */
if (arith_decode(cinfo, st))
MCU_data[blkn][0][0] |= p1;
}
return TRUE;
}
/*
* MCU decoding for AC successive approximation refinement scan.
*/
METHODDEF(boolean)
decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
JBLOCKROW block;
JCOEFPTR thiscoef;
unsigned char *st;
int tbl, k, kex;
int p1, m1;
const int * natural_order;
/* Process restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0)
process_restart(cinfo);
entropy->restarts_to_go--;
}
if (entropy->ct == -1) return TRUE; /* if error do nothing */
natural_order = cinfo->natural_order;
/* There is always only one block per MCU */
block = MCU_data[0];
tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */
/* Establish EOBx (previous stage end-of-block) index */
kex = cinfo->Se;
do {
if ((*block)[natural_order[kex]]) break;
} while (--kex);
k = cinfo->Ss - 1;
do {
st = entropy->ac_stats[tbl] + 3 * k;
if (k >= kex)
if (arith_decode(cinfo, st)) break; /* EOB flag */
for (;;) {
thiscoef = *block + natural_order[++k];
if (*thiscoef) { /* previously nonzero coef */
if (arith_decode(cinfo, st + 2)) {
if (*thiscoef < 0)
*thiscoef += m1;
else
*thiscoef += p1;
}
break;
}
if (arith_decode(cinfo, st + 1)) { /* newly nonzero coef */
if (arith_decode(cinfo, entropy->fixed_bin))
*thiscoef = m1;
else
*thiscoef = p1;
break;
}
st += 3;
if (k >= cinfo->Se) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* spectral overflow */
return TRUE;
}
}
} while (k < cinfo->Se);
return TRUE;
}
/*
* Decode one MCU's worth of arithmetic-compressed coefficients.
*/
METHODDEF(boolean)
decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
jpeg_component_info * compptr;
JBLOCKROW block;
unsigned char *st;
int blkn, ci, tbl, sign, k;
int v, m;
const int * natural_order;
/* Process restart marker if needed */
if (cinfo->restart_interval) {
if (entropy->restarts_to_go == 0)
process_restart(cinfo);
entropy->restarts_to_go--;
}
if (entropy->ct == -1) return TRUE; /* if error do nothing */
natural_order = cinfo->natural_order;
/* Outer loop handles each block in the MCU */
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
block = MCU_data[blkn];
ci = cinfo->MCU_membership[blkn];
compptr = cinfo->cur_comp_info[ci];
/* Sections F.2.4.1 & F.1.4.4.1: Decoding of DC coefficients */
tbl = compptr->dc_tbl_no;
/* Table F.4: Point to statistics bin S0 for DC coefficient coding */
st = entropy->dc_stats[tbl] + entropy->dc_context[ci];
/* Figure F.19: Decode_DC_DIFF */
if (arith_decode(cinfo, st) == 0)
entropy->dc_context[ci] = 0;
else {
/* Figure F.21: Decoding nonzero value v */
/* Figure F.22: Decoding the sign of v */
sign = arith_decode(cinfo, st + 1);
st += 2; st += sign;
/* Figure F.23: Decoding the magnitude category of v */
if ((m = arith_decode(cinfo, st)) != 0) {
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
while (arith_decode(cinfo, st)) {
if ((m <<= 1) == 0x8000) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* magnitude overflow */
return TRUE;
}
st += 1;
}
}
/* Section F.1.4.4.1.2: Establish dc_context conditioning category */
if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))
entropy->dc_context[ci] = 0; /* zero diff category */
else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))
entropy->dc_context[ci] = 12 + (sign * 4); /* large diff category */
else
entropy->dc_context[ci] = 4 + (sign * 4); /* small diff category */
v = m;
/* Figure F.24: Decoding the magnitude bit pattern of v */
st += 14;
while (m >>= 1)
if (arith_decode(cinfo, st)) v |= m;
v += 1; if (sign) v = -v;
entropy->last_dc_val[ci] += v;
}
(*block)[0] = (JCOEF) entropy->last_dc_val[ci];
/* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */
if (cinfo->lim_Se == 0) continue;
tbl = compptr->ac_tbl_no;
k = 0;
/* Figure F.20: Decode_AC_coefficients */
do {
st = entropy->ac_stats[tbl] + 3 * k;
if (arith_decode(cinfo, st)) break; /* EOB flag */
for (;;) {
k++;
if (arith_decode(cinfo, st + 1)) break;
st += 3;
if (k >= cinfo->lim_Se) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* spectral overflow */
return TRUE;
}
}
/* Figure F.21: Decoding nonzero value v */
/* Figure F.22: Decoding the sign of v */
sign = arith_decode(cinfo, entropy->fixed_bin);
st += 2;
/* Figure F.23: Decoding the magnitude category of v */
if ((m = arith_decode(cinfo, st)) != 0) {
if (arith_decode(cinfo, st)) {
m <<= 1;
st = entropy->ac_stats[tbl] +
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
while (arith_decode(cinfo, st)) {
if ((m <<= 1) == 0x8000) {
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
entropy->ct = -1; /* magnitude overflow */
return TRUE;
}
st += 1;
}
}
}
v = m;
/* Figure F.24: Decoding the magnitude bit pattern of v */
st += 14;
while (m >>= 1)
if (arith_decode(cinfo, st)) v |= m;
v += 1; if (sign) v = -v;
(*block)[natural_order[k]] = (JCOEF) v;
} while (k < cinfo->lim_Se);
}
return TRUE;
}
/*
* Initialize for an arithmetic-compressed scan.
*/
METHODDEF(void)
start_pass (j_decompress_ptr cinfo)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
int ci, tbl;
jpeg_component_info * compptr;
if (cinfo->progressive_mode) {
/* Validate progressive scan parameters */
if (cinfo->Ss == 0) {
if (cinfo->Se != 0)
goto bad;
} else {
/* need not check Ss/Se < 0 since they came from unsigned bytes */
if (cinfo->Se < cinfo->Ss || cinfo->Se > cinfo->lim_Se)
goto bad;
/* AC scans may have only one component */
if (cinfo->comps_in_scan != 1)
goto bad;
}
if (cinfo->Ah != 0) {
/* Successive approximation refinement scan: must have Al = Ah-1. */
if (cinfo->Ah-1 != cinfo->Al)
goto bad;
}
if (cinfo->Al > 13) { /* need not check for < 0 */
bad:
ERREXIT4(cinfo, JERR_BAD_PROGRESSION,
cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);
}
/* Update progression status, and verify that scan order is legal.
* Note that inter-scan inconsistencies are treated as warnings
* not fatal errors ... not clear if this is right way to behave.
*/
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
int coefi, cindex = cinfo->cur_comp_info[ci]->component_index;
int *coef_bit_ptr = & cinfo->coef_bits[cindex][0];
if (cinfo->Ss && coef_bit_ptr[0] < 0) /* AC without prior DC scan */
WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);
for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {
int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];
if (cinfo->Ah != expected)
WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);
coef_bit_ptr[coefi] = cinfo->Al;
}
}
/* Select MCU decoding routine */
if (cinfo->Ah == 0) {
if (cinfo->Ss == 0)
entropy->pub.decode_mcu = decode_mcu_DC_first;
else
entropy->pub.decode_mcu = decode_mcu_AC_first;
} else {
if (cinfo->Ss == 0)
entropy->pub.decode_mcu = decode_mcu_DC_refine;
else
entropy->pub.decode_mcu = decode_mcu_AC_refine;
}
} else {
/* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.
* This ought to be an error condition, but we make it a warning.
*/
if (cinfo->Ss != 0 || cinfo->Ah != 0 || cinfo->Al != 0 ||
(cinfo->Se < DCTSIZE2 && cinfo->Se != cinfo->lim_Se))
WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);
/* Select MCU decoding routine */
entropy->pub.decode_mcu = decode_mcu;
}
/* Allocate & initialize requested statistics areas */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
if (! cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) {
tbl = compptr->dc_tbl_no;
if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
if (entropy->dc_stats[tbl] == NULL)
entropy->dc_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, DC_STAT_BINS);
MEMZERO(entropy->dc_stats[tbl], DC_STAT_BINS);
/* Initialize DC predictions to 0 */
entropy->last_dc_val[ci] = 0;
entropy->dc_context[ci] = 0;
}
if ((! cinfo->progressive_mode && cinfo->lim_Se) ||
(cinfo->progressive_mode && cinfo->Ss)) {
tbl = compptr->ac_tbl_no;
if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
if (entropy->ac_stats[tbl] == NULL)
entropy->ac_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, AC_STAT_BINS);
MEMZERO(entropy->ac_stats[tbl], AC_STAT_BINS);
}
}
/* Initialize arithmetic decoding variables */
entropy->c = 0;
entropy->a = 0;
entropy->ct = -16; /* force reading 2 initial bytes to fill C */
/* Initialize restart counter */
entropy->restarts_to_go = cinfo->restart_interval;
}
/*
* Module initialization routine for arithmetic entropy decoding.
*/
GLOBAL(void)
jinit_arith_decoder (j_decompress_ptr cinfo)
{
arith_entropy_ptr entropy;
int i;
entropy = (arith_entropy_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(arith_entropy_decoder));
cinfo->entropy = &entropy->pub;
entropy->pub.start_pass = start_pass;
/* Mark tables unallocated */
for (i = 0; i < NUM_ARITH_TBLS; i++) {
entropy->dc_stats[i] = NULL;
entropy->ac_stats[i] = NULL;
}
/* Initialize index for fixed probability estimation */
entropy->fixed_bin[0] = 113;
if (cinfo->progressive_mode) {
/* Create progression status table */
int *coef_bit_ptr, ci;
cinfo->coef_bits = (int (*)[DCTSIZE2])
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
cinfo->num_components*DCTSIZE2*SIZEOF(int));
coef_bit_ptr = & cinfo->coef_bits[0][0];
for (ci = 0; ci < cinfo->num_components; ci++)
for (i = 0; i < DCTSIZE2; i++)
*coef_bit_ptr++ = -1;
}
}
+124 -5
View File
@@ -2,13 +2,14 @@
* jdatadst.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2009-2012 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains compression data destination routines for the case of
* emitting JPEG data to a file (or any stdio stream). While these routines
* are sufficient for most applications, some will want to use a different
* destination manager.
* emitting JPEG data to memory or to a file (or any stdio stream).
* While these routines are sufficient for most applications,
* some will want to use a different destination manager.
* IMPORTANT: we assume that fwrite() will correctly transcribe an array of
* JOCTETs into 8-bit-wide elements on external storage. If char is wider
* than 8 bits on your machine, you may need to do some tweaking.
@@ -19,6 +20,11 @@
#include "jpeglib.h"
#include "jerror.h"
#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare malloc(),free() */
extern void * malloc JPP((size_t size));
extern void free JPP((void *ptr));
#endif
/* Expanded data destination object for stdio output */
@@ -34,6 +40,21 @@ typedef my_destination_mgr * my_dest_ptr;
#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */
/* Expanded data destination object for memory output */
typedef struct {
struct jpeg_destination_mgr pub; /* public fields */
unsigned char ** outbuffer; /* target buffer */
unsigned long * outsize;
unsigned char * newbuffer; /* newly allocated buffer */
JOCTET * buffer; /* start of buffer */
size_t bufsize;
} my_mem_destination_mgr;
typedef my_mem_destination_mgr * my_mem_dest_ptr;
/*
* Initialize destination --- called by jpeg_start_compress
* before any data is actually written.
@@ -47,12 +68,18 @@ init_destination (j_compress_ptr cinfo)
/* Allocate the output buffer --- it will be released when done with image */
dest->buffer = (JOCTET *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
OUTPUT_BUF_SIZE * SIZEOF(JOCTET));
OUTPUT_BUF_SIZE * SIZEOF(JOCTET));
dest->pub.next_output_byte = dest->buffer;
dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
}
METHODDEF(void)
init_mem_destination (j_compress_ptr cinfo)
{
/* no work necessary here */
}
/*
* Empty the output buffer --- called whenever buffer fills up.
@@ -92,6 +119,36 @@ empty_output_buffer (j_compress_ptr cinfo)
return TRUE;
}
METHODDEF(boolean)
empty_mem_output_buffer (j_compress_ptr cinfo)
{
size_t nextsize;
JOCTET * nextbuffer;
my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest;
/* Try to allocate new buffer with double size */
nextsize = dest->bufsize * 2;
nextbuffer = (JOCTET *) malloc(nextsize);
if (nextbuffer == NULL)
ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);
MEMCOPY(nextbuffer, dest->buffer, dest->bufsize);
if (dest->newbuffer != NULL)
free(dest->newbuffer);
dest->newbuffer = nextbuffer;
dest->pub.next_output_byte = nextbuffer + dest->bufsize;
dest->pub.free_in_buffer = dest->bufsize;
dest->buffer = nextbuffer;
dest->bufsize = nextsize;
return TRUE;
}
/*
* Terminate destination --- called by jpeg_finish_compress
@@ -119,6 +176,15 @@ term_destination (j_compress_ptr cinfo)
ERREXIT(cinfo, JERR_FILE_WRITE);
}
METHODDEF(void)
term_mem_destination (j_compress_ptr cinfo)
{
my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest;
*dest->outbuffer = dest->buffer;
*dest->outsize = dest->bufsize - dest->pub.free_in_buffer;
}
/*
* Prepare for output to a stdio stream.
@@ -140,7 +206,7 @@ jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile)
if (cinfo->dest == NULL) { /* first time for this JPEG object? */
cinfo->dest = (struct jpeg_destination_mgr *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
SIZEOF(my_destination_mgr));
SIZEOF(my_destination_mgr));
}
dest = (my_dest_ptr) cinfo->dest;
@@ -149,3 +215,56 @@ jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile)
dest->pub.term_destination = term_destination;
dest->outfile = outfile;
}
/*
* Prepare for output to a memory buffer.
* The caller may supply an own initial buffer with appropriate size.
* Otherwise, or when the actual data output exceeds the given size,
* the library adapts the buffer size as necessary.
* The standard library functions malloc/free are used for allocating
* larger memory, so the buffer is available to the application after
* finishing compression, and then the application is responsible for
* freeing the requested memory.
* Note: An initial buffer supplied by the caller is expected to be
* managed by the application. The library does not free such buffer
* when allocating a larger buffer.
*/
GLOBAL(void)
jpeg_mem_dest (j_compress_ptr cinfo,
unsigned char ** outbuffer, unsigned long * outsize)
{
my_mem_dest_ptr dest;
if (outbuffer == NULL || outsize == NULL) /* sanity check */
ERREXIT(cinfo, JERR_BUFFER_SIZE);
/* The destination object is made permanent so that multiple JPEG images
* can be written to the same buffer without re-executing jpeg_mem_dest.
*/
if (cinfo->dest == NULL) { /* first time for this JPEG object? */
cinfo->dest = (struct jpeg_destination_mgr *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
SIZEOF(my_mem_destination_mgr));
}
dest = (my_mem_dest_ptr) cinfo->dest;
dest->pub.init_destination = init_mem_destination;
dest->pub.empty_output_buffer = empty_mem_output_buffer;
dest->pub.term_destination = term_mem_destination;
dest->outbuffer = outbuffer;
dest->outsize = outsize;
dest->newbuffer = NULL;
if (*outbuffer == NULL || *outsize == 0) {
/* Allocate initial buffer */
dest->newbuffer = *outbuffer = (unsigned char *) malloc(OUTPUT_BUF_SIZE);
if (dest->newbuffer == NULL)
ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);
*outsize = OUTPUT_BUF_SIZE;
}
dest->pub.next_output_byte = dest->buffer = *outbuffer;
dest->pub.free_in_buffer = dest->bufsize = *outsize;
}
+74 -11
View File
@@ -2,13 +2,14 @@
* jdatasrc.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2009-2011 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains decompression data source routines for the case of
* reading JPEG data from a file (or any stdio stream). While these routines
* are sufficient for most applications, some will want to use a different
* source manager.
* reading JPEG data from memory or from a file (or any stdio stream).
* While these routines are sufficient for most applications,
* some will want to use a different source manager.
* IMPORTANT: we assume that fread() will correctly transcribe an array of
* JOCTETs from 8-bit-wide elements on external storage. If char is wider
* than 8 bits on your machine, you may need to do some tweaking.
@@ -52,6 +53,12 @@ init_source (j_decompress_ptr cinfo)
src->start_of_file = TRUE;
}
METHODDEF(void)
init_mem_source (j_decompress_ptr cinfo)
{
/* no work necessary here */
}
/*
* Fill the input buffer --- called whenever buffer is emptied.
@@ -111,6 +118,27 @@ fill_input_buffer (j_decompress_ptr cinfo)
return TRUE;
}
METHODDEF(boolean)
fill_mem_input_buffer (j_decompress_ptr cinfo)
{
static const JOCTET mybuffer[4] = {
(JOCTET) 0xFF, (JOCTET) JPEG_EOI, 0, 0
};
/* The whole JPEG data is expected to reside in the supplied memory
* buffer, so any request for more data beyond the given buffer size
* is treated as an error.
*/
WARNMS(cinfo, JWRN_JPEG_EOF);
/* Insert a fake EOI marker */
cinfo->src->next_input_byte = mybuffer;
cinfo->src->bytes_in_buffer = 2;
return TRUE;
}
/*
* Skip data --- used to skip over a potentially large amount of
@@ -127,22 +155,22 @@ fill_input_buffer (j_decompress_ptr cinfo)
METHODDEF(void)
skip_input_data (j_decompress_ptr cinfo, long num_bytes)
{
my_src_ptr src = (my_src_ptr) cinfo->src;
struct jpeg_source_mgr * src = cinfo->src;
/* Just a dumb implementation for now. Could use fseek() except
* it doesn't work on pipes. Not clear that being smart is worth
* any trouble anyway --- large skips are infrequent.
*/
if (num_bytes > 0) {
while (num_bytes > (long) src->pub.bytes_in_buffer) {
num_bytes -= (long) src->pub.bytes_in_buffer;
(void) fill_input_buffer(cinfo);
while (num_bytes > (long) src->bytes_in_buffer) {
num_bytes -= (long) src->bytes_in_buffer;
(void) (*src->fill_input_buffer) (cinfo);
/* note we assume that fill_input_buffer will never return FALSE,
* so suspension need not be handled.
*/
}
src->pub.next_input_byte += (size_t) num_bytes;
src->pub.bytes_in_buffer -= (size_t) num_bytes;
src->next_input_byte += (size_t) num_bytes;
src->bytes_in_buffer -= (size_t) num_bytes;
}
}
@@ -193,11 +221,11 @@ jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile)
if (cinfo->src == NULL) { /* first time for this JPEG object? */
cinfo->src = (struct jpeg_source_mgr *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
SIZEOF(my_source_mgr));
SIZEOF(my_source_mgr));
src = (my_src_ptr) cinfo->src;
src->buffer = (JOCTET *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
INPUT_BUF_SIZE * SIZEOF(JOCTET));
INPUT_BUF_SIZE * SIZEOF(JOCTET));
}
src = (my_src_ptr) cinfo->src;
@@ -210,3 +238,38 @@ jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile)
src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
src->pub.next_input_byte = NULL; /* until buffer loaded */
}
/*
* Prepare for input from a supplied memory buffer.
* The buffer must contain the whole JPEG data.
*/
GLOBAL(void)
jpeg_mem_src (j_decompress_ptr cinfo,
unsigned char * inbuffer, unsigned long insize)
{
struct jpeg_source_mgr * src;
if (inbuffer == NULL || insize == 0) /* Treat empty input as fatal error */
ERREXIT(cinfo, JERR_INPUT_EMPTY);
/* The source object is made permanent so that a series of JPEG images
* can be read from the same buffer by calling jpeg_mem_src only before
* the first one.
*/
if (cinfo->src == NULL) { /* first time for this JPEG object? */
cinfo->src = (struct jpeg_source_mgr *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
SIZEOF(struct jpeg_source_mgr));
}
src = cinfo->src;
src->init_source = init_mem_source;
src->fill_input_buffer = fill_mem_input_buffer;
src->skip_input_data = skip_input_data;
src->resync_to_restart = jpeg_resync_to_restart; /* use default method */
src->term_source = term_source;
src->bytes_in_buffer = (size_t) insize;
src->next_input_byte = (JOCTET *) inbuffer;
}
+186 -181
View File
@@ -2,6 +2,7 @@
* jdcoefct.c
*
* Copyright (C) 1994-1997, Thomas G. Lane.
* Modified 2002-2011 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -63,15 +64,15 @@ typedef my_coef_controller * my_coef_ptr;
/* Forward declarations */
METHODDEF(int) decompress_onepass
JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
#ifdef D_MULTISCAN_FILES_SUPPORTED
METHODDEF(int) decompress_data
JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
#endif
#ifdef BLOCK_SMOOTHING_SUPPORTED
LOCAL(boolean) smoothing_ok JPP((j_decompress_ptr cinfo));
METHODDEF(int) decompress_smooth_data
JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
#endif
@@ -160,15 +161,16 @@ decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
yoffset++) {
for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col;
MCU_col_num++) {
MCU_col_num++) {
/* Try to fetch an MCU. Entropy decoder expects buffer to be zeroed. */
jzero_far((void FAR *) coef->MCU_buffer[0],
(size_t) (cinfo->blocks_in_MCU * SIZEOF(JBLOCK)));
if (cinfo->lim_Se) /* can bypass in DC only case */
FMEMZERO((void FAR *) coef->MCU_buffer[0],
(size_t) (cinfo->blocks_in_MCU * SIZEOF(JBLOCK)));
if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
coef->MCU_ctr = MCU_col_num;
return JPEG_SUSPENDED;
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
coef->MCU_ctr = MCU_col_num;
return JPEG_SUSPENDED;
}
/* Determine where data should go in output_buf and do the IDCT thing.
* We skip dummy blocks at the right and bottom edges (but blkn gets
@@ -177,32 +179,32 @@ decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
*/
blkn = 0; /* index of current DCT block within MCU */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
/* Don't bother to IDCT an uninteresting component. */
if (! compptr->component_needed) {
blkn += compptr->MCU_blocks;
continue;
}
inverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index];
useful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
: compptr->last_col_width;
output_ptr = output_buf[compptr->component_index] +
yoffset * compptr->DCT_scaled_size;
start_col = MCU_col_num * compptr->MCU_sample_width;
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
if (cinfo->input_iMCU_row < last_iMCU_row ||
yoffset+yindex < compptr->last_row_height) {
output_col = start_col;
for (xindex = 0; xindex < useful_width; xindex++) {
(*inverse_DCT) (cinfo, compptr,
(JCOEFPTR) coef->MCU_buffer[blkn+xindex],
output_ptr, output_col);
output_col += compptr->DCT_scaled_size;
compptr = cinfo->cur_comp_info[ci];
/* Don't bother to IDCT an uninteresting component. */
if (! compptr->component_needed) {
blkn += compptr->MCU_blocks;
continue;
}
inverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index];
useful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
: compptr->last_col_width;
output_ptr = output_buf[compptr->component_index] +
yoffset * compptr->DCT_v_scaled_size;
start_col = MCU_col_num * compptr->MCU_sample_width;
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
if (cinfo->input_iMCU_row < last_iMCU_row ||
yoffset+yindex < compptr->last_row_height) {
output_col = start_col;
for (xindex = 0; xindex < useful_width; xindex++) {
(*inverse_DCT) (cinfo, compptr,
(JCOEFPTR) coef->MCU_buffer[blkn+xindex],
output_ptr, output_col);
output_col += compptr->DCT_h_scaled_size;
}
}
blkn += compptr->MCU_width;
output_ptr += compptr->DCT_v_scaled_size;
}
}
blkn += compptr->MCU_width;
output_ptr += compptr->DCT_scaled_size;
}
}
}
/* Completed an MCU row, but perhaps not an iMCU row */
@@ -268,25 +270,25 @@ consume_data (j_decompress_ptr cinfo)
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
yoffset++) {
for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row;
MCU_col_num++) {
MCU_col_num++) {
/* Construct list of pointers to DCT blocks belonging to this MCU */
blkn = 0; /* index of current DCT block within MCU */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
start_col = MCU_col_num * compptr->MCU_width;
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
coef->MCU_buffer[blkn++] = buffer_ptr++;
}
}
compptr = cinfo->cur_comp_info[ci];
start_col = MCU_col_num * compptr->MCU_width;
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
coef->MCU_buffer[blkn++] = buffer_ptr++;
}
}
}
/* Try to fetch the MCU. */
if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
coef->MCU_ctr = MCU_col_num;
return JPEG_SUSPENDED;
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
coef->MCU_ctr = MCU_col_num;
return JPEG_SUSPENDED;
}
}
/* Completed an MCU row, but perhaps not an iMCU row */
@@ -327,8 +329,8 @@ decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
/* Force some input to be done if we are getting ahead of the input. */
while (cinfo->input_scan_number < cinfo->output_scan_number ||
(cinfo->input_scan_number == cinfo->output_scan_number &&
cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) {
(cinfo->input_scan_number == cinfo->output_scan_number &&
cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) {
if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED)
return JPEG_SUSPENDED;
}
@@ -359,12 +361,12 @@ decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
buffer_ptr = buffer[block_row];
output_col = 0;
for (block_num = 0; block_num < compptr->width_in_blocks; block_num++) {
(*inverse_DCT) (cinfo, compptr, (JCOEFPTR) buffer_ptr,
output_ptr, output_col);
buffer_ptr++;
output_col += compptr->DCT_scaled_size;
(*inverse_DCT) (cinfo, compptr, (JCOEFPTR) buffer_ptr,
output_ptr, output_col);
buffer_ptr++;
output_col += compptr->DCT_h_scaled_size;
}
output_ptr += compptr->DCT_scaled_size;
output_ptr += compptr->DCT_v_scaled_size;
}
}
@@ -419,8 +421,8 @@ smoothing_ok (j_decompress_ptr cinfo)
if (coef->coef_bits_latch == NULL)
coef->coef_bits_latch = (int *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
cinfo->num_components *
(SAVED_COEFS * SIZEOF(int)));
cinfo->num_components *
(SAVED_COEFS * SIZEOF(int)));
coef_bits_latch = coef->coef_bits_latch;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
@@ -430,11 +432,11 @@ smoothing_ok (j_decompress_ptr cinfo)
return FALSE;
/* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */
if (qtable->quantval[0] == 0 ||
qtable->quantval[Q01_POS] == 0 ||
qtable->quantval[Q10_POS] == 0 ||
qtable->quantval[Q20_POS] == 0 ||
qtable->quantval[Q11_POS] == 0 ||
qtable->quantval[Q02_POS] == 0)
qtable->quantval[Q01_POS] == 0 ||
qtable->quantval[Q10_POS] == 0 ||
qtable->quantval[Q20_POS] == 0 ||
qtable->quantval[Q11_POS] == 0 ||
qtable->quantval[Q02_POS] == 0)
return FALSE;
/* DC values must be at least partly known for all components. */
coef_bits = cinfo->coef_bits[ci];
@@ -444,7 +446,7 @@ smoothing_ok (j_decompress_ptr cinfo)
for (coefi = 1; coefi <= 5; coefi++) {
coef_bits_latch[coefi] = coef_bits[coefi];
if (coef_bits[coefi] != 0)
smoothing_useful = TRUE;
smoothing_useful = TRUE;
}
coef_bits_latch += SAVED_COEFS;
}
@@ -480,7 +482,7 @@ decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
/* Force some input to be done if we are getting ahead of the input. */
while (cinfo->input_scan_number <= cinfo->output_scan_number &&
! cinfo->inputctl->eoi_reached) {
! cinfo->inputctl->eoi_reached) {
if (cinfo->input_scan_number == cinfo->output_scan_number) {
/* If input is working on current scan, we ordinarily want it to
* have completed the current row. But if input scan is DC,
@@ -489,7 +491,7 @@ decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
*/
JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0;
if (cinfo->input_iMCU_row > cinfo->output_iMCU_row+delta)
break;
break;
}
if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED)
return JPEG_SUSPENDED;
@@ -517,15 +519,15 @@ decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
if (cinfo->output_iMCU_row > 0) {
access_rows += compptr->v_samp_factor; /* prior iMCU row too */
buffer = (*cinfo->mem->access_virt_barray)
((j_common_ptr) cinfo, coef->whole_image[ci],
(cinfo->output_iMCU_row - 1) * compptr->v_samp_factor,
(JDIMENSION) access_rows, FALSE);
((j_common_ptr) cinfo, coef->whole_image[ci],
(cinfo->output_iMCU_row - 1) * compptr->v_samp_factor,
(JDIMENSION) access_rows, FALSE);
buffer += compptr->v_samp_factor; /* point to current iMCU row */
first_row = FALSE;
} else {
buffer = (*cinfo->mem->access_virt_barray)
((j_common_ptr) cinfo, coef->whole_image[ci],
(JDIMENSION) 0, (JDIMENSION) access_rows, FALSE);
((j_common_ptr) cinfo, coef->whole_image[ci],
(JDIMENSION) 0, (JDIMENSION) access_rows, FALSE);
first_row = TRUE;
}
/* Fetch component-dependent info */
@@ -543,13 +545,13 @@ decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
for (block_row = 0; block_row < block_rows; block_row++) {
buffer_ptr = buffer[block_row];
if (first_row && block_row == 0)
prev_block_row = buffer_ptr;
prev_block_row = buffer_ptr;
else
prev_block_row = buffer[block_row-1];
prev_block_row = buffer[block_row-1];
if (last_row && block_row == block_rows-1)
next_block_row = buffer_ptr;
next_block_row = buffer_ptr;
else
next_block_row = buffer[block_row+1];
next_block_row = buffer[block_row+1];
/* We fetch the surrounding DC values using a sliding-register approach.
* Initialize all nine here so as to do the right thing on narrow pics.
*/
@@ -559,104 +561,104 @@ decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
output_col = 0;
last_block_column = compptr->width_in_blocks - 1;
for (block_num = 0; block_num <= last_block_column; block_num++) {
/* Fetch current DCT block into workspace so we can modify it. */
jcopy_block_row(buffer_ptr, (JBLOCKROW) workspace, (JDIMENSION) 1);
/* Update DC values */
if (block_num < last_block_column) {
DC3 = (int) prev_block_row[1][0];
DC6 = (int) buffer_ptr[1][0];
DC9 = (int) next_block_row[1][0];
}
/* Compute coefficient estimates per K.8.
* An estimate is applied only if coefficient is still zero,
* and is not known to be fully accurate.
*/
/* AC01 */
if ((Al=coef_bits[1]) != 0 && workspace[1] == 0) {
num = 36 * Q00 * (DC4 - DC6);
if (num >= 0) {
pred = (int) (((Q01<<7) + num) / (Q01<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
} else {
pred = (int) (((Q01<<7) - num) / (Q01<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
pred = -pred;
/* Fetch current DCT block into workspace so we can modify it. */
jcopy_block_row(buffer_ptr, (JBLOCKROW) workspace, (JDIMENSION) 1);
/* Update DC values */
if (block_num < last_block_column) {
DC3 = (int) prev_block_row[1][0];
DC6 = (int) buffer_ptr[1][0];
DC9 = (int) next_block_row[1][0];
}
/* Compute coefficient estimates per K.8.
* An estimate is applied only if coefficient is still zero,
* and is not known to be fully accurate.
*/
/* AC01 */
if ((Al=coef_bits[1]) != 0 && workspace[1] == 0) {
num = 36 * Q00 * (DC4 - DC6);
if (num >= 0) {
pred = (int) (((Q01<<7) + num) / (Q01<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
} else {
pred = (int) (((Q01<<7) - num) / (Q01<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
pred = -pred;
}
workspace[1] = (JCOEF) pred;
}
/* AC10 */
if ((Al=coef_bits[2]) != 0 && workspace[8] == 0) {
num = 36 * Q00 * (DC2 - DC8);
if (num >= 0) {
pred = (int) (((Q10<<7) + num) / (Q10<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
} else {
pred = (int) (((Q10<<7) - num) / (Q10<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
pred = -pred;
}
workspace[8] = (JCOEF) pred;
}
/* AC20 */
if ((Al=coef_bits[3]) != 0 && workspace[16] == 0) {
num = 9 * Q00 * (DC2 + DC8 - 2*DC5);
if (num >= 0) {
pred = (int) (((Q20<<7) + num) / (Q20<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
} else {
pred = (int) (((Q20<<7) - num) / (Q20<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
pred = -pred;
}
workspace[16] = (JCOEF) pred;
}
/* AC11 */
if ((Al=coef_bits[4]) != 0 && workspace[9] == 0) {
num = 5 * Q00 * (DC1 - DC3 - DC7 + DC9);
if (num >= 0) {
pred = (int) (((Q11<<7) + num) / (Q11<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
} else {
pred = (int) (((Q11<<7) - num) / (Q11<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
pred = -pred;
}
workspace[9] = (JCOEF) pred;
}
/* AC02 */
if ((Al=coef_bits[5]) != 0 && workspace[2] == 0) {
num = 9 * Q00 * (DC4 + DC6 - 2*DC5);
if (num >= 0) {
pred = (int) (((Q02<<7) + num) / (Q02<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
} else {
pred = (int) (((Q02<<7) - num) / (Q02<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
pred = -pred;
}
workspace[2] = (JCOEF) pred;
}
/* OK, do the IDCT */
(*inverse_DCT) (cinfo, compptr, (JCOEFPTR) workspace,
output_ptr, output_col);
/* Advance for next column */
DC1 = DC2; DC2 = DC3;
DC4 = DC5; DC5 = DC6;
DC7 = DC8; DC8 = DC9;
buffer_ptr++, prev_block_row++, next_block_row++;
output_col += compptr->DCT_h_scaled_size;
}
workspace[1] = (JCOEF) pred;
}
/* AC10 */
if ((Al=coef_bits[2]) != 0 && workspace[8] == 0) {
num = 36 * Q00 * (DC2 - DC8);
if (num >= 0) {
pred = (int) (((Q10<<7) + num) / (Q10<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
} else {
pred = (int) (((Q10<<7) - num) / (Q10<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
pred = -pred;
}
workspace[8] = (JCOEF) pred;
}
/* AC20 */
if ((Al=coef_bits[3]) != 0 && workspace[16] == 0) {
num = 9 * Q00 * (DC2 + DC8 - 2*DC5);
if (num >= 0) {
pred = (int) (((Q20<<7) + num) / (Q20<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
} else {
pred = (int) (((Q20<<7) - num) / (Q20<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
pred = -pred;
}
workspace[16] = (JCOEF) pred;
}
/* AC11 */
if ((Al=coef_bits[4]) != 0 && workspace[9] == 0) {
num = 5 * Q00 * (DC1 - DC3 - DC7 + DC9);
if (num >= 0) {
pred = (int) (((Q11<<7) + num) / (Q11<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
} else {
pred = (int) (((Q11<<7) - num) / (Q11<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
pred = -pred;
}
workspace[9] = (JCOEF) pred;
}
/* AC02 */
if ((Al=coef_bits[5]) != 0 && workspace[2] == 0) {
num = 9 * Q00 * (DC4 + DC6 - 2*DC5);
if (num >= 0) {
pred = (int) (((Q02<<7) + num) / (Q02<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
} else {
pred = (int) (((Q02<<7) - num) / (Q02<<8));
if (Al > 0 && pred >= (1<<Al))
pred = (1<<Al)-1;
pred = -pred;
}
workspace[2] = (JCOEF) pred;
}
/* OK, do the IDCT */
(*inverse_DCT) (cinfo, compptr, (JCOEFPTR) workspace,
output_ptr, output_col);
/* Advance for next column */
DC1 = DC2; DC2 = DC3;
DC4 = DC5; DC5 = DC6;
DC7 = DC8; DC8 = DC9;
buffer_ptr++, prev_block_row++, next_block_row++;
output_col += compptr->DCT_scaled_size;
}
output_ptr += compptr->DCT_scaled_size;
output_ptr += compptr->DCT_v_scaled_size;
}
}
@@ -679,7 +681,7 @@ jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
coef = (my_coef_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_coef_controller));
SIZEOF(my_coef_controller));
cinfo->coef = (struct jpeg_d_coef_controller *) coef;
coef->pub.start_input_pass = start_input_pass;
coef->pub.start_output_pass = start_output_pass;
@@ -697,20 +699,20 @@ jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
jpeg_component_info *compptr;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
ci++, compptr++) {
access_rows = compptr->v_samp_factor;
#ifdef BLOCK_SMOOTHING_SUPPORTED
/* If block smoothing could be used, need a bigger window */
if (cinfo->progressive_mode)
access_rows *= 3;
access_rows *= 3;
#endif
coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
((j_common_ptr) cinfo, JPOOL_IMAGE, TRUE,
(JDIMENSION) jround_up((long) compptr->width_in_blocks,
(long) compptr->h_samp_factor),
(JDIMENSION) jround_up((long) compptr->height_in_blocks,
(long) compptr->v_samp_factor),
(JDIMENSION) access_rows);
((j_common_ptr) cinfo, JPOOL_IMAGE, TRUE,
(JDIMENSION) jround_up((long) compptr->width_in_blocks,
(long) compptr->h_samp_factor),
(JDIMENSION) jround_up((long) compptr->height_in_blocks,
(long) compptr->v_samp_factor),
(JDIMENSION) access_rows);
}
coef->pub.consume_data = consume_data;
coef->pub.decompress_data = decompress_data;
@@ -725,10 +727,13 @@ jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
buffer = (JBLOCKROW)
(*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
for (i = 0; i < D_MAX_BLOCKS_IN_MCU; i++) {
coef->MCU_buffer[i] = buffer + i;
}
if (cinfo->lim_Se == 0) /* DC only case: want to bypass later */
FMEMZERO((void FAR *) buffer,
(size_t) (D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK)));
coef->pub.consume_data = dummy_consume_data;
coef->pub.decompress_data = decompress_onepass;
coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */
+258 -36
View File
@@ -2,6 +2,7 @@
* jdcolor.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2011-2012 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -23,20 +24,28 @@ typedef struct {
int * Cb_b_tab; /* => table for Cb to B conversion */
INT32 * Cr_g_tab; /* => table for Cr to G conversion */
INT32 * Cb_g_tab; /* => table for Cb to G conversion */
/* Private state for RGB->Y conversion */
INT32 * rgb_y_tab; /* => table for RGB to Y conversion */
} my_color_deconverter;
typedef my_color_deconverter * my_cconvert_ptr;
/**************** YCbCr -> RGB conversion: most common case **************/
/**************** RGB -> Y conversion: less common case **************/
/*
* YCbCr is defined per CCIR 601-1, except that Cb and Cr are
* normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
* The conversion equations to be implemented are therefore
*
* R = Y + 1.40200 * Cr
* G = Y - 0.34414 * Cb - 0.71414 * Cr
* B = Y + 1.77200 * Cb
*
* Y = 0.29900 * R + 0.58700 * G + 0.11400 * B
*
* where Cb and Cr represent the incoming values less CENTERJSAMPLE.
* (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
*
@@ -61,6 +70,18 @@ typedef my_color_deconverter * my_cconvert_ptr;
#define ONE_HALF ((INT32) 1 << (SCALEBITS-1))
#define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
/* We allocate one big table for RGB->Y conversion and divide it up into
* three parts, instead of doing three alloc_small requests. This lets us
* use a single table base address, which can be held in a register in the
* inner loops on many machines (more than can hold all three addresses,
* anyway).
*/
#define R_Y_OFF 0 /* offset to R => Y section */
#define G_Y_OFF (1*(MAXJSAMPLE+1)) /* offset to G => Y section */
#define B_Y_OFF (2*(MAXJSAMPLE+1)) /* etc. */
#define TABLE_SIZE (3*(MAXJSAMPLE+1))
/*
* Initialize tables for YCC->RGB colorspace conversion.
@@ -76,26 +97,26 @@ build_ycc_rgb_table (j_decompress_ptr cinfo)
cconvert->Cr_r_tab = (int *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(int));
(MAXJSAMPLE+1) * SIZEOF(int));
cconvert->Cb_b_tab = (int *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(int));
(MAXJSAMPLE+1) * SIZEOF(int));
cconvert->Cr_g_tab = (INT32 *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(INT32));
(MAXJSAMPLE+1) * SIZEOF(INT32));
cconvert->Cb_g_tab = (INT32 *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(MAXJSAMPLE+1) * SIZEOF(INT32));
(MAXJSAMPLE+1) * SIZEOF(INT32));
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
/* Cr=>R value is nearest int to 1.40200 * x */
cconvert->Cr_r_tab[i] = (int)
RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
/* Cb=>B value is nearest int to 1.77200 * x */
cconvert->Cb_b_tab[i] = (int)
RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
/* Cr=>G value is scaled-up -0.71414 * x */
cconvert->Cr_g_tab[i] = (- FIX(0.71414)) * x;
/* Cb=>G value is scaled-up -0.34414 * x */
@@ -118,8 +139,8 @@ build_ycc_rgb_table (j_decompress_ptr cinfo)
METHODDEF(void)
ycc_rgb_convert (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
register int y, cb, cr;
@@ -148,8 +169,8 @@ ycc_rgb_convert (j_decompress_ptr cinfo,
/* Range-limiting is essential due to noise introduced by DCT losses. */
outptr[RGB_RED] = range_limit[y + Crrtab[cr]];
outptr[RGB_GREEN] = range_limit[y +
((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
SCALEBITS))];
((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
SCALEBITS))];
outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]];
outptr += RGB_PIXELSIZE;
}
@@ -160,6 +181,178 @@ ycc_rgb_convert (j_decompress_ptr cinfo,
/**************** Cases other than YCbCr -> RGB **************/
/*
* Initialize for RGB->grayscale colorspace conversion.
*/
LOCAL(void)
build_rgb_y_table (j_decompress_ptr cinfo)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
INT32 * rgb_y_tab;
INT32 i;
/* Allocate and fill in the conversion tables. */
cconvert->rgb_y_tab = rgb_y_tab = (INT32 *)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(TABLE_SIZE * SIZEOF(INT32)));
for (i = 0; i <= MAXJSAMPLE; i++) {
rgb_y_tab[i+R_Y_OFF] = FIX(0.29900) * i;
rgb_y_tab[i+G_Y_OFF] = FIX(0.58700) * i;
rgb_y_tab[i+B_Y_OFF] = FIX(0.11400) * i + ONE_HALF;
}
}
/*
* Convert RGB to grayscale.
*/
METHODDEF(void)
rgb_gray_convert (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
register INT32 * ctab = cconvert->rgb_y_tab;
register int r, g, b;
register JSAMPROW outptr;
register JSAMPROW inptr0, inptr1, inptr2;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
while (--num_rows >= 0) {
inptr0 = input_buf[0][input_row];
inptr1 = input_buf[1][input_row];
inptr2 = input_buf[2][input_row];
input_row++;
outptr = *output_buf++;
for (col = 0; col < num_cols; col++) {
r = GETJSAMPLE(inptr0[col]);
g = GETJSAMPLE(inptr1[col]);
b = GETJSAMPLE(inptr2[col]);
/* Y */
outptr[col] = (JSAMPLE)
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
>> SCALEBITS);
}
}
}
/*
* [R-G,G,B-G] to [R,G,B] conversion with modulo calculation
* (inverse color transform).
*/
METHODDEF(void)
rgb1_rgb_convert (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
{
register int r, g, b;
register JSAMPROW outptr;
register JSAMPROW inptr0, inptr1, inptr2;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
while (--num_rows >= 0) {
inptr0 = input_buf[0][input_row];
inptr1 = input_buf[1][input_row];
inptr2 = input_buf[2][input_row];
input_row++;
outptr = *output_buf++;
for (col = 0; col < num_cols; col++) {
r = GETJSAMPLE(inptr0[col]);
g = GETJSAMPLE(inptr1[col]);
b = GETJSAMPLE(inptr2[col]);
/* Assume that MAXJSAMPLE+1 is a power of 2, so that the MOD
* (modulo) operator is equivalent to the bitmask operator AND.
*/
outptr[RGB_RED] = (JSAMPLE) ((r + g - CENTERJSAMPLE) & MAXJSAMPLE);
outptr[RGB_GREEN] = (JSAMPLE) g;
outptr[RGB_BLUE] = (JSAMPLE) ((b + g - CENTERJSAMPLE) & MAXJSAMPLE);
outptr += RGB_PIXELSIZE;
}
}
}
/*
* [R-G,G,B-G] to grayscale conversion with modulo calculation
* (inverse color transform).
*/
METHODDEF(void)
rgb1_gray_convert (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
register INT32 * ctab = cconvert->rgb_y_tab;
register int r, g, b;
register JSAMPROW outptr;
register JSAMPROW inptr0, inptr1, inptr2;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
while (--num_rows >= 0) {
inptr0 = input_buf[0][input_row];
inptr1 = input_buf[1][input_row];
inptr2 = input_buf[2][input_row];
input_row++;
outptr = *output_buf++;
for (col = 0; col < num_cols; col++) {
r = GETJSAMPLE(inptr0[col]);
g = GETJSAMPLE(inptr1[col]);
b = GETJSAMPLE(inptr2[col]);
/* Assume that MAXJSAMPLE+1 is a power of 2, so that the MOD
* (modulo) operator is equivalent to the bitmask operator AND.
*/
r = (r + g - CENTERJSAMPLE) & MAXJSAMPLE;
b = (b + g - CENTERJSAMPLE) & MAXJSAMPLE;
/* Y */
outptr[col] = (JSAMPLE)
((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
>> SCALEBITS);
}
}
}
/*
* No colorspace change, but conversion from separate-planes
* to interleaved representation.
*/
METHODDEF(void)
rgb_convert (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
{
register JSAMPROW outptr;
register JSAMPROW inptr0, inptr1, inptr2;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
while (--num_rows >= 0) {
inptr0 = input_buf[0][input_row];
inptr1 = input_buf[1][input_row];
inptr2 = input_buf[2][input_row];
input_row++;
outptr = *output_buf++;
for (col = 0; col < num_cols; col++) {
/* We can dispense with GETJSAMPLE() here */
outptr[RGB_RED] = inptr0[col];
outptr[RGB_GREEN] = inptr1[col];
outptr[RGB_BLUE] = inptr2[col];
outptr += RGB_PIXELSIZE;
}
}
}
/*
* Color conversion for no colorspace change: just copy the data,
* converting from separate-planes to interleaved representation.
@@ -167,22 +360,23 @@ ycc_rgb_convert (j_decompress_ptr cinfo,
METHODDEF(void)
null_convert (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
{
register JSAMPROW inptr, outptr;
register JDIMENSION count;
register int num_components = cinfo->num_components;
JDIMENSION num_cols = cinfo->output_width;
int ci;
register int nc = cinfo->num_components;
register JSAMPROW outptr;
register JSAMPROW inptr;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
while (--num_rows >= 0) {
for (ci = 0; ci < num_components; ci++) {
for (ci = 0; ci < nc; ci++) {
inptr = input_buf[ci][input_row];
outptr = output_buf[0] + ci;
for (count = num_cols; count > 0; count--) {
*outptr = *inptr++; /* needn't bother with GETJSAMPLE() here */
outptr += num_components;
for (col = 0; col < num_cols; col++) {
*outptr = *inptr++; /* needn't bother with GETJSAMPLE() here */
outptr += nc;
}
}
input_row++;
@@ -199,11 +393,11 @@ null_convert (j_decompress_ptr cinfo,
METHODDEF(void)
grayscale_convert (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
{
jcopy_sample_rows(input_buf[0], (int) input_row, output_buf, 0,
num_rows, cinfo->output_width);
num_rows, cinfo->output_width);
}
@@ -215,10 +409,11 @@ grayscale_convert (j_decompress_ptr cinfo,
METHODDEF(void)
gray_rgb_convert (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
{
register JSAMPROW inptr, outptr;
register JSAMPROW outptr;
register JSAMPROW inptr;
register JDIMENSION col;
JDIMENSION num_cols = cinfo->output_width;
@@ -243,8 +438,8 @@ gray_rgb_convert (j_decompress_ptr cinfo,
METHODDEF(void)
ycck_cmyk_convert (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
{
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
register int y, cb, cr;
@@ -274,8 +469,8 @@ ycck_cmyk_convert (j_decompress_ptr cinfo,
/* Range-limiting is essential due to noise introduced by DCT losses. */
outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])]; /* red */
outptr[1] = range_limit[MAXJSAMPLE - (y + /* green */
((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
SCALEBITS)))];
((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
SCALEBITS)))];
outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])]; /* blue */
/* K passes through unchanged */
outptr[3] = inptr3[col]; /* don't need GETJSAMPLE here */
@@ -308,8 +503,8 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
cconvert = (my_cconvert_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_color_deconverter));
cinfo->cconvert = (struct jpeg_color_deconverter *) cconvert;
SIZEOF(my_color_deconverter));
cinfo->cconvert = &cconvert->pub;
cconvert->pub.start_pass = start_pass_dcolor;
/* Make sure num_components agrees with jpeg_color_space */
@@ -337,6 +532,10 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
break;
}
/* Support color transform only for RGB colorspace */
if (cinfo->color_transform && cinfo->jpeg_color_space != JCS_RGB)
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
/* Set out_color_components and conversion method based on requested space.
* Also clear the component_needed flags for any unused components,
* so that earlier pipeline stages can avoid useless computation.
@@ -346,11 +545,24 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
case JCS_GRAYSCALE:
cinfo->out_color_components = 1;
if (cinfo->jpeg_color_space == JCS_GRAYSCALE ||
cinfo->jpeg_color_space == JCS_YCbCr) {
cinfo->jpeg_color_space == JCS_YCbCr) {
cconvert->pub.color_convert = grayscale_convert;
/* For color->grayscale conversion, only the Y (0) component is needed */
for (ci = 1; ci < cinfo->num_components; ci++)
cinfo->comp_info[ci].component_needed = FALSE;
cinfo->comp_info[ci].component_needed = FALSE;
} else if (cinfo->jpeg_color_space == JCS_RGB) {
switch (cinfo->color_transform) {
case JCT_NONE:
cconvert->pub.color_convert = rgb_gray_convert;
break;
case JCT_SUBTRACT_GREEN:
cconvert->pub.color_convert = rgb1_gray_convert;
break;
default:
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break;
}
build_rgb_y_table(cinfo);
} else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break;
@@ -362,8 +574,18 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
build_ycc_rgb_table(cinfo);
} else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
cconvert->pub.color_convert = gray_rgb_convert;
} else if (cinfo->jpeg_color_space == JCS_RGB && RGB_PIXELSIZE == 3) {
cconvert->pub.color_convert = null_convert;
} else if (cinfo->jpeg_color_space == JCS_RGB) {
switch (cinfo->color_transform) {
case JCT_NONE:
cconvert->pub.color_convert = rgb_convert;
break;
case JCT_SUBTRACT_GREEN:
cconvert->pub.color_convert = rgb1_rgb_convert;
break;
default:
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break;
}
} else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
break;
+234 -17
View File
@@ -14,11 +14,16 @@
/*
* A forward DCT routine is given a pointer to a work area of type DCTELEM[];
* the DCT is to be performed in-place in that buffer. Type DCTELEM is int
* for 8-bit samples, INT32 for 12-bit samples. (NOTE: Floating-point DCT
* implementations use an array of type FAST_FLOAT, instead.)
* The DCT inputs are expected to be signed (range +-CENTERJSAMPLE).
* A forward DCT routine is given a pointer to an input sample array and
* a pointer to a work area of type DCTELEM[]; the DCT is to be performed
* in-place in that buffer. Type DCTELEM is int for 8-bit samples, INT32
* for 12-bit samples. (NOTE: Floating-point DCT implementations use an
* array of type FAST_FLOAT, instead.)
* The input data is to be fetched from the sample array starting at a
* specified column. (Any row offset needed will be applied to the array
* pointer before it is passed to the FDCT code.)
* Note that the number of samples fetched by the FDCT routine is
* DCT_h_scaled_size * DCT_v_scaled_size.
* The DCT outputs are returned scaled up by a factor of 8; they therefore
* have a range of +-8K for 8-bit data, +-128K for 12-bit data. This
* convention improves accuracy in integer implementations and saves some
@@ -32,8 +37,12 @@ typedef int DCTELEM; /* 16 or 32 bits is fine */
typedef INT32 DCTELEM; /* must have 32 bits */
#endif
typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data));
typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data));
typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data,
JSAMPARRAY sample_data,
JDIMENSION start_col));
typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data,
JSAMPARRAY sample_data,
JDIMENSION start_col));
/*
@@ -44,7 +53,7 @@ typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data));
* sample array starting at a specified column. (Any row offset needed will
* be applied to the array pointer before it is passed to the IDCT code.)
* Note that the number of samples emitted by the IDCT routine is
* DCT_scaled_size * DCT_scaled_size.
* DCT_h_scaled_size * DCT_v_scaled_size.
*/
/* typedef inverse_DCT_method_ptr is declared in jpegint.h */
@@ -84,38 +93,246 @@ typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */
#define jpeg_fdct_islow jFDislow
#define jpeg_fdct_ifast jFDifast
#define jpeg_fdct_float jFDfloat
#define jpeg_fdct_7x7 jFD7x7
#define jpeg_fdct_6x6 jFD6x6
#define jpeg_fdct_5x5 jFD5x5
#define jpeg_fdct_4x4 jFD4x4
#define jpeg_fdct_3x3 jFD3x3
#define jpeg_fdct_2x2 jFD2x2
#define jpeg_fdct_1x1 jFD1x1
#define jpeg_fdct_9x9 jFD9x9
#define jpeg_fdct_10x10 jFD10x10
#define jpeg_fdct_11x11 jFD11x11
#define jpeg_fdct_12x12 jFD12x12
#define jpeg_fdct_13x13 jFD13x13
#define jpeg_fdct_14x14 jFD14x14
#define jpeg_fdct_15x15 jFD15x15
#define jpeg_fdct_16x16 jFD16x16
#define jpeg_fdct_16x8 jFD16x8
#define jpeg_fdct_14x7 jFD14x7
#define jpeg_fdct_12x6 jFD12x6
#define jpeg_fdct_10x5 jFD10x5
#define jpeg_fdct_8x4 jFD8x4
#define jpeg_fdct_6x3 jFD6x3
#define jpeg_fdct_4x2 jFD4x2
#define jpeg_fdct_2x1 jFD2x1
#define jpeg_fdct_8x16 jFD8x16
#define jpeg_fdct_7x14 jFD7x14
#define jpeg_fdct_6x12 jFD6x12
#define jpeg_fdct_5x10 jFD5x10
#define jpeg_fdct_4x8 jFD4x8
#define jpeg_fdct_3x6 jFD3x6
#define jpeg_fdct_2x4 jFD2x4
#define jpeg_fdct_1x2 jFD1x2
#define jpeg_idct_islow jRDislow
#define jpeg_idct_ifast jRDifast
#define jpeg_idct_float jRDfloat
#define jpeg_idct_7x7 jRD7x7
#define jpeg_idct_6x6 jRD6x6
#define jpeg_idct_5x5 jRD5x5
#define jpeg_idct_4x4 jRD4x4
#define jpeg_idct_3x3 jRD3x3
#define jpeg_idct_2x2 jRD2x2
#define jpeg_idct_1x1 jRD1x1
#define jpeg_idct_9x9 jRD9x9
#define jpeg_idct_10x10 jRD10x10
#define jpeg_idct_11x11 jRD11x11
#define jpeg_idct_12x12 jRD12x12
#define jpeg_idct_13x13 jRD13x13
#define jpeg_idct_14x14 jRD14x14
#define jpeg_idct_15x15 jRD15x15
#define jpeg_idct_16x16 jRD16x16
#define jpeg_idct_16x8 jRD16x8
#define jpeg_idct_14x7 jRD14x7
#define jpeg_idct_12x6 jRD12x6
#define jpeg_idct_10x5 jRD10x5
#define jpeg_idct_8x4 jRD8x4
#define jpeg_idct_6x3 jRD6x3
#define jpeg_idct_4x2 jRD4x2
#define jpeg_idct_2x1 jRD2x1
#define jpeg_idct_8x16 jRD8x16
#define jpeg_idct_7x14 jRD7x14
#define jpeg_idct_6x12 jRD6x12
#define jpeg_idct_5x10 jRD5x10
#define jpeg_idct_4x8 jRD4x8
#define jpeg_idct_3x6 jRD3x8
#define jpeg_idct_2x4 jRD2x4
#define jpeg_idct_1x2 jRD1x2
#endif /* NEED_SHORT_EXTERNAL_NAMES */
/* Extern declarations for the forward and inverse DCT routines. */
EXTERN(void) jpeg_fdct_islow JPP((DCTELEM * data));
EXTERN(void) jpeg_fdct_ifast JPP((DCTELEM * data));
EXTERN(void) jpeg_fdct_float JPP((FAST_FLOAT * data));
EXTERN(void) jpeg_fdct_islow
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_ifast
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_float
JPP((FAST_FLOAT * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_7x7
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_6x6
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_5x5
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_4x4
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_3x3
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_2x2
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_1x1
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_9x9
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_10x10
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_11x11
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_12x12
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_13x13
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_14x14
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_15x15
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_16x16
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_16x8
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_14x7
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_12x6
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_10x5
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_8x4
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_6x3
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_4x2
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_2x1
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_8x16
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_7x14
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_6x12
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_5x10
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_4x8
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_3x6
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_2x4
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_fdct_1x2
JPP((DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col));
EXTERN(void) jpeg_idct_islow
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_ifast
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_float
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_7x7
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_6x6
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_5x5
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_4x4
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_3x3
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_2x2
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_1x1
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_9x9
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_10x10
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_11x11
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_12x12
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_13x13
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_14x14
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_15x15
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_16x16
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_16x8
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_14x7
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_12x6
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_10x5
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_8x4
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_6x3
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_4x2
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_2x1
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_8x16
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_7x14
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_6x12
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_5x10
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_4x8
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_3x6
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_2x4
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
EXTERN(void) jpeg_idct_1x2
JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));
/*
+190 -75
View File
@@ -2,6 +2,7 @@
* jddctmgr.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
* Modified 2002-2010 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -98,48 +99,161 @@ start_pass (j_decompress_ptr cinfo)
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
/* Select the proper IDCT routine for this component's scaling */
switch (compptr->DCT_scaled_size) {
switch ((compptr->DCT_h_scaled_size << 8) + compptr->DCT_v_scaled_size) {
#ifdef IDCT_SCALING_SUPPORTED
case 1:
case ((1 << 8) + 1):
method_ptr = jpeg_idct_1x1;
method = JDCT_ISLOW; /* jidctred uses islow-style table */
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case 2:
case ((2 << 8) + 2):
method_ptr = jpeg_idct_2x2;
method = JDCT_ISLOW; /* jidctred uses islow-style table */
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case 4:
case ((3 << 8) + 3):
method_ptr = jpeg_idct_3x3;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((4 << 8) + 4):
method_ptr = jpeg_idct_4x4;
method = JDCT_ISLOW; /* jidctred uses islow-style table */
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((5 << 8) + 5):
method_ptr = jpeg_idct_5x5;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((6 << 8) + 6):
method_ptr = jpeg_idct_6x6;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((7 << 8) + 7):
method_ptr = jpeg_idct_7x7;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((9 << 8) + 9):
method_ptr = jpeg_idct_9x9;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((10 << 8) + 10):
method_ptr = jpeg_idct_10x10;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((11 << 8) + 11):
method_ptr = jpeg_idct_11x11;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((12 << 8) + 12):
method_ptr = jpeg_idct_12x12;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((13 << 8) + 13):
method_ptr = jpeg_idct_13x13;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((14 << 8) + 14):
method_ptr = jpeg_idct_14x14;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((15 << 8) + 15):
method_ptr = jpeg_idct_15x15;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((16 << 8) + 16):
method_ptr = jpeg_idct_16x16;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((16 << 8) + 8):
method_ptr = jpeg_idct_16x8;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((14 << 8) + 7):
method_ptr = jpeg_idct_14x7;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((12 << 8) + 6):
method_ptr = jpeg_idct_12x6;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((10 << 8) + 5):
method_ptr = jpeg_idct_10x5;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((8 << 8) + 4):
method_ptr = jpeg_idct_8x4;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((6 << 8) + 3):
method_ptr = jpeg_idct_6x3;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((4 << 8) + 2):
method_ptr = jpeg_idct_4x2;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((2 << 8) + 1):
method_ptr = jpeg_idct_2x1;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((8 << 8) + 16):
method_ptr = jpeg_idct_8x16;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((7 << 8) + 14):
method_ptr = jpeg_idct_7x14;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((6 << 8) + 12):
method_ptr = jpeg_idct_6x12;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((5 << 8) + 10):
method_ptr = jpeg_idct_5x10;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((4 << 8) + 8):
method_ptr = jpeg_idct_4x8;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((3 << 8) + 6):
method_ptr = jpeg_idct_3x6;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((2 << 8) + 4):
method_ptr = jpeg_idct_2x4;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
case ((1 << 8) + 2):
method_ptr = jpeg_idct_1x2;
method = JDCT_ISLOW; /* jidctint uses islow-style table */
break;
#endif
case DCTSIZE:
case ((DCTSIZE << 8) + DCTSIZE):
switch (cinfo->dct_method) {
#ifdef DCT_ISLOW_SUPPORTED
case JDCT_ISLOW:
method_ptr = jpeg_idct_islow;
method = JDCT_ISLOW;
break;
method_ptr = jpeg_idct_islow;
method = JDCT_ISLOW;
break;
#endif
#ifdef DCT_IFAST_SUPPORTED
case JDCT_IFAST:
method_ptr = jpeg_idct_ifast;
method = JDCT_IFAST;
break;
method_ptr = jpeg_idct_ifast;
method = JDCT_IFAST;
break;
#endif
#ifdef DCT_FLOAT_SUPPORTED
case JDCT_FLOAT:
method_ptr = jpeg_idct_float;
method = JDCT_FLOAT;
break;
method_ptr = jpeg_idct_float;
method = JDCT_FLOAT;
break;
#endif
default:
ERREXIT(cinfo, JERR_NOT_COMPILED);
break;
ERREXIT(cinfo, JERR_NOT_COMPILED);
break;
}
break;
default:
ERREXIT1(cinfo, JERR_BAD_DCTSIZE, compptr->DCT_scaled_size);
ERREXIT2(cinfo, JERR_BAD_DCTSIZE,
compptr->DCT_h_scaled_size, compptr->DCT_v_scaled_size);
break;
}
idct->pub.inverse_DCT[ci] = method_ptr;
@@ -160,74 +274,75 @@ start_pass (j_decompress_ptr cinfo)
#ifdef PROVIDE_ISLOW_TABLES
case JDCT_ISLOW:
{
/* For LL&M IDCT method, multipliers are equal to raw quantization
* coefficients, but are stored as ints to ensure access efficiency.
*/
ISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table;
for (i = 0; i < DCTSIZE2; i++) {
ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[i];
}
/* For LL&M IDCT method, multipliers are equal to raw quantization
* coefficients, but are stored as ints to ensure access efficiency.
*/
ISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table;
for (i = 0; i < DCTSIZE2; i++) {
ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[i];
}
}
break;
#endif
#ifdef DCT_IFAST_SUPPORTED
case JDCT_IFAST:
{
/* For AA&N IDCT method, multipliers are equal to quantization
* coefficients scaled by scalefactor[row]*scalefactor[col], where
* scalefactor[0] = 1
* scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
* For integer operation, the multiplier table is to be scaled by
* IFAST_SCALE_BITS.
*/
IFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table;
/* For AA&N IDCT method, multipliers are equal to quantization
* coefficients scaled by scalefactor[row]*scalefactor[col], where
* scalefactor[0] = 1
* scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
* For integer operation, the multiplier table is to be scaled by
* IFAST_SCALE_BITS.
*/
IFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table;
#define CONST_BITS 14
static const INT16 aanscales[DCTSIZE2] = {
/* precomputed values scaled up by 14 bits */
16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270,
21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906,
19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315,
16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552,
8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446,
4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247
};
SHIFT_TEMPS
static const INT16 aanscales[DCTSIZE2] = {
/* precomputed values scaled up by 14 bits */
16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270,
21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906,
19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315,
16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552,
8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446,
4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247
};
SHIFT_TEMPS
for (i = 0; i < DCTSIZE2; i++) {
ifmtbl[i] = (IFAST_MULT_TYPE)
DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
(INT32) aanscales[i]),
CONST_BITS-IFAST_SCALE_BITS);
}
for (i = 0; i < DCTSIZE2; i++) {
ifmtbl[i] = (IFAST_MULT_TYPE)
DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
(INT32) aanscales[i]),
CONST_BITS-IFAST_SCALE_BITS);
}
}
break;
#endif
#ifdef DCT_FLOAT_SUPPORTED
case JDCT_FLOAT:
{
/* For float AA&N IDCT method, multipliers are equal to quantization
* coefficients scaled by scalefactor[row]*scalefactor[col], where
* scalefactor[0] = 1
* scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
*/
FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table;
int row, col;
static const double aanscalefactor[DCTSIZE] = {
1.0, 1.387039845, 1.306562965, 1.175875602,
1.0, 0.785694958, 0.541196100, 0.275899379
};
/* For float AA&N IDCT method, multipliers are equal to quantization
* coefficients scaled by scalefactor[row]*scalefactor[col], where
* scalefactor[0] = 1
* scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
* We apply a further scale factor of 1/8.
*/
FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table;
int row, col;
static const double aanscalefactor[DCTSIZE] = {
1.0, 1.387039845, 1.306562965, 1.175875602,
1.0, 0.785694958, 0.541196100, 0.275899379
};
i = 0;
for (row = 0; row < DCTSIZE; row++) {
for (col = 0; col < DCTSIZE; col++) {
fmtbl[i] = (FLOAT_MULT_TYPE)
((double) qtbl->quantval[i] *
aanscalefactor[row] * aanscalefactor[col]);
i++;
}
}
i = 0;
for (row = 0; row < DCTSIZE; row++) {
for (col = 0; col < DCTSIZE; col++) {
fmtbl[i] = (FLOAT_MULT_TYPE)
((double) qtbl->quantval[i] *
aanscalefactor[row] * aanscalefactor[col] * 0.125);
i++;
}
}
}
break;
#endif
@@ -252,7 +367,7 @@ jinit_inverse_dct (j_decompress_ptr cinfo)
idct = (my_idct_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(my_idct_controller));
SIZEOF(my_idct_controller));
cinfo->idct = (struct jpeg_inverse_dct *) idct;
idct->pub.start_pass = start_pass;
@@ -261,7 +376,7 @@ jinit_inverse_dct (j_decompress_ptr cinfo)
/* Allocate and pre-zero a multiplier table for each component */
compptr->dct_table =
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(multiplier_table));
SIZEOF(multiplier_table));
MEMZERO(compptr->dct_table, SIZEOF(multiplier_table));
/* Mark multiplier table not yet set up for any method */
idct->cur_method[ci] = -1;
+1111 -220
View File
File diff suppressed because it is too large Load Diff
-201
View File
@@ -1,201 +0,0 @@
/*
* jdhuff.h
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains declarations for Huffman entropy decoding routines
* that are shared between the sequential decoder (jdhuff.c) and the
* progressive decoder (jdphuff.c). No other modules need to see these.
*/
/* Short forms of external names for systems with brain-damaged linkers. */
#ifdef NEED_SHORT_EXTERNAL_NAMES
#define jpeg_make_d_derived_tbl jMkDDerived
#define jpeg_fill_bit_buffer jFilBitBuf
#define jpeg_huff_decode jHufDecode
#endif /* NEED_SHORT_EXTERNAL_NAMES */
/* Derived data constructed for each Huffman table */
#define HUFF_LOOKAHEAD 8 /* # of bits of lookahead */
typedef struct {
/* Basic tables: (element [0] of each array is unused) */
INT32 maxcode[18]; /* largest code of length k (-1 if none) */
/* (maxcode[17] is a sentinel to ensure jpeg_huff_decode terminates) */
INT32 valoffset[17]; /* huffval[] offset for codes of length k */
/* valoffset[k] = huffval[] index of 1st symbol of code length k, less
* the smallest code of length k; so given a code of length k, the
* corresponding symbol is huffval[code + valoffset[k]]
*/
/* Link to public Huffman table (needed only in jpeg_huff_decode) */
JHUFF_TBL *pub;
/* Lookahead tables: indexed by the next HUFF_LOOKAHEAD bits of
* the input data stream. If the next Huffman code is no more
* than HUFF_LOOKAHEAD bits long, we can obtain its length and
* the corresponding symbol directly from these tables.
*/
int look_nbits[1<<HUFF_LOOKAHEAD]; /* # bits, or 0 if too long */
UINT8 look_sym[1<<HUFF_LOOKAHEAD]; /* symbol, or unused */
} d_derived_tbl;
/* Expand a Huffman table definition into the derived format */
EXTERN(void) jpeg_make_d_derived_tbl
JPP((j_decompress_ptr cinfo, boolean isDC, int tblno,
d_derived_tbl ** pdtbl));
/*
* Fetching the next N bits from the input stream is a time-critical operation
* for the Huffman decoders. We implement it with a combination of inline
* macros and out-of-line subroutines. Note that N (the number of bits
* demanded at one time) never exceeds 15 for JPEG use.
*
* We read source bytes into get_buffer and dole out bits as needed.
* If get_buffer already contains enough bits, they are fetched in-line
* by the macros CHECK_BIT_BUFFER and GET_BITS. When there aren't enough
* bits, jpeg_fill_bit_buffer is called; it will attempt to fill get_buffer
* as full as possible (not just to the number of bits needed; this
* prefetching reduces the overhead cost of calling jpeg_fill_bit_buffer).
* Note that jpeg_fill_bit_buffer may return FALSE to indicate suspension.
* On TRUE return, jpeg_fill_bit_buffer guarantees that get_buffer contains
* at least the requested number of bits --- dummy zeroes are inserted if
* necessary.
*/
typedef INT32 bit_buf_type; /* type of bit-extraction buffer */
#define BIT_BUF_SIZE 32 /* size of buffer in bits */
/* If long is > 32 bits on your machine, and shifting/masking longs is
* reasonably fast, making bit_buf_type be long and setting BIT_BUF_SIZE
* appropriately should be a win. Unfortunately we can't define the size
* with something like #define BIT_BUF_SIZE (sizeof(bit_buf_type)*8)
* because not all machines measure sizeof in 8-bit bytes.
*/
typedef struct { /* Bitreading state saved across MCUs */
bit_buf_type get_buffer; /* current bit-extraction buffer */
int bits_left; /* # of unused bits in it */
} bitread_perm_state;
typedef struct { /* Bitreading working state within an MCU */
/* Current data source location */
/* We need a copy, rather than munging the original, in case of suspension */
const JOCTET * next_input_byte; /* => next byte to read from source */
size_t bytes_in_buffer; /* # of bytes remaining in source buffer */
/* Bit input buffer --- note these values are kept in register variables,
* not in this struct, inside the inner loops.
*/
bit_buf_type get_buffer; /* current bit-extraction buffer */
int bits_left; /* # of unused bits in it */
/* Pointer needed by jpeg_fill_bit_buffer. */
j_decompress_ptr cinfo; /* back link to decompress master record */
} bitread_working_state;
/* Macros to declare and load/save bitread local variables. */
#define BITREAD_STATE_VARS \
register bit_buf_type get_buffer; \
register int bits_left; \
bitread_working_state br_state
#define BITREAD_LOAD_STATE(cinfop,permstate) \
br_state.cinfo = cinfop; \
br_state.next_input_byte = cinfop->src->next_input_byte; \
br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \
get_buffer = permstate.get_buffer; \
bits_left = permstate.bits_left;
#define BITREAD_SAVE_STATE(cinfop,permstate) \
cinfop->src->next_input_byte = br_state.next_input_byte; \
cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \
permstate.get_buffer = get_buffer; \
permstate.bits_left = bits_left
/*
* These macros provide the in-line portion of bit fetching.
* Use CHECK_BIT_BUFFER to ensure there are N bits in get_buffer
* before using GET_BITS, PEEK_BITS, or DROP_BITS.
* The variables get_buffer and bits_left are assumed to be locals,
* but the state struct might not be (jpeg_huff_decode needs this).
* CHECK_BIT_BUFFER(state,n,action);
* Ensure there are N bits in get_buffer; if suspend, take action.
* val = GET_BITS(n);
* Fetch next N bits.
* val = PEEK_BITS(n);
* Fetch next N bits without removing them from the buffer.
* DROP_BITS(n);
* Discard next N bits.
* The value N should be a simple variable, not an expression, because it
* is evaluated multiple times.
*/
#define CHECK_BIT_BUFFER(state,nbits,action) \
{ if (bits_left < (nbits)) { \
if (! jpeg_fill_bit_buffer(&(state),get_buffer,bits_left,nbits)) \
{ action; } \
get_buffer = (state).get_buffer; bits_left = (state).bits_left; } }
#define GET_BITS(nbits) \
(((int) (get_buffer >> (bits_left -= (nbits)))) & ((1<<(nbits))-1))
#define PEEK_BITS(nbits) \
(((int) (get_buffer >> (bits_left - (nbits)))) & ((1<<(nbits))-1))
#define DROP_BITS(nbits) \
(bits_left -= (nbits))
/* Load up the bit buffer to a depth of at least nbits */
EXTERN(boolean) jpeg_fill_bit_buffer
JPP((bitread_working_state * state, register bit_buf_type get_buffer,
register int bits_left, int nbits));
/*
* Code for extracting next Huffman-coded symbol from input bit stream.
* Again, this is time-critical and we make the main paths be macros.
*
* We use a lookahead table to process codes of up to HUFF_LOOKAHEAD bits
* without looping. Usually, more than 95% of the Huffman codes will be 8
* or fewer bits long. The few overlength codes are handled with a loop,
* which need not be inline code.
*
* Notes about the HUFF_DECODE macro:
* 1. Near the end of the data segment, we may fail to get enough bits
* for a lookahead. In that case, we do it the hard way.
* 2. If the lookahead table contains no entry, the next code must be
* more than HUFF_LOOKAHEAD bits long.
* 3. jpeg_huff_decode returns -1 if forced to suspend.
*/
#define HUFF_DECODE(result,state,htbl,failaction,slowlabel) \
{ register int nb, look; \
if (bits_left < HUFF_LOOKAHEAD) { \
if (! jpeg_fill_bit_buffer(&state,get_buffer,bits_left, 0)) {failaction;} \
get_buffer = state.get_buffer; bits_left = state.bits_left; \
if (bits_left < HUFF_LOOKAHEAD) { \
nb = 1; goto slowlabel; \
} \
} \
look = PEEK_BITS(HUFF_LOOKAHEAD); \
if ((nb = htbl->look_nbits[look]) != 0) { \
DROP_BITS(nb); \
result = htbl->look_sym[look]; \
} else { \
nb = HUFF_LOOKAHEAD+1; \
slowlabel: \
if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb)) < 0) \
{ failaction; } \
get_buffer = state.get_buffer; bits_left = state.bits_left; \
} \
}
/* Out-of-line case for Huffman code fetching */
EXTERN(int) jpeg_huff_decode
JPP((bitread_working_state * state, register bit_buf_type get_buffer,
register int bits_left, d_derived_tbl * htbl, int min_bits));

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